02-23-2007 4:16 PM
Hi IDOCers,
in ME23N in the object services, I can click the refernce button and it will show me the the IDOC number and type in a small ALV grid.
Question: How can I retrieve the IDOC number for an order and/or vice versa?
TIA,
Clemens
02-23-2007 4:21 PM
Hi,
In WE02 tcode u can find the order number from the idoc number.generally we will find the idocs in the table edidd,edid4.So we need to give the message type ORDERS .But for a particular order number ,this is the idoc ,probably we may not get...
regards,
Nagaraj
04-12-2007 2:08 PM
... found it:
Involved tables are srrelroles and idocrel. Tables have to be joined back and forth.
* prepare reference table complete
loop at pt_alv assigning <alv>.
lv_objkey = <alv>-docnum.
* collect object keys
insert lv_objkey into table lt_objkey.
at last.
* at least one key - no empty select 4 all entries
select srrelroles_idoc~objkey srrelroles_ekko~objkey
into (lv_objkey_docnum, lv_objkey_ebeln)
from srrelroles as srrelroles_idoc
join idocrel
on idocrel~role_a = srrelroles_idoc~roleid
join srrelroles as srrelroles_ekko
on srrelroles_ekko~roleid = idocrel~role_b
* just to make sure
join ekko on ekko~ebeln = srrelroles_ekko~objkey
for all entries in lt_objkey
where srrelroles_idoc~objkey = lt_objkey-table_line
and srrelroles_idoc~objtype = 'IDOC'
and srrelroles_idoc~roletype = 'INIDOC'.
ls_docnum_ebeln-ebeln = lv_objkey_ebeln.
ls_docnum_ebeln-docnum = lv_objkey_docnum.
insert ls_docnum_ebeln into table lt_docnum_ebeln.
endselect.
endat.
endloop." at pt_alv assigning <alv>.
Regards,
Clemens
04-12-2007 2:10 PM