method ONACTIONSTART_SCAN

 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
method ONACTIONSTART_SCAN .
data:
lv_devgrp_intid TYPE /AIN/PUB_DEVGRP_INTID_STR,
lt_devgrp TYPE /AIN/PUB_DEVGRP_TAB,
ls_devgrp LIKE LINE OF LT_DEVGRP,
lv_devgrp_id TYPE /AIN/DM_DEVGRP_ID.
data: lv_msg TYPE string,
error_saving TYPE wdy_boolean,
lt_return TYPE bapirettab,
lv_para1 TYPE string,
lv_exists TYPE WDY_BOOLEAN,
lv_error_msg TYPE bapi_msg,
error_exists TYPE WDY_BOOLEAN.
DATA: ls_doc_str TYPE /ain/dm_doc_str,
lt_intid TYPE /ain/pub_intid_tab,
lt_doc TYPE /ain/ui_document_tab,
ls_doc TYPE /AIN/UI_DOCUMENT_STR,
lt_btd_header TYPE /ain/pub_btd_header_cre_tab,
ls_btd_header LIKE LINE OF lt_btd_header,
lt_btd_othattr TYPE /ain/pub_btd_othattr_cre_tab,
ls_btd_othattr LIKE LINE OF lt_btd_othattr,
EV_DOC_GUID TYPE /AIN/DM_DOC_GUID.
LV_DEVGRP_ID = WD_COMP_CONTROLLER->GET_DEV_GRP( ).
IF LV_DEVGRP_ID = ZCL_AII_UTILS=>GC_DC_NAME_52_TABLE.
wd_this->FIRE_CHANGE_DC_PLG( EXPORTING DEVGRP_ID = LV_DEVGRP_ID BTD_TYPE = WD_COMP_CONTROLLER->GV_BTD_TYPE ).
ELSEIF LV_DEVGRP_ID = ZCL_AII_UTILS=>GC_DC_NAME_52_CELL.
wd_this->FIRE_RESTART_DC_PLG( LV_DEVGRP_ID ).
ENDIF.
CALL FUNCTION '/AIN/PUB_DEVGRP_SIMPLEBY_EXTID'
EXPORTING
IV_DEVGRP_EXTID = LV_DEVGRP_ID
IMPORTING
EV_DEVGRP_INTID = WD_COMP_CONTROLLER->DEVGRP_INTID
TABLES
ET_RETURN = LT_RETURN
EXCEPTIONS
TECHNICAL_LEVEL_ERROR = 1
BUSINESS_LEVEL_ERROR_INPUT = 2
OTHERS = 3.
ZCL_AII_UTILS=>CREATE_BTD(
EXPORTING
iv_devgrp_id = LV_DEVGRP_ID
iv_doc_type = WD_COMP_CONTROLLER->GV_BTD_TYPE " /ain/dm_doc_type'
CHANGING
et_doc_tab = lt_doc " /ain/ui_document_tab
ev_msg = LV_MSG " string
).
IF LT_DOC is NOT INITIAL.
* WD_COMP_CONTROLLER->MSG_MGR->REPORT_SUCCESS( MESSAGE_TEXT = LV_MSG ).
* wd_this->REPORT_SUCCESS( LV_MSG ).
READ TABLE LT_DOC INTO ls_doc INDEX 1.
LS_DOC_STR-DOC_ID = LS_DOC-DOC_ID.
LS_DOC_STR-DOC_GUID = LS_DOC-DOC_GUID.
LS_DOC_STR-DOC_TYPE = LS_DOC-DOC_TYPE.
WD_COMP_CONTROLLER->GV_ASSIGNED_DOC = LS_DOC-DOC_GUID.
LV_MSG = ZCL_AII_UTILS=>ASSIGN_BTD( IV_DEVGRP_ID = LV_DEVGRP_ID IV_DOC = LS_DOC_STR ).
IF LV_MSG IS NOT INITIAL.
* WD_COMP_CONTROLLER->MSG_MGR->REPORT_ERROR_MESSAGE( MESSAGE_TEXT = LV_MSG ).
data lv_bmsg TYPE bapi_msg.
LV_BMSG = LV_MSG.
WD_COMP_CONTROLLER->CREATE_ERROR_MSG( LV_BMSG ).
ELSE.
SET_SETTINGS_ON_START( ).
ENDIF.
ELSE.
WD_COMP_CONTROLLER->MSG_MGR->REPORT_MESSAGE( MESSAGE_TEXT = LV_MSG ).
ENDIF.
WD_COMP_CONTROLLER->CHECK_FOR_ERRORS( ).
endmethod.