method CHECK_DRK чистим таблицы рабочие для выделения wd_this- CLEAR_T

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
method CHECK_DRK .
* чистим таблицы рабочие для выделения
wd_this->CLEAR_TMP_TABLES( ).
data lo_node TYPE REF TO IF_WD_CONTEXT_NODE.
data lo_el TYPE REF TO IF_WD_CONTEXT_ELEMENT.
data: lt_rfid TYPE wd_this->ELEMENTS_TABLE_RFID,
ls_rfid LIKE LINE OF LT_RFID,
lt_size TYPE wd_this->ELEMENTS_TABLE_SIZE,
ls_size LIKE LINE OF LT_SIZE,
ls_input TYPE wd_this->ELEMENT_INPUT.
data: lt_alv_i14 TYPe TABLE OF ZSC_RFID_DS_ARRIVAL_SSF_ALV14,
ls_alv_i14 LIKE LINE OF LT_ALV_I14,
lt_z05 TYPE TABLE OF zsc_rfid_z05,
lt_z05_1 TYPE TABLE OF Zsc_rfid_z05,
lt_z05_2 TYPE TABLE OF Zsc_rfid_z05,
ls_z05 LIKE LINE OF LT_Z05,
lt_z05_agg TYPE TABLE OF zsc_rfid_z05.
data lv_meins TYPE c LENGTH 3.
data: et_return TYPE BAPIRETTAB,
ls_return like LINE OF ET_RETURN.
data: lv_has_error TYPE boolean,
lv_error_msg TYPE string.
DATA LV_MSG TYPE STRING.
DATA lv_msg_popup TYPE STRING.
FIELD-SYMBOLS <fs_rfid> like ls_Rfid.
FIELD-SYMBOLS <fs_size> like LS_SIZE.
FIELD-SYMBOLS <fs_z05> like LS_Z05.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
INPUT = 'ST'
* LANGUAGE = SY-LANGU
IMPORTING
* LONG_TEXT =
OUTPUT = LV_MEINS
* SHORT_TEXT =
EXCEPTIONS
UNIT_NOT_FOUND = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
LV_HAS_ERROR = abap_true.
LV_ERROR_MSG = 'Отсутствует БЕИ'.
data lv_bmsg TYPE BAPI_MSG.
LV_BMSG = LV_ERROR_MSG.
wd_this->CREATE_ERROR_MSG( LV_BMSG ).
*
* lv_msg_popup = LV_ERROR_MSG.
* ZCL_GUI_UTILS=>show_error_popup( EXPORTING
* ir_component = WD_THIS->wd_get_api( )
* iv_win_name = 'APPROVE'
* iv_view_name = 'APPROVE_VIEW'
* iv_msg = lv_msg_popup ).
ENDIF.
IF LV_HAS_ERROR is INITIAL.
LO_NODE = WD_CONTEXT->GET_CHILD_NODE( name = wd_this->WDCTX_INPUT ).
lo_el = LO_NODE->GET_ELEMENT( ).
LO_EL->GET_STATIC_ATTRIBUTES( IMPORTING STATIC_ATTRIBUTES = LS_INPUT ).
LO_NODE = WD_CONTEXT->GET_CHILD_NODE( name = wd_this->WDCTX_TABLE_RFID ).
LO_NODE->GET_STATIC_ATTRIBUTES_TABLE( IMPORTING TABLE = lt_rfid ).
LOOP AT lt_rfid ASSIGNING <FS_RFID>.
LS_ALV_I14-MEINS = <FS_RFID>-UOM.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = <FS_RFID>-MATNR
IMPORTING
output = LS_ALV_I14-MATNR.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_OUTPUT'
EXPORTING
INPUT = LS_ALV_I14-MEINS
IMPORTING
OUTPUT = LS_ALV_I14-MEINS
EXCEPTIONS
UNIT_NOT_FOUND = 1
OTHERS = 2.
LS_ALV_I14-HEIGHT = <FS_RFID>-HEIGHT.
LS_ALV_I14-RSIZE = <FS_RFID>-SIZES.
* LS_ALV_I14-MEINS = LV_MEINS.
LS_ALV_I14-LGORT = LS_INPUT-SS_LGORT.
LS_ALV_I14-WERKS = LS_INPUT-SS_WERKS.
LS_ALV_I14-UMWRK = LS_INPUT-SS_WERKS.
LS_ALV_I14-UMLGO = LS_INPUT-LGORT.
LS_ALV_I14-RFID = <FS_RFID>-RFID.
LS_ALV_I14-SEASON = ZCL_WD_ASSISTANCE=>GET_EN_SEASON( <FS_RFID>-SEASON ).
append LS_ALV_I14 to LT_ALV_I14.
ENDLOOP.
IF LT_ALV_I14 is NOT INITIAL.
data lv_dest_name TYPE string.
LV_DEST_NAME = ZCL_WD_ASSISTANCE=>GET_R3_DESTINATION( ).
* CALL FUNCTION 'ZRFID_CHECK_DRK' DESTINATION LV_DEST_NAME
* EXPORTING
* i_bwart = 'Z05'
* TABLES
* ct_alv4 = LT_ALV_I14
CALL FUNCTION 'ZRFID_RELINC_CHARG' DESTINATION LV_DEST_NAME
* EXPORTING
* i_bwart = 'Z05'
TABLES
ct_alv4 = LT_ALV_I14
out_tab = LT_Z05
out_tab2 = LT_Z05_2
out_tab1 = LT_Z05_1
et_return = ET_RETURN
OUT_CHNG_RES = wd_this->GT_CNHG_RESERV
EXCEPTIONS
SYSTEM_FAILURE = 1
COMMUNICATION_FAILURE = 2
OTHERS = 3.
IF sy-subrc = 0.
clear wd_this->GV_RES_ERR.
READ TABLE ET_RETURN with key type = 'E' INTO LS_RETURN. "TRANSPORTING NO FIELDS.
IF sy-subrc is INITIAL.
LOOP AT ET_RETURN INTO LS_RETURN.
CREATE_ERROR_MSG( LS_RETURN-MESSAGE ).
* lv_msg_popup = LS_RETURN-MESSAGE.
* ZCL_GUI_UTILS=>show_error_popup( EXPORTING
* ir_component = WD_THIS->wd_get_api( )
* iv_win_name = 'APPROVE'
* iv_view_name = 'APPROVE_VIEW'
* iv_msg = lv_msg_popup ).
ENDLOOP.
"set error flag to DENY posting
wd_this->deny_posting( ).
* IF not wd_this->GV_RES_ERR = '1'.
* CREATE_ERROR_MSG( 'ZRFID_GET_RESB_Z05: Резервирование отсутствует ' ).
wd_this->GV_RES_ERR = '1'.
* ENDIF.
endif.
LOOP AT LT_Z05_1 ASSIGNING <FS_Z05>.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = <FS_Z05>-MATNR
IMPORTING
output = <FS_Z05>-MATNR.
ENDLOOP.
wd_this->GT_Z05 = LT_Z05_1.
LOOP AT LT_ALV_I14 INTO LS_ALV_I14.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = LS_ALV_I14-MATNR
IMPORTING
output = LS_ALV_I14-MATNR.
LOOP AT LT_RFID ASSIGNING <FS_RFID> WHERE RFID = LS_ALV_I14-RFID.
<FS_RFID>-CHARG = LS_ALV_I14-CHARG.
<FS_RFID>-CHARGH = LS_ALV_I14-CHARGH.
<FS_RFID>-RESERV = LS_ALV_I14-RSNUM.
<FS_RFID>-POSNR = LS_ALV_I14-RSPOS.
* <FS_RFID>-bdmng = LS_ALV_I14-BDMNG.
* IF <FS_RFID>-RESERV is not INITIAL and not <FS_RFID>-RESERV = '0000000000'.
* READ TABLE LT_Z05 INTO LS_Z05 with key matnr = <FS_RFID>-MATNR rsnum = <FS_RFID>-RESERV charg = <fs_rfid>-CHARG heigh = <FS_RFID>-HEIGHT rsize = <fs_rfid>-SIZES.
* IF sy-subrc = 0.
* <FS_RFID>-BDMNG = LS_Z05-BDMNG.
* ENDIF.
* ENDIF.
ENDLOOP.
ENDLOOP.
LO_NODE->BIND_TABLE( EXPORTING NEW_ITEMS = LT_RFID ).
LOAD_BDATA_CHARG_SIZE( ).
"set error flag to ALLOW posting
IF not wd_this->GV_RES_ERR = '1'.
wd_this->allow_posting( ).
SHOW_INFO_MSG( ET_RETURN ).
ENDIF.
* else.
* LOOP AT ET_RETURN INTO LS_RETURN.
* CREATE_ERROR_MSG( LS_RETURN-MESSAGE ).
* ENDLOOP.
* "set error flag to DENY posting
* wd_this->deny_posting( ).
** wd_this->GV_DRK_ERR = 'E'.
*
* ENDIF. "ET_RETURN READ
ELSE.
lv_msg = 'Ошибка при вызове ФМ ZRFID_RELINC_CHARG'.
CREATE_ERROR_MSG( 'Ошибка при вызове ФМ ZRFID_RELINC_CHARG' ).
* ZCL_GUI_UTILS=>show_error_popup( EXPORTING
* ir_component = WD_THIS->wd_get_api( )
* iv_win_name = 'APPROVE'
* iv_view_name = 'APPROVE_VIEW'
* iv_msg = lv_msg ).
ENDIF. "FM CALL
ENDIF.
ENDIF.
CHECK_FOR_ERRORS( ).
endmethod.