2010 Apr 24 7:24 AM
Dear all,
i have created on selection screen.
which have two input screen.
One field is mandatory and another is optional.
But requirement is that if user fill the second field for input the first field mandatiry option removed.
Example.
SELECT-OPTIONS: S_ARTNO FOR DRAP-DOKNR OBLIGATORY.
PARAMETERS: S_MATNR like MARA-MATNR.
if user not fill S_ARTNO and fill S_MATNR . Then remove mandatory option from S_ARTNO.
And not error dispaly.
and report displayed on the base of second field.
Please help me as soon as possible.
Regards & Thanx
2010 Apr 24 7:45 AM
AFAIK once you have set the mandatory flag for a field you cannot revert it back. Instead of making the field OBLIGATORY, you can write a simple code to do the job for you:
AT SELECTION-SCREEN.
IF SY-UCOMM = 'ONLI' "Execute Button
OR SY-UCOMM = 'PRIN'. "Schedule Background Button
IF S_MATNR IS INITIAL AND S_ARTNO IS INITIAL.
MESSAGE 'Input required for S_ARTNO' TYPE 'E'.
ENDIF.
ENDIF.
START-OF-SELECTION.
IF S_MATNR IS INITIAL AND S_ARTNO IS INITIAL.
MESSAGE 'Input required for S_ARTNO' TYPE 'I'.
LEAVE LIST-PROCESSING.
ENDIF.Hope this helps.
BR,
Suhas
AFAIK once you have set the mandatory flag for a field you cannot revert it back. Instead of making the field OBLIGATORY, you can write a simple code to do the job for you:
AT SELECTION-SCREEN.
IF SY-UCOMM = 'ONLI' "Execute Button
OR SY-UCOMM = 'PRIN'. "Schedule Background Button
IF S_MATNR IS INITIAL AND S_ARTNO IS INITIAL.
MESSAGE 'Input required for S_ARTNO' TYPE 'E'.
ENDIF.
ENDIF.
START-OF-SELECTION.
IF S_MATNR IS INITIAL AND S_ARTNO IS INITIAL.
MESSAGE 'Input required for S_ARTNO' TYPE 'I'.
LEAVE LIST-PROCESSING.
ENDIF.Hope this helps.
BR,
Suhas
2010 Apr 24 7:45 AM
AFAIK once you have set the mandatory flag for a field you cannot revert it back. Instead of making the field OBLIGATORY, you can write a simple code to do the job for you:
AT SELECTION-SCREEN.
IF SY-UCOMM = 'ONLI' "Execute Button
OR SY-UCOMM = 'PRIN'. "Schedule Background Button
IF S_MATNR IS INITIAL AND S_ARTNO IS INITIAL.
MESSAGE 'Input required for S_ARTNO' TYPE 'E'.
ENDIF.
ENDIF.
START-OF-SELECTION.
IF S_MATNR IS INITIAL AND S_ARTNO IS INITIAL.
MESSAGE 'Input required for S_ARTNO' TYPE 'I'.
LEAVE LIST-PROCESSING.
ENDIF.Hope this helps.
BR,
Suhas
2010 Apr 24 7:47 AM
Hi,
Try like this,
Here just remove obligatory.
SELECT-OPTIONS: S_ARTNO FOR DRAP-DOKNR.
PARAMETERS: S_MATNR like MARA-MATNR.
At selection-screen.
if s_artno-low eq space and s_matnr eq space.
stop.
endif.
Here it will not show any error message but it is compulsory to enter
either one of the specified fields.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |