‎2007 Sep 11 8:25 AM
Hi friends,
I need a small help.I am implementing a custom enhancement for Sales Orders.
For this,I am using the User Exit SAVE_DOCUMENT_PREPARE in the standard program MV45FZZ(Include in SAPMV45A).I wrote a small logic,that gets triggered each time a Sales Order is created or Changed through VA01 or VA02 respectively.
I need to check the Pricing date PRSDT in VBKD for the Current Sales Order.If it is less than a value(Constant Date),I need to place a Billing Block.
While changing i.e., VA02,I can access XVBAP-VBELN and retrieve PRSDT from VBKD and check it.
But,while Creation i.e., VA01, XVBAP-VBELN is blank.
How can I get the current Sales Order while creation through VA01 ?
For VA02 i.e., change my logic works pretty well.I am capturing the current Sales Order Number using XVBAP-VBELN and implementing my logic.
But while creation i.e., VA01,I am using the same logic and trying to capture current Sales Order through XVBAP-VBELN(not yet saved).
But,XVBAP-VBELN is blank when I am debugging.
Where does the Sales Order Number get stored,while it is being created i.e., before being updated to VBAK-VBELN.(before commit).
REgards,
Imran.
‎2007 Sep 11 8:30 AM
Hi,
u can get the sales documentnumber in XVBAK temporary table....chek the same..
Regards,
Nagaraj
‎2007 Sep 11 10:07 AM
‎2007 Sep 11 10:15 AM
‎2007 Sep 11 10:14 AM
hello Masood,
How are you creating the sales order in VA01?
if you are creating sales order (VA01) by using Call transaction then the message with the new sale order number will be in the messages table.
check the below code.
CALL TRANSACTION 'VA01' USING bdcdata OPTIONS FROM opt
MESSAGES INTO g_t_messtab.
IF sy-subrc = 0.
IF l_f_vbeln IS INITIAL.
READ TABLE g_t_messtab WITH KEY tcode = 'VA01'
dyname = 'SAPMV45A'
dynumb = '4001'
msgtyp = 'S'
msgid = 'V1'
msgnr = '261'.
IF sy-subrc = 0.
l_f_vbeln = g_t_messtab-msgv2.
ELSE.
CLEAR l_f_vbeln.
ENDIF.
ENDIF.
l_f_ebeln is the field where i will getting the new sale order number.
i will use it for future purposes.
‎2007 Sep 11 10:19 AM
hi,
there would be a structure NRIV, Which holds the number temporarily.
if helpful reward points.
regards
Mukesh
‎2007 Nov 22 7:04 AM
Hi Masood,
If you have got the answer for this please share.
Mohan