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

Is there any way to Catch the event of Checkboxes on Selection Screen

Hi,

I am quite naive in ABAP.

I want to know, is it possible to code some thing for the check and un-check event of Checkboxes on selection screen.

Or if at all something of this sort exists for checkboxes in selection screen.I mean to say events for checkboxes in selection screen.

If so please let me know.

Thanks in Advance,

Mayank.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

7 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2005 at 12:12 PM

    Hi,

    I think Max is right. AT SELECTION-SCREEN is PAI event. You can <b>not</b> modify SCREEN in PAI. So First check SY-UCOMM in AT SELECTION-SCREEN and after that modify it in AT SELECTION-SCREEN OUTPUT (PBO).

    data output(1).

    SELECTION-SCREEN BEGIN OF BLOCK BL3 WITH FRAME TITLE TEXT-BL3.

    parameters: EPDF as checkbox USER-COMMAND FPDF,

    FILEPDF type RLGRAP-FILENAME MODIF ID M01.

    SELECTION-SCREEN END OF BLOCK BL3.

    ****

    initialization.

    .....

    at selection-screen output.

    if output is initial.

    LOOP AT SCREEN.

    IF SCREEN-GROUP1 = 'M01'.

    SCREEN-ACTIVE = '0'.

    modify screen.

    endif.

    endloop.

    else.

    LOOP AT SCREEN.

    IF SCREEN-GROUP1 = 'M01'.

    SCREEN-ACTIVE = '1'.

    modify screen.

    endif.

    endloop.

    endif.

    at selection-screen.

    if sscrfields-ucomm = 'FPDF' and EPDF = 'X'.

    output = 'X'.

    else.

    clear output.

    endif.

    Svetlin

    Message was edited by: Svetlin Rusev

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2005 at 11:43 AM

    Hi all,

    Half of my problem got solved with the posts ,

    I am not able to figure out the problem I am facing.

    I have 5 checkboxes and 5 textboxes. Each checkbox is used for enabling or disabling corresponding textbox.

    I am using the solution given in previous posts for catching the click of checkboxes.Till this point everything is fine.

    But when I am enabling one of the textbox,each and every text box is getting enabled. I want to know the cause of this.

    Below is the code i am using to enable/disable.

    AT SELECTION-SCREEN.

    CASE SSCRFIELDS-UCOMM.

    WHEN 'CHECK1'.

    IF P_UGENCD = 'X'.

    LOOP AT SCREEN.

    IF SCREEN-NAME EQ 'P_BUSUNT'.

    SCREEN-INPUT = 1.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    elseIF P_UGENCD = ''.

    LOOP AT SCREEN.

    IF SCREEN-NAME EQ 'P_BUSUNT'.

    SCREEN-INPUT = 0.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    endif.

    ENDCASE.

    I disabled the Textboxes in the INITIALIZATION Event of selection screen,

    FORM SUB_DISABLE_FIELDS .

    LOOP AT SCREEN.

    IF SCREEN-NAME EQ 'P_BUSUNT'

    OR SCREEN-NAME EQ 'P_FLDIND'

    OR SCREEN-NAME EQ 'P_DIV'

    OR SCREEN-NAME EQ 'P_REGION'

    OR SCREEN-NAME EQ 'P_EEO'

    OR SCREEN-NAME EQ 'P_O_GRCD'.

    SCREEN-INPUT = 0.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDFORM. "sub_disable_fields

    Please let me the problem with this...

    Thanks in advance.

    Mayank

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Try this -

      PARAMETERS:

      p_chbox1 AS CHECKBOX,

      p_chtxt1(20) TYPE c,

      P_CHBOX2 AS CHECKBOX,

      P_CHTXT2(20) TYPE C,

      p_chbox3 AS CHECKBOX,

      p_chtxt3(20) TYPE c.

      AT SELECTION-SCREEN OUTPUT.

      IF p_chbox1 = 'X'.

      LOOP AT SCREEN.

      IF screen-name = 'P_CHTXT1'.

      screen-input = 0.

      screen-output = 0.

      MODIFY SCREEN.

      ENDIF.

      ENDLOOP.

      ENDIF.

      IF p_chbox2 = 'X'.

      LOOP AT SCREEN.

      IF screen-name = 'P_CHTXT2'.

      screen-input = 0.

      screen-output = 0.

      MODIFY SCREEN.

      ENDIF.

      ENDLOOP.

      ENDIF.

      IF p_chbox3 = 'X'.

      LOOP AT SCREEN.

      IF screen-name = 'P_CHTXT3'.

      screen-input = 0.

      screen-output = 0.

      MODIFY SCREEN.

      ENDIF.

      ENDLOOP.

      ENDIF.

      AT SELECTION-SCREEN.

      IF p_chbox1 = 'X'.

      LOOP AT SCREEN.

      IF screen-name = 'P_CHTXT1'.

      screen-input = 0.

      screen-output = 0.

      MODIFY SCREEN.

      ENDIF.

      ENDLOOP.

      ELSE.

      LOOP AT SCREEN.

      IF screen-name = 'P_CHTXT1'.

      screen-input = 1.

      screen-output = 1.

      MODIFY SCREEN.

      ENDIF.

      ENDLOOP.

      ENDIF.

      IF p_chbox2 = 'X'.

      LOOP AT SCREEN.

      IF screen-name = 'P_CHTXT2'.

      screen-input = 0.

      screen-output = 0.

      MODIFY SCREEN.

      ENDIF.

      ENDLOOP.

      ELSE.

      LOOP AT SCREEN.

      IF screen-name = 'P_CHTXT2'.

      screen-input = 1.

      screen-output = 1.

      MODIFY SCREEN.

      ENDIF.

      ENDLOOP.

      ENDIF.

      IF p_chbox3 = 'X'.

      LOOP AT SCREEN.

      IF screen-name = 'P_CHTXT3'.

      screen-input = 0.

      screen-output = 0.

      MODIFY SCREEN.

      ENDIF.

      ENDLOOP.

      ELSE.

      LOOP AT SCREEN.

      IF screen-name = 'P_CHTXT3'.

      screen-input = 1.

      screen-output = 1.

      MODIFY SCREEN.

      ENDIF.

      ENDLOOP.

      ENDIF.

  • Posted on Sep 23, 2005 at 03:03 PM

    Sure, check out this example.

    
    report zrich_0002
           no standard page heading.
    
    
    parameters: p_check1 as checkbox <b>user-command check</b>,
                p_check2 as checkbox <b>user-command check</b>.
    
    data: cursorfield(20) type c.
    
    at selection-screen.
    
    
      get cursor field cursorfield.
    
      if cursorfield = 'P_CHECK1'.
        p_check2 = space.
      elseif  cursorfield = 'P_CHECK2'.
        p_check1 = space.
      endif.
    
    

    Regards,

    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2005 at 03:35 PM

    Just see report DEMO_SEL_SCREEN_USER_COMMAND

    is SE38 .

    Cheers

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2005 at 04:35 PM

    if a checkbox is select, it has value 'X' else '

    thanks

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2005 at 11:49 AM

    Hi,

    Try to use,

    AT SELECTION-SCREEN

    CASE SSCRFIELDS.

    WHEN 'SAVE'.

    LOOP AT SCREEN

    <b>SCREEN-ACTIVE = 1.</b>

    MODIFY SCREEN

    ENDLOOP.

    ENDCASE.

    Hope it helps u.

    Thanks&Regards,

    Ruthra.R

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 26, 2005 at 12:21 PM

    Hi

    This is the one with 5 fields and 5 check boxes. See if it suits your need .

    DATA NAME(50).

    PARAMETER P1 AS CHECKBOX USER-COMMAND SEL .

    PARAMETER PTEST1(5) MODIF ID MOD .

    PARAMETER P2 AS CHECKBOX USER-COMMAND SEL .

    PARAMETER PTEST2(5) MODIF ID MOD.

    PARAMETER P3 AS CHECKBOX USER-COMMAND SEL .

    PARAMETER PTEST3(5) MODIF ID MOD.

    PARAMETER P4 AS CHECKBOX USER-COMMAND SEL .

    PARAMETER PTEST4(5) MODIF ID MOD.

    PARAMETER P5 AS CHECKBOX USER-COMMAND SEL .

    PARAMETER PTEST5(5) MODIF ID MOD.

    DEFINE CHANGE_SCREEN.

    LOOP AT SCREEN .

    CHECK SCREEN-NAME = &1.

    IF &2 EQ 'X'.

    SCREEN-INPUT = 1.

    ELSE.

    SCREEN-INPUT = 0.

    ENDIF.

    MODIFY SCREEN.

    ENDLOOP.

    END-OF-DEFINITION.

    INITIALIZATION.

    LOOP AT SCREEN.

    CHECK SCREEN-GROUP1 = 'MOD'.

    SCREEN-INPUT = 0.

    MODIFY SCREEN.

    ENDLOOP.

    AT SELECTION-SCREEN OUTPUT.

    NAME = 'PTEST1'.

    CHANGE_SCREEN NAME P1.

    NAME = 'PTEST2'.

    CHANGE_SCREEN NAME P2.

    NAME = 'PTEST3'.

    CHANGE_SCREEN NAME P3.

    NAME = 'PTEST4'.

    CHANGE_SCREEN NAME P4.

    NAME = 'PTEST5'.

    CHANGE_SCREEN NAME P5.

    Cheers

    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.