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: 

Help with selection screen

kamesh_g
Contributor
0 Kudos
167

HI

I Need help on radio button group ..My requirement is like below example and please give answers to particular one .dont be general

Eg :

Below is the my selection screen block ..

parameters: : R1 radiobutton

R2 radiobutton

R3 radiobutton

parameter : p1

select option :S1

When I click radibutton R2 parameter p1 should be defaulted , and when again i go to R1 or R3 i should clear P1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF R3 = 'x'.

IF screen-group1 = 'M1' OR

screen-group1 = 'M2'.

screen-active = '0'.

ENDIF.

ENDIF.

IF r2 = 'x'.

IF screen-group1 = 'M1'.

p1 = text-000. "defaiult text

screen-input = '0'.

ENDIF.

ENDIF.

IF r3 = gc_x .

IF screen-group1 EQ 'M1'.

CLEAR: p1.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

I am using above code . but when give some values in S1 and P1 and press enter P1 is getting cleared which i dont

Please give other ideas specific to above logic only .......

<LOCKED BY MODERATOR - URGEN, PLEAS* HEP OR SIMILAR ARE FORBIDDEN>

Edited by: Alvaro Tejada Galindo on Jan 13, 2010 9:58 AM

Edited by: Alvaro Tejada Galindo on Jan 13, 2010 9:58 AM

Edited by: Alvaro Tejada Galindo on Jan 13, 2010 9:58 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos
134

Hi,

Below code works perfectly as per ur requirement...



DATA: W_CHAR TYPE I.

parameters: R1 radiobutton group RAD USER-COMMAND FCODE,
R2 radiobutton GROUP RAD,
R3 radiobutton GROUP RAD.

parameterS : p1 TYPE I MODIF ID MOD.
select-optionS: S1 FOR W_CHAR.

AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF R2 = 'X'." OR R1 = 'X'.
ELSE.
  IF SCREEN-GROUP1 = 'MOD'.
    SCREEN-ACTIVE = 0.
   MODIFY SCREEN.
  ENDIF.
ENDIF.
ENDLOOP.

Regards,

Deeba

17 REPLIES 17

Former Member
0 Kudos
134

Hi,

try this short example:


PARAMETERS: P1 DEFAULT 'X' RADIOBUTTON GROUP PR1 USER-COMMAND DUMMY.
PARAMETERS: P2             RADIOBUTTON GROUP PR1.
PARAMETERS: P3             RADIOBUTTON GROUP PR1.
PARAMETERS: VAL1(10) MODIF ID DI1.
PARAMETERS: VAL2(10) MODIF ID DI2.
*
AT SELECTION-SCREEN OUTPUT.
*
  IF P1 = 'X'.
       VAL1 = 'Muster'.
  ELSE.
       CLEAR VAL1.
  ENDIF.

Regards, Dieter

kesavadas_thekkillath
Active Contributor
0 Kudos
134

can you check this, its not tested.

parameters:pa type matnr.

parameters: : R1 radiobutton group1 default 'X' user-command ABC.

R2 radiobutton group1,

R3 radiobutton group1.

at selection-screen output.

if R1 = 'X' or R3 = 'X'.

clear pa.

elseif R2 = 'X'.

pa = 123.

endif.

0 Kudos
134

Hi

If you can see code i pasted .i have used the same logic only ..

Just try the same what you mentioned .When you press enter on selection screen The values in paramter is getting cleared which i dont want .

I mentioned it .Please look at it and one more its not probelm of nesting .

So clear statement wont work here

thanks for ur reply

0 Kudos
134

When you press enter on selection screen The values in paramter is getting cleared

Check if the radio button 1 or 3 are marked while you hit enter. This was your requirement( if 1 or 3 choosed clear and if 2 choosed default ).

What do you mean by "should be defaulted".

0 Kudos
134

Hi keshav

When we press enter also same At selection screen output will trigger.

I can say you understood my requirement.

Do you have any idea on this . But we cant check radio buttons flag when we press ENTER>

0 Kudos
134

Hi even if we hit enter, the code will work only based on the 'if' condition written, so the enter doesnt have any precedence here.

Please me more clear, exactly what do you want.

0 Kudos
134

HI

The parameters should clear only when toggle between other 2 radio buttons but not when we press enter on sel.screen

But for my code its clearing parameter when i press enter.

Requirement is clear becauase i pasted code also.

thanks

Former Member
0 Kudos
135

Hi,

Below code works perfectly as per ur requirement...



DATA: W_CHAR TYPE I.

parameters: R1 radiobutton group RAD USER-COMMAND FCODE,
R2 radiobutton GROUP RAD,
R3 radiobutton GROUP RAD.

