Skip to Content
author's profile photo Former Member
Former Member

At selection-screen output not working

Hello

On a sap 4.6 i have a report with two radiobuttons.When selecting the second radiobutton, there should appear some additional fields on the screen.

Parameters: rb1 radiobutton group rb1,

rb2 radiobutton group rb1.

I have used the event "at selection-screen on radiobutton group gr1" to catch the change on the radiobuttons. The event is not triggered when changing the selection on the radiobuttons, only when pressing the enter button. How can i trigger this event when changing the selection of the radiobuttons?

Even if i am changing the radiobuttons and pressing enter , my code for showing/hiding fields is processed but the fields do not dissapear anymore.

loop at screen.

if screen-name eq 'FIELD1'.

screen-invisible = 0.

modify screen.

endif.

endloop.

Sy-subrc = 0 but still, the field does not dissapear. I have tried all possible ways but still nothing.

Help.

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Jul 30, 2012 at 09:10 PM

    I notice that in your parameters statement, the radiobutton group is "RB1", but in your AT SELECTION-SCREEN statement you give the group name as "GR1". In addition, I believe you need to specify a USER-COMMAND in order for the radiobutton to trigger PAI (and thus, trigger the AT SELECTION-SCREEN event.

    Also, The SCREEN-NAME will not be "FIELD1". It will be "RB1" and "RB2". But you shouldn't be using the SCREEN-NAME field, because they are generated dynamically in a selection screen. You should be using the MODIF ID keyword on your parameter declaration and the field SCREEN-GROUP1 in the screen loop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 30, 2012 at 09:11 PM

    Hi Sebastian,

    Search the forum for examples. This has been discussed many times. Also, I think you have to use MODIF ID extension in your parameter declaration. Paste your code if still unable to figure out.

    Regards,

    Shravan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 31, 2012 at 01:46 AM

    You can compare your work on this working sample code.

    SELECTION-SCREEN BEGIN OF BLOCK selection WITH FRAME TITLE text-003.

    PARAMETERS: p_show RADIOBUTTON GROUP rb1 USER-COMMAND aa,
    p_hide RADIOBUTTON GROUP rb1.

    PARAMETERS: p_matnr LIKE mara-matnr MODIF ID bb.

    SELECTION-SCREEN END OF BLOCK selection.

    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.

    IF screen-group1 = 'BB'.
    IF p_show = 'X'.
    screen-active = 1. " 1 = show
    ELSEIF p_hide = 'X'.
    screen-active = 0. " 0 = hide
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.

    -Jake

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 01, 2012 at 11:14 AM

    Try this below code:

    SELECTION-SCREEN BEGIN OF block bok1 with frame.

    PARAMETERS: p_matnr TYPE mara-matnr MODIF ID i1,

    p_ernam TYPE mara-ernam MODIF ID i1,

    p_werks TYPE marc-werks MODIF ID i2.

    SELECTION-SCREEN end of BLOCK bok1.

    SELECTION-SCREEN begin of block bok2 with frame.

    PARAMETERS: r_mat RADIOBUTTON GROUP g1 USER-COMMAND u1 DEFAULT 'X',

    r_pnt RADIOBUTTON GROUP g1 .

    SELECTion-screen end of block bok2.

    AT SELECTION-SCREEN OUTPUT.

    loop AT SCREEN.

    if r_pnt = 'X'.

    if screen-group1 = 'I1'.

    screen-active = '0'.

    MODIFY SCREEN.

    endif.

    endif.

    if r_mat ='X'.

    if screen-group1 = 'I2'.

    screen-active ='0'.

    MODIFY SCREEN.

    ENDIF.

    ENDIF.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 01, 2012 at 11:22 AM

    Hi ,

    Follow the below link... i think this will solve your problem...

    http://scn.sap.com/message/13323215#13323215

    Regards,

    Venkat.

    Add a comment
    10|10000 characters needed characters exceeded

    • 😊 One of my computer science professors used to refer to "ghosts in the code", and the only way to get rid of them was to delete and rewrite the problemattic code. It's easy to forget to add or remove small things when you're trying to figure out how to make something work. Those small things can be tough to notice when you've been looking at the same code for awhile, and yet they tend to cause problems.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.