11-21-2007 3:19 PM
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
11-21-2007 3:28 PM
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
11-21-2007 3:35 PM
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
11-21-2007 4:08 PM
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.
11-21-2007 4:54 PM
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
11-21-2007 4:58 PM
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
11-21-2007 3:33 PM
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