cancel
Showing results for 
Search instead for 
Did you mean: 

Adding new Line Items to Sales Order from a closed period

Former Member
0 Kudos

Hi All,

Is there a way to block the users from adding new line items to a sales order from a closed period. In simple, once a sales order is created and billed, no one should add any more line items to the sales order.

Please let me know.

Thanks

SM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Shylaja,

Once you create Order --> Delivery --> Finally you do billing and pass on to accounting all the items in sales order would get greyed out.

But its not having, we can do this by using User Exit.

Please try with the one of the below user exit, In this regard please take your abapers help.

MV45ATZZ

MV45AOZZ

MV45AIZZ

MV45AIZZ

MV45AFZZ

MV45EFZ1

MV45AOZZ

MV45AIZZ.

Please Reward If Really Helpful,

Thanks and Regards,

Sateesh.Kandula

Answers (1)

Answers (1)

Former Member
0 Kudos

you can either raise error message preventing order save if it's VA02, if all items have been billed and there is any item in xvbap with xvabp-updkz = 'I' - insert.... it can be done in userexit_save_document_prepare

OR

you can simply switch from VA02 to VA03 using userexit_read_document if all items have been billed so your users won't be able to change anything in sales order which is complete.

Former Member
0 Kudos

Thanks.

Could you please provide me a detail procedure if available.

But this is exactly what I was lookin for.

Thanks once again.

Former Member
0 Kudos

1st case -

userexit_save_document_prepare (main program - sapmv45a)

if sy-tcode = 'VA02'.

read table xvbap with key updkx = 'I'.

if sy-subrc = 0.

  • check if all items are billed or just order status

  • if the order is complete - issue error message.

endif.

endif.

2nd case -

userexit_read_document

  • if your order is complete

  • issue INFO message

set parameter id 'AUN' field vbak-vbeln.

leave to transaction 'VA03' and skip first screen.

it will actually prevent user from opening the order in VA02 and it will eb open in VA03 instead.