Question:
Hello all,
We are in 4.0B and most of our programs uses "call transaction" to create SD documents. Can you guys suggest how can we obtain document number created from the following transactions after the CT call:
VA21 - create quotation
VA01 - create sales order
VF01 - create invoice
We tried the messages return but sometimes the document numbers were not in the same place.
Thanks a lot,
John
Answer:
Hi John,
You'll generally find the document number in SY-MSGV1, however, a more general way of finding them in the message table goes like this:
*
* Find the first error or abend message
*
Read Message Table with message type 'E'.
If sy-subrc <> 0.
Read Message Table with message type 'A'.
EndIf.
If sy-subrc <> 0.
*
* Find the last success message
*
Loop at Message Table with Message type 'S'
EndLoop.
EndIf.
*
* Required message is now in message table header or work area.
*
_________________
Regards
R
Abap KC
SFMDR