Sunteți pe pagina 1din 6

CALL TRANSACTION - bdc_options Syntax ...

{ {[MODE mode] [UPDATE upd]} |[OPTIONS FROM opt]} [MESSAGES INTO itab] ... . Extras: 1. ... MODE mode 2. ... UPDATE upd 3. ... OPTIONS FROM opt 4. ... MESSAGES INTO itab Effect Controls processing of the batch input table by the addition USING. Note The control options for a batch input table include the control options for batch input sessions in real batch input, plus some extra options. Addition 1 ... MODE mode

Effect The MODE addition determines the processing mode for processing. mode can be specified as a character-like data object, whose content and purpose are shown in the following table. If one of the additions MODE or OPTIONS FROM is not used, the effect is the same as if mode had the content "A". mode Effect "A" "E" "N" Processing with screens displayed Screens displayed only if an error occurs Processing without screens displayed. If a breakpoint is reached in one of the called transactions, processing is terminated with sy-subrc equal to 1001. The field sy-msgty contains "S", sy-msgid contains "00", sy-msgno contains "344", sy-msgv1 contains

"SAPMSSY3", and sy-msgv2 contains "0131". "P" Processing without screens displayed. If a breakpoint is reached in one of the called transactions, the system branches to the ABAP Debugger.

Others As for "A".

Addition 2 ... UPDATE upd

Effect The UPDATE addition determines the update mode for processing. upd can be specified as a character-like data object, whose content and purpose are shown in the following table. If one of the additions UPDATE or OPTIONS FROM is not used, the effect is the same as if upd had the content "A". upd "A" "S" "L" Effect Asynchronous update. Updates of called programs are executed in the same way as if the AND WAIT addition was not specified in the COMMIT WORK statement. Synchronous update. Updates of the called programs are executed in the same way as if the AND WAIT addition had been specified in the COMMIT WORK statement. Local updates. Updates of the called program are executed in the same way as if the SET UPDATE TASK LOCAL statement had been executed in the program.

Others As for "A".

Note This option is not available for execution of batch input sessions in batch input. Updates are always synchronous. Addition 3 ... OPTIONS FROM opt

Effect The OPTIONS addition covers the functions of the MODE and UPDATE additions and provides further options for controlling processing of the batch input table. The control parameters are

specified in an opt structure of the type CTU_PARAMS from ABAP Dictionary. The CTU_PARAMS structure has the components displayed in the following table: Component DISMODE UPMODE Meaning Processing mode. Values as for the MODE addition. Update mode for processing. Values as for the UPDATE addition.

CATT mode for processing. While batch input is used mostly for data transfer, CATT processes are more complex transactions, since they are reusable tests. CATTMODE Values: " " (no CATT mode), "N" (CATT without single screen control), "A" (CATT with single screen control). DEFSIZE Selects whether the screens of the called transaction are displayed in the standard screen size. Values: "X" (standard size), " " (current size).

Selects whether the COMMIT WORK statement terminates processing or not. RACOMMIT Values: " " (COMMIT WORK terminates processing), "X" (COMMIT WORK does not terminate processing). NOBINPT NOBIEND Selection for the system field sy-binpt. Values: " " (sy-binpt contains "X" in the called transaction), "X" (sy-binpt contains " " in the called transaction). Selection for the system field sy-binpt. Values: " " (sy-binpt contains "X" after the end of the batch input table data in the called transaction ) "X" (sy-binpt contains " " after the end of the data in the called transaction).

If the OPTIONS FROM addition is not used, the values set by the additions MODE or UPDATE or the standard values specified there "A" apply to DISMODE and UPMODE. The other components are set to the value " ". Addition 4 ... MESSAGES INTO itab

Effect Using this addition, all the messages sent during batch input processing are saved to an internal table itab of the type BDCMSGCOLL from ABAP Dictionary.
********** For DATA: gt_bdcdata gt_messtab gs_options updating txn QA01 using BDC data ******* LIKE bdcdata OCCURS 0 WITH HEADER LINE, LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE, TYPE ctu_params. " Message

" BDC Table " BDC Messages

DATA: fv_msg TYPE char250.

