Application Development and Automation 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: 
Read only

how do display document no. generated while running BDC

Former Member
0 Likes
857

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
Read only

JozsefSzikszai
Active Contributor
0 Likes
636

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

Read only

0 Likes
636

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

Read only

0 Likes
636

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.

Read only

0 Likes
636

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

Read only

0 Likes
636

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

Read only

naimesh_patel
Active Contributor
0 Likes
636

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