05-05-2010 3:40 PM
Hi All,
if confirmed Quantity is less than ordered quantity the i have to create saperate sales order for each line item which comes under this condition.(VBEP-BMENG is less than VBEP-WMENG.)
i am writting code in MV45AFZZ in user exit USEREXIT_SAVE_DOCUMENT_PREPARE
and i am using Bapi (BAPI_SALESDOCU_CREATEFROMDATA1) for this but iam not able to create separate sales order (ie Split sales orders).
Thanks in Advance,
Sudhakar Reddy .A
05-06-2010 7:07 AM
What error you are getting ? Call the BAPI in USEREXIT_SAVE_DOCUMENT in MV45AFZZ.
Regards
Vinod
05-06-2010 9:45 AM
> and i am using Bapi (BAPI_SALESDOCU_CREATEFROMDATA1) for this but iam not able to create separate sales order (ie Split sales orders).
>
Why?
Any error?
--
Reddy
05-06-2010 9:48 AM
if i have 5 itmes in sales order
Example
Material Plant
MAT1 1000 (confirmed quanity is less than ordered quanity)
MAT2 1005 confirmed quanity is EQUAL TO ordered quanity
MAT3 1004 (confirmed quanity is less than ordered quanity)
MAT4 1003 confirmed quanity is EQUAL TO ordered quanity
MAT5 1006 (confirmed quanity is less than ordered quanity)
i have to create a sales order for each line item if confirmed quanity is less than ordered quanity.
and for other line items how it will behave can you please let me know .
If any one has code for this can you please send.
Regards,
Sudhakar Reddy.A
05-06-2010 9:55 AM
Hi Sudhakar,
Call BAPI per every 'confirmed quanity is less than ordered quanity' case. And it will create a seperate SO.
Call Bapi one time for all 'confirmed quanity is EQUAL TO ordered quanity' case. then it will create SO with multiple items.
--
Reddy
05-07-2010 7:45 AM
Hi,
if u have any solution and how to do that plz tell me...
Regards,
Sudhakar Reddy.A
05-07-2010 10:01 AM
Hi ,
Thanks for the quick replies.
and also have to change plant for each line depending on the condition is that possible in USEREXIT_SAVE_DOCUMENT.
can you please send the sample code.
regards,
Sudhakar Reddy.A
05-07-2010 11:14 AM
Hi Sudhakar,
Declare one internal table and puplate the fileds like material, plant, qty ..etc and a flag.
Flag = X, Means confirmed quanity is less than ordered quanity
Flag = '', confirmed quanity is EQUAL TO ordered quanity.
Loop the table, if flag = X, call bapi every time.
loop the table where flag = '', ans pass all the records as items to BAPI.
--
Reddy
Note: Mark all usefull answers