Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM VIM_PROCESS_MESSAGE                                      *
3
*---------------------------------------------------------------------*
4
* process message depending on dialog mode                            *
5
*---------------------------------------------------------------------*
6
* VALUE(PM_ID)          ---> ID of message to send                    *
7
* VALUE(PM_ONLINE_TYPE) ---> message type used for online mode        *
8
* VALUE(PM_BATCH_TYPE)  ---> message type used for batch mode         *
9
* VALUE(PM_NBR)         ---> number of message to send                *
10
* VALUE(PM_V1)          ---> first mesage variable                    *
11
* VALUE(PM_V2)          ---> second mesage variable                   *
12
* VALUE(PM_V3)          ---> third mesage variable                    *
13
* VALUE(PM_V4)          ---> fourth mesage variable                   *
14
*---------------------------------------------------------------------*
15
FORM VIM_PROCESS_MESSAGE USING VALUE(PM_ID) LIKE SY-MSGID
16
                           VALUE(PM_ONLINE_TYPE) LIKE SY-MSGTY
17
                           VALUE(PM_BATCH_TYPE) LIKE SY-MSGTY
18
                           VALUE(PM_NBR)  LIKE SY-MSGNO
19
                           VALUE(PM_V1) LIKE SY-MSGV1
20
                           VALUE(PM_V2) LIKE SY-MSGV2
21
                           VALUE(PM_V3) LIKE SY-MSGV3
22
                           VALUE(PM_V4) LIKE SY-MSGV4.
23
 
24
  DATA: I_TYPE LIKE SPROT_U-SEVERITY, I_MSGTY LIKE SY-MSGTY,
25
        I_MSGNO LIKE SY-MSGNO,
26
        objtype TYPE ob_typ.
27
 
28
  IF VIM_NO_DIALOG NE SPACE.           "no dialog - write protocol
29
    I_TYPE = I_MSGTY = PM_BATCH_TYPE. I_MSGNO = PM_NBR.
30
    IF VIM_IMPORT_PROFILE = 'X'.        "Profilimport
31
      IF x_header-bastab EQ space.
32
        objtype = 'V'.
33
      ELSE.
34
        objtype = 'S'.
35
      ENDIF.
36
      CALL FUNCTION 'SCPR_PROT_DATA_WRITE'
37
          EXPORTING
38
            act_id           = VIM_ACTOPTS-ACT_ID
39
            bcset_id         = VIM_BCSET_ID
40
            objectname       = VIM_VIEW_NAME
41
*           tablename        = object
42
*           tabletype        = tabtype
43
            tablekey         = VIM_PROFILE_ERRORKEY
44
              MSGID            = PM_ID
45
              MSGTY            = I_TYPE
46
              MSGNO            = I_MSGNO
47
            var1             = PM_V1
48
            var2             = PM_V2
49
            var3             = PM_V3
50
            var4             = PM_V4
51
            objecttype       = objtype.
52
    ELSE.
53
      TRANSLATE I_TYPE USING 'I S '.
54
      CALL FUNCTION 'LCT_MESSAGE'
55
         EXPORTING
56
              IV_MSGID  = PM_ID
57
              IV_MSGTY  = I_TYPE
58
              IV_MSGNO  = I_MSGNO
59
              IV_MSGV1  = PM_V1
60
              IV_MSGV2  = PM_V2
61
              IV_MSGV3  = PM_V3
62
              IV_MSGV4  = PM_V4
63
              IV_DIALOG = SPACE.
64
    ENDIF.
65
    VIM_LAST_LOGGED_MESSAGE-ID = PM_ID.
66
    VIM_LAST_LOGGED_MESSAGE-TYPE = I_MSGTY.
67
    VIM_LAST_LOGGED_MESSAGE-NBR = PM_NBR.
68
    VIM_LAST_LOGGED_MESSAGE-V1 = PM_V1.
69
    VIM_LAST_LOGGED_MESSAGE-V2 = PM_V2.
