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: 

VA01 Item category display only for specific order type

aromalr
Active Participant
0 Kudos

Hi,

I have a requirement to deactivate(display only) item category field in VA01 table item for certain order type . I tried the user exit MV45AFZZ(USEREXIT_FIELD_MODIFICATION). This is working only if the table item has a value. i.e I could able to enter an item category first and then enter the material and quantity.

So please suggest any alternative how to make the item category field(VBAP-PSTYV) column display only for centrain order type.

Regards

Aromal R

1 ACCEPTED SOLUTION

former_member320332
Contributor
0 Kudos

Hi Aromal,

Can you paste the logic you have tried for this issue.

I tried below option in debugging at it is working fine.

Table Control name used for item details in VA01 screen is TCTRL_U_ERF_GUTLAST. You have to modify this table control

screen structure for field VBAP-PSTYV. In TCTRL_U_ERF_GUTLAST-cols[ ] you will get the all the fileds of the table control

and TCTRL_U_ERF_GUTLAST-cols[ ]-screen will have screen details.I modified TCTRL_U_ERF_GUTLAST-cols[9]-screen-INPUT = '0' and VBAP-PSTYV was made output field only.Please try this and check.

Thanks,

Pawan

8 REPLIES 8

former_member320332
Contributor
0 Kudos

Hi Aromal,

Can you paste the logic you have tried for this issue.

I tried below option in debugging at it is working fine.

Table Control name used for item details in VA01 screen is TCTRL_U_ERF_GUTLAST. You have to modify this table control

screen structure for field VBAP-PSTYV. In TCTRL_U_ERF_GUTLAST-cols[ ] you will get the all the fileds of the table control

and TCTRL_U_ERF_GUTLAST-cols[ ]-screen will have screen details.I modified TCTRL_U_ERF_GUTLAST-cols[9]-screen-INPUT = '0' and VBAP-PSTYV was made output field only.Please try this and check.

Thanks,

Pawan

aromalr
Active Participant
0 Kudos

HI,

in the exit USEREXIT_FIELD_MODIFICATION(MV45AFZZ)

I have tried

if vbak-auart = 'ZEKE'.

CASE SCREEN-NAME.

when 'VBAP-PSTYV'.

screen-output = 1.

screen-input = 0.

endcase.

endif.

This will work only if table control has a value.

Regards

Aromal R

Former Member
0 Kudos

IMO this userexit will not work with table controls where the records are yet to be populated. This user exit will execute at item level only when the value is entered against any of the columns (in table control).

Regards, Vinod

0 Kudos

Hi,

In your code you have missed one important statement MODIFY SCREEN after screen-output = 1.

screen-input = 0. Anyway have you tried what I mentioned earlier.

Thanks,

Pawan

aromalr
Active Participant
0 Kudos

Hi,

MODIFY SCREEN is not need in this exit.

I have resolved the issue with implicit enhancement.

thread is closed.

Thank you all.

Regards

Aromal R

Former Member
0 Kudos

Hi,

Could you please explain your solution in more detail?

aromalr
Active Participant
0 Kudos

Hi,

Create a Custom Authorization Object so that you can control it for certain users.  2. Write implicit enhancement spot in the include TCS MV45AF0T_TCTRL_U_ERF_AUFTRAG_I,

FORM TCTRL_U_ERF_AUFTRAG_INIT

AUTHORITY-CHECK OBJECT 'ZITMCAT'

          ID 'ACTVT' FIELD '02'.



IF SY-SUBRC NE 0.

*    DATA: WA_COLS LIKE LINE OF TCTRL_U_ERF_AUFTRAG-COLS.



LOOP AT   TCTRL_U_ERF_AUFTRAG-COLS INTO WA_COLS.



   IF WA_COLS-SCREEN-NAME = 'VBAP-PSTYV'.


   WA_COLS-SCREEN-INPUT = 0.

   WA_COLS-SCREEN-OUTPUT = 1.

  MODIFY TCTRL_U_ERF_AUFTRAG-COLS FROM WA_COLS.

   ENDIF.

ENDLOOP.

ENDIF.

Regards

Aromal R

Former Member
0 Kudos

I used this code in USEREXIT_FIELD_MODIFICATION(MV45AFZZ) with other field and it worked ok.