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

Problem with logic at-selection screen

Former Member
0 Likes
666

Hi ,

I have this piece of code :

I have 3 radiobuttons and corresponding screens and fields like r_matnr s_charge etc on that screen .

default radio button is r_build .

a) If on this screen is user forgots to give value for s_matnr then error is given .

now if we click on r_conf the contents of display screen when r_buld was pressed should be gone ..

the r_matnr , r_werks etc . should be blank .

what i should do to implement it ? also validation of point a) should be performed for the current values of that screen .

plz help..

SELECTION-SCREEN BEGIN OF LINE.
  PARAMETERS: r_build RADIOBUTTON GROUP r1 USER-COMMAND act DEFAULT 'X'.

 PARAMETERS: r_conf RADIOBUTTON GROUP r1.

SELECTION-SCREEN BEGIN OF LINE.
  
  SELECT-OPTIONS : s_matnr FOR mara-matnr MODIF ID c.
  SELECTION-SCREEN END OF LINE.

  SELECTION-SCREEN BEGIN OF LINE.
  
  SELECT-OPTIONS : s_charg FOR mch1-charg MODIF ID c.
  SELECTION-SCREEN END OF LINE.

LOOP AT SCREEN.
         IF r_conf = 'X'.
        IF screen-group1 = 'A'.
          screen-active = 0.
        ENDIF.
      ELSE.
        IF r_rel = 'X'.
          IF screen-group1 = 'A' OR screen-group1 = 'B'
            OR  screen-group1 = 'C'.
            screen-active = 0.
          ENDIF.
        ENDIF.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.

AT SELECTION-SCREEN ON s_matnr.
    IF s_matnr IS NOT INITIAL.
    some select where = s_matnr .
      MESSAGE e019(zesapp).
      LEAVE TO SCREEN 0.
    ENDIF.

plz help..

Regards .

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
627

You can try something like this


at selection-screen output.
if r_conf = 'X'.
clear:s_matnr,s_matnr[].
LOOP AT SCREEN.
   IF screen-group1 = 'A'.
       screen-active = 0.
modify screen.
        ENDIF.
endloop.
elseif r_rel = 'X'.
clear : s_charg,s_charg[].
loop at screen.
 IF screen-group1 = 'B'.
   screen-active = 0.
modify screen.
          ENDIF.
endloop.
endif.

5 REPLIES 5
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
628

You can try something like this


at selection-screen output.
if r_conf = 'X'.
clear:s_matnr,s_matnr[].
LOOP AT SCREEN.
   IF screen-group1 = 'A'.
       screen-active = 0.
modify screen.
        ENDIF.
endloop.
elseif r_rel = 'X'.
clear : s_charg,s_charg[].
loop at screen.
 IF screen-group1 = 'B'.
   screen-active = 0.
modify screen.
          ENDIF.
endloop.
endif.

Read only

0 Likes
627

Hi the values are getting blank just after entering it .

The loop at screen is in at selection-screen output ...

plz suggest..

Read only

0 Likes
627

hi ujjwal,

can you please elaborate on "the values are getting blank just after entering it ."...

you mean material number gets blank after you enter the value?

also in the below code you are checking material number NOT INITIAL that means some value is entered and if it does not satisfy the SELECT condition then it will give error message and navigate u again to your initial screen...maybe this could be the reason for the blank values...

AT SELECTION-SCREEN ON s_matnr.

IF s_matnr IS NOT INITIAL.

some select where = s_matnr .

MESSAGE e019(zesapp).

LEAVE TO SCREEN 0.

ENDIF.

hope this is helpful.

Read only

0 Likes
627

Hi ,

actually i tried to put clear statement in loop at screen .

but its getting clear immediately after i press enter . It should work only when i change the radio button ...

Read only

former_member418469
Participant
0 Likes
627

hi,

Write the logic loop at screen in the event at selection-screen output.