Regarding ALV selection screen

hi all,
my issue:
i have an alv report which has almost 10 paramters based on which the internal table will be populated. the two parameters are mandatory .. 4 are select options and 4 are radiobuttons. i think this will lead to a lot of select queries.
i was wondering if there is any way we can minimize the no. of select query.
also would like to know if ranges table can work in such a scenario.
9 fields are from table pLAF and two are from MARA and MKAL respectively
please advice.
thanks in advance
Srinivas

Hi,
For select-options,You dont have to check whether that field is initial or not.So For 4 select-options, u can use one select query.2 parameter field is also mandatory so you dont have to check those 2 field is intial or not.U got to put 4 if condition for 4 radio buttons.
Eg:
If rd_1 = 'X'.
select field1 field1 from <table1> into table where field1 = p_param1
        and field2 = p_param2
and field3 in s_selop1
and field4 in s_selop2
and field5 in s_selop3
and field6 in s_selop4.
elseif rd_2 = 'X'.
select field1 field1 from <table2> into table where field1 = p_param1
        and field2 = p_param2
and field3 in s_selop1
and field4 in s_selop2
and field5 in s_selop3
and field6 in s_selop4.
elseif rd_3 = 'X'.
select field1 field1 from <table3> into table where field1 = p_param1
        and field2 = p_param2
and field3 in s_selop1
and field4 in s_selop2
and field5 in s_selop3
and field6 in s_selop4.
elseif rd_4 = 'X'.
select field1 field1 from <table4> into table where field1 = p_param1
        and field2 = p_param2
and field3 in s_selop1
and field4 in s_selop2
and field5 in s_selop3
and field6 in s_selop4.
endif.

Similar Messages

  • Variant in ALV selection screen

    Hi friends,
         How to protect a variant in ALV selection screen from changing or deleting by other users.
    Thanks,
    Rajesh

    Rajesh,
    You still need someone to be able to change the variant, right? That is what exactly PROTECT VARIANT does.
    If you select the field Protect variant, the variant can only be changed by the person who created it or last changed it.                         
    Regards,
    Ravi
    Note :Please mark the helpful answers  and close the thread if the quesiton is answered

  • Check box in ALV selection screen

    Hi to all
              I like to know how to create a checkbox in the input screen of an ALV.

    What do you mean by ALV check box selection screen?
    ALV and selection screen check box( you are mixing two cases in your Question).
    You need use the Function moduel in the user command to get the updated data.
    in fieldcatalog you have to use INPUT = 'X' and EDIT = 'X' for the columns which ever you want edit.
    GET_GLOBALS_FROM_SLVC_FULLSCR
    follow the sample code.
    REPORT ZTEST_ALV_CHECK MESSAGE-ID ZZ .
    TYPE-POOLS: SLIS.
    DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
    IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
    L_LAYOUT TYPE SLIS_LAYOUT_ALV,
    X_EVENTS TYPE SLIS_ALV_EVENT,
    IT_EVENTS TYPE SLIS_T_EVENT.
    DATA: BEGIN OF ITAB OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    CHK(1),
    color(4),
    END OF ITAB.
    SELECT VBELN
    POSNR
    FROM VBAP
    UP TO 20 ROWS
    INTO TABLE ITAB.
    X_FIELDCAT-FIELDNAME = 'CHK'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 1.
    X_FIELDCAT-INPUT = 'X'.
    X_FIELDCAT-EDIT = 'X'.
    X_FIELDCAT-CHECKBOX = 'X'.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-SELTEXT_L = 'VBELN'.
    X_FIELDCAT-HOTSPOT = 'X'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 2.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-SELTEXT_L = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 3.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    L_LAYOUT-info_fieldname = 'COLOR'.
    *L_LAYOUT-ZEBRA = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = L_LAYOUT
    I_CALLBACK_PF_STATUS_SET = 'STATUS'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    IT_FIELDCAT = IT_FIELDCAT
    TABLES
    T_OUTTAB = ITAB
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *& Form STATUS
    text
    -->P_EXTAB text
    FORM STATUS USING P_EXTAB TYPE SLIS_T_EXTAB.
    Pf status
    SET PF-STATUS 'STATUS'.
    ENDFORM. " STATUS
    *& Form USER_COMMAND
    text
    -->R_UCOMM text
    -->RS_SELFIELD text
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
    DATA: GD_REPID LIKE SY-REPID, "Exists
    REF_GRID TYPE REF TO CL_GUI_ALV_GRID.
    IF REF_GRID IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
    E_GRID = REF_GRID.
    ENDIF.
    IF NOT REF_GRID IS INITIAL.
    CALL METHOD REF_GRID->CHECK_CHANGED_DATA .
    ENDIF.
    loop at itab where chk = 'X'.
    itab-color = 'C300'.
    modify itab index sy-tabix transporting color.
    endloop.
    RS_SELFIELD-refresh = 'X'.
    break-point.
    ENDFORM. "USER_COMMAND
    Regards
    Vijay Babu Dudla

  • Screen Text in ALV selection screen

    A user has asked me to add some text at the bottom of a selection screen in an ALV report program. In se80 I double clicked the screen (1000) and then went into the layout and added a text field with some text in it. The system then requested a transport and added a LIMU DYNP screen object to it. The only other object in the transport is the Report Source Code.
    When I run the transport to another system the new text fields disappear from the screen object although double clicking the screen object in the transport shows they are there.
    Any ideas why they disappear??

    I have tried selection-screen comment but there appears to be a limit to the size of the text string (83) and this is not long enough for our purpose as the next needs to go right accross the page. Thanks for replying.

  • Regarding at selection screen event

    hi experts,
                   i m working on hr abap report with the help of pnp ldb i made my selection screen using report category 'PY_DEF'  now what i want that i m not using the first selction screen which contains current period  details etc but when i click on the payroll period button the second selection screen is coming no doubt... containing payroll area current period ,other periods etc here i m entering payroll area eq 'ka' and  other periods from '012006' to '122006' ,,here i want to validate the user input that it sud be of one year that is from 1 to 12.....for this i know i will use at selection event but how can i use it for the second selection screen not for first screen......... plz help me....

    Do u realy need the first selection screen having the current period? If u don't need then u can hide the field in the report category, by passing only the payroll area with other period, in this case we can validate through selection screen..
    Reward points ... if found helpful...
    Regards,
    Sowmen Das

  • Regarding LDB selection screen

    Hi All,
    I copied a standard LDB program "RCATSCMP".
    I have a date fields in selection screen.
    When i debuged the standard program i am getting the date values PN-BEGDA and PN-ENDDA.
    but when iam debugging my program iam not getting any values for these fields.
    How to get these values.
    Thanks in Advance
    kiran i

    Hi Kiran,
      Please check the attributes of the copied program
      and see whether it has logical data base 'PNP' is
      there are not.
    Thanks & Regards,
    Siri.

  • Regarding at Selection-Screen

    Hi Experts,
    In the selection-screen, i have 2 radiobuttons .
    parameters : rb1 radiobutton group g2 ,
                 rb2 radiobutton group g2 .
    and 4 input fields.
    SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.  " OBLIGATORY.
    SELECT-OPTIONS : S_MTART FOR MARA-MTART NO INTERVALS NO-EXTENSION.
    SELECT-OPTIONS : S_WERKS FOR MARA-MATNR NO INTERVALS NO-EXTENSION.
    parameters : lifnr like lfa1-lifnr .
    Now my requirement is when i execute the report by default the 1st radiobutton is selected. For this radiobutton,
    i want to display only the first 3 select-options. And when the user clicks on the second radiobutton,
    the parameter LIFNR should appear without pressing enter button. Again when the user clicks on
    1st radiobutton the parameter field LIFNr should not appear.
    Please can anybod yrpovide the code.
    Thanks in advance.

    Hi,
    Test the Code Bellow it is working as per your requirement,
    TABLES: mara.
    PARAMETERS : rb1 RADIOBUTTON GROUP g2 USER-COMMAND a DEFAULT 'X',
    rb2 RADIOBUTTON GROUP g2 .
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_matnr FOR mara-matnr MODIF ID s1. " OBLIGATORY.
    SELECT-OPTIONS : s_mtart FOR mara-mtart NO INTERVALS NO-EXTENSION MODIF ID s1.
    SELECT-OPTIONS : s_werks FOR mara-matnr NO INTERVALS NO-EXTENSION MODIF ID s1.
    SELECTION-SCREEN END OF BLOCK a.
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-002.
    PARAMETERS : lifnr LIKE lfa1-lifnr MODIF ID s2.
    SELECTION-SCREEN END OF BLOCK b.
    BREAK-POINT.
    AT SELECTION-SCREEN OUTPUT.
      IF rb1 = 'X'.
        LOOP AT SCREEN.
          IF screen-group1 = 'S2'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF rb2 = 'X'.
        LOOP AT SCREEN.
          IF screen-group1 = 'S1'.
            screen-active = 0.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.
    Best Regards,
    Faisal

  • Regarding At selection-screen on Radiobutton    output....

    Hi...
    This is the code I used, to check AT SELECTION-SCREEN ON RADIOBUTTON.
    But, after displaying the error message,
    all fields are becoming inactive in selection screen.
    CODE:
    TYPES : BEGIN OF st_employee,
                  cid TYPE zintelli_emp-cid,              
                 cname TYPE zintelli_emp-cname,         
             l   ocation TYPE zintelli_emp-location,           
                phno TYPE zintelli_emp-phno ,          
                gender TYPE zintelli_emp-gender,       
            END OF st_employee.
    DATA :  it_employee TYPE STANDARD TABLE OF      st_employee,
            wa_employee TYPE st_employee,
            v_cid TYPE  zintelli_emp-cid.
    SELECTION-SCREEN BEGIN OF SCREEN 500 TITLE title.
    PARAMETERS : p_cid TYPE st_employee-cid obligatory.
    PARAMETERS : p_cname TYPE st_employee-cname,       
                 p_culoc TYPE st_employeelocation,    
                 p_phno TYPE st_employee-phno. 
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(6) rc1.
    PARAMETERS : rb_1 RADIOBUTTON GROUP b .
    SELECTION-SCREEN COMMENT 15(7) rc2.
    PARAMETERS :  rb_2 RADIOBUTTON GROUP b.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN SKIP 2.
    SELECTION-SCREEN PUSHBUTTON /35(10) pb1 USER-COMMAND pb1.
    SELECTION-SCREEN SKIP 5.
    SELECTION-SCREEN END OF SCREEN 500.
    CALL SELECTION-SCREEN '500'.
    INITIALIZATION.
      title  = 'CUSTOMER INFORMATION'.
      pb1 = 'INSERT'.
      rc1 = 'MALE'.
      rc2 = 'FEMALE'.
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP b.
      IF rb_1 EQ 'X'.
        p_cid = p_cid+0(1).
        IF p_cid NE 'M'.
          MESSAGE e020(z50871msg) WITH 'The id should start with "M" '.
         EXIT.
        ENDIF.
      ELSE.
        p_cid = p_cid+0(1).
        IF p_cid NE 'F'.
          MESSAGE e020(z50871msg) WITH 'The id should start with "F" '.
          EXIT.
        ENDIF.
        ENDIF.
    Regards
    sandeep.

    At selection-screen on FIELD
              Will give work like: If given input is wrong then it will give the Error message and all other fields will be diasable except the entered wrong on At selection-screen on FIELD.
    until you give the right input it won't go for next At Selection-screen On FILED.
    If you Don't want to disable other fields Use ONLY AT SELECTION-SCREEN.
    Regards,
    Umashankar

  • Regarding At selection-screen on radiobutton

    Hi..
    I need sample code on AT SELECTION-SCREEN ON RADIOBUTTON.
    thanx and regards
    Sandeep.

    Hi,
    Just copy paste this code and run it,
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    PARAMETERS: R1 RADIOBUTTON GROUP RAD1 DEFAULT 'X',
    R2 RADIOBUTTON GROUP RAD1,
    R3 RADIOBUTTON GROUP RAD1.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
    PARAMETERS: R4 RADIOBUTTON GROUP RAD2 DEFAULT 'X',
    R5 RADIOBUTTON GROUP RAD2,
    R6 RADIOBUTTON GROUP RAD2.
    SELECTION-SCREEN END OF BLOCK B2.
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.
    IF R1 = 'X'.
    MESSAGE W040(HB).
    ENDIF.
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD2.
    IF R4 = 'X'.
    MESSAGE W040(HB).
    ENDIF.
    note: after selecting the choices press F8 and test.
    hope this helps.

  • Regarding At Selection-Screen On field

    Hi..
    When we wil use At Selection-Screen On <Field>
    and  At Selection-Screen On Radiobutton.
    What is the purpose of these events.
    I need samplecode for these events.
    Regards
    Sandeep.

    Hi Sandeep
    hope this will help you.
    REPORT zextest595 .
    *--- Radiobuttons
    PARAMETERS: p_up RADIOBUTTON GROUP a DEFAULT 'X' USER-COMMAND rb,
    p_list RADIOBUTTON GROUP a.
    PARAMETERS: p_pcfile LIKE rlgrap-filename OBLIGATORY DEFAULT 'C:\'
    MODIF ID ccc,
    p_pctype LIKE rlgrap-filetype OBLIGATORY DEFAULT 'ASC'
    MODIF ID ccc,
    p_unix LIKE rlgrap-filename OBLIGATORY DEFAULT '.\'
    MODIF ID ccc.
    PARAMETERS: p_dir LIKE rlgrap-filename OBLIGATORY DEFAULT '.'
    MODIF ID ddd,
    p_fp LIKE rlgrap-filename
    MODIF ID ddd.
    AT SELECTION-SCREEN
    AT SELECTION-SCREEN OUTPUT.
    IF p_up = 'X' .
    LOOP AT SCREEN.
    CASE screen-group1.
    WHEN 'CCC'.
    screen-input = 1. "Enable
    screen-invisible = 0. "Disable
    MODIFY SCREEN.
    WHEN 'DDD'.
    screen-input = 0.
    screen-invisible = 1.
    MODIFY SCREEN.
    ENDCASE.
    ENDLOOP.
    ENDIF.
    IF p_list = 'X'.
    LOOP AT SCREEN.
    CASE screen-group1.
    WHEN 'CCC'.
    screen-input = 0.
    screen-invisible = 1.
    MODIFY SCREEN.
    WHEN 'DDD'.
    screen-input = 1.
    screen-invisible = 0.
    MODIFY SCREEN.
    ENDCASE.
    ENDLOOP.
    ENDIF.

  • Regarding passing selection screen values into internal table

    Hi,
    I have created one selection screen with fields
    <b>POSNR LIKE VBAP-POSNR</b>
    <b>SELECT-OPTIONS: s_posnr FOR vbap-posnr.</b>
    I had created one internal table as:
    <b>DATA: BEGIN OF i_item OCCURS 0,
            posnr     LIKE vbap-posnr,
          END OF i_item.</b>
    Now what i want is to pass what ever entries available in <b>s_posnr into i_item</b> internal table.
    If user gives 10 in select-screen i_item should have 10,
    If user gives 10 to 30 in select-screen i_item should have 10,20,30 entries.
    If user gives nothing in s_posnr of selection screen
    then i_item should have all the valid item no's[POSNR's]
    from respective sales order.
    Can anybody tell me how can i solve this issue!
    Thanks in advance.
    Thanks & Regards,
    Prasad.

    Hi Prasad,
    I guess somewhere on your selection screen there is also a parameter for sales order (eg. pa_vbeln)?
    Then:
    SELECT posnr
          FROM vbap
          INTO TABLE i_item
         WHERE vbeln EQ pa_vbeln
           AND posnr IN s_posnr.
    Will get all position numbers in your internal table.
    Regards,
    John.

  • ALV selection screen

    Hi,
    Iam new to A.L.V and have few queries.please tell me the coding for the below.
    At selection screen:
    Process the following validations for selection screen fields and display the appropriate error messages.
    1.     Validate  the Date From (SAP Transaction Date ) against VEKP –Created-On Date .
    2.     Validate  the Date From (SAP Transaction Date ) against VEKP –Created-On Date .
    3.     Validate the Plant From (Transaction Source Location ) against VEKP – Shipping Point.
    4.     Validate the Plant To (Transaction Destination Location ) against VEKP – Shipping Point.
    5.     Validate the Pallet ID against VEKP – Handling Unit.
    6.      If Date From field is blank, display an appropriate error message.
    7.     If Plant From field is blank, display an appropriate error message.
    Kindly send me the coding for this.
    Regards,
    Tanya

    Hi,
    the code is  :
    *For VEKP-Created-on-date :
    AT SELECTION-SCREEN ON s_erdat.
      IF NOT s_erdat[] IS INITIAL.
        SELECT erdat FROM VEKP    INTO VEKP-ERDAT
                      WHERE ERDAT IN s_erdat.
        ENDSELECT.
        IF sy-subrc <> 0.
          MESSAGE 'Enter a valid created date' Type E.
        ENDIF.
    Else ( for question 6& 7)
    MESSAGE 'Enter a date in the Date From field' Type E.
      ENDIF.
    from 1 to 2, the above was the code.. and from 3 to 5 - the else paart is not requried..

  • Regarding the selection screen..

    Hi all,
      i have a requirement that.i need to create two selection screens..i.e. in the first selection screen i need to enter some values after that if i execute then another selection screen need to come and make the user to enter the values.

    Hi,
    You can make this definitely through Dialog Programming.
    I am attaching the code for that.
    *& Module Pool       SAPMZDS_CRTSCREEN
    INCLUDE MZDS_SUBSCREENTOP.
    *INCLUDE MZDS_IOCHKRBTTOP.
    INCLUDE MZDS_SUBSCREENO01.
    *INCLUDE MZDS_IOCHKRBTO01.
    INCLUDE MZDS_SUBSCREENI01.
    *INCLUDE MZDS_IOCHKRBTI01.
    INCLUDE MZDS_SUBSCREENF01.
    *GUI Texts
    * TITLE --> MODULE POOL PROGRAM BY DS
    TOP INCLUDE
    *& Include MZDS_CRTSCREENTOP                                 Module Pool      SAPMZDS_CRTSCREEN
    PROGRAM  SAPMZDS_CRTSCREEN.
    TABLES: SPFLI,SBOOK.
    DATA: OK_CODE TYPE SYUCOMM.
    CONTROLS TAB1 TYPE TABSTRIP.
    DATA: BEGIN OF IT_SPFLI OCCURS 0,
          CITYFROM TYPE SPFLI-CITYFROM,
          AIRPFROM TYPE SPFLI-AIRPFROM,
          CITYTO TYPE SPFLI-CITYTO,
          AIRPTO TYPE SPFLI-AIRPTO,
      END OF IT_SPFLI.
    DATA: IT_SBOOK TYPE SBOOK.
    DATA: DYNNR TYPE SY-DYNNR.
    DATA: DEP_CITY(20) TYPE C,
          DEP_AIR(20) TYPE C,
          DES_CITY(20) TYPE C,
          DES_AIR(20) TYPE C.
    DATA: FLDATE(20) TYPE C,
          BOOKNO(20) TYPE C,
          CUSTNO(20) TYPE C.
    DATA:CITY_FROM(20) TYPE C,
         AIRP_FROM(20) TYPE C,
         CITY_TO(20) TYPE C,
         AIRP_TO(20) TYPE C.
    DATA: FL_DATE(20) TYPE C,
          BOOKID(20) TYPE C,
          CUSTOMID(20) TYPE C.
    DATA: BEGIN OF RBT,
          SPFLI VALUE 'X',
          SBOOK,
          END OF RBT.
    PBO
    *&  Include           MZDS_CRTSCREENO01
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'BASE'.
      SET TITLEBAR 'TITLE'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  CLEAR_OKCODE  OUTPUT
    *       text
    MODULE CLEAR_OKCODE OUTPUT.
    CLEAR OK_CODE.
    ENDMODULE.                 " CLEAR_OKCODE  OUTPUT
    MODULE DISPLAY_DATA OUTPUT.
    CASE 'X' .
       WHEN RBT-SPFLI.
        SELECT CITYFROM AIRPFROM CITYTO AIRPTO FROM SPFLI
        INTO CORRESPONDING FIELDS OF TABLE IT_SPFLI
        WHERE CARRID = SPFLI-CARRID
        AND CONNID = SPFLI-CONNID.
    FLDATE = ' '.
    BOOKNO = ' '.
    CUSTNO = ' '.
    LOOP AT IT_SPFLI.
       DEP_CITY = IT_SPFLI-CITYFROM.
       DEP_AIR = IT_SPFLI-AIRPFROM.
       DES_CITY = IT_SPFLI-CITYTO.
       DES_AIR = IT_SPFLI-AIRPTO.
    ENDLOOP.
      WHEN RBT-SBOOK.
        SELECT SINGLE FLDATE BOOKID CUSTOMID FROM SBOOK
        INTO CORRESPONDING FIELDS OF IT_SBOOK
        WHERE CARRID = SPFLI-CARRID
        AND CONNID = SPFLI-CONNID.
       FLDATE = IT_SBOOK-FLDATE.
       BOOKNO = IT_SBOOK-BOOKID.
       CUSTNO = IT_SBOOK-CUSTOMID.
    DEP_CITY = ' '.
    DEP_AIR = ' '.
    DES_CITY = ' '.
    DES_AIR = ' '.
    ENDCASE.
    ENDMODULE.
    *&      Module  CALL_DYNNR  OUTPUT
    *       text
    MODULE CALL_DYNNR OUTPUT.
    CASE TAB1-ACTIVETAB.
      WHEN 'SPFLI'.
        DYNNR = 102.
      WHEN 'SBOOK'.
        DYNNR = 103.
      WHEN OTHERS.
        TAB1-ACTIVETAB = 'SPFLI'.
        DYNNR = 102.
    ENDCASE.
    ENDMODULE.                 " CALL_DYNNR  OUTPUT
    *&      Module  DISPLAY_SFLIGHT  OUTPUT
    *       text
    MODULE DISPLAY_SFLIGHT OUTPUT.
    SELECT CITYFROM AIRPFROM CITYTO AIRPTO FROM SPFLI
        INTO CORRESPONDING FIELDS OF TABLE IT_SPFLI
        WHERE CARRID = SPFLI-CARRID
        AND CONNID = SPFLI-CONNID.
    CITY_FROM = IT_SPFLI-CITYFROM.
    AIRP_FROM = IT_SPFLI-AIRPFROM.
    CITY_TO = IT_SPFLI-CITYTO.
    AIRP_TO = IT_SPFLI-AIRPTO.
    ENDMODULE.                 " DISPLAY_SFLIGHT  OUTPUT
    *&      Module  DISPLAY_SBOOK  OUTPUT
    *       text
    MODULE DISPLAY_SBOOK OUTPUT.
    SELECT SINGLE FLDATE BOOKID CUSTOMID FROM SBOOK
        INTO CORRESPONDING FIELDS OF IT_SBOOK
        WHERE CARRID = SPFLI-CARRID
        AND CONNID = SPFLI-CONNID.
    FL_DATE = IT_SBOOK-FLDATE.
    BOOKID = IT_SBOOK-BOOKID.
    CUSTOMID = IT_SBOOK-CUSTOMID.
    ENDMODULE.                 " DISPLAY_SBOOK  OUTPUT
    PAI
    *&  Include           MZDS_CRTSCREENI01
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
      WHEN 'BACK'.
        LEAVE TO SCREEN 0.
      WHEN 'SPFLI' OR 'SBOOK'.
         TAB1-ACTIVETAB = OK_CODE.
      WHEN 'EXIT'.
        LEAVE PROGRAM.
      WHEN 'CANCEL'.
        LEAVE TO SCREEN 100.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    FORM Routine
    *&  Include           MZDS_SUBSCREENF01
    FORM DISPLAY_SPFLI_DATA.
    *SELECT CITYFROM AIRPFROM CITYTO AIRPTO FROM SPFLI
    *    INTO CORRESPONDING FIELDS OF TABLE IT_SPFLI
    *    WHERE CARRID = SPFLI-CARRID
    *    AND CONNID = SPFLI-CONNID.
    *CITY_FROM = IT_SPFLI-CITYFROM.
    *AIRP_FROM = IT_SPFLI-AIRPFROM.
    *CITY_TO = IT_SPFLI-CITYTO.
    *AIRP_TO = IT_SPFLI-AIRPTO.
    ENDFORM.
    FORM DISPLAY_SBOOK_DATA.
    *SELECT SINGLE FLDATE BOOKID CUSTOMID FROM SBOOK
    *    INTO CORRESPONDING FIELDS OF IT_SBOOK
    *    WHERE CARRID = SPFLI-CARRID
    *    AND CONNID = SPFLI-CONNID.
    ENDFORM.
    HTH
    Regards,
    Dhruv Shah

  • Regarding Hardcoding selection-screen field.

    Hi frnds,
                   I want to hardcode vbak-erdat in my selection screen , i m using loop at screen . and i m also usiing INITIALIZATION EVENT,where i am initializing vbak-erdat.
    so frnds can anyone help me in this regard.
    Thanks,
    satish

    Hi,
    Please look at the code below :
    TABLES : bsis.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETER : sp_sel radiobutton group rad USER-COMMAND radio DEFAULT 'X',
                sp_all RADIOBUTTON GROUP rad.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    SELECT-OPTIONS : so_bukrs FOR bsis-bukrs MODIF ID sp1.
    SELECT-OPTIONS : so_hkont FOR bsis-hkont MODIF ID sp2.
    SELECTION-SCREEN END OF BLOCK b2.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
      IF sp_sel = 'X'.
          IF screen-group1 = 'SP2'.
            screen-input = '0'.
            screen-invisible = '0'.
            screen-required = '0'.
            MODIFY SCREEN.
          ENDIF.
          elseif  sp_all = 'X'.
            IF screen-group1 = 'SP1'.
             screen-input = '0'.
             screen-invisible = '0'.
             screen-required = '0'.
             MODIFY SCREEN.
           ENDIF.
         endif.
        ENDLOOP.
    Thanks,
    Sriram Ponna.

  • Regarding hiding Selection screen block

    hi all ,
    i have 2 blocks in the selection screen. the First block has 4 radiobuttons and the second block has 4 parameters.
    i need to hide the block 2 based on the radiobutton checked in the initail block.
    if radiobutton 1 or 2 is selected then the block should not be visible and if the rdbtn 3 or 4 is selected the block should be visible
    i have wriiten the code but it doesn't work at all. the block is hidden but when i select the radiobtn 3 or 4 it doesn't work
    the code i hve wriiten is as follows
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: par1 RADIOBUTTON GROUP rg2 DEFAULT 'X' USER-COMMAND ucom1
    PARAMETERS: par2 RADIOBUTTON GROUP rg2 .
    PARAMETERS: par3 RADIOBUTTON GROUP rg2 .
    PARAMETERS: par4 RADIOBUTTON GROUP rg2
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-001.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETER p_pwwrk TYPE plaf-pwwrk  MODIF ID FSC.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS p_wch TYPE cr_hname MODIF ID FSC.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECT-OPTIONS s_mdv01 FOR g_mdv01 MODIF ID FSC.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK a1.
    I have declared this  after Initialization.
    AT SELECTION-SCREEN OUTPUT.
    if par3 eq 'X' or par4 eq 'X'.
    LOOP AT SCREEN.
    IF screen-group1 = 'FSC'.
    screen-active = 0.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    endif.
    can anybody please suggest.
    Thanx
    Srinivas

    Hiding Input Fields Locate the document in its SAP Library structure
    To suppress the display of the input field on the selection screen, you use the following syntax:
    PARAMETERS p ...... NO-DISPLAY ......
    Although parameter p is declared, it is not displayed on the selection screen.
    If the parameter belongs to the standard selection screen, you can assign a value to it either by using the DEFAULT addition when you declare it, or during the INITIALIZATION event. If you call the executable program using the SUBMIT statement, the calling program can also pass the value.
    When you use user-defined selection screens, you can assign a value to the parameter at any time before calling the selection screen.
    If you want to display a parameter only in certain cases, for example, depending on the values entered by the user in other input fields of the selection screen, you cannot use the NO-DISPLAY addition. If you use NO-DISPLAY, the parameter actually is an element of the interface for program calls, but not an element of the selection screen. As a result, you cannot make it visible using the MODIFY SCREEN statement.
    To hide a parameter that is an element of the selection screen, you must declare it without the NO-DISPLAY addition and suppress its display using the MODIFY SCREEN statement.
    We can Hide parameter / select option in selection screen dynamically by manipulating screen object.
    SCREEN is like an internal table with a header line. However, you do not have to declare it in your program. Go to debugging mode and then view structure of screen.
    You can modify SCREEN in your ABAP program during the PBO event of a screen. Its contents override the static attributes of the screen fields for a single screen call. The only statements that you can use with SCREEN are:
    LOOP AT SCREEN.
    MODIFY SCREEN.
    ENDLOOP.
    We can hide parameter by set screen-active to 0.
    Here is example of how to hide parameter in selection screen. Write it, and change click on radiobutton to hide parameter.
        REPORT ZAALGAL0006.
        DATA: d_ucomm LIKE sy-ucomm.
        PARAMETERS: p_grpa1(10) MODIF ID A,
        p_grpa2(5) MODIF ID A,
        p_grpb1(2) MODIF ID B.
        PARAMETERS: p_actA RADIOBUTTON GROUP rad1 USER-COMMAND ACT DEFAULT 'X',
        p_actB RADIOBUTTON GROUP rad1.
        AT SELECTION-SCREEN.
        d_ucomm = sy-ucomm.
        AT SELECTION-SCREEN OUTPUT.
        LOOP AT screen.
        IF p_actA = 'X'.
        IF screen-group1 = 'B'.
        screen-active = 0.
        ENDIF.
        ELSEIF p_actB = 'X'.
        IF screen-group1 = 'A'.
        screen-active = 0.
        ENDIF.
        ENDIF.
        MODIFY screen.
        ENDLOOP.
        START-OF-SELECTION.
    regards,
    srinivas
    <b>*reward for useful answers*</b>

Maybe you are looking for

  • Multiple BoMs for Same FG and Subcontracting Vendor

    Hello Gurus, I have a situation where client get job-work done for a finished good with multiple BoMs .... It is only decided at the time of creating PO when they decide which components/ child items to be used (Product Version). Even if the check fo

  • Display Problem in E71

    I have a Nokia E71.... I have been useing is for about one and half yr with any problem....but suddenly last week the display went off.... i am getting incoming and can make out going calls but there is no display can some one advice me what could be

  • Problem using SUM standard function  during Field Mapping

    Hi Experts , I am trying to sum all LIFMG 's in in the lineitems of a particular header and map this result to Lifmg of the header.(Idoc with multiple headers and line item).I am using SUM standard function. Rough Source structure. Header1       vbel

  • Cross Business Area posting restriction

    Dear Experts, Is it possible to restrict in Cross business area posting through configuration? I want to keep validation in cross business area posting. Sourav

  • Correct receipts for PO which is finally closed

    Hi Sir, What's the steps to correct receipts for POs having status of "Finally Closed"? I look forward to hearing from you soon. Kind regards, James