RFC
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 |
REPORT ztest_rfc. DATA: flag1, flag2. CALL FUNCTION 'Z_PAR_TEST' STARTING NEW TASK 'TASK1' PERFORMING res_from_rfc ON END OF TASK EXPORTING count = 2. CALL FUNCTION 'Z_PAR_TEST' STARTING NEW TASK 'TASK2' PERFORMING res_from_rfc ON END OF TASK EXPORTING count = 2. "------------------------------------------- WAIT UNTIL flag1 = abap_true AND flag2 = abap_true. IF sy-subrc = 0. WRITE 'ВСЕ УСЛОВИЯ ВЫПОЛНЕНЫ'. ELSE. WRITE 'Все RFC закончены. Однако условия не выполнены'. ENDIF. "------------------------------------------- FORM res_from_rfc USING taskname. CASE taskname. WHEN 'TASK1'. flag1 = abap_true. WHEN 'TASK2'. flag2 = abap_true. ENDCASE. RECEIVE RESULTS FROM FUNCTION 'Z_PAR_TEST'. ENDFORM. "-------------------------------------------- |
RFC FM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
FUNCTION Z_PAR_TEST. *"---------------------------------------------------------------------- *"*"Ћокальный интерфейс: *" IMPORTING *" VALUE(COUNT) TYPE I *" EXPORTING *" VALUE(INDEX) TYPE I *"---------------------------------------------------------------------- DATA: tmp TYPE FLOAT. DO 5000000 TIMES. tmp = tmp * 2. ENDDO. INDEX = tmp. ENDFUNCTION. |
BAPI
журнал ошибок – slg1
константа времени выполнения – sy-uzeit
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 |
REPORT z_test_bapi_nik. data: wa_head like bapie1mathead, wa_return like bapireturn1. DATA m TYPE TABLE OF mara. DATA: it_description TYPE TABLE OF BAPIE1MAKTRT WITH HEADER LINE. wa_head-basic_view = 'X'. wa_head-MATERIAL = '000000000000000008'. wa_head-function = '004'. it_description-material = '000000000000000008'. it_description-function = '004'. it_description-matl_desc = 'description'. it_description-langu = 'R'. APPEND it_description. *"------------------------------------------ call function 'BAPI_MATERIAL_MAINTAINDATA_RT' exporting headdata = wa_head importing return = wa_return tables materialdescription = it_description. . if wa_return-type eq 'E'. write:/ wa_return. else. call function 'BAPI_TRANSACTION_COMMIT'. write:/ 'Updating the Material is Successful'. endif. |
UPDATE-TASK, LUW
1 2 3 4 5 6 7 8 9 10 11 |
REPORT ZUPDATE_TASK. PERFORM update ON COMMIT. "сбор данных и т д. COMMIT WORK. FORM update. UPDATE zinneravto SET car_mass = 10000 WHERE name = 'car1' . ENDFORM. |
ROLLBACK WORK. откатывает текущий LUW при условии что не был вызван неявный DB Commit
Пример
1 2 3 4 5 |
REPORT ZUPDATE_TASK. TABLES: ZTEST_UPDATE. CALL FUNCTION 'ZCOMMIT_TEST' IN UPDATE TASK. ROLLBACK WORK. |