Application Development and Automation 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: 
Read only

Selection-Screen

Former Member
0 Likes
636

Hello Friends,

Can any body tell me the logic of the following query?

If there are 3 fields in the selection screen...if we enter wrong number in the first field it automatically block the remaining fields.

Thanx in Advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
619

just check this code...

REPORT  ZTEST1223.

TABLES: MARA.
PARAMETERS: P_MATNR LIKE MARA-MATNR,
            P_VBELN LIKE VBAK-VBELN,
            P_POSNR LIKE VBAP-POSNR.


AT SELECTION-SCREEN OUTPUT.
  IF NOT P_MATNR IS INITIAL.
    SELECT SINGLE MATNR
                  FROM MARA
                  INTO MARA-MATNR
                  WHERE MATNR = P_MATNR.
    IF SY-SUBRC <> 0.
      LOOP AT SCREEN.
        IF SCREEN-NAME = 'P_VBELN'.
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
          CLEAR P_VBELN.
        ENDIF.
        IF SCREEN-NAME = 'P_POSNR'.
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
          CLEAR P_POSNR.
        ENDIF.
      ENDLOOP.
    ENDI

8 REPLIES 8
Read only

abdul_hakim
Active Contributor
0 Likes
619

Use the below code..

SELECTION-SCREEN BEGIN OF BLOCK B1.

PARAMETERS: P1 TYPE I,

P2 TYPE I,

P3 TYPE I.

SELECTION-SCREEN END OF BLOCKB1.

AT SELECTION-SCREEN ON BLOCK B1.

IF P1 NE <SOME VALUE>.

<ERROR MESSAGE>

ENDIF.

Read only

0 Likes
619

Hi Abdul Hakim ,

using at-selection screen on BLOCK <block> will allow all the fields to be editable in side the block and other blocks will get grayed out.

Regards

Raja

Read only

0 Likes
619

Hi Raja,

I thought he is asking what u have said..

Nice letting me know about this..

Abdul

Read only

athavanraja
Active Contributor
0 Likes
619

Try this code sample.

parameters: a(1),

b(1) ,

c(1) .

at selection-screen on a .

if a is initial .

message e398(00) with 'Enter value in A' .

endif .

Regards

Raja

Read only

0 Likes
619

the key here is if you issue the error message in

at selection-screen on <parameter name> .

that parameter alone will be available for editing and the others will be grayed out.

Regards

Raja

Read only

Former Member
0 Likes
620

just check this code...

REPORT  ZTEST1223.

TABLES: MARA.
PARAMETERS: P_MATNR LIKE MARA-MATNR,
            P_VBELN LIKE VBAK-VBELN,
            P_POSNR LIKE VBAP-POSNR.


AT SELECTION-SCREEN OUTPUT.
  IF NOT P_MATNR IS INITIAL.
    SELECT SINGLE MATNR
                  FROM MARA
                  INTO MARA-MATNR
                  WHERE MATNR = P_MATNR.
    IF SY-SUBRC <> 0.
      LOOP AT SCREEN.
        IF SCREEN-NAME = 'P_VBELN'.
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
          CLEAR P_VBELN.
        ENDIF.
        IF SCREEN-NAME = 'P_POSNR'.
          SCREEN-INPUT = 0.
          MODIFY SCREEN.
          CLEAR P_POSNR.
        ENDIF.
      ENDLOOP.
    ENDI

Read only

0 Likes
619

Hi Vijay Babu,

Thank you very much.

Read only

0 Likes
619

Hi jak,

though the method given by Vijay Babu works, i suggest that you should be using "At selection-screen on <param>"

parameters: a(1),

b(1) ,

c(1) .

at selection-screen on a .

check it against DB table and throw the error message here in this event.

Regards

Raja