针对特殊总账 屏幕录屏需要对应动态获取对应屏幕
修改的时候可以直接读取 BSEG-UMSKS 特殊总分类帐事务类型,
针对创建,可以根据过特殊总账类型,客户/供应商,读取T074U-UMSKS,
再去T019 按照 客户/供应商 和 UMSKZ = T074U-UMSKS 读取,此处没有验证,但是存在T019表未配置客户供应商情况,读取时若是没有直接匹配项,应该会去掉该条件,直接按照 UMSKZ = T074U-UMSKS 去匹配,待验证
macro_bdc_dynpro : 'SAPMF05L' '0100'.
macro_bdc_field : 'BDC_OKCODE' '/00',
'RF05L-BELNR' gt_disp-belnr,
'RF05L-BUKRS' gt_disp-bukrs,
'RF05L-GJAHR' gt_disp-gjahr.
macro_bdc_dynpro : 'SAPMF05L' '0700'.
macro_bdc_field : 'BDC_OKCODE' '=ABZL'.
macro_bdc_dynpro : 'SAPMF05L' '1130'.
macro_bdc_field : 'BDC_OKCODE' '=ENTR',
'RF05L-BUZEI' gt_disp-buzei.
macro_bdc_dynpro : 'SAPMF05L' '0700'.
macro_bdc_field : 'BDC_OKCODE' '=PK',
'BDC_CURSOR' 'RF05L-ANZDT(01)'.
IF p_ra1 = 'X'.
lv_koart = 'K'.
lv_umskz = gt_disp-umsks.
ELSE.
lv_koart = 'D'.
"CASE gt_disp-umskz.
" WHEN ''.
" lv_umskz = 'X'.
" WHEN OTHERS.
" lv_umskz = gt_disp-umsks.
"ENDCASE.
lv_umskz = gt_disp-umsks.
ENDIF.
CLEAR ls_t019.
SELECT SINGLE * FROM t019
INTO ls_t019
WHERE dyncl = 'A'
AND koart = lv_koart
AND umskz = lv_umskz "gt_disp-umsks
AND buvar = ''.
lv_hbkid = gt_disp-hbkid.
lv_hktid = gt_disp-hktid.
lv_zlsch = gt_disp-zlsch.
IF p_poc = 'X'.
ELSE.
CLEAR :lv_hbkid,lv_hktid,lv_zlsch.
ENDIF.
IF p_ra1 = 'X'.
IF gt_disp-umsks IS NOT INITIAL.
macro_bdc_dynpro : 'SAPMF05L' ls_t019-dynnr. "'0304'.
macro_bdc_field : 'BDC_OKCODE' '=ZK',
'BSEG-ZLSCH' lv_zlsch."gt_disp-zlsch.
macro_bdc_dynpro : 'SAPMF05L' '1303'.
macro_bdc_field : 'BDC_OKCODE' '=ENTR',
'BSEG-HBKID' lv_hbkid,"gt_disp-hbkid,
'BSEG-HKTID' lv_hktid."gt_disp-hktid.
ELSE.
macro_bdc_dynpro : 'SAPMF05L' ls_t019-dynnr. "'0302'.
macro_bdc_field : 'BDC_OKCODE' '=ZK',
'BSEG-ZLSCH' lv_zlsch."gt_disp-zlsch.
macro_bdc_dynpro : 'SAPMF05L' '1302'.
macro_bdc_field : 'BDC_OKCODE' '=ENTR',
'BSEG-HBKID' lv_hbkid,"gt_disp-hbkid,
'BSEG-HKTID' lv_hktid."gt_disp-hktid.
ENDIF.
ELSE.
IF gt_disp-umsks IS NOT INITIAL.
macro_bdc_dynpro : 'SAPMF05L' ls_t019-dynnr. "'0304'.
macro_bdc_field : 'BDC_OKCODE' '=ZK',
'BSEG-ZLSCH' lv_zlsch."gt_disp-zlsch.
macro_bdc_dynpro : 'SAPMF05L' '1303'.
macro_bdc_field : 'BDC_OKCODE' '=ENTR',
'BSEG-HBKID' lv_hbkid,"gt_disp-hbkid,
'BSEG-HKTID' lv_hktid."gt_disp-hktid.
ELSE.
macro_bdc_dynpro : 'SAPMF05L' ls_t019-dynnr. "'0301'.
macro_bdc_field : 'BDC_OKCODE' '=ZK'.
macro_bdc_dynpro : 'SAPMF05L' '1301'.
macro_bdc_field : 'BDC_OKCODE' '=ENTR',
'BSEG-HBKID' lv_hbkid,"gt_disp-hbkid,
'BSEG-HKTID' lv_hktid,"gt_disp-hktid.
'BSEG-ZLSCH' lv_zlsch."gt_disp-zlsch.
ENDIF.
ENDIF.
macro_bdc_dynpro : 'SAPMF05L' ls_t019-dynnr.
macro_bdc_field : 'BDC_OKCODE' '=AE'.
* IF p_ra1 = 'X'.
* IF gt_disp-umsks IS NOT INITIAL.
* macro_bdc_dynpro : 'SAPMF05L' '0304'.
* macro_bdc_field : 'BDC_OKCODE' '=AE'.
* ELSE.
* macro_bdc_dynpro : 'SAPMF05L' '0302'.
* macro_bdc_field : 'BDC_OKCODE' '=AE'.
* ENDIF.
* ELSE.
* IF gt_disp-umsks IS NOT INITIAL.
* macro_bdc_dynpro : 'SAPMF05L' '0304'.
* macro_bdc_field : 'BDC_OKCODE' '=AE'.
* ELSE.
* macro_bdc_dynpro : 'SAPMF05L' '0301'.
* macro_bdc_field : 'BDC_OKCODE' '=AE'.
* ENDIF.
* ENDIF.
*-- Call Transaction
DATA: lv_mode TYPE c.
lv_mode = 'N'.
CALL TRANSACTION 'FB02' USING it_bdcdata
MODE lv_mode
UPDATE 'S'
MESSAGES INTO it_bdcmsg.
DELETE ADJACENT DUPLICATES FROM it_bdcmsg.
CLEAR it_bdcmsg.
* READ TABLE it_bdcmsg WITH KEY msgtyp = 'S'.
LOOP AT it_bdcmsg WHERE msgid = 'F5' AND
( msgnr = '300' OR msgnr = '303').
EXIT.
ENDLOOP.