parameterS : p1 TYPE I MODIF ID MOD.
select-optionS: S1 FOR W_CHAR.

AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF R2 = 'X'." OR R1 = 'X'.
ELSE.
  IF SCREEN-GROUP1 = 'MOD'.
    SCREEN-ACTIVE = 0.
   MODIFY SCREEN.
  ENDIF.
ENDIF.
ENDLOOP.

Regards,

Deeba

0 Kudos
134

Hi Deeba

if we use Screen-active = 0. The parameter itself wont appear on screen which dont .Just I need blank parameter.

Thanks for ur reply

0 Kudos
134

Hi,

i give you a little short example and it solved what you need, isn't it??

Do you test it?

Regards, Dieter

0 Kudos
134

Hi

Yes I have tested it .still its clearing .See the below code same i pasted before.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-a02.

PARAMETERS : p_rb1 TYPE c RADIOBUTTON GROUP gr1 USER-COMMAND u1,

p_rb2 TYPE c RADIOBUTTON GROUP gr1,

p_rb3 TYPE c RADIOBUTTON GROUP gr1,

p_res TYPE hrs1000-stext MODIF ID m1 .

SELECT-OPTIONS :

s_res_ob FOR hrp1240-objid MODIF ID m2 .

SELECTION-SCREEN END OF BLOCK b2.

above is my selection screen apart with some fileds ...

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF p_rb3 = gc_x.

IF screen-group1 = 'M1' OR

screen-group1 = 'M2'.

screen-active = '0'.

CLEAR: p_res.

ENDIF.

ENDIF.

IF p_rb2 = gc_x.

IF screen-group1 = 'M1'.

p_res = text-000.

screen-input = '0'.

ENDIF.

ENDIF.

IF p_rb1 = gc_x .

IF screen-group1 EQ 'M1'.

clear : p_res.

ENDIF.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

0 Kudos
134

Hi kamesh,

I worked with your code and SLIGHTLY modified and enhanced.

The lines changed/added are with comment @@@@@@

and it works fine now.

*

1. R2 to R1 = parameter is cleared

2. R1 and we press enter = Entered Value REMAINS (does not get cleared)

*

Just copy paste.





SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-a02.
PARAMETERS : p_rb1 TYPE c RADIOBUTTON GROUP gr1 USER-COMMAND u1,
p_rb2 TYPE c RADIOBUTTON GROUP gr1,
p_rb3 TYPE c RADIOBUTTON GROUP gr1,
p_res TYPE hrs1000-stext MODIF ID m1 .
SELECT-OPTIONS :
s_res_ob FOR hrp1240-objid MODIF ID m2 .

SELECTION-SCREEN END OF BLOCK b2.

*"@@@@@@@@@@@@@@@@@@@@@@ add this declaration
DATA : rb2flag type c.




*above is my selection screen apart with some fileds ...

AT SELECTION-SCREEN OUTPUT.
*BREAK-POINT.

  LOOP AT SCREEN.
    IF p_rb3 = 'X'.
      IF screen-group1 = 'M1' OR
      screen-group1 = 'M2'.
        screen-active = '0'.
*        CLEAR: p_res. "@@@@@@ comment this line
      ENDIF.
    ENDIF.
    IF p_rb2 = 'X'.
      IF screen-group1 = 'M1'.
*        p_res = text-000. "@@@@@@ comment this line
        screen-input = '0'.
        rb2flag = 'X'. "@@@@@ add this line.
      ENDIF.
    ENDIF.
    IF p_rb1 = 'X' .
      IF screen-group1 EQ 'M1'.
*        clear : p_res. "@@@@@@ comment this line
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

*"@@@@@@@@@@@@ add this code
  if rb2flag = 'X'.
    p_res = text-000.
    clear rb2flag.
  else.
    if p_res = text-000.
      clear p_res.
    endif.
  endif.

regards,

amit m.

Edited by: Amit Mittal on Jan 13, 2010 6:42 PM

Edited by: Amit Mittal on Jan 13, 2010 6:43 PM

0 Kudos
134

Solved by Amit Mittal

Thank you and Awarded points ..Close this forum..

Thank you Amit

0 Kudos
134

Solved by Amit

kesavadas_thekkillath
Active Contributor
0 Kudos
134

Hi this is just a guess.

can you try like this.

parameters:p1 type matnr memory ID TST.

Clemenss
Active Contributor
0 Kudos
134

Hi,

if you need Need help on radio button group, why use a subject of 'Help with selection screen'

?

Regards,

Clemens

kesavadas_thekkillath
Active Contributor
0 Kudos
134

or try the menu System u2192 User specifications u2192 Hold data, mark it and check.