method COMPLETE_DOC

  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
method COMPLETE_DOC .
data: ls_btd_intid TYPE /AIN/PUB_BTD_INTID_STR,
lt_btd_intid TYPE /AIN/PUB_BTD_INTID_tab,
lt_btd_header TYPE /ain/pub_btd_header_tab,
ls_btd_header TYPE /ain/pub_btd_header_str,
lt_btd_obj_act type /AIN/PUB_BTD_OBJ_ACT_TAB,
ls_btd_obj_act type /AIN/PUB_BTD_OBJ_ACT_str,
lt_btd_othattr TYPE /AIN/PUB_BTD_OTHATTR_CRE_TAB,
ls_btd_othattr TYPE /AIN/PUB_BTD_OTHATTR_CRE_STR,
lt_btd_status TYPE /ain/pub_btd_status_cre_tab,
ls_btd_status LIKE LINE OF lt_btd_status,
lv_time TYPE tzntstmps,
lv_error TYPE wdy_boolean.
DATA lv_e_btd_intid TYPE /ain/pub_btd_intid.
data: lt_pobj_tab type /AIN/PUB_POBJ_INTID_TAB,
ls_pobj_tab type /AIN/PUB_POBJ_INTID_STR,
lT_POBJ_ID TYPE /AIN/PUB_POBJ_ID_TAB,
ls_pobj_id type /AIN/PUB_POBJ_ID_str.
data: lt_return type BAPIRETTAB.
DATA lo_nd_table TYPE REF TO if_wd_context_node.
* DATA lo_el_table TYPE REF TO if_wd_context_element.
DATA ls_table TYPE wd_this->Element_table.
DATA lt_table TYPE wd_this->Elements_table.
data lt_rfid TYPE wd_this->ELEMENTs_TABLE_RFID.
data ls_rfid TYPE wd_this->ELEMENT_TABLE_RFID.
data:
LT_POBJ_EXTID TYPE /AIN/PUB_POBJ_EXTID_TAB,
ls_pobj_extid LIKE LINE OF LT_POBJ_EXTID,
LT_POBJ_EXTID_LINK TYPE /AIN/PUB_POBJ_EXTID_LINK_TAB,
ls_pobj_extid_link LIKE LINE OF LT_POBJ_EXTID_LINK.
lo_nd_table = wd_context->get_child_node( name = wd_this->wdctx_table ).
LO_ND_TABLE->GET_STATIC_ATTRIBUTES_TABLE( IMPORTING TABLE = LT_TABLE ).
READ TABLE LT_TABLE INTO LS_TABLE INDEX 1.
IF sy-subrc eq 0.
lv_e_btd_intid = wd_this->GV_ASSIGNED_DOC. "wd_this->get_assigned_doc( ).
LS_BTD_INTID-BTD_INTID = lv_e_btd_intid.
APPEND LS_BTD_INTID to LT_BTD_INTID.
CALL FUNCTION '/AIN/PUB_BO_BUFFER_REFRESH'.
CALL FUNCTION '/AIN/PUB_BTD_BY_INTIDS'
TABLES
IT_BTD_INTID = LT_BTD_INTID
ET_BTD_HEADER = lt_btd_header
* ET_BTD_ITM = ET_BTD_ITM
* ET_BTD_ITM_ACT = lt_btd_obj_act
* ET_BTD_ITM_EXP = ET_BTD_ITM_EXP
ET_BTD_OBJ_ACT = lt_btd_obj_act
* ET_BTD_OBIT_ACT =
* ET_BTD_OBJ_EXP = lt_btd_obj_exp
* ET_BTD_OBIT_EXP =
ET_BTD_OTHATTR = LT_BTD_OTHATTR
* ET_BTD_STATUS =
ET_RETURN = lt_return
* ET_BTD_ITM_OTHATTR =
* IT_BTD_INTID_ACTP =
* ET_BTD_OBIT_ACT_AGGR =
* ET_BTD_OBJ_ACT_AGGR =
* ET_QCHAR_COMB =
* IT_POBJ_INTID =
* ET_BTD_HEADER_TZONE =
EXCEPTIONS
TECHNICAL_LEVEL_ERROR = 1
BUSINESS_LEVEL_ERROR_INPUT = 2
OTHERS = 3.
IF sy-SUBrc = 0.
CLEAR LT_BTD_OTHATTR.
get TIME STAMP FIELD LV_TIME.
LS_BTD_OTHATTR-BTD_INTID = LV_E_BTD_INTID.
LS_BTD_OTHATTR-UPDATE_USER = sy-UNAME.
LS_BTD_OTHATTR-UPDATE_TIME = lv_time.
LS_BTD_OTHATTR-ATTRIBUTE_NAME = 'ZLGORT_49'. "Документ возврата
LS_BTD_OTHATTR-ATTRIBUTE_VALUE = LS_TABLE-TTN_NUMBER.
APPEND LS_BTD_OTHATTR to LT_BTD_OTHATTR.
LS_BTD_STATUS-BTD_INTID = LV_E_BTD_INTID.
LS_BTD_STATUS-BTD_STATUS = /ain/cl_pub_c=>_C_BTD_STATUS_PROCESS.
LS_BTD_STATUS-ACTION_TYPE = wd_this->GV_ACTION_TYPE.
APPEND LS_BTD_STATUS to LT_BTD_STATUS.
"Lets modify pobj attrs to filter out tags at store shop
ev_msg = wd_this->UPDATE_POBJ_OTHATTRS( ).
IF ev_msg is INITIAL.
CALL FUNCTION '/AIN/PUB_BTD_MODIFY'
* EXPORTING
* IV_BTD_STATUS_BY_OBJ_ACT = 'X'
* IV_BTD_ITM_ACT_BY_OBJ_ACT = 'X'
* IV_BTD_NO_MATCH_RESPONSE = 'W'
TABLES
IT_BTD_HEADER = LT_BTD_HEADER
* IT_BTD_ITM =
* IT_BTD_ITM_ACT =
* IT_BTD_ITM_EXP =
* IT_BTD_OBJ_ACT =
* IT_BTD_OBJ_EXP =
* IT_BTD_OBIT_EXP =
IT_BTD_OTHATTR = LT_BTD_OTHATTR
IT_BTD_STATUS = LT_BTD_STATUS
* ET_RETURN =
* IT_BTD_ITM_OTHATTR =
* IT_BTD_HEADER_TZONE =
EXCEPTIONS
TECHNICAL_LEVEL_ERROR = 1
BUSINESS_LEVEL_ERROR_INPUT = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
ev_msg = WD_ASSIST->GET_TEXT( 'E05' ).
ELSE.
CALL FUNCTION '/AIN/PUB_BO_SAVE'
EXCEPTIONS
technical_level_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
EV_MSG = WD_ASSIST->GET_TEXT( 'E05' ).
ELSE.
* coz we did that in stop_scan
* data: lv_devgrp_intid TYPE /AIN/DM_DEVGRP_GUID,
* LV_DEVGRP_EXTID TYPE /AIN/PUB_DEVGRP_EXTID.
* LV_DEVGRP_EXTID = wd_this->GET_DEV_GRP( ).
*
* CALL FUNCTION '/AIN/PUB_DEVGRP_SIMPLEBY_EXTID'
* EXPORTING
* IV_DEVGRP_EXTID = LV_DEVGRP_EXTID
* IMPORTING
* EV_DEVGRP_INTID = lv_devgrp_intid
* TABLES
* ET_RETURN = LT_RETURN
* EXCEPTIONS
* TECHNICAL_LEVEL_ERROR = 1
* BUSINESS_LEVEL_ERROR_INPUT = 2
* OTHERS = 3.
*
*
* CALL FUNCTION '/AIN/PUB_DEVGRP_DOC_UNASSIGN'
* EXPORTING
* IV_DEVGRP_INTID = LV_DEVGRP_INTID
* IV_BTD_INTID = lv_e_btd_intid
** TABLES
** ET_RETURN =
* EXCEPTIONS
* TECHNICAL_LEVEL_ERROR = 1
* BUSINESS_LEVEL_ERROR_INPUT = 2
* OTHERS = 3
* .
* IF SY-SUBRC <> 0.
* EV_MSG = 'Не удалось осуществить отвязку документа от группы устройств'.
* data lv_str TYPE string.
* lv_str = LV_DEVGRP_EXTID.
* CONCATENATE EV_MSG LV_DEVGRP_EXTID INTO EV_MSG SEPARATED BY space.
* ENDIF.
ENDIF.
ENDIF.
ENDIF.
else.
data lv_s TYPE string.
lv_s = lv_e_btd_intid.
ev_msg = WD_ASSIST->GET_TEXT( KEY = 'E04' PARA1 = lv_s ).
ENDIF.
ENDIF.
endmethod.