DATA: fv_msg_id fv_msg_no fv_msg_var1 fv_msg_var2 fv_msg_var3 fv_msg_var4

LIKE LIKE LIKE LIKE LIKE LIKE

t100-arbgb, t100-msgnr, balm-msgv1, balm-msgv2, balm-msgv3, balm-msgv4.

" " " " " "

Message Message Message Message Message Message

Id No Var1 Var2 Var3 Var4

DATA : lv_mode TYPE char1 VALUE 'N', lv_datum TYPE sydatum. IF gs_bflushdat IS NOT INITIAL. lv_datum = sy-datum. CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT' EXPORTING input = gs_bflushdat-materialnr IMPORTING output = gs_bflushdat-materialnr. DATA : lv_insqty(17) lv_insqty TYPE c." qlosmenge.

= gs_bflushdat-backflquant. USING 'SAPLQPL1' '0100'. USING 'BDC_CURSOR' 'QALS-MATNR'. USING 'BDC_OKCODE' '/00'. USING 'QALS-MATNR' gs_bflushdat-materialnr. USING 'QALS-WERK' gs_bflushdat-prodplant. USING 'QALS-HERKUNFT' '89'. USING 'SAPLQPL1' '0200'. USING 'BDC_OKCODE' '/00'. USING 'BDC_SUBSCR' 'SAPLQPL1' &' 1102LOT_HEADER'. USING 'BDC_SUBSCR' 'SAPLQPL1' &' 0212SUBSCR_TABSTRIP'. USING 'BDC_CURSOR' 'QALS-LOSMENGE'. USING 'QALS-LOSMENGE' lv_insqty . "'4'. USING 'QALS-PASTRTERM' '07.05.2013'. USING 'BDC_SUBSCR' 'SAPLSEXM'

PERFORM bdc_dynpro PERFORM bdc_field PERFORM bdc_field PERFORM bdc_field PERFORM bdc_field PERFORM bdc_field PERFORM bdc_dynpro PERFORM bdc_field PERFORM bdc_field PERFORM bdc_field PERFORM bdc_field PERFORM bdc_field PERFORM bdc_field PERFORM bdc_field

" '592513'. " '1000'.

PERFORM bdc_dynpro PERFORM bdc_field PERFORM bdc_field PERFORM bdc_field PERFORM bdc_field

&' 0200SUBSCREEN_ADDON'. USING 'SAPLQPL1' '0200'. USING 'BDC_OKCODE' '=BU'. USING 'BDC_SUBSCR' 'SAPLQPL1' &' 1102LOT_HEADER'. USING 'BDC_CURSOR' 'QALS-WERK'. USING 'BDC_SUBSCR' 'SAPLQPL1' &' 0203SUBSCR_TABSTRIP'. " MODE " CATTMODE " UPDATE MODE

* * *

gs_options-cattmode = 'A'. gs_options-dismode = 'N'. gs_options-updmode = 'S'.

CALL TRANSACTION 'QA01' USING gt_bdcdata MODE lv_mode UPDATE 'S' MESSAGES INTO gt_messtab. OPTIONS FROM gs_options. READ TABLE gt_messtab WITH KEY msgtyp = 'S' msgnr = 100. IF sy-subrc = 0 . fv_msg_id = gt_messtab-msgid. fv_msg_no = gt_messtab-msgnr. fv_msg_var1 = gt_messtab-msgv1. fv_msg_var2 = gt_messtab-msgv2. fv_msg_var3 = gt_messtab-msgv3. fv_msg_var4 = gt_messtab-msgv4. fv_msg_no = 100. CALL FUNCTION 'MESSAGE_PREPARE' EXPORTING language = sy-langu msg_id = fv_msg_id msg_no = fv_msg_no msg_var1 = fv_msg_var1 msg_var2 = fv_msg_var2 msg_var3 = fv_msg_var3 msg_var4 = fv_msg_var4 IMPORTING msg_text = fv_msg EXCEPTIONS function_not_completed = 1 message_not_found = 2 OTHERS = 3. ENDIF.

IF fv_msg IS NOT INITIAL. gs_error-lot_no = fv_msg_var2. gs_error-lot_mess = fv_msg. ENDIF. ENDIF.

S-ar putea să vă placă și