70
    VIM_LAST_LOGGED_MESSAGE-V3 = PM_V3.
71
    VIM_LAST_LOGGED_MESSAGE-V4 = PM_V4.
72
    IF VIM_IMPORT_NO_MESSAGE EQ SPACE.
73
      MESSAGE ID PM_ID TYPE I_MSGTY NUMBER PM_NBR "to raise exception
74
                WITH PM_V1 PM_V2 PM_V3 PM_V4.
75
    ENDIF.
76
  ELSE.                                "with dialog - use pm_online_type
77
    I_MSGTY = PM_ONLINE_TYPE.
78
    MESSAGE ID PM_ID TYPE I_MSGTY NUMBER PM_NBR
79
              WITH PM_V1 PM_V2 PM_V3 PM_V4.
80
  ENDIF.                               "vim_no_dialog eq space
81
ENDFORM.                               "vim_process_message
82
*---------------------------------------------------------------------*
83
*       FORM VIM_BC_PROCESS_MESSAGE
84
*
85
*---------------------------------------------------------------------*
86
* process message depending on dialog mode                            *
87
*---------------------------------------------------------------------*
88
* VALUE(PM_ID)          ---> ID of message to send                    *
89
* VALUE(PM_ONLINE_TYPE) ---> message type used for online mode        *
90
* VALUE(PM_BATCH_TYPE)  ---> message type used for batch mode         *
91
* VALUE(PM_NBR)         ---> number of message to send                *
92
* VALUE(PM_V1)          ---> first mesage variable                    *
93
* VALUE(PM_V2)          ---> second mesage variable                   *
94
* VALUE(PM_V3)          ---> third mesage variable                    *
95
* VALUE(PM_V4)          ---> fourth mesage variable                   *
96
*---------------------------------------------------------------------*
97
FORM vim_bc_process_message USING value(pm_id) LIKE sy-msgid
98
                           value(pm_online_type) LIKE sy-msgty
99
                           value(pm_batch_type) LIKE sy-msgty
100
                           value(pm_nbr)  LIKE sy-msgno
101
                           value(pm_v1) LIKE sy-msgv1
102
                           value(pm_v2) LIKE sy-msgv2
103
                           value(pm_v3) LIKE sy-msgv3
104
                           value(pm_v4) LIKE sy-msgv4
105
                           value(objtype) TYPE ob_typ.
106
 
107
  DATA: i_type LIKE sprot_u-severity, i_msgty LIKE sy-msgty,
108
        i_msgno LIKE sy-msgno.
109
 
110
  i_type = i_msgty = pm_batch_type. i_msgno = pm_nbr.
111
 
112
  CALL FUNCTION 'SCPR_PROT_DATA_WRITE'
113
      EXPORTING
114
        act_id           = vim_actopts-act_id
115
        bcset_id         = vim_bcset_id
116
        objectname       = vim_view_name
117
*       tablename        = object
118
*       tabletype        = tabtype
119
        tablekey         = vim_profile_errorkey
120
        msgid            = pm_id
121
        msgty            = i_type
122
        msgno            = i_msgno
123
        var1             = pm_v1
124
        var2             = pm_v2
125
        var3             = pm_v3
126
        var4             = pm_v4
127
        objecttype       = objtype.
128
  vim_last_logged_message-id = pm_id.
129
  vim_last_logged_message-type = i_msgty.
130
  vim_last_logged_message-nbr = pm_nbr.
131
  vim_last_logged_message-v1 = pm_v1.
132
  vim_last_logged_message-v2 = pm_v2.
133
  vim_last_logged_message-v3 = pm_v3.
134
  vim_last_logged_message-v4 = pm_v4.
135
  IF vim_import_no_message EQ space.
136
    MESSAGE ID pm_id TYPE i_msgty NUMBER pm_nbr "to raise exception
137
              WITH pm_v1 pm_v2 pm_v3 pm_v4.
138
  ENDIF.
139
ENDFORM.                               "vim_bc_process_message