analyse idoc by creation date

t-code ZMM0127

image

infoset: ZMM_IDOC_READ_01

image

go to code:

image

image

image

AUTHORITY-CHECK OBJECT 'S_IDOCMONI'
ID 'ACTVT' FIELD '03'
ID 'EDI_DIR' FIELD edidc-direct
ID 'EDI_MES' FIELD edidc-mestyp
ID 'EDI_PRN' FIELD edidc-rcvprn
ID 'EDI_PRT' FIELD edidc-rcvprt
ID 'EDI_TCD' DUMMY.
CHECK sy-subrc = 0.
*add by zhiang zhang S20160808141051-BYJL-ACM99X
DATA l_e1edka1 TYPE e1edka1.
DATA l_sdata LIKE edid4-sdata.
IF edidc-direct = '2' AND edidc-mestyp = 'ORDERS'.
SELECT sdata INTO l_sdata FROM edid4
WHERE docnum = edidc-docnum
AND segnam = 'E1EDKA1'.
    l_e1edka1 = l_sdata.
IF l_e1edka1-parvw = 'AG'.
      customer = l_e1edka1-partn.
EXIT.
ENDIF.
ENDSELECT.
ENDIF.
*end by zhiang zhang S20160808141051-BYJL-ACM99X
*--Start by qihui 20171027  S20171020084240-EXJZ-ASB2UQ
DATA:l_roleid TYPE srrelroles-roleid,
     l_objkey TYPE srrelroles-objkey,
BEGIN OF lt_idocrel OCCURS 0,
     role_a TYPE idocrel-role_a,
END OF lt_idocrel.
CLEAR:docnum_rltd.
IF edidc-direct = '1'.
CLEAR:l_objkey,l_roleid,lt_idocrel[],lt_idocrel.
SELECT SINGLE roleid FROM srrelroles
INTO l_roleid
WHERE objkey = edidc-docnum
AND objtype = 'IDOC'
AND roletype = 'OUTIDOC'.
IF l_roleid IS NOT INITIAL.
SELECT role_a INTO TABLE lt_idocrel
FROM idocrel  WHERE role_b = l_roleid.
IF lt_idocrel[] IS NOT INITIAL.
LOOP AT lt_idocrel.
SELECT SINGLE objkey FROM srrelroles
INTO l_objkey
WHERE roleid = lt_idocrel-role_a
AND objtype = 'IDOC'.
IF sy-subrc = 0.
          docnum_rltd = l_objkey.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.

转载于:https://www.cnblogs.com/chrisrockdl/p/10735501.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值