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: 

Check in selection-screen

Former Member
0 Kudos

Hi Experts,

In Selection screen, i have one input field for project. Now my requirement is that

When i enter the project and press enter and if it belongs to a particluar company code , for e.g. '1000'

then i should see two radio buttons below it. But if the project does not

belong to this CCode, then the radiobuttons should not be displayed.

1 ACCEPTED SOLUTION

I355602
Advisor
Advisor
0 Kudos

Hi,

Use :-


parameters : p_rb1 radiobutton group1 modif if abc,
        p_rb2 radiobutton group1 modif if abc.

AT SELECTION-SCREEN OUTPUT.
  "select query
  if sy-subrc ne 0. "no record found
    loop at screen.
      if screen-group1 = 'ABC'.
        screen-invisible = 1. "hide radiobuttons
      endif.
      modify screen.
    endloop.
  else.
    loop at screen.
      if screen-group1 = 'ABC'.
        screen-invisible = 0. "display radiobuttons
      endif.
      modify screen.
    endloop.
  endif.

Regards,

Tarun

11 REPLIES 11

Former Member
0 Kudos

Hi,

Make use of LOOP AT screen.

If the project meets ur criterion then screen-name = 'Radi_1' and rad_2

screen-invisible = 0.

MODIFY screen.

ENDLOOP.

Initially keep the radiobuttons hidden.

You can code this in selection-screen output.

I355602
Advisor
Advisor
0 Kudos

Hi,

Use :-


parameters : p_rb1 radiobutton group1 modif if abc,
        p_rb2 radiobutton group1 modif if abc.

AT SELECTION-SCREEN OUTPUT.
  "select query
  if sy-subrc ne 0. "no record found
    loop at screen.
      if screen-group1 = 'ABC'.
        screen-invisible = 1. "hide radiobuttons
      endif.
      modify screen.
    endloop.
  else.
    loop at screen.
      if screen-group1 = 'ABC'.
        screen-invisible = 0. "display radiobuttons
      endif.
      modify screen.
    endloop.
  endif.

Regards,

Tarun

Former Member
0 Kudos

hi,

i have put the following code but yet when i execute i can see both the radiobuttons.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

parameters : rb1 radiobutton group g2 modif id abc,

rb2 radiobutton group g2 modif id abc.

SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.

SELECT SINGLE * FROM PROJ WHERE

PSPNR IN S_PSPNR.

if proj-vbukr = '5800'.

loop at screen.

if screen-group1 = 'ABC'.

screen-invisible = 1. "hide radiobuttons

endif.

modify screen.

endloop.

else.

loop at screen.

if screen-group1 = 'ABC'.

screen-invisible = 0. "display radiobuttons

endif.

modify screen.

endloop.

endif.

Former Member
0 Kudos

thanks all. its working

Former Member
0 Kudos

Hi Priti,


if proj-vbukr = '5800'. 

loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 1. "hide radiobuttons  "Just check if this is even getting executed.
modify screen.
endif.
endloop.
else.
loop at screen.
if screen-group1 = 'ABC'.
screen-invisible = 0. "display radiobuttons
modify screen.
endif.
endloop.
endif.

Former Member
0 Kudos

Hi Priti,

You can achieve it by using LOOP AT SCREEN,

check its syntax for that.

Regrds

Mansi

Mohamed_Mukhtar
Active Contributor
0 Kudos

hi,

Try with the below code...

PARAMETERS : p_proj(4),
             r1 RADIOBUTTON GROUP g1 USER-COMMAND x modif id mod,
             r2 RADIOBUTTON GROUP g1 modif id mod.


AT SELECTION-SCREEN OUTPUT.
  IF p_proj ='1000'.
    LOOP AT SCREEN.
      IF screen-group1 = 'MOD'.
        screen-invisible = 0.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-group1 = 'MOD'.
        screen-invisible = 1.
      ENDIF.
      MODIFY SCREEN.
    ENDLOOP.
  ENDIF.

Thanks & Regards

kamesh_g
Contributor
0 Kudos

hi

use following code .

parameters : p_rb1 radiobutton group grp1 modif id abc,

p_rb2 radiobutton group grp1 modif id abc.

data : i_var like mara-matnr value '0001'.

AT SELECTION-SCREEN OUTPUT.

select matnr from mara

into i_var WHERE matnr = i_var.

endselect.

if sy-subrc ne 0. "no record found

loop at screen.

if screen-group1 = 'ABC'.

screen-invisible = 1.

endif.

modify screen.

endloop.

else.

loop at screen.

if screen-group1 = 'ABC'.

screen-invisible = 0.

endif.

modify screen.

endloop.

endif.

Former Member
0 Kudos

Hi experts,

But it is not working the other way. The condition is that if company code is '1000' then it should not display the radiobuttons else for all other company codes it should display

0 Kudos

Hi,

>

> Hi experts,

> But it is not working the other way. The condition is that if company code is '1000' then it should not display the radiobuttons else for all other company codes it should display

As your requirement, if company code is 1000, then it should not display those radiobuttons, else the radiobuttons need to be displayed.

So use code:-


parameters : p_rb1 radiobutton group gp1 modif id abc,
             p_rb2 radiobutton group gp1 modif id abc.

data : v_bukrs type bukrs.
 
AT SELECTION-SCREEN OUTPUT.
  "select query (select sinlge bukrs into v_bukrs where <condition>.)
  if sy-subrc = 0. "if company code found
    if v_bukrs = '1000'. "if company code is 1000
      loop at screen.
        if screen-group1 = 'ABC'.
          screen-invisible = 1. "hide radiobuttons
        endif.
        modify screen.
      endloop.
    else. "if company code is not 1000
      loop at screen.
        if screen-group1 = 'ABC'.
          screen-invisible = 0. "display radiobuttons
        endif.
        modify screen.
      endloop.
    endif.
  else. "if no company code found
    loop at screen.
      if screen-group1 = 'ABC'.
        screen-invisible = 0. "display radiobuttons
      endif.
      modify screen.
    endloop.
  endif.

Hope this helps you.

Regards,

Tarun

Former Member
0 Kudos

resolved