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: 

Selection screen fields in SAP Query

Former Member
0 Kudos

HI friends,

I have to make the seletion screen field as mandatory in SAP-Query.

Please let me know the procedure to make field as mandatory or Let me know how to validate the selection-screen field in Query.

Thanks in Advance,

Ravi

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

U can write:

select-options : field like type OBLIGATORY

This will make field mandatory.

4 REPLIES 4

Former Member
0 Kudos

report ztest message-id zmsg.

tables :mara .

select-options:s_matnr for mara-matnr .

data: v_matnr like mara-matnr.

at selection-screen.

select matnr from mara into v_matnr where matnr in s_matnr.

if sy-subrc ne 0.

message e000 with 'enter a valid material number'.

endif.

Former Member
0 Kudos

Hi,

U can write:

select-options : field like type OBLIGATORY

This will make field mandatory.

Former Member
0 Kudos

To make a field mandatory in Sap query (SQ01) create a variant and in that variant make the field as required field (set the check box Required field). Use this variant whenever u execute the query.

Regards,

Joy.

0 Kudos

Go to SQ02

Select your Infoset-->Change

On next Screen.

Select GoTo->Code->Initialization.

Write there code

LOOP AT SCREEN.
  IF screen-name EQ 'SP$00004'.
       screen-required = 1.
       MODIFY SCREEN.
  ENDIF.
ENDLOOP.