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: 

how do display document no. generated while running BDC

Former Member
0 Kudos

Hi all,

I have devloped a BDC for t-code F-43 for passing expenses detail. But in this document created for the enteries is shown below , but i want all the document generated after running BDC should be shown in a screen at the end .

Please help me with the code to display all generated document no.

Thanks in advance,

Regards,

Vivek

6 REPLIES 6

JozsefSzikszai
Active Contributor
0 Kudos

hi Vivek,

if you do it with CALL TRANSACTIOn, you can capture all the return messages which will contain the numbers of the just created documents as well. BDC session method is not a solution in this case.

ec

0 Kudos

Hi Eric,

I am using call transaction method only , Now how to capture these return messages of document no. generated and display at the end.

Thanks,

Vivek

0 Kudos

CALL TRANSACTION ....

<b>MESSAGES INTO gt_messtab</b>

here you can capture. if the document was created successfully, the issued message by the system will contain the number.

declaration for messtab:

DATA : gt_messtab TYPE TABLE OF bdcmsgcoll.

0 Kudos

Ok.. than you can do like this:

DATA: IT_MESS LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.

CALL TRANSACTION 'F-43' TABLE BDC_TAB MESSAGE IT_MESS.

READ TABLE IT_MESS WITH KEY MSGID = 'F5'
MSGNO = '312'
IF SY-SUBRC = 0.
* DOCUMENT POSTED SUCCESSFULLY.
ELSE.
*  ERROR HANDLING
ENDIF.

Regards,

Naimesh Patel

0 Kudos

For each CALL TRANSACTION, put the messages into the message table; then loop through the table, formatting and writing them to the list. You will end up with a list of all the messages produced by all of the transactions.

Rob

naimesh_patel
Active Contributor
0 Kudos

If you have used SESSION for this BDC, than you can go to BKPF and find out the generated documents.

SELECT BELNR
INTO TABLE IT_DOC
FROM BKPF
WHERE BUKRS = <your_cc>
GRPID = <your_session_name>.

Make sure that your session name is unique every time you run your BDC to avoid duplicate entries from the the table.

Regards,

Naimesh Patel