Skip to Content

Regd Selection Screen of a report..

Hi all

I have a requirement where if the value input on a selection screen field is some 'X' then the next field should get disabled immmediately...

i have many blocks in the selection scrren.. but the two fields i'm referring to are in the same block..

i have tried loop at screen at selection screen output.. but it is not working..

i would like someone to tell me how to capture the value entered in the field as 'X' dynamically and write logic to disable the next field..

i have searched through the forums.. but haven't found solution to this requirement..

Thanks in advance.

Shilpa

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

9 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 10, 2009 at 10:02 AM

    Hi Shilpa,

    You have the syntax for USER-COMMAND in a parameter.. This event will be triggered as soon as the value is changed and will go through the rest of the selection-screen events..

    This can very well be used for the dynamic function u want.

    PARAMETERS: p_opt1 RADIOBUTTON GROUP rb1 USER-COMMAND ONLI DEFAULT 'X',

    p_opt2 RADIOBUTTON GROUP rb1.

    then u only need to check radiobutton value..

    same can be done with checkboxes too..

    hope it helps.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 10, 2009 at 10:06 AM

    try the following logic

    selection screen declarations

    SELECTION-SCREEN BEGIN OF BLOCK SL WITH FRAME TITLE TEXT-001.

    PARAMETERS : P_R1 TYPE C USER-COMMAND R1 RADIOBUTTON GROUP R1 DEFAULT 'X'.

    SELECT-OPTIONS S_AUFNR FOR AUFK-AUFNR.

    PARAMETERS : P_R2 TYPE CHAR1 RADIOBUTTON GROUP R1.

    SELECTION-SCREEN END OF BLOCK SL.

    code for hiding(the fields will be hiiden when user clicks on 2nd radio button)

    AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN.

    CASE C_X.

    WHEN P_R2.

    IF SCREEN-NAME = 'S_AUFNR' OR SCREEN-NAME = '%_S_AUFNR_%_APP_%-TEXT' OR SCREEN-NAME = '%_S_AUFNR_%_APP_%-OPTI_PUSH'

    OR SCREEN-NAME = 'S_AUFNR-LOW' OR SCREEN-NAME = '%_S_AUFNR_%_APP_%-TO_TEXT'

    OR SCREEN-NAME = 'S_AUFNR-HIGH' OR SCREEN-NAME = '%_S_AUFNR_%_APP_%-VALU_PUSH'.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    ENDCASE.

    ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 10, 2009 at 10:07 AM

    Hi,

    You can try like this,

    
    
    SELECT-OPTIONS: s_bukrs FOR t001-bukrs MODIF ID abc,
                             s_werks FOR t001w-werks MODIF ID xyz.
    
    AT SELECTION-SCREEN OUTPUT.
    
    loop at screen.
    
    if s_bukrs-low = 'X'.
    if screen-group1 = 'XYZ'.
    screen-input = 0.
    modify screen.
    endif.
    endif.
    endloop.
    
    

    Regards,

    Vik

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 10, 2009 at 11:32 AM

    Hello Shilpa ,

    PARAMETERS : P_R1(2) TYPE C RADIOBUTTON GROUP R1.

    AT SELECTION-SCREEN OUTPUT.

    IF p_r1 EQ 'X'.

    LOOP AT SCREEN.

    IF screen-name = 'P1' or 'P2'.

    screen-input = 0.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    Vanu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 10, 2009 at 11:39 AM

    Hi,

    Try this

    
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-T01.
        PARAMETERS: P_VBELN TYPE VBAK-VBELN,
                    P_CHECK AS CHECKBOX USER-COMMAND FLAG,
                    P_FPATH TYPE RLGRAP-FILENAME.
    SELECTION-SCREEN END OF BLOCK B1.
     
     
    AT SELECTION-SCREEN OUTPUT.
        LOOP AT SCREEN.
          IF P_CHECK EQ 'X'.
            IF SCREEN-NAME EQ 'P_FPATH'.
              SCREEN-INPUT = '0'.
              MODIFY SCREEN.
            ENDIF.
          ELSE.
              IF SCREEN-NAME EQ 'P_FPATH'.
              SCREEN-INPUT = '1'.
              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 10, 2009 at 11:49 AM

    Hi try this code.

    REPORT ztest_notepad.

    tables : kna1,ekko,vbrk.

    PARAMETERS : SALES RADIOBUTTON GROUP VIJJ USER-COMMAND VJY ,

    PUR RADIOBUTTON GROUP VIJJ ,

    BILL RADIOBUTTON GROUP VIJJ ,

    TOTAL AS CHECKBOX.

    SELECT-OPTIONS : S_CUSTNO FOR KNA1-KUNNR MODIF ID AKP DEFAULT 1000 TO 1033,

    S_PONO FOR EKKO-EBELN MODIF ID VKP,

    S_BNO FOR VBRK-VBELN MODIF ID PKP.

    INITIALIZATION.

    AT SELECTION-SCREEN OUTPUT.

    LOOP AT SCREEN.

    IF SALES = 'X'.

    IF SCREEN-GROUP1 = 'VKP'.

    SCREEN-INPUT = 0.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    IF SCREEN-GROUP1 = 'PKP'.

    SCREEN-INPUT = 0.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    ELSEIF PUR = 'X'.

    IF SCREEN-GROUP1 = 'PKP'.

    SCREEN-INPUT = 0.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    IF SCREEN-GROUP1 = 'AKP'.

    SCREEN-INPUT = 0.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    ELSEIF BILL = 'X'.

    IF SCREEN-GROUP1 = 'AKP'.

    SCREEN-INPUT = 0.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    IF SCREEN-GROUP1 = 'VKP'.

    SCREEN-INPUT = 0.

    SCREEN-ACTIVE = 0.

    MODIFY SCREEN.

    ENDIF.

    ENDIF.

    ENDLOOP.

    Regards,

    Vijay

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 10, 2009 at 11:52 AM

    Hi Shilpa,

    you can follow coding in that way:

    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.

    PARAMETERS: rb_psv RADIOBUTTON GROUP rbg1 USER-COMMAND abc

    DEFAULT 'X',

    rb_asv RADIOBUTTON GROUP rbg1,

    po_psv LIKE ibipparms-path MODIF ID aaa,

    po_asv LIKE ibipparms-path MODIF ID bbb.

    SELECTION-SCREEN END OF BLOCK a.

    AT SELECTION-SCREEN OUTPUT.

    PERFORM screen_modification.

    FORM screen_modification .

    IF rb_asv = 'X'.

    LOOP AT SCREEN.

    IF screen-group1 = 'AAA'.

    screen-input = 0.

    screen-invisible = 1.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ELSE.

    LOOP AT SCREEN.

    IF screen-group1 = 'BBB'.

    screen-input = 0.

    screen-invisible = 1.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    ENDIF.

    ENDFORM. " SCREEN_MODIFICATION

    Hope this can solve your problems.

    Regards,

    Tutun

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 10, 2009 at 11:54 AM

    Declare the PARAMETER [AS CHECKBOX and add a dummy USER-COMMAND|http://help.sap.com/abapdocu/en/ABAPPARAMETERS_SCREEN.htm#!ABAP_ADDITION_4@4@]. So the PAI will be triggered when changed. You will manage the screen attributes of the depending fields in the PBO (AT SELECTION-SCREEN OUTPUT) as usual via [LOOP AT SCREEN|http://help.sap.com/abapdocu/en/ABAPLOOP_AT_SCREEN.htm].

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 10, 2009 at 12:36 PM

    Hi Shilpa ,

    I had faced a similar issue a month back, my requirement was similar to u, it was i had two fields on my selection screen, field 1 and field2.

    if i enter a value in field1 the other should get converted to an output field i.e in the 2nd field no input would be possible i will remain just a output field.

    and vise-versa.

    I had used following piece of code---->>>>

    SELECTION-SCREEN BEGIN OF BLOCK AA WITH FRAME TITLE TEXT-001.

    PARAMETERS : P_EBELN LIKE EKKO-EBELN ." At selection screen."OBLIGATORY. " PONUMBER

    SELECTION-SCREEN END OF BLOCK AA.

    SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-003.

    PARAMETERS : P_LIFNR LIKE LFA1-LIFNR .

    SELECTION-SCREEN END OF BLOCK A.

    *********************

    P_EBELN IS FIELD1

    P_LIFNR IS FIELD2

    *********************

    THEN I CALLED A MODAL DAILOG BOX IN AT SELECTION-SCREEN OUTPUT, WHICH CONSIST OF --IN WHICH FIELD U WANT TO MAKE ENTRY, IF I SELECT FIELD1, THEN FIELD2 GETS IN OUTPUT MODE, IF I SELECT FIELD 2 THEN FIELD1 GETS IN OUTPUT MODE.

    AT SELECTION-SCREEN OUTPUT.

    if p_ebeln is initial and P_LIFNR is initial.

    call screen 300 STARTING AT 75 4 ENDING AT 122 9.

    endif.

    ***********************************************************************

    SCREEN 300 PBO AND PAI ARE AS FOLLOWS--->

    MODULE STATUS_0300 OUTPUT.

    SET PF-STATUS '300'.

    SET TITLEBAR '300'.

    ENDMODULE. " STATUS_0300 OUTPUT

    &----


    *& Module USER_COMMAND_0300 INPUT

    &----


    • text

    ----


    MODULE USER_COMMAND_0300 INPUT.

    data LV1_ucomm type sy-ucomm.

    LV1_ucomm = sy-ucomm.

    CASE LV1_ucomm.

    WHEN 'CANCEL'.

    LEAVE PROGRAM.

    WHEN 'CONTINUE'.

    set screen '0'.

    leave screen.

    ENDCASE.

    ENDMODULE. " USER_COMMAND_0300 INPUT

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I AM CONTINUING WITH MY LAST POST......

      then i added a code to AT SELECTION SCREEN OUTPUT.

      as follows---->>>>

      if p_ebeln is initial and P_LIFNR is initial.

      call screen 300 STARTING AT 75 4 ENDING AT 122 9.

      endif.

      *******************************************new code

      IF RAD-RAD1 = 'X'.

      LOOP AT SCREEN.

      IF SCREEN-NAME = 'P_LIFNR'.

      SCREEN-INPUT = 0.

      ENDIF.

      MODIFY SCREEN.

      ENDLOOP.

      ELSEIF RAD-RAD2 = 'X'.

      LOOP AT SCREEN.

      IF SCREEN-NAME = 'P_EBELN'.

      SCREEN-INPUT = 0.

      ENDIF.

      MODIFY SCREEN.

      ENDLOOP.

      ENDIF.

      here RAD-RAD1 AND RAD-RAD2 ARE THE RADIO BUTTONS THAT I DEFINED ON THE MODAL DIALOG BOX SCREEN 300.

      SEE ABOVE IF RAD-RAD1 I.E FIELD1 IS SELECTED IN SCREEN 300 THEN FIELD2 BECOMES A OUTPUT FIELD ELSE IF I SELECT RAD-RAD2 I.E FIELD2 THEN FIELD1 BECOMES A OUTPUT FIELD.

      LIKE THIS U CAN MAKE CHANGES TO THE SELECTION SCREEN FIELD BEFORE THEY GET OUTPUT ON THE SELECTION SCREEN, HOPE THIS HELPS U RESOLVE UR ISSUE.

      Regards,

      Akash Rana

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.