cancel
Showing results for 
Search instead for 
Did you mean: 

Don't allow to change sales order item

Former Member
0 Kudos

Hi Gurus,

We are creating a process where, after some events, we would like to update the sales order, so from that moment for a specific item, the user won't be able to modify anything of it. If it was possible to don't allow the deletion of that item, it would be even better. We want something similar to what the Overall Status of the item level offers when it is "Complete", but also we want to be able to bill that item (no delivery is needed).

Do you know if that is possible? Is there any FM that can help us?

Thank you in advance.

Accepted Solutions (1)

Accepted Solutions (1)

former_member195427
Active Contributor

Hi Abel,

           Yes, You have following options to achieve your requirement:

  • The methodology of user status suggested by Navaneetha as above.

  • Explore the usage of Screen variant(t-code: SHD0)& Transaction variant: In this process(screen variant)you can display a few fields which you don't want to get changed then you can create a transaction variant(Z t-code which is created in relevance of screen variant) and assign these transaction variants in users roles with the help of BASIS guy. This way, you can un authorize users for changes VA02 and allow them to change via ZVA02 (Z t-code created through transaction variant). Explore more on it and you will be fine.

  • You can develop a logic which would prohibit any changes in sales orders for ex. If delivery done against WBS then it should not be changed or replaced by users in sales orders line items. For the same you can ask your ABAPer to write a logic/program that would check if entries are existing in LIPS table for the respective account assigned WBS ( object number ) of sales order line item then disallow change.  You can also use the following exists for similar purposes :

USEREXIT_SAVE_DOCUMENT_PREPARE

USEREXIT_CHECK_VBAP

BADI_SD_SALES_ITEM

I hope, it will help you.

Regards

Ankur

Former Member
0 Kudos

Thank you Ankur,

If it can be done by statuses I rather do it that way. Do you know how I should customize the new  status profile I created to forbid the modifications on the item?

Thank you so much again,

Abel

former_member195427
Active Contributor
0 Kudos

Hi Abel,

         I can give you some brief guidelines on user status configuration:

  1. Create status profile (OK02) . Here, select object types sales order header & sales order item.
  2. Then,Create a status for ex. LOCK and forbid the business transactions like create delivery, create sales order line items etc.
  3. Thereafter, create another status as ALLW and here allow those business transactions which you forbid earlier.
  4. Create authorization code in BS52 and assign them in your user status profile.Assign this authorization code, to only those users who are responsible for setting and resetting.
  5. You can remove authorization for change in sales order using t-code PFCG , ask with your BASIS guy for the same. You can do it at department level or transaction type level.

You can search more about it on sap help or Google it. you will find a lot of threads for the same.

I hope, its clear to you now.

Regards

Ankur

Former Member
0 Kudos

Thank you Ankur, but I think this solution it's not good for us. We don't want to allow or lock business transactions, we want to make the item of the sales order non editable. And I don't know if we can solve it through item status...

The user, after a certain process, should not be able to modify the item of a specific sales order. Not changing quantities or any other field. And this is where I am now. I know how to create a status profile, but all my attemps to make non editable the item are not working.

former_member195427
Active Contributor
0 Kudos

Hi Abel,

           I am sure that you can control it through status. Kindly check the below given screen shots and try it in your system:

Secondly, if you are not comfortable with setting up user status then you have to take the help of ABAPer to prepare a logic and subsequently writing a program to make changes in SODS line items or its subsequent fields. Here, I am giving you a program through which I made fields of material code, quantity and WBS fields un editable. You can prepare your own by modifying the same logic and altering a few fields or tables in the program:

if sy-tcode = 'VA02' .
DATA return type table of BAPIRET2 .
REFRESH return[].
IF ( screen-GROUP2 = 'LOO' ) AND ( screen-name = 'RV45A-KWMENG' OR  screen-name = 'VBAP-VRKME' OR  screen-name =  'VBAP-PS_PSP_PNR' ).
IF vbap-vbeln is NOT INITIAL AND vbap-PS_PSP_PNR is INITIAL.
CALL FUNCTION 'ZSD_FM_CHECK_VALIDATION'
EXPORTING
vbeln         = vbap-vbeln
posnr         = vbap-POSNR
PS_PSP_PNR    = vbap-PS_PSP_PNR
tables
return        = return
.
IF return[] IS NOT initial.
CASE screen-name.
WHEN 'RV45A-KWMENG' OR 'VBAP-VRKME' OR 'VBAP-PS_PSP_PNR'.
screen-input =
0.
ENDCASE.
ENDIF.
endif.
IF vbap-vbeln is not initial AND vbap-PS_PSP_PNR is not INITIAL.
CALL FUNCTION 'ZSD_FM_CHECK_VALIDATION'
EXPORTING
vbeln         = vbap-vbeln
posnr         = vbap-POSNR
PS_PSP_PNR    = vbap-PS_PSP_PNR
tables
return        = return                     .
IF return[] IS NOT initial.
CASE screen-name.
WHEN 'RV45A-KWMENG' OR 'VBAP-VRKME' OR 'VBAP-PS_PSP_PNR'.
screen-input =
0.
ENDCASE.
ENDIF.
endif.

endif.
endif.

There is one more option of "Maintaining System Status through t-code BS22" but i won't suggest that option.

However, you can test all the above mentioned processes in your testing server and decide which one suits you the best.

Good Luck!!

Regards

Ankur

Former Member
0 Kudos

Hello Ankur,

That looks exactly what I need, but I don't know to which kind of object did you linked your status profile. For sales order item I don't see any business transaction called "Change". Is there other object I could use for this?

Thanks again!

Abel

former_member195427
Active Contributor
0 Kudos

Hi Abel,

          In T-code OK02/BS02 while creating status profile take object types Operation of process order & PP/PM: order header in addition to what you have already selected (Sales order header & Sales order item ) -> Then, while creating a new status and adding new entries for transaction control under Business Transaction, you will find the field "Change" now.Here, you do the same as mentioned above i.e. forbid->allow.

Now,come to IMG(SPRO)->Sales & Disribution-> Sales-> Define & Assign Status profile ->Assign order types/status profiles (VOV8)->Here, assign your status profile under parameters of 'Transaction Flow'

Again, IMG(SPRO)->Sales & Disribution-> Sales-> Define & Assign Status profile ->Allocate status profile to item categories->Here again, assign your status profile under parameters of 'Transaction Flow'

Check it again.

Hope it will work now.

Regards

Ankur

Former Member
0 Kudos

I tried this and the "change" option appears in the status but doesn't affect to the sales order item.

What I will do is create a new status profile with 2 status and when is in the 2nd status I will control by user exits to make non editable some fields.

Thanks for all your help!

Abel

Answers (1)

Answers (1)

former_member183879
Active Contributor
0 Kudos

Hi Abel,

That is very much possible with Status profile at the item level. YOu can disable the changing functionality of a line item for a particular status of the line item. You can easily enable this in standard SAP.

Just check the statuses and statuses profile little bit, explore them, you can do wonders with them.

Former Member
0 Kudos

Hi Navaneetha,

I tried creating a new status profile and it get assigned correctly to the sales order, but I can't find any changing functionality. I did some tests with "lock" and other options but nothing seems to restrict the modifications. Could you tell me how to do it?

thanks

Abel