我想要一个如何通过更新
FB02
字段在 xref2
交易代码中进行批量输入的示例?
我尝试直接在表格中更新表格
BKPF
。
我需要示例如何更改特定字段
你可以帮我找到解决方案。
感谢您的帮助。
您可以通过SAP GUI获取批量输入代码。进入系统 > 服务 > 批量输入 > 录音机,开始新的录音。
节目 | SCR | SID | 字段名称 | 字段值 |
---|---|---|---|---|
T | FB02 | |||
SAPMF05L | 0100 | X | ||
BDC_CURSOR | RF05L-BELNR | |||
BDC_OKCODE | =微特 | |||
RF05L-BELNR | 5000000001 | |||
RF05L-BUKRS | 1000 | |||
RF05L-GJAHR | 2024 | |||
SAPMF05L | 0700 | X | ||
BDC_CURSOR | BKPF-BELNR | |||
BDC_OKCODE | =VK | |||
SAPMF05L | 1710 | X | ||
BDC_CURSOR | BKPF-XREF2_HD | |||
BDC_OKCODE | =进入 | |||
BKPF-XBLNR | FI1 | |||
BKPF-XREF1_HD | XREF1 | |||
BKPF-XREF2_HD | XREF2 | |||
SAPMF05L | 0700 | X | ||
BDC_CURSOR | BKPF-BELNR | |||
BDC_OKCODE | =AE |
我发现这个例子很容易理解....
FORM XPTO.
DATA : lv_bdc_mode TYPE ctu_mode,
lt_bdcmess TYPE TABLE OF bdcmsgcoll. "Message table
CLEAR t_bdcdata.
" Selection screen
PERFORM bdc_dynpro USING 'SAPMF05L' '0100'.
PERFORM bdc_field USING 'RF05L-BELNR' ps_bkpf-belnr.
PERFORM bdc_field USING 'RF05L-BUKRS' ps_bkpf-bukrs.
PERFORM bdc_field USING 'RF05L-GJAHR' ps_bkpf-gjahr.
PERFORM bdc_field USING 'BDC_OKCODE' '/00'.
" Main screen
PERFORM bdc_dynpro USING 'SAPMF05L' '0700'.
PERFORM bdc_field USING 'BDC_OKCODE' '=VK'. " [Button to reach header]
" Header Screen
PERFORM bdc_dynpro USING 'SAPMF05L' '1710'.
PERFORM bdc_field USING 'BKPF-XREF2_HD' pv_endda. " Value to be changed
PERFORM bdc_field USING 'BDC_OKCODE' '=ENTR'. " [Validate button]
" Main screen
PERFORM bdc_dynpro USING 'SAPMF05L' '0700'.
PERFORM bdc_field USING 'BDC_OKCODE' '=AE'. " [Save button]
lv_bdc_mode = 'N'. " <== set A in debug to display screen
CALL TRANSACTION 'FB02'
USING t_bdcdata
MODE lv_bdc_mode " N : Screens not displayed
UPDATE 'S' " Save synchronous
MESSAGES INTO lt_bdcmess.
* Get all transaction messages into li_bdcmess.
ENDFORM.
FORM bdc_dynpro USING pw_prog
pw_scr.
DATA ls_bdcdata TYPE bdcdata.
ls_bdcdata-program = pw_prog.
ls_bdcdata-dynpro = pw_scr.
ls_bdcdata-dynbegin = 'X'.
APPEND ls_bdcdata TO t_bdcdata.
ENDFORM. "BDC_DYNPRO
FORM bdc_field USING pw_fnam
pw_fval.
DATA ls_bdcdata TYPE bdcdata.
ls_bdcdata-fnam = pw_fnam.
ls_bdcdata-fval = pw_fval.
APPEND ls_bdcdata TO t_bdcdata.
ENDFORM. "BDC_FIELD