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

At selection screen

hi guys,

In the selection screen, i am having two radio buttons and a text field..

For 1st radio button, i have kept the text field as mandatory and on selection of 2nd radio button i have made the field disabled.

please find the below code used

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-name = 'P_RADIO1' OR screen-name = 'P_textfield'.

screen-input = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSEIF p_RADIO2 = 'X'.

LOOP AT SCREEN.

IF screen-name = 'P_textfield'.

screen-input = '0'.

CLEAR p_textfield.

  • SCREEN-OUTPUT = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

END-OF-SELECTION.

Once the radio button is selected and on pressing the enter button it works fine. i want to know whether the similar process should also work without pressing enter button. If so, how it is possible?

Regards

senthil

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 07:43 AM

    Check below sample code:

    parameters: p_rd1 radiobutton group rad1 default 'X' user-command but,
                p_rd2 radiobutton group rad1,
                p_text type char128 obligatory.
    
    at selection-screen output.
    
      loop at screen.
         if screen-name CP '*P_TEXT*'.
            if not p_rd1 is initial.
               screen-active = 1.
               screen-required = 1.
            else.
               screen-active = 0.
               screen-required = 0.
            endif.
            modify screen.
         endif.
      endloop.
    

    Note that by characteristic of Mandatory field, once set we need to give input before further processing can take place. Alternatively you can use error message handling.

    Remember the addition USER-COMMAND which triggers the action without using ENTER.

    Regards

    Eswar

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      try this code

      selection-screen begin of block 1 with frame title text-001.

      selection-screen begin of line.

      selection-screen comment 1(31) text-002 for field R1.

      parameter : R1 radiobutton group RAD default 'X' user-command file .

      .

      selection-screen end of line.

      selection-screen begin of line.

      selection-screen comment 1(31) text-003 for field par.

      parameter : par like rlgrap-filename MODIF ID A.

      selection-screen end of line.

      selection-screen begin of line.

      selection-screen comment 1(31) text-002 for field R1.

      parameter : R2 radiobutton group RAD .

      .

      selection-screen end of line.

      selection-screen begin of line.

      selection-screen comment 1(31) text-003 for field par1.

      parameter : par1 like rlgrap-filename MODIF ID B.

      selection-screen end of line.

      selection-screen end of block 1.

      at selection-screen output.

      perform selection.

      at selection-screen on value-request for par.

      perform request using par.

      &----


      *& Form SELECTION

      &----


      • text

      ----


      • --> p1 text

      • <-- p2 text

      ----


      FORM SELECTION .

      loop at screen.

      case screen-group1.

      • Presentation Server Radiobutton

      when 'A'.

      if R1 = space.

      screen-invisible = '1'.

      screen-input = '0'.

      • p_pres = 'X'.

      • else.

      • screen-invisible = '0'.

      • screen-input = '1'.

      endif.

      modify screen.

      • Shuttle Radiobutton

      when 'B'.

      if R2 = space.

      screen-invisible = '1'.

      screen-input = '0'.

      • else.

      • screen-invisible = '0'.

      • screen-input = '1'.

      endif.

      modify screen.

      endcase.

      endloop.

      ENDFORM. " SELECTION

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 07:39 AM

    Hi

    AT SELECTION-SCREEN event will be triggerd only when you do some action on the selection screen

    so after selection the radiobutton you must click on enter button

    or other than enter also it works

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 07:40 AM

    Hi,

    u can do it when the user cliks on the radio button then next event should be happening.

    for that purpose

    parameters:

    p_rad radiobutton group g1 user-command 'Co'.

    Plzz reward points if it helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 28, 2008 at 07:41 AM

    Hi,

    This is possible and simple also.

    Declare your selection screen as defined below:

    selection-screen .......begin of.....

    PARAMETERS: p_class RADIOBUTTON GROUP grp1 DEFAULT 'X' USER-COMMAND UC1

    selection screen...........end of......

    The syntax: USER COMMAND....will do this ABAP trick for the logic.

    Once this is done, do the necessary logics in your AT Selection-screen output.

    Reg,

    JLN

    Add a comment
    10|10000 characters needed characters exceeded

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.