2006 Aug 08 2:33 PM
Hi all,
My first program in ABAP works very well. Thanks to all who helped me
I would like only one function to it.
The program read data from excel file and generates document using BDC.
I use this statement:
call transaction 'F-65' using bdcdatafile
I count the number of documents which have been generated or refeused because of error using the sy-subrc function.
if sy-subrc <> 0.
counter for errors
else.
counter for generated documents
endif.
Finally program displays these number on the last screen and the user knows if there everything is ok. For example this is a sample screen:
-
1. OK.
2. OK.
3. Error.
Number of imported documents (2)
Errors (1)
-
However, I would like to add one information to these screen. If the document is saved it gets its own number.
Is any possibility to get this number for displaying?
Maybe there is a function which returns this number.
I want to get the scren like this:
1. OK. Document No. 10000001
2. OK. Document No. 10000002
3. Error
Best regards
Arek
2006 Aug 08 2:35 PM
The document number should be being passed back via a message. You need to specifiy to return any messages in the messtab when calling the transaction.
DATA: MESSTAB type table of BDCMSGCOLL WITH HEADER LINE.
call transaction 'F-65' using bdcdatafile
messages into messtab.
Messtab will have the messages after the call, you can then read this internal table and check for the success message, usually the document number is in the first variable field, MSGV1.
Regards,
Rich Heilman
2006 Aug 08 2:35 PM
The document number should be being passed back via a message. You need to specifiy to return any messages in the messtab when calling the transaction.
DATA: MESSTAB type table of BDCMSGCOLL WITH HEADER LINE.
call transaction 'F-65' using bdcdatafile
messages into messtab.
Messtab will have the messages after the call, you can then read this internal table and check for the success message, usually the document number is in the first variable field, MSGV1.
Regards,
Rich Heilman
2006 Aug 08 4:30 PM