Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Idoc Number created through BD14

Former Member
0 Kudos

Hi,

I want to send some vendor details from SAP side to other system.And for that I am submitting BD14 using some vendor numberand message type cremas.

Now whenever we execute BD14 transaction with a vendor it will create one idoc number.

Now please let me know can we get this idoc number?

If i go to we02 i can see that but i want the table from where i can get this idoc number as i want show it in my final report output.

Edited by: Julius Bussche on Sep 12, 2008 4:45 PM

1 ACCEPTED SOLUTION

asik_shameem
Active Contributor
0 Kudos

Hi

Its very simple.

Use function module SREL_GET_NEXT_RELATIONS

where :

GWA_OBJECT-OBJKEY = VENDOR_NUMBER.
GWA_OBJECT-OBJTYPE = 'LFA1'.

CALL FUNCTION 'SREL_GET_NEXT_RELATIONS'
  EXPORTING
    OBJECT = GWA_OBJECT
  TABLES
    ROLES = GT_ROLES .

DELETE GT_ROLES WHERE OBJKEY EQ VENDOR_NUMBER AND OBJTYPE EQ 'LFA1'.

After that, you will get IDOC number in the OBJKEY field where OBJTYPE = 'IDOC'

7 REPLIES 7

Former Member
0 Kudos

Hi,

You can get more details from tables EDIDC, EDID4 and EDIDS tables.

Regards,

Naresh.

Former Member
0 Kudos

Hello,

If you want to Programatically get the Most recent IDoc Number which was generated, then use the GET PARAMETER ID "DCN" to get the Latest IDoc Number.

However, if you want to view the most recent IDoc in any transaction, goto either WE02 / WE05 and specify your message type / IDoc Type / Extension. Or go to WE19, then the First thing that you'll see is the Most recent IDoc Number which was generated. Copy the IDoc Number and then go to WE02 / WE05 to view the Same IDoc.

Hope that was helpful.

Thanks and Regards,

Venkat Phani Prasad Konduri

0 Kudos

But as i am executing my program with multiple vendor so multiple idoc can be generated.

And I need all those idoc number.

GET PARAMETER ID 'DCN' will going to give me only one idoc right?

Former Member
0 Kudos

i think your fastest option is to go to the table EDIDC

in your query pass the sy-datum (or any date ) value to the field UPDDAT , also give the field MESTYP the value 'CREMAS'

obviously the problem with that is that it will return all the idocs created on that day , so , you also have to "play" with the field UPDTIM to select the lastest idocs created

you might as well do a subquery selecting the last hour that an idoc that you are using was created and then give like a range of 5 minutes or something like that (i dont know how often do you create an idoc)

hope this will help you

asik_shameem
Active Contributor
0 Kudos

Hi

Its very simple.

Use function module SREL_GET_NEXT_RELATIONS

where :

GWA_OBJECT-OBJKEY = VENDOR_NUMBER.
GWA_OBJECT-OBJTYPE = 'LFA1'.

CALL FUNCTION 'SREL_GET_NEXT_RELATIONS'
  EXPORTING
    OBJECT = GWA_OBJECT
  TABLES
    ROLES = GT_ROLES .

DELETE GT_ROLES WHERE OBJKEY EQ VENDOR_NUMBER AND OBJTYPE EQ 'LFA1'.

After that, you will get IDOC number in the OBJKEY field where OBJTYPE = 'IDOC'

Former Member
0 Kudos

Thanx Asik.This Function module is very helpful for me and it will solve my purpose...

Thank You all for all your effort.

Thank You very much

0 Kudos

You are welcome Ghosh.