SAP Data Intelligence側のCustom ABAP Operatorのinport/outportを作成します。
Connection Managementで設定した接続をABAP Connectionに設定し、ABAP Operatorの検索ヘルプを選択すると、使用可能なSAP ABAP システムのOperatorが表示されます。
呼び出す用Operator設定(Custom ABAP Operator)
返した結果をファイルに書き込む(Write file)
CLASS lcl_process DEFINITION INHERITING FROM cl_dhape_graph_proc_abstract.
PUBLIC SECTION.
METHODS: if_dhape_graph_process~on_start REDEFINITION.
METHODS: if_dhape_graph_process~on_resume REDEFINITION.
METHODS: if_dhape_graph_process~step REDEFINITION.
DATA:
mo_util TYPE REF TO cl_dhape_util_factory,
mo_in TYPE REF TO if_dhape_graph_channel_reader,
mo_out TYPE REF TO if_dhape_graph_channel_writer.
ENDCLASS.
CLASS lcl_process IMPLEMENTATION.
METHOD if_dhape_graph_process~on_start.
* mo_out->write_copy( 'abap operator 処理起動' ) .
"This method is called when the graph is submitted.
"Note that you can only check things here but you cannot initialize variables.
ENDMETHOD.
METHOD if_dhape_graph_process~on_resume.
"This method is called before the graph is started.
"Read parameters from the config here
* mv_myparameter = to_upper( if_dhape_graph_process~get_conf_value( '/Config/myparameter' ) ).
"Do initialization here.
mo_util = cl_dhape_util_factory=>new( ).
mo_in = get_port( 'in' )->get_reader( ).
mo_out = get_port( 'out' )->get_writer( ).
ENDMETHOD.
METHOD if_dhape_graph_process~step.
"This method caled in a loop as long as the graph is alive
rv_progress = abap_false.
CHECK mv_alive = abap_true.
DATA : ldf_string TYPE string,
ldf_result TYPE string.
IF mo_in->has_data( ).
CHECK mo_out->is_blocked( ) <> abap_true.
mo_in->read_copy( IMPORTING ea_data = ldf_string ).
DATA: salesdocument TYPE vbeln,
order_header_in TYPE bapisdh1,
order_header_inx TYPE bapisdh1x,
order_item_in TYPE TABLE OF bapisditm,
order_item_inx TYPE TABLE OF bapisditmx,
order_item_inl LIKE LINE OF order_item_in,
order_item_inxl LIKE LINE OF order_item_inx,
return1 TYPE TABLE OF bapiret2,
returnmessage TYPE bapiret2,
schedule_lines TYPE TABLE OF bapischdl,
schedule_linesx TYPE TABLE OF bapischdlx,
schedule_linesl LIKE LINE OF schedule_lines,
schedule_linesxl LIKE LINE OF schedule_linesx,
ldf_vbeln TYPE vbeln,
ldf_string2 TYPE string,
ldf_string3 TYPE string,
message TYPE string.
SPLIT ldf_string AT '/' INTO ldf_vbeln ldf_string2 ldf_string3.
order_header_inx-updateflag = 'U'.
order_item_inl-itm_number = ldf_string2 .
APPEND order_item_inl TO order_item_in.
order_item_inxl-itm_number = ldf_string2 .
order_item_inxl-updateflag = 'U'.
APPEND order_item_inxl TO order_item_inx..
schedule_linesl-itm_number = ldf_string2 .
schedule_linesl-sched_line = '0001'.
schedule_linesl-req_qty = ldf_string3.
APPEND schedule_linesl TO schedule_lines.
schedule_linesxl-itm_number = ldf_string2.
schedule_linesxl-sched_line = '0001'.
schedule_linesxl-updateflag = 'U'.
schedule_linesxl-req_qty = 'X'.
APPEND schedule_linesxl TO schedule_linesx..
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = ldf_vbeln
order_header_inx = order_header_inx
TABLES
return = return1
order_item_in = order_item_in
order_item_inx = order_item_inx
schedule_lines = schedule_lines
schedule_linesx = schedule_linesx.
IF sy-subrc = '0'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ENDIF.
READ TABLE return1 INTO returnmessage INDEX LINES( return1 ).
CALL FUNCTION 'Z_GET'
EXPORTING
salesorder_vbeln = ldf_vbeln
IMPORTING
salesorder_data_json = message.
mo_out->write_copy( returnmessage-message && message ) .
rv_progress = abap_true.
ELSEIF mo_in->is_closed( ).
mo_out->close( ).
rv_progress = abap_true.
ENDIF.
ENDMETHOD.
ENDCLASS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
6 | |
4 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 |