Application Development and Automation 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: 
Read only

prohibit certain field changes in SD order

Former Member
0 Likes
458

Hi,

I am a business analyst with few ABAP experience(...) and kinda stuck with following SD (sales & distribution) issue :

Users with a certain user-role must only be able to change the field "FPLT-FAKSP" (billing block) in the billing plan. All the changes in other fields are prohibited.

I thought on using following user-exits and codes

<u>in include MV45AFZZ</u>

<b>form userexit_move_field_to_vbap.</b>

IF NOT YVBAP[]IS INITIAL.

Errormessage

ENDIF.

<b>endform.</b> <i>"From the moment YVBAP has a value you know something has changed.</i>

<b>form userexit_move_field_to_vbep.</b>

IF NOT YVBEP[]IS INITIAL.

Errormessage

ENDIF.

<b>endform.</b>

<b>form userexit_move_field_to_vbkd.</b>

IF NOT YVBKD[]IS INITIAL.

Errormessage

ENDIF.

<b>endform.</b>

<b>form userexit_move_field_to_vbak.</b>

<i>Here i am stuck :Should there be a loop that compares xvbak with yvbak, and if yes how should the code look like ?</i><b>endform.</b>

<u>in include RV60FUS1</u>

FORM USEREXIT_MOVE_FIELD_TO_FPLA.

IF NOT YFPLA[] IS INITIAL

Errormessage

ENDIF.

ENDFORM.

FORM USEREXIT_MOVE_FIELD_TO_FPLA.

stuck here to, i could say :

IF YFPLT-FAKSP is INITIAL

Errormessage

ENDIF

--> But if the user changes second time he can change whatever he wants.

ENDFORM.

Any remarks, ideas on this ?

with regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
392

You can try something like this

Program MV45AFZZ

FORM userexit_field_modification.

IF screen-name = 'VBAK-FAKSK'.

if sy-tcode = 'VA02' or

sy-tcode = 'VA01'.

IF vbak-faksk = 'Z1' OR

vbak-faksk = 'Y1' OR

vbak-faksk = 'Y2'.

screen-input = 0.

ENDIF.

Endif.

endif.

ENDFORM.

1 REPLY 1
Read only

Former Member
0 Likes
393

You can try something like this

Program MV45AFZZ

FORM userexit_field_modification.

IF screen-name = 'VBAK-FAKSK'.

if sy-tcode = 'VA02' or

sy-tcode = 'VA01'.

IF vbak-faksk = 'Z1' OR

vbak-faksk = 'Y1' OR

vbak-faksk = 'Y2'.

screen-input = 0.

ENDIF.

Endif.

endif.

ENDFORM.