2007 May 15 10:21 PM
Hi all,
I have added two optional parameters in the selection screen of an existing program.now the requirement is..user has to enter in any one of the parameters but not both,or none of them.
how to write the logic for this and where to write..(which event).
points assured.
thanks and regards,
maahi
2007 May 15 11:02 PM
Hi,
You can use the event AT SELECTION-SCREEN.
Check this ex..
PARAMETERS: P_MATNR TYPE MATNR,
P_WERKS TYPE WERKS_D.
AT SELECTION-SCREEN.
* If both the parameters are entered raise an error message.
IF NOT P_MATNR IS INITIAL AND
NOT P_WERKS IS INITIAL.
MESSAGE E208(00) WITH 'You cannot enter both of them'.
ENDIF.
* One of them should be mandatory.
IF P_MATNR IS INITIAL AND
P_WERKS IS INITIAL.
MESSAGE E208(00) WITH 'Enter one of them'.
ENDIF.
Thanks,
Naren
2007 May 15 10:23 PM
You need to write the code under at selection-screen or even you can write under start-of-selection.
if p_1 is 'X'
if p_2 is 'X'.
message'.
endif.
endif.
Reward points if it is helpful
Thanks
Seshu
2007 May 15 11:02 PM
Hi,
You can use the event AT SELECTION-SCREEN.
Check this ex..
PARAMETERS: P_MATNR TYPE MATNR,
P_WERKS TYPE WERKS_D.
AT SELECTION-SCREEN.
* If both the parameters are entered raise an error message.
IF NOT P_MATNR IS INITIAL AND
NOT P_WERKS IS INITIAL.
MESSAGE E208(00) WITH 'You cannot enter both of them'.
ENDIF.
* One of them should be mandatory.
IF P_MATNR IS INITIAL AND
P_WERKS IS INITIAL.
MESSAGE E208(00) WITH 'Enter one of them'.
ENDIF.
Thanks,
Naren