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: 

Price conditions non modifiable

Former Member
0 Kudos

Sir,

While using T-code VA02, some users are not allowed to edit the condition amount in the "Conditions" Tab i.e. the field of "Amount" for some identified condition types must be in editable mode and for rest all other condition types the field "Amount" must be displayed/gray mode.

Howerver we tried the user-exit include MV45AFZZ and used the FORMS ( USEREXIT_FIELD_MODIFICATION and USEREXIT_PRICING_PREPARE_TKOMP ) to meet the requirement. the changes are working in VA01 but working improperly in VA02.

the code snapshot is enclosed herewith for needful.

FORM USEREXIT_FIELD_MODIFICATION.

data : v_uname type sy-uname.

if ( sy-tcode = 'VA01' or sy-tcode = 'VA02' ).

select single uname into v_uname

from YUSRS4_KSCHLEDIT

where uname = sy-uname.

endif.

if v_uname is initial.

CASE SCREEN-NAME.

WHEN 'KOMV-KBETR'.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

ENDCASE.

endif.

ENDFORM.

FORM USEREXIT_PRICING_PREPARE_TKOMP.

data : v_uname type sy-uname.

data : v_kschl type kschl.

if ( sy-tcode = 'VA01' or sy-tcode = 'VA02' ).

select single uname into v_uname

from YUSRS4_KSCHLEDIT

where uname = sy-uname.

endif.

IF NOT V_UNAME IS INITIAL.

LOOP AT XKOMV.

v_kschl = XKOMV-KSCHL.

IF ( v_KSCHL = 'ZR00' or v_KSCHL = 'ZFR1' ).

XKOMV-KMANU = 'C'.

MODIFY XKOMV transporting kmanu.

ENDIF.

clear:v_kschl,XKOMV.

ENDLOOP.

ELSE.

LOOP AT XKOMV.

v_kschl = XKOMV-KSCHL.

IF ( v_KSCHL = 'ZR00' or v_KSCHL = 'ZFR1' ).

XKOMV-KMANU = 'D'.

MODIFY XKOMV transporting kmanu.

ENDIF.

clear:v_kschl,XKOMV.

ENDLOOP.

ENDIF.

ENDFORM.

Please help.

Regards,

+91-9650493434/9650493432

6 REPLIES 6

Former Member
0 Kudos

Hi,

you have to add MODIFY SCREEn, whenever you make change sto screen,

if v_uname is initial.
CASE SCREEN-NAME.
WHEN 'KOMV-KBETR'.
SCREEN-INPUT = 0.
SCREEN-OUTPUT = 1.
*MODIFY SCREEN*
ENDCASE.
endif.

Former Member
0 Kudos

Sir,

Thank you very much for the quick response.

But i am not able to get what you said.

can you eleborate the code and suggest as the screen no for "Condition' Tab is 6201.

Regards,

0 Kudos

Add modify screen before endcase.

You are make screen-input = 0.

But to reflect it to the screen structure , you need to use MODIFY SCREEN statement.

Else it doenst apply.

Former Member
0 Kudos

sir,

as suggested, i have modified the code as per below.

if v_uname is initial.

CASE SCREEN-NAME.

WHEN 'KOMV-KBETR'.

SCREEN-INPUT = 0.

SCREEN-OUTPUT = 1.

MODIFY SCREEN.

ENDCASE.

endif.

but when i do run the tcode VA02 by giving the Sales order no 152546, the item detail block is displayed. when i double clikc on field "Material", system control goes to "Sales A" Tab. then I click on "Conditions" Tab to see the pricing conditions, I found that the field "Amount" is editable for condition type "ZR00" and "ZFR1" wheras this these two condition types must be only editable for identified users only. for rest users, it must be disable mode.

Regards,

Venkat_Sesha
Advisor
Advisor
0 Kudos

Hey Please check the below code for the same which i did and working fine

IF screen-name = 'CCDATA-CCINS'. " Payment Card

IF sy-tcode = 'VA01'. " Create SO

GET PARAMETER ID 'ONB' FIELD c_onb.

IF sy-subrc = 0.

IF c_onb = '2' OR

c_onb = '5'.

screen-required = '1'.

ENDIF.

ENDIF.

ENDIF.

ENDIF.

CHECK screen-group2 = 'LOO'.

CHECK sy-stepl NE 0.

IF vbap-uepos NE 0.

IF screen-name = 'VBAP-PSTYV'.

IF t180-trtyp EQ 'V'.

screen-input = 1.

ENDIF.

ELSE.

screen-input = 0.

ENDIF.

ENDIF.

Note You dont write Modify screen in the perform Userexit_field_Modification. You should write after the perform as mentioned below

  • Userexit

PERFORM USEREXIT_FIELD_MODIFICATION.

MODIFY SCREEN.

Hope This Helps

Former Member
0 Kudos

Dear MR Bhargav ji,

thanks for your valuable input. it does not worked for me. i hope that you have clearly read and understood the requirement/problem which is as per below.

"but when i do run the tcode VA02 by giving the Sales order no 152546, the item detail block is displayed. when i double clikc on field "Material", system control goes to "Sales A" Tab. then I click on "Conditions" Tab to see the pricing conditions, I found that the field "Amount" is editable for condition type "ZR00" and "ZFR1" wheras this these two condition types must be only editable for identified users only. for rest users, it must be disable mode."

see i want to make the screen field "KOMV-KBETR" enable/disable based on the pre-identified users(being maintained in ZTable) whenver the user CLICK ON on the "Conditions" Tab . thats it. what i have done is working OK not for 1st time but from 2nd or rest all the time it works OK. I want as soon user click on "Conditions" Tab the field "KOMV-KBETR" enbale/disable decision should be carried on.

please help.

Regards,