cancel
Showing results for 
Search instead for 
Did you mean: 

How to grey out BSARK(PO Type) in header while changing Sales Order VA02

Former Member
0 Kudos

HI All,

I have a requirement like this.

Need to default a value in PO type BSARK field in the header while creating sales order VA01.

After defaulting, If user trying to change the PO type in VA02, I need to make the field as non-editable/Grey out. system should not allow the user to change the PO type.

Please help if some one worked on the same kind of requirement.

Thanks,

Mahesh.

Accepted Solutions (0)

Answers (2)

Answers (2)

sez41
Active Contributor
0 Kudos

Mahesh,

If you want to default this field in sales order header level, you need to make an enhancement. Do you want this value to be editable in VA01 screen? If so, make the enhancement in program MV45AFZZ, form USEREXIT_MOVE_FIELD_TO_VBAK. If not, make the enhancement in program MV45AFZB, form USEREXIT_CHECK_VBAK.

In VA02, make an enhancement in in program MV45AFZZ, form USEREXIT_FIELD_MODIFICATION to make the field act as display only.

Former Member
0 Kudos

HI Kivanc,

Actually Defaulting the value in BSARK for VA01 is completed and working fine with USEREXIT_MOVE_FIELD_TO_VBAK.

But I need to disable the same field when the user tries to change the sales order in VA02.

I have tried with  userexit_check_vbkd in MV45AFZB and also tried with USEREXIT_FIELD_MODIFICATION in MV45AFZZ with the below code. But it is not working.

if sy-tcode = 'VA02'.

       if xvbak-auart = 'XXXX'.

         if xvbak-ernam ne 'XXXXXXXX'.

           if xvbkd-bsark = 'XXXX'.

             case screen-name.

             when xvbkd-bsark.

               screen-input = 0.

             endcase.

           endif.

         endif.

       endif.

   endif.

Please help.

sez41
Active Contributor
0 Kudos

Mahesh,

Try using tables vbak and vbkd instead of xvbak and xvbkd in the code.

RAF
Active Contributor
0 Kudos

Hi,

with help of ABAP you can use  userexit_field_modification. MV45AFZZ.

Here you can Change the Screen attributes of field bsark.

In the include are also Exits to move Default values to fields.


Exits are nicley documented http://help.sap.com/saphelp_46c/helpdata/en/1c/f62c7dd435d1118b3f0060b03ca329/content.htm

BR

Robert