Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ihave2create sales order using userexits if confirmed qty is LT ordered qty

Former Member
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

What error you are getting ? Call the BAPI in USEREXIT_SAVE_DOCUMENT in MV45AFZZ.

Regards

Vinod

Former Member
0 Kudos

> 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

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

Hi,

if u have any solution and how to do that plz tell me...

Regards,

Sudhakar Reddy.A

Former Member
0 Kudos

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

0 Kudos

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