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: 

validations on parameters

Former Member
0 Kudos

hi i have following selectionscreen.

Dropdown option: Tradable to Spare

Spare to Tradable

Movement Type T156-BWART Automatically Populated as 909 Greyed if it is tradable to spare.

Material Description makt-maKTX Automatically Populated Greyed(ref to mara matnr)

how can i get this.

Thanks in advace.

3 REPLIES 3

Former Member
0 Kudos

Hi,

Sorry to say this that i dint your question clearly. Can you let me know the question once again?

Thanks,

Phani Diwakar.

Former Member
0 Kudos

hi,

You can Assign the default value in the INITIALIZATION event.

And You can Apply validations on the field in

AT SE:ECTION-SCREEN OUTPUT.

This Event is triggered after the initialization but before the display of the Screen.

Hope this will help.

Regards

Sumit Agarwal

Former Member
0 Kudos

Try this code:

report z_demo.

TYPE-POOLS: vrm.

DATA: name TYPE vrm_id, list TYPE vrm_values, value LIKE LINE OF list.

TABLES: sscrfields.

PARAMETERS: ps_parm AS LISTBOX VISIBLE LENGTH 10

USER-COMMAND abc.

PARAMETERS: p_bwart like T156-BWART.

INITIALIZATION.

name = 'PS_PARM'.

value-key = '1'. value-text = 'Tradable to Spare'.

APPEND value TO list.

value-key = '2'. value-text = 'Spare to Tradable'.

APPEND value TO list.

AT SELECTION-SCREEN OUTPUT.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = name

values = list.

if ps_parm = 1.

p_bwart = '099'.

else.

clear p_bwart.

endif.

LOOP AT SCREEN.

IF ps_parm = 1.

IF screen-name = 'P_BWART' .

screen-INPUT = 0.

ENDIF.

MODIFY SCREEN.

elseIF ps_parm = 2.

IF screen-name = 'P_BWART' .

screen-INPUT = 1.

ENDIF.

MODIFY SCREEN.

endif.

ENDLOOP.

AT SELECTION-SCREEN.

IF sscrfields-ucomm = 'ABC'.

ENDIF.

START-OF-SELECTION.

WRITE: / 'Parameter:', ps_parm.

Similarly u can do this for Material Description makt-maKTX also.

Regards,

Joy.