Selection screen  report  dump on "start-of-selection "event.

Hello ,
I created report with selection screen . When I run the transaction  and  hit execute F8 the program is NOT  executed at all and transaction ends up on "SAP easy access" screen.
I checked in debugger and I realized that program is  executed  until the event  "start-of-selection" on that line execution stops.
In that moment sy-ucomm = 'CRET'
Although when the program is executed from SE80 ( direct execution ) everything works well in this case sy- ucomm  is initial ( no value)
Please advice .
Krsto
at selection-screen.
  perform layout_validation .
start-of-selection.     - execution stop s on this line
  select * from zlabveri

so what did the dump (read it in trans ST22) tell you the problem is?  Read the dump and fix the error.  Forum participants have no psychic antennae nor can they remote view your dumps

Similar Messages

  • BDC on Selection Screen report

    Hi Experts,
    Is there any norm of NOT using BDC for selection screen reports? Please share your experience if someone had used it and faced issues later.
    Thanks,
    Chirantan

    Hi Chirantan ,
    I would advice you to use submit report option instead of BDC.
    First capture your selection screen parameters into a selection_table and fill it with suitable data .
    Use submit report and there you go......... report is executed.
    ALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
                EXPORTING
                  CURR_REPORT               = 'ZREPORT'
    *         IMPORTING
    *           SP                        =
                TABLES
                  SELECTION_TABLE           = LT_SELSCREEN
    *           SELECTION_TABLE_255       =
    *         EXCEPTIONS
    *           NOT_FOUND                 = 1
    *           NO_REPORT                 = 2
    *           OTHERS                    = 3
              IF SY-SUBRC <> 0.
    * Implement suitable error handling here
              ENDIF.
    * Fill LT_SELSCREEN
              LOOP AT LT_SELSCREEN INTO LW_SELSCREEN.
                CASE LW_SELSCREEN-SELNAME.
    *           WHEN OTHERS.
                ENDCASE.
              ENDLOOP.
                SUBMIT ZREPORT
                      USING SELECTION-SCREEN 1000
                WITH SELECTION-TABLE LT_SELSCREEN
                AND RETURN .
    Regards ,
    Yogendra Bhaskar

  • Call a Screen from A selection screen report

    Hi Friends,
       I developed a report (1. Excecutable) and i am calling a screen say 9000 which is having several subscreens. While i am clicking the BACK button it should come to the same selection screen report. How to do this? We can't use LEAVE SCREEN or LEAVE TO SCREEN 0. Because 9000 screen having the subscreen. If i use LEAVE PROGRAM it won't come to selection screen. Instead it will come out of program.
    Please help me.
    Thanks and regards
    Srikanth. S

    hi srikanth,
                    We can come from screen to selection screen of the report by using -- "LEAVE TO LIST PROCESSING".
    If u need some more info plz check below.
    https://www.sdn.sap.com/irj/sdn/forums
    https://www.sdn.sap.com/irj/sdn/forums
    https://www.sdn.sap.com/irj/sdn/forums
    Reward if it is usful,
    Thanks,
    Srikanth.A

  • TO display pop_up on selection screen And chosse that field in 'SELECT' sta

    Hello,
    I want a pop up on selection screen when user clicks the push button on selection screen pop up should come on selection screen and display the all field of YTLEA table. when user checks few or all field from pop up then data for that field is selected from the YTLEA table.

    DDIF_TABL_GET

  • How to add f4 help for a parameter in selection screen (Report)

    hai friends
           I am hving a pblm regarding the F4 help in selection screen for a parameter field ,currenly this parameter field is for personnel number , now in f4 help all the personnel numbers r listing ,i need to include the name of the corresponding personnel numbers along with it ,how do i do that .please give me a help.
    thankyou

    Hai
    you first extract personal number and name into one internal table say itab.
    THEN CALL THE FM.
    AT SELECTION-SCREEN ON VALUE REQUEST FOR P_PARAMETER.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD     =  P_PARAMETER
           DYNPPROG     = SY-REPID
          DYNPNR       = SY-DYNNR
          VALUE_ORG    = 'S'
          WINDOW_TITLE = 'Open Quantity'
        TABLES
          VALUE_TAB    = ITAB.

  • How to pass Selection screen values to another program's selection screen

    Hello,
    I have a requriement where in which i need to pass the selection screen values (say list of pernrs) and few others of one program to selection screen of another. 
    One option that i came across is using Submit. But am unware how to pass only the selection screen values (there wont be any data processing or filtering).  Just the values of one prgm's selection screen are to be sent to another.
    Thanks
    RK

    prog1.
    data:lt_params type table of RSPARAMS.
    data:wa like line of lt_params.
    parameters:pa1 type sy-datum.
    select-options:so1 type sy-dtaum.
    wa-SELNAME = 'PA2'.               "Seletion screen field name
    wa-KIND     = 'P'.                    "P-Parameter,S-Select-options
    wa-SIGN     = 'I'.                    "I-in
    wa-OPTION     = 'EQ'.               "EQ,BT,CP
    wa-LOW     = pa1.                    "Selection Option Low,Parameter value
    append wa to lt_params.
    loop at so1.
    wa-SELNAME = 'SO2'.               "Seletion screen field name
    wa-KIND     = 'S'.                    "P-Parameter,S-Select-options
    wa-SIGN     = 'I'.                    "I-in
    wa-OPTION     = 'EQ'.               "EQ,BT,CP
    wa-LOW     = so1-low.               "Selection Option Low,Parameter value
    wa-HIGH     = so1-high.               "Selection Option Low,Parameter value
    append wa to lt_params.
    endloop.
    CALL FUNCTION 'SUBMIT_REPORT'
      EXPORTING
        report                 = 'ZPROG2.'   "report name of ur tocde
        RET_VIA_LEAVE          = ''            "IF 'X' returns to the called program after execution
        SKIP_SELSCREEN         = 'X'       "If 'X' selection screen of called program is not displayed
    TABLES
       SELECTION_TABLE        = lt_params       "Contains values to the selection screen
    EXCEPTIONS
      JUST_VIA_VARIANT       = 1
      NO_SUBMIT_AUTH         = 2
      OTHERS                 = 3
    Prog2.
    parameters:pa2 type sy-datum.
    select-options:so2 type sy-dtaum.
    write pa2.
    skip 1.
    loop at so2.
    write:so2-low,so2-high.
    skip 1.
    endloop.
    Edited by: Keshu Thekkillam on Aug 20, 2009 3:22 PM

  • Selection screen framebox's width extension and select option position

    Hi,
    when i code the following, the select option multiple selection button falls outside the framebox. Is there any way to increase the frame's width or adjust the select option's button? Can I control the select options' distance between the text and input field, the distance between input field skstar10-low and skstar10-high, as well as the position of the word "to" (at the left of skstar10-high)?
    SELECTION-SCREEN BEGIN OF BLOCK C10_12 WITH FRAME.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (11) TEXT-042 FOR FIELD skstar10.
    SELECT-OPTIONS: skstar10 FOR cosp-kstar.
    SELECTION-SCREEN COMMENT 61(11) TEXT-043 FOR FIELD skstar11.
    SELECT-OPTIONS: skstar11 FOR cosp-kstar.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK C10_12.

    Hi,
    Try this
    SELECTION-SCREEN BEGIN OF BLOCK c10_12 WITH FRAME.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (11) text-042 FOR FIELD skstar10.
    SELECT-OPTIONS: skstar10 FOR cosp-kstar.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (11) text-043 FOR FIELD skstar11.
    SELECT-OPTIONS: skstar11 FOR cosp-kstar.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK c10_12.

  • Selection-screen - add default value to multiple selection

    Hi,
    How I can add a default value for multiple selection, on a Select-options?
    Thanks in advance,
    Brian Gonsales

    By default, selection optoins are RANGES, therefore to fill these before display, in the INITIALIZATION section
      CLEAR: so_field, so_field[].
      so_field = 'IEQvalue'. append so_field.
      so_field = 'IEQvalue2'. append so_field.
      so_field = 'IEQvalue3'. append so_field.
    If you want ranges
      CLEAR: so_field, so_field[].
      so_field = 'IBT'. so_field-low = 'lowvalue'. so_field-high = 'highvalue' append so_field.
    *  ETC
    Edited by: Paul Chapman on May 15, 2008 9:30 AM

  • Selection-screen fields validation for dialog

    Hello ABAP Gurus
    Requirements: this is a report wherein , depending upon the correct select-options , user will pick some field values from table and some will be entered by the user in the next se51 custom screen for creation of a record in a ztable .
    the problem is :without validating select-options values , it calls the se51 screen 100.
    How to keep the cursor at the selection-screen field until & unless user enters the correct i/p s .if i/p are correct then only it should call screen 100 otherwise remain in the selection screen only .
    *& Report ZSD_REP_QUOT_BANK_CREATE *
    REPORT ZSD_REP_QUOT_BANK_CREATE NO STANDARD PAGE HEADING LINE-SIZE 255.
    TABLES: VBAK,VBAP,VBRK,ZSD_TABL_QOTBANK,MARA,KONV.
    DATA: OK_CODE LIKE SY-UCOMM,
    SAVE_OK_CODE LIKE SY-UCOMM,
    WA_ITAB LIKE ZSD_TABL_QOTBANK,
    ANSWER TYPE C,
    COPIED ,
    STS TYPE N,
    EMGRP LIKE MARA-EXTWG,
    QTY LIKE ZSD_TABL_QOTBANK-QTY,
    UPRICE LIKE ZSD_TABL_QOTBANK-UPRICE,
    TOT LIKE ZSD_TABL_QOTBANK-TOT,
    INO LIKE VBAP-POSNR.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS: S_QTNO FOR ZSD_TABL_QOTBANK-QTNO
    NO INTERVALS NO-EXTENSION OBLIGATORY,
    S_ITNO FOR ZSD_TABL_QOTBANK-ITNO
    NO INTERVALS NO-EXTENSION OBLIGATORY.
    S_MATNO FOR ZSD_TABL_QOTBANK-MATNO
    NO INTERVALS NO-EXTENSION. "
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN.
    SELECT SINGLE VBTYP
    INTO VBAK-VBTYP
    FROM VBAK
    WHERE VBELN IN S_QTNO.
    IF SY-SUBRC EQ 0 AND VBAK-VBTYP NE 'B'.
    MESSAGE I005(ZQOTBANK).
    SET CURSOR FIELD S_QTNO-LOW.
    SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
    ENDIF.
    CLEAR WA_ITAB.
    SELECT SINGLE QTNO ITNO
    INTO WA_ITAB
    FROM ZSD_TABL_QOTBANK
    WHERE QTNO IN S_QTNO
    AND ITNO IN S_ITNO.
    IF SY-SUBRC EQ 0.
    MESSAGE I001(ZQOTBANK).
    SET CURSOR FIELD S_QTNO-LOW.
    SET CURSOR FIELD S_ITNO-LOW.
    SUBMIT (SY-REPID) VIA SELECTION-SCREEN.
    ENDIF.
    *START-OF-SELECTION.
    END-OF-SELECTION.
    CALL SCREEN 0100.
    *& Module STATUS_0100 OUTPUT
    text
    MODULE STATUS_0100 OUTPUT.
    SET PF-STATUS '0100'.
    SET TITLEBAR '0100'.
    ZSD_TABL_QOTBANK-QTNO = S_QTNO-LOW.
    SELECT SINGLE BUKRS_VF VKORG VTWEG SPART KUNNR ERDAT BNDDT
    KNUMV
    INTO (ZSD_TABL_QOTBANK-CCODE,
    ZSD_TABL_QOTBANK-SORG,
    ZSD_TABL_QOTBANK-DISTCHAN,
    ZSD_TABL_QOTBANK-DIV,
    ZSD_TABL_QOTBANK-CUSTNO,
    ZSD_TABL_QOTBANK-QTDAT,
    ZSD_TABL_QOTBANK-QTVALDAT,
    VBAK-KNUMV)
    FROM VBAK
    WHERE VBELN IN S_QTNO
    AND VBTYP = 'B'.
    IF SY-SUBRC EQ 0.
    SELECT SINGLE KWMENG POSNR MATNR
    INTO (QTY , INO , ZSD_TABL_QOTBANK-MATNO)
    FROM VBAP
    WHERE VBELN IN S_QTNO.
    SELECT SINGLE EXTWG
    INTO EMGRP
    FROM MARA
    WHERE MATNR EQ ZSD_TABL_QOTBANK-MATNO.
    ZSD_TABL_QOTBANK-ITNO = INO.
    ZSD_TABL_QOTBANK-EMATGRP = EMGRP.
    ZSD_TABL_QOTBANK-QTY = QTY.
    SELECT SINGLE KBETR
    INTO UPRICE
    FROM KONV
    WHERE KNUMV = VBAK-KNUMV
    AND KPOSN = INO
    AND KSCHL = 'PR00'.
    ENDIF.
    ZSD_TABL_QOTBANK-UPRICE = UPRICE.
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-CGL_QTY.
    UPRICE = ZSD_TABL_QOTBANK-CGL_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-CGL_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-BHEL_QTY.
    UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-BHEL_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-BHEL_QTY.
    UPRICE = ZSD_TABL_QOTBANK-BHEL_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-BHEL_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-ALSTOM_QTY.
    UPRICE = ZSD_TABL_QOTBANK-ALSTOM_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-ALSTOM_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-SIEMENS_QTY.
    UPRICE = ZSD_TABL_QOTBANK-SIEMENS_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-SIEMENS_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-TELK_QTY.
    UPRICE = ZSD_TABL_QOTBANK-TELK_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-TELK_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    QTY = ZSD_TABL_QOTBANK-OTH_QTY.
    UPRICE = ZSD_TABL_QOTBANK-OTH_UPRICE .
    TOT = QTY * UPRICE .
    ZSD_TABL_QOTBANK-OTH_TOT = TOT .
    CLEAR: QTY, UPRICE, TOT.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE USER_COMMAND_0100 INPUT.
    CASE OK_CODE.
    WHEN 'SAVE'.
    INSERT ZSD_TABL_QOTBANK.
    IF SY-SUBRC EQ 0.
    MESSAGE I000(ZQOTBANK).
    COMMIT WORK.
    CALL SELECTION-SCREEN 1000.
    ELSE.
    MESSAGE E001(ZQOTBANK).
    CALL SELECTION-SCREEN 1000.
    ENDIF.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Module EXIT_COMMAND INPUT
    text
    MODULE EXIT_COMAND INPUT.
    SAVE_OK_CODE = OK_CODE.
    CLEAR OK_CODE.
    CASE SAVE_OK_CODE.
    WHEN 'CANCEL'.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
    TITLEBAR = 'Quotation Bank Entry'
    TEXT_QUESTION = 'Do you want to Cancel ?'
    TEXT_BUTTON_1 = 'Yes'
    TEXT_BUTTON_2 = 'No'
    DEFAULT_BUTTON = '2'
    IMPORTING
    ANSWER = ANSWER.
    IF ANSWER = '1'.
    LEAVE PROGRAM.
    ELSE.
    CALL SELECTION-SCREEN 1000.
    ENDIF.
    WHEN 'EXIT'.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
    TITLEBAR = 'Quotation Bank Entry'
    TEXT_QUESTION = 'Do you want to Exit ?'
    TEXT_BUTTON_1 = 'Yes'
    TEXT_BUTTON_2 = 'No'
    DEFAULT_BUTTON = '2'
    IMPORTING
    ANSWER = ANSWER.
    IF ANSWER = '1'.
    LEAVE PROGRAM.
    ELSE.
    CALL SELECTION-SCREEN 1000.
    ENDIF.
    ENDCASE.
    ENDMODULE. " EXIT_COMMAND INPUT
    Thnx in Advance

    Put the statement
    CALL SCREEN 100
    in the event <b>AT SELECTION-SCREEN</b> and NOT in <b>END-OF-SELECTION</b>.
    Regards,
    Subramanian V.

  • Selection screen and DP

    Hi friends
              Can any one tell me which event triggers first and the order of event triggering when both selection screen and dialog program is used..Also tell me which event  wont fire.
    Regards
    Suresh.A

    Here is the Sequence.
    1. First Load-of-Program event is triggred by default when you execute any report.
    2. Inisilization.
    3. At-selection Screen output.
    4. At selection Screen.
    5. Start-of-selection.
    6. end-of-selection.
    if you are calling screen in your report you will be doing so in Start-of-selection
    then after start-of-selection.
                  Process before output
                  Process after input
                 (if you add POH, and POV, these event will trigger when you press F1 or F4)
                  End-of-selection.
    Thanks & regards

  • Error when generating the selection screen "1000"  for Report ztest

    Hi Experts,
    I am getting this strange error while trying to activate my report. I simply copy paste report from my other system to new system it was working fine there. I also created all include program etc.
    While I am trying to create "Selection-text" it is giving message that "Program contain some serious syntax error" while checking syntax saying that "Program is syntactically right".
    Any idea how to solve this???
    Regards,
    Gourav

    Here is the code::::
    SELECTION-SCREEN BEGIN OF BLOCK select  WITH FRAME TITLE text-sl1.
    Component
    SELECT-OPTIONS:
           s_xcide            FOR gw_zsmmess_compo-xcide
                              NO INTERVALS
                              MATCHCODE OBJECT zsm_xcide_oi.
    SELECTION-SCREEN END OF BLOCK select.
    SELECTION-SCREEN BEGIN OF BLOCK prcopt  WITH FRAME TITLE text-sl2.
    Default severity code
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(30) text-dsc.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: p_dfsevc   LIKE gw_zsmglob_sever-sevco
                           OBLIGATORY
                           MATCHCODE OBJECT zsm_sevco
                           DEFAULT '3'.
    SELECTION-SCREEN COMMENT 37(30) pt_sevtx.
    SELECTION-SCREEN END OF LINE.
    Minutes to wait before re-issuing alert
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(30) text-ria.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: p_aleexp(3) TYPE n
                            OBLIGATORY
                            DEFAULT '45'.
    SELECTION-SCREEN COMMENT 37(10) text-min.
    SELECTION-SCREEN END OF LINE.
    Use component specific parameters Yes/No
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(30) text-cpu.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: p_usecsp   RADIOBUTTON GROUP rg1  DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 35(10) text-rby    FOR FIELD p_usecsp.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: p_dnucsp   RADIOBUTTON GROUP rg1.
    SELECTION-SCREEN COMMENT 35(10) text-rbn    FOR FIELD p_dnucsp.
    SELECTION-SCREEN END OF LINE.
    Create/update component specific parameters automatically
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(32) text-cpc.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: p_updcsp   RADIOBUTTON GROUP rg2.
    SELECTION-SCREEN COMMENT 35(10) text-rby    FOR FIELD p_updcsp.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 33.
    PARAMETERS: p_dnccsp   RADIOBUTTON GROUP rg2  DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 35(10) text-rbn    FOR FIELD p_dnccsp.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(30) text-afo.
    SELECTION-SCREEN POSITION 33.
    Fire one alert per component/error type combination
    PARAMETERS: p_afrerr   RADIOBUTTON GROUP rg3  DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 35(50) text-afe    FOR FIELD p_afrerr.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 33.
    Fire one alert per component (= outbound XI interface)
    PARAMETERS: p_afrcom   RADIOBUTTON GROUP rg3.
    SELECTION-SCREEN COMMENT 35(50) text-afc    FOR FIELD p_afrcom.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 33.
    Fire one alert per run
    PARAMETERS: p_afrrun   RADIOBUTTON GROUP rg3.
    SELECTION-SCREEN COMMENT 35(50) text-afr    FOR FIELD p_afrrun.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(30) text-sel.
    SELECTION-SCREEN POSITION 33.
    Select messages since last run
    PARAMETERS: p_lstrun   RADIOBUTTON GROUP rg4  DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 35(40) text-slr    FOR FIELD p_lstrun.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 33.
    Select messages in selected interval
    PARAMETERS: p_mintvl   RADIOBUTTON GROUP rg4.
    SELECTION-SCREEN COMMENT 35(40) text-sin    FOR FIELD p_mintvl.
    SELECTION-SCREEN END OF LINE.
    Message selection interval
    SELECTION-SCREEN BEGIN OF BLOCK msgfilt WITH FRAME TITLE text-msf.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(10) text-icr.
    SELECTION-SCREEN COMMENT 14(05) text-ifr.
    SELECTION-SCREEN COMMENT 25(05) text-dat       FOR FIELD p_stadat.
    Select messages - start date
    PARAMETERS: p_stadat   TYPE d.
    SELECTION-SCREEN COMMENT 46(05) text-tim       FOR FIELD p_statim.
    Select messages - start time
    PARAMETERS: p_statim   TYPE t.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 14(05) text-ito.
    SELECTION-SCREEN COMMENT 25(05) text-dat       FOR FIELD p_enddat.
    Select messages - end date
    PARAMETERS: p_enddat   TYPE d                  DEFAULT sy-datum.
    SELECTION-SCREEN COMMENT 46(05) text-tim       FOR FIELD p_endtim.
    Select messages - end time
    PARAMETERS: p_endtim   TYPE t                  DEFAULT sy-timlo.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK msgfilt.
    SELECTION-SCREEN END OF BLOCK prcopt.
    SELECTION-SCREEN BEGIN OF BLOCK testopt WITH FRAME TITLE text-tso.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT  1(10) text-tst.
    SELECTION-SCREEN POSITION 33.
    List only, no updates
    PARAMETERS: p_lstonl    RADIOBUTTON GROUP rg5  DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 35(14) text-tsl       FOR FIELD p_lstonl.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 33.
    Execute updates
    PARAMETERS: p_update    RADIOBUTTON GROUP rg5.
    SELECTION-SCREEN COMMENT 35(14) text-tsu       FOR FIELD p_update.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK testopt.
    *eject
    INITIALIZATION.

  • Two selection screen problem in one report

    i have a two selection screens 1000 & 2000 in single report , which needs to be executed one after the other ,
    the problem is when i execute second selection screen(2000) , the cursor is going back to at-selection-screen once again.
    but i need to trigger start-of-selection directly after executing second selection screen,
    the first selection screen 1000 will be executed with the help of select options..
    the sample code is below .
    at-selection-screen.
        perform validations.
       call selection screen 2000.
        at selection screen on value request p_adm
    start-of-selection.
       main logic

    Moderator message - Cross post locked
    Rob

  • Choose fields option in Selection Screen of report program.

    Hi Experts,
          Actually In my requirement , the user wants to display the output fields in ALV Grid and also in Block ALV format.They need 10 fields to be displayed by default and the additional fields has to be displayed based on the choose fields option
    ( i.e like SE11 choose fields option ) provided in the selection screen of this report program.So based on this the output has to be displayed.
    Pls suggest ur ideas.....
    Thanks in advance.
    Regards,
    Srinivas.

    Hi ,
    The following code will be helpful for your requirement...
    REPORT  ypm_hist_dyn.
    *              T Y P E - P O O L S                *
    TYPE-POOLS: slis.
    *                   T Y P E S                     *
    TYPES :   BEGIN OF t_equz,
                datbi TYPE datbi,     " Valid To Date
                equnr TYPE equnr,     " Equipment Number
                erdat TYPE erdat,     " Date on Which Record Was Created
                aedat TYPE aedat,    " Changed On
                iloan TYPE iloan,     " Location and account assignment for technical object
                gewrk TYPE lgwid,     " Object ID of the Work Center
                ingrp TYPE ingrp,      " Planner Group for Customer Service and Plant Maintenance
             END OF t_equz,
               BEGIN OF t_equz1,
                 datbi TYPE datbi,     " Valid To Date
                 equnr TYPE equnr,     " Equipment Number
                 erdat TYPE erdat,     " Date on Which Record Was Created
                 aedat TYPE aedat,    " Changed On
              END OF t_equz1,
              BEGIN OF t_iloa,
                iloan TYPE iloan,   "Location and account assignment for technical object
                tplnr TYPE tplnr,    " Functional Location
                msgrp TYPE raumnr,  " Room
             END OF t_iloa,
             BEGIN OF t_iflotx,
               tplnr TYPE tplnr,   "Functional Location
               pltxt TYPE pltxt,  " Description of functional location
             END OF t_iflotx,
            BEGIN OF t_equi,
              equnr TYPE equnr,   " Equipment Number
              eqart TYPE eqart,   "Type of Technical Object
           END OF t_equi,
           BEGIN OF t_crhd,
              objid TYPE cr_objid,  "Object ID of the resource
              arbpl TYPE arbpl,     "Work center
          END OF t_crhd,
              BEGIN OF t_eqkt,
              equnr TYPE equnr,    "Equipment Number
              eqktx TYPE ktx01,    "Description of technical object
              END OF t_eqkt,
              BEGIN OF t_t370k_t,
              eqart TYPE eqart,  "Type of Technical Object
              eartx TYPE eartx,  "Text for Object Type
              END OF t_t370k_t,
              BEGIN OF t_t024i,
              ingrp TYPE ingrp,  "Planner Group for Customer Service and Plant Maintenance
              innam TYPE innam,  "Name of the Maintenance Planner Group
              END OF t_t024i,
              BEGIN OF t_viqmel,
              equnr TYPE equnr,  "Equipment Number
              qmnum TYPE qmnum,  "Notification No
              qmdat TYPE qmdat,  "Date of Notification
              bequi TYPE bequi,  "Equipment Affected
              iloan TYPE iloan,  "Location and account assignment for technical object
              END OF t_viqmel,
              BEGIN OF t_final,
               equnr TYPE equz-equnr,
               eqktx TYPE eqkt-eqktx,
               tplnr TYPE iloa-tplnr,
               pltxt TYPE iflotx-pltxt,
               iloan TYPE iloan,
               datbi TYPE equz-datbi,
               ingrp TYPE t024i-ingrp,
               erdat TYPE equz-erdat,
               enddt1 TYPE char10,
               aedat TYPE equz-aedat,
               innam TYPE t024i-innam,
               equart TYPE equi-eqart,
               eartx TYPE t370k_t-eartx,
              qmnum TYPE viqmel-qmnum,
              arbpl TYPE crhd-arbpl,
              msgrp TYPE iloa-msgrp,
              dat_diff TYPE char10,
              END OF t_final,
              BEGIN OF t_final1,
               equnr TYPE equz-equnr,
               eqktx TYPE eqkt-eqktx,
               tplnr TYPE iloa-tplnr,
               pltxt TYPE iflotx-pltxt,
              END OF t_final1.
    DATA:   it_equz TYPE STANDARD TABLE OF t_equz,
            it_iloa TYPE STANDARD TABLE OF t_iloa,
            it_iflotx TYPE STANDARD TABLE OF t_iflotx,
            it_equi TYPE STANDARD TABLE OF t_equi,
            it_crhd TYPE STANDARD TABLE OF t_crhd,
            it_eqkt TYPE STANDARD TABLE OF t_eqkt,
            it_t370k_t TYPE STANDARD TABLE OF t_t370k_t,
            it_t024i TYPE STANDARD TABLE OF  t_t024i,
            it_viqmel TYPE STANDARD TABLE OF  t_viqmel,
            it_final TYPE STANDARD TABLE OF t_final,
            it_final1 TYPE STANDARD TABLE OF t_final1,
            it_equz1 TYPE STANDARD TABLE OF t_equz1.
    DATA:   wa_equz TYPE  t_equz,
           wa_iloa TYPE t_iloa,
           wa_iflotx TYPE  t_iflotx,
           wa_equi TYPE  t_equi,
           wa_crhd TYPE t_crhd,
           wa_eqkt TYPE t_eqkt,
           wa_t370k_t TYPE  t_t370k_t,
           wa_t024i TYPE  t_t024i,
           wa_viqmel TYPE t_viqmel,
           wa_final TYPE t_final,
           wa_final1 TYPE t_final1,
           wa_equz1 TYPE t_equz.
    DATA: t_equnr TYPE equz-equnr,          "EQUZ-EQUNR
          t_tplnr TYPE iloa-tplnr,          "Functional Location
          t_datbi TYPE equz-datbi,          "Date
          t_ingrp TYPE equz-ingrp,          "Planner Group
          t_eqart TYPE equi-eqart,          "Technical Object
          w_diff TYPE p,
          w_time TYPE t.
    *            ALV DATA DECLARATION                 *
    * Field Catalog
    TYPES:  BEGIN OF t_fldnam,
              fld TYPE fieldname,
              desc TYPE char30,
            END OF t_fldnam.
    DATA:   is_layout TYPE slis_layout_alv,
            it_fieldcat TYPE slis_t_fieldcat_alv,
            is_fieldcat TYPE slis_fieldcat_alv,
            it_fldnam TYPE STANDARD TABLE OF t_fldnam,
            wa_fldnam TYPE t_fldnam,
            it_sort TYPE STANDARD TABLE OF slis_t_sortinfo_alv,
            wa_sort LIKE LINE OF it_sort.
    DATA:   i_events   TYPE slis_t_event,
            ls_line TYPE slis_listheader,
            gt_list_top_of_page TYPE slis_t_listheader,  "FOR TOP OF PAGE
            gt_list_end_of_page TYPE slis_t_listheader.  "FOR END OF PAGE
    DATA : formname_top_of_page TYPE slis_formname VALUE
                                                  'GENERATE_TOP_OF_PAGE',
           formname_end_of_page TYPE slis_formname VALUE
                                                  'GENERATE_END_OF_PAGE',
           formname_user_command TYPE slis_formname VALUE 'USER_COMMAND'.
    *                C O N S T A N T S                *
    *CONSTANTS: c_top         TYPE slis_formname VALUE 'TOP_OF_PAGE',
    *           c_final(40)   TYPE c VALUE 'IT_FINAL',
    *           c_detail(15)  TYPE c VALUE 'IT_FINAL1'.
    DATA :      g_save(1) TYPE c,
          g_exit(1) TYPE c,
          g_variant LIKE disvariant,
          gx_variant LIKE disvariant.
    *        S E L E C T I O N   S C R E E N          *
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_equnr FOR t_equnr,
                    s_tplnr FOR   t_tplnr,
                    s_datbi FOR  t_datbi ,
                    s_ingrp FOR t_ingrp,
                    s_eqart FOR t_eqart.
    SELECTION-SCREEN: END OF BLOCK b1.
    SELECTION-SCREEN  :  BEGIN OF BLOCK blk2 WITH FRAME TITLE text-002.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 3(16) text-007.
    SELECTION-SCREEN POSITION 22.
    PARAMETERS        :  11_flds RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND g1.
    SELECTION-SCREEN COMMENT 39(13) text-009.
    SELECTION-SCREEN POSITION 54.
    PARAMETERS        :  6_flds RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN  :  END OF BLOCK blk2.
    SELECTION-SCREEN:BEGIN OF BLOCK b2 WITH FRAME TITLE text-003.
    PARAMETERS:     alv_list RADIOBUTTON GROUP gp1 DEFAULT 'X'.
    PARAMETERS:  alv_grid RADIOBUTTON GROUP gp1.
    SELECTION-SCREEN:END OF BLOCK b2.
    SELECTION-SCREEN: BEGIN OF BLOCK b3 WITH FRAME TITLE text-005.
    PARAMETERS  : p_vari LIKE disvariant-variant.
    SELECTION-SCREEN: END OF BLOCK b3.
    AT SELECTION-SCREEN.
      PERFORM date_range.
      IF s_datbi[] IS INITIAL.
        MESSAGE e398(00) WITH 'ENTER A VALUE FOR DATE'(012).
      ENDIF.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
      PERFORM f4_for_variant.
    START-OF-SELECTION.
      IF 11_flds EQ 'X'.
        PERFORM fill_equz.
        PERFORM fill_iloa.
        PERFORM fill_iflotx.
        PERFORM fill_equi.
        PERFORM fill_t370k_t.
        PERFORM fill_t024i.
        PERFORM fill_crhd.
        PERFORM fill_eqkt.
        PERFORM fill_viqmel.
      ELSE.
        PERFORM fill_equz.
        PERFORM fill_iloa.
        PERFORM fill_iflotx.
        PERFORM haha_final.
        PERFORM dyn_tab.
      ENDIF.
      PERFORM fill_final.
      PERFORM get_day_diff.
    *                      END-OF-SELECTION                                *
    END-OF-SELECTION.
    *Display Output in ALV Format
    *  PERFORM populate_layout.
      PERFORM populate_fcat.
      PERFORM populate_events .
    *  PERFORM gen_top.
      PERFORM display_alv .
    *&      Form  FILL_EQUZ
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM fill_equz .
      IF s_datbi-high IS INITIAL.
        s_datbi-high = '99990701'.
      ENDIF.
    *  IF s_datbi-LOW IS INITIAL.
    *    s_datbi-LOW = '20071201'.
    *  ENDIF.
        SELECT datbi
                equnr
                erdat
                aedat
                iloan
                gewrk
                ingrp
                FROM equz
            INTO CORRESPONDING FIELDS OF TABLE  it_equz
    *      WHERE datbi IN s_datbi AND equnr IN s_equnr.
            WHERE equnr IN s_equnr
             AND  ingrp IN s_ingrp
             AND  datbi LE s_datbi-high
            AND  datbi GE s_datbi-low.
    ENDFORM.                    " FILL_EQUZ
    *&      Form  FILL_ILOA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM fill_iloa .
      SELECT iloan
              tplnr
              msgrp
             INTO CORRESPONDING FIELDS OF TABLE it_iloa
              FROM iloa
              FOR ALL ENTRIES IN it_equz
              WHERE iloan = it_equz-iloan.
    ENDFORM.                    " FILL_ILOA
    *&      Form  FILL_IFLOTX
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM fill_iflotx .
      SELECT tplnr
              pltxt
              INTO CORRESPONDING FIELDS OF TABLE it_iflotx
              FROM iflotx
              FOR ALL ENTRIES IN it_iloa
              WHERE tplnr = it_iloa-tplnr.
    ENDFORM.                    " FILL_IFLOTX
    *&      Form  FILL_EQUI
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM fill_equi .
      SELECT equnr
            eqart
            INTO CORRESPONDING FIELDS OF TABLE  it_equi
            FROM equi
            FOR ALL ENTRIES IN it_equz
            WHERE equnr = it_equz-equnr.
    ENDFORM.                    " FILL_EQUI
    *&      Form  FILL_T370K_T
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM fill_t370k_t .
      SELECT eqart
            eartx
            INTO CORRESPONDING FIELDS OF TABLE it_t370k_t
            FROM t370k_t
            FOR ALL ENTRIES IN it_equi
            WHERE eqart = it_equi-eqart.
    ENDFORM.                    " FILL_T370K_T
    *&      Form  FILL_T024I
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM fill_t024i .
      SELECT ingrp
              innam
              INTO CORRESPONDING FIELDS OF TABLE it_t024i
              FROM t024i
              FOR ALL ENTRIES IN it_equz
              WHERE ingrp = it_equz-ingrp.
    ENDFORM.                    " FILL_T024I
    *&      Form  FILL_CRHD
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM fill_crhd .
      SELECT objid
              arbpl
              INTO CORRESPONDING FIELDS OF TABLE it_crhd
              FROM crhd
              FOR ALL ENTRIES IN it_equz
              WHERE objid = it_equz-gewrk.
    ENDFORM.                    " FILL_CRHD
    *&      Form  FILL_EQKT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM fill_eqkt .
      SELECT equnr
             eqktx
             INTO CORRESPONDING FIELDS OF TABLE it_eqkt
             FROM eqkt
             FOR ALL ENTRIES IN it_equz
             WHERE equnr = it_equz-equnr.
    ENDFORM.                    " FILL_EQKT
    *&      Form  FILL_VIQMEL
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM fill_viqmel .
    ENDFORM.                    " FILL_VIQMEL
    *&      Form  SHW_DATA
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM shw_data .
      LOOP AT it_final1 INTO wa_final1.
        WRITE : wa_final1-equnr , wa_final1-eqktx , wa_final1-tplnr , wa_final1-pltxt.
        CLEAR wa_final1.
      ENDLOOP.
    ENDFORM.                    " SHW_DATA
    *&      Form  POPULATE_LAYOUT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    *FORM populate_layout .
    *  is_layout-zebra = 'X'.
    *  is_layout-colwidth_optimize = 'X'.
    *  APPEND is_layout.
    *ENDFORM.                    " POPULATE_LAYOUT
    *&      Form  POPULATE_FCAT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM populate_fcat .
      IF 11_flds EQ 'X'.
        APPEND 'EQUNR                         EQUIP NUMBER         ' TO it_fldnam.
        APPEND 'EQKTX                         DESC OF EQUIP        '  TO it_fldnam.
        APPEND 'ERDAT                         START DATE           ' TO it_fldnam.
        APPEND 'DATBI                         END DATE             ' TO it_fldnam.
        APPEND 'AEDAT                         CHND ON              '  TO it_fldnam.
        APPEND 'ILOAN                         LOC ON ACCOUNT       '  TO it_fldnam.
        APPEND 'TPLNR                         FUNC LOC             '  TO it_fldnam.
        APPEND 'PLTXT                         DESC FUNC LOC        '  TO it_fldnam.
        APPEND 'INGRP                         PLANNER GRP          '  TO it_fldnam.
        APPEND 'INNAM                         MAINT PLN GRP        '  TO it_fldnam.
        APPEND 'DAT_DIFF                      DATE DIFF            '  TO it_fldnam.
      ENDIF.
      IF 6_flds EQ 'X'.
        APPEND 'TPLNR                         FUNC LOCATION        ' TO it_fldnam.
        APPEND 'PLTXT                         DESC OF FUC LOC      ' TO it_fldnam.
        APPEND 'DATBI                         END DATE             ' TO it_fldnam.
        APPEND 'EQUNR                         EQUIP NUMBER         ' TO it_fldnam.
        APPEND 'ERDAT                         START DATE           ' TO it_fldnam.
        APPEND 'AEDAT                         CHND ON              '  TO it_fldnam.
      ENDIF.
    ENDFORM.                    " POPULATE_FCAT
    *&      Form  DISPLAY_ALV
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM display_alv .
    *--------------------------------------------------Preparing the Layout*
      is_layout-colwidth_optimize = 'X'.
      is_layout-zebra = 'X'.
    *-------------------------------------------Preparing the Field Catalog*
        BREAK-POINT.
      LOOP AT it_fldnam INTO wa_fldnam.
        is_fieldcat-tabname       = 'IT_FINAL'.
        is_fieldcat-fieldname     = wa_fldnam-fld.
        is_fieldcat-seltext_l     = wa_fldnam-desc.
        is_fieldcat-col_pos       = sy-tabix.
        IF wa_fldnam-fld = 'EQKTX'.
          is_fieldcat-lowercase       = ' '.
        ENDIF.
        APPEND is_fieldcat TO it_fieldcat.
        CLEAR : is_fieldcat, wa_fldnam.
      ENDLOOP.
    *-------------------------------------------------------Calling Display*
      IF alv_list = 'X'.
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            i_callback_program = sy-repid
            is_layout          = is_layout
            it_fieldcat        = it_fieldcat
            it_events          = i_events[]
            i_default          = 'X'
          TABLES
            t_outtab           = it_final
          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.
      ELSE.
    *    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    *      EXPORTING
    *        i_callback_program     = sy-repid
    *        i_callback_top_of_page = 'GEN_TOP'
    *        is_layout              = is_layout
    *        it_fieldcat            = it_fieldcat
    *        it_events              = i_events[]
    *        i_save                 = g_save
    *        is_variant             = g_variant
    *        i_default              = 'A'
    *      TABLES
    *        t_outtab               = it_final
    *      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.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
           i_callback_program                = sy-repid
    *   I_CALLBACK_PF_STATUS_SET          = ' '
    *   I_CALLBACK_USER_COMMAND           = ' '
           i_callback_top_of_page            = 'GEN_TOP'
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
    *   I_STRUCTURE_NAME                  =
    *   I_BACKGROUND_ID                   = ' '
    *   I_GRID_TITLE                      =
    *   I_GRID_SETTINGS                   =
           is_layout                         = is_layout
           it_fieldcat                       = it_fieldcat
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
    *   IT_SORT                           =
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
    *   I_DEFAULT                         = 'X'
           i_save                            = 'A'
    *   IS_VARIANT                        = g_variant
    *   IT_EVENTS                         = i_events[]
    *   IT_EVENT_EXIT                     =
    *   IS_PRINT                          =
    *   IS_REPREP_ID                      =
    *   I_SCREEN_START_COLUMN             = 20
    *   I_SCREEN_START_LINE               = 30
    *   I_SCREEN_END_COLUMN               = 100
    *   I_SCREEN_END_LINE                 = 40
    *   I_HTML_HEIGHT_TOP                 = 0
    *   I_HTML_HEIGHT_END                 = 0
    *   IT_ALV_GRAPHICS                   =
    *   IT_HYPERLINK                      =
    *   IT_ADD_FIELDCAT                   =
    *   IT_EXCEPT_QINFO                   =
    *   IR_SALV_FULLSCREEN_ADAPTER        =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
          TABLES
            t_outtab                          = it_final
         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.
      ENDIF.
    ENDFORM.                    " DISPLAY_ALV
    *&      Form  GET_DAY_DIFF
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM get_day_diff .
      w_time = '00:00:00'.
      FIELD-SYMBOLS: <deb> LIKE LINE OF it_final.
      LOOP AT it_final ASSIGNING <deb>.
        CALL FUNCTION 'SD_DATETIME_DIFFERENCE'
          EXPORTING
            date1                  = <deb>-datbi
            time1                  = w_time
            date2                  = <deb>-erdat
            time2                  = w_time
         IMPORTING
           datediff               = w_diff
    *   TIMEDIFF               =
    *   EARLIEST               =
    * EXCEPTIONS
    *   INVALID_DATETIME       = 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.
        ELSEIF sy-subrc = 0.
          <deb>-dat_diff = w_diff.
    *      MODIFY it_final FROM WA_FINAL TRANSPORTING dat_diff.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " GET_DAY_DIFF
    *&      Form  HAHA_FINAL
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM haha_final .
    *  FIELD-SYMBOLS: <deb> LIKE LINE OF it_final.
      LOOP AT it_iflotx INTO wa_iflotx.
    *    wa_final1-equnr = wa_iflotx-equnr.
    *    wa_final1-eqktx = wa_iflotx-eqktx.
        wa_final1-tplnr = wa_iflotx-tplnr.
        wa_final1-pltxt = wa_iflotx-pltxt.
        APPEND wa_final1 TO it_final1.
      ENDLOOP.
    ENDFORM.                    " HAHA_FINAL
    *&      Form  DYN_TAB
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM dyn_tab .
      LOOP AT it_equz INTO wa_equz.
        wa_equz1-datbi = wa_equz-datbi.
        wa_equz1-equnr = wa_equz-equnr.
        wa_equz1-erdat = wa_equz-erdat.
        wa_equz1-aedat = wa_equz-aedat.
        APPEND wa_equz1 TO it_equz1.
      ENDLOOP.
    ENDFORM.                    " DYN_TAB
    *&      Form  FILL_FINAL1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM fill_final.
      IF 11_flds EQ 'X'.
        FIELD-SYMBOLS: <deb> LIKE LINE OF it_equz,
                     <deb1> LIKE LINE OF it_final.
        CLEAR wa_equz.
        REFRESH : it_final[].
        LOOP AT it_equz ASSIGNING <deb>.
          wa_final-equnr = <deb>-equnr.
          wa_final-datbi = <deb>-datbi.
          wa_final-erdat = <deb>-erdat.
          wa_final-aedat = <deb>-aedat.
          wa_final-iloan = <deb>-iloan.
          wa_final-ingrp = <deb>-ingrp.
          APPEND wa_final TO it_final.
          CLEAR wa_final.
        ENDLOOP.
        LOOP AT it_final ASSIGNING <deb1>.
          READ TABLE it_iloa INTO wa_iloa WITH KEY iloan = <deb1>-iloan.
          <deb1>-tplnr = wa_iloa-tplnr.
        ENDLOOP.
        LOOP AT it_final ASSIGNING <deb1>.
          READ TABLE it_iflotx INTO wa_iflotx WITH KEY tplnr = <deb1>-tplnr.
          <deb1>-pltxt = wa_iflotx-pltxt.
        ENDLOOP.
        LOOP AT it_final ASSIGNING <deb1>.
          READ TABLE it_eqkt INTO wa_eqkt WITH KEY equnr = <deb1>-equnr.
          <deb1>-eqktx = wa_eqkt-eqktx.
        ENDLOOP.
        LOOP AT it_final ASSIGNING <deb1>.
          READ TABLE it_t024i INTO wa_t024i WITH KEY ingrp = <deb1>-ingrp.
          <deb1>-innam = wa_t024i-innam.
        ENDLOOP.
      ELSE.
        REFRESH : it_final[].
        LOOP AT it_equz INTO wa_equz.
          wa_final-datbi = wa_equz-datbi.
          wa_final-equnr = wa_equz-equnr.
          wa_final-erdat = wa_equz-erdat.
          wa_final-aedat = wa_equz-aedat.
          wa_final-iloan = wa_equz-iloan.
          APPEND wa_final TO it_final.
          CLEAR wa_final.
        ENDLOOP.
        FIELD-SYMBOLS: <deb2> LIKE LINE OF it_final.
        LOOP AT it_final ASSIGNING <deb2>.
          READ TABLE it_iloa INTO wa_iloa WITH KEY iloan = <deb2>-iloan.
          <deb2>-tplnr = wa_iloa-tplnr.
        ENDLOOP.
        LOOP AT it_final ASSIGNING <deb2>.
          READ TABLE it_iflotx INTO wa_iflotx WITH KEY tplnr = <deb2>-tplnr.
          <deb2>-pltxt = wa_iflotx-pltxt.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " FILL_FINAL
    *&      Form  DATE_RANGE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM date_range .
      DATA :l_dat TYPE i.
      IF s_datbi-high IS NOT INITIAL.
        CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
          EXPORTING
            i_datum_bis             = s_datbi-high
            i_datum_von             = s_datbi-low
          IMPORTING
            e_tage                  = l_dat
          EXCEPTIONS
            days_method_not_defined = 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.
        IF l_dat GT '31'.
          MESSAGE e398(00) WITH 'Split Your Planning for a range of 31 Days'(012).
          LEAVE LIST-PROCESSING.
        ENDIF.
      ENDIF.
    ENDFORM.                    " DATE_RANGE
    *&      Form  GEN_TOP
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM gen_top .
      DATA: info(60),
            w_dt TYPE d.
      CLEAR ls_line.
      ls_line-typ = 'H'.
      ls_line-info = 'ALV DISPLAY'.
      APPEND ls_line TO gt_list_top_of_page.
      CONCATENATE 'Date :' s_datbi-low ' TO ' s_datbi-high INTO info SEPARATED BY space.
      CLEAR ls_line.
      ls_line-typ = 'S'.
      ls_line-info = info.
      APPEND ls_line TO gt_list_top_of_page.
      CLEAR ls_line.
      ls_line-typ = 'A'.
      ls_line-info = 'By Debarshi Roy'.
      APPEND ls_line TO gt_list_top_of_page.
    * Generate the End of Page
    *  CLEAR ls_line.
    *  ls_line-typ = 'H'.
    *  ls_line-info = 'ECL'.
    *  APPEND ls_line TO gt_list_end_of_page.
      CLEAR: ls_line.
    *  PERFORM generate_top_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = gt_list_top_of_page
          i_logo             = 'DEB'.
    ENDFORM.                    " GEN_TOP
    *&      Form  POPULATE_EVENTS
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM populate_events .
      DATA: l_i_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type = 0
        IMPORTING
          et_events   = i_events[].
    *----- Pass top-of-page
      READ TABLE i_events WITH KEY name = slis_ev_top_of_page
                               INTO l_i_event.
      IF sy-subrc = 0.
        MOVE formname_top_of_page TO l_i_event-form.
        APPEND l_i_event TO i_events.
      ENDIF.
      CLEAR l_i_event.
    *----- Pass end-of-page
      READ TABLE i_events WITH KEY name = slis_ev_end_of_page
                               INTO l_i_event.
      IF sy-subrc = 0.
        MOVE formname_end_of_page TO l_i_event-form.
        APPEND l_i_event TO i_events.
      ENDIF.
      CLEAR l_i_event.
    *----- Pass user-command
      READ TABLE i_events WITH KEY name = slis_ev_user_command
                               INTO l_i_event.
      IF sy-subrc = 0.
        MOVE formname_user_command TO l_i_event-form.
        APPEND l_i_event TO i_events.
      ENDIF.
    ENDFORM.                    " POPULATE_EVENTS
    *&      Form  generate_top_of_page
    *       text
    *FORM generate_top_of_page.
    *  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    *    EXPORTING
    *      it_list_commentary = gt_list_top_of_page
    *      i_logo             = 'DEB'.
    *ENDFORM.                    "generate_top_of_page
    *&      Form  generate_end_of_page
    *       text
    FORM generate_end_of_page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary       = gt_list_end_of_page
    *   I_LOGO                   =
    ENDFORM.                    "generate_end_of_page
    *&      Form  F4_FOR_VARIANT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM f4_for_variant .
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
        EXPORTING
          is_variant = g_variant
          i_save     = g_save
        IMPORTING
          e_exit     = g_exit
          es_variant = gx_variant
        EXCEPTIONS
          not_found  = 2.
      IF sy-subrc = 2.
        MESSAGE ID sy-msgid TYPE 'S'      NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        IF g_exit = space.
          p_vari = gx_variant-variant.
        ENDIF.
      ENDIF.
    ENDFORM.                    " F4_FOR_VARIANT

  • Report should executed based on the radio buttons on the selection screen

    Hi everyone,
    Greets....................
    My scenario is I have 2 selection screen blocks on same screen..
    One selection screen block contains input parameters as follows
    Company Code  -  S_BUKRS
    Business Area -  S_GSBER
    Customer Code -  S_KUNNR
    Fiscal Area  -   S_GJAHR
    GL Account - S_HKONT
    Posting Date  -S_ZFBDT
    Ledger Type  -P_RLDNR
    Open Item Key Date -  P_ZFBDT
    Another selection screen block contains 2 radio buttons with the option as follows
    Collection Plan
    *Credit days summary.
    If i click Collection plan the report output should come based on the input parameters in first selection-screen block.
    If i click Credit days summary the report output should come based on the input parameters in first selection-screen block.
    Pls send me the sample code for this.
    Thanks in Advance
    Regards
    Raj kumar

    See the below folling example : it will have radio buttons and depends on radio button it will show output.
    REPORT ZPPR_BOM_INFOL_REPORT no standard page heading
                     line-size 160
                     line-count 60.
    ======================================================================
    Program Name : ZPPR_BOM_INFOL_REPORT
    Description  : This Program would be used for BOM List for a material*
                   and the component's where used list                   *
    Author       : Seshu                                                 *
    Date         : 07/24/2006                                            *
    MODIFICATION HISTORY                                                 *
    DATE    | AUTHOR   | CHANGE #   | DESCRIPTION OF MODIFICATION        *
    |----
    |----
    |----
    *12/04/06 | Seshu    | DEVK921821 | Removed new page for each material *
    ======================================================================
    Table definition                                                    *
    TABLES: mast,
            stko,
            stpo,
            T418,
            makt.
    TYPE - POOLS
    TYPE-POOLS: slis.
    Constants
    constants : c_tcode(4) type c value 'CS03',
                gc_formname_top_of_page TYPE slis_formname
                VALUE 'TOP_OF_PAGE'.
    Variables
    data : v_maktx like makt-maktx,
           wa_stko like stko.
    DATA:
    Objekttyp 'Material'
       otyp_mat(1) TYPE c VALUE '1',
       ootyp_mat(1) TYPE c VALUE 'M',
    Objekttyp 'kein Objekt'
       otyp_noo(1) TYPE c VALUE '2',
    Objekttyp 'Dokument'
       otyp_doc(1) TYPE c VALUE '3',
    Objekttyp 'Klasse'
       otyp_kla(1) TYPE c VALUE '4',
    Objekttyp 'Intramaterial'
       otyp_ntm(1) TYPE c VALUE '5'.
    maximal anzeigbare Menge
    data:   max_num(7)  TYPE p DECIMALS 3 VALUE '9999999999.999',
            ueberl_kz(1) TYPE c VALUE '*',
            min_num(7)  TYPE p DECIMALS 3 VALUE '9999999999.999-',
            b_flag(1) TYPE c VALUE 'X',
            ecfld(250) TYPE c,
            v_flag type c.
    ALV Variables
    DATA: gt_fieldcat TYPE slis_t_fieldcat_alv,
          gs_layout   TYPE slis_layout_alv,
          gs_keyinfo  TYPE slis_keyinfo_alv,
          gt_sp_group TYPE slis_t_sp_group_alv,
          gt_events   TYPE slis_t_event.
    DATA: g_repid LIKE sy-repid.
    DATA: gt_list_top_of_page TYPE slis_t_listheader,
                g_tabname_header TYPE slis_tabname,
                g_tabname_item   TYPE slis_tabname,
                g_save(1) TYPE c,
                gx_variant LIKE disvariant,
                g_variant LIKE disvariant,
                g_default(1) TYPE c,
                g_exit(1) TYPE c.
    Includes                                                             *
    INCLUDE .
    Internal Table Declaration                                           *
    DATA: t_mast LIKE STANDARD TABLE OF mast WITH HEADER LINE.
    *DATA: t_makt LIKE STANDARD TABLE OF makt WITH HEADER LINE.
    BOM Function module Related
    DATA: t_matcat  LIKE cscmat OCCURS 0 WITH HEADER LINE.
    Internal Table for Level by Level Function module
    DATA: t_stb  LIKE stpox OCCURS 0 WITH HEADER LINE.
    Get the Relevant data from FM
    DATA: BEGIN OF hd_tab OCCURS 0,
             stufe LIKE stpox-stufe,
             vwegx LIKE stpox-vwegx,
          END OF hd_tab.
    Final Output
    DATA: BEGIN OF alv_stb OCCURS 0.
            INCLUDE STRUCTURE stpox_alv.
    DATA:   info(3)   TYPE c,
          END OF alv_stb.
    DATA: BEGIN OF stb_orig.
            INCLUDE STRUCTURE stpox.
    DATA: END OF stb_orig.
    DATA: BEGIN OF stb_add.
            INCLUDE STRUCTURE stpol_add.
    DATA: END OF stb_add.
    Internal Table for STPO
    *-- BOM Line item
    TYPES: BEGIN OF ty_stpo,
           stlty TYPE stpo-stlty,
           stlnr TYPE stpo-stlnr,
           stlkn TYPE stpo-stlkn,
           stpoz TYPE stpo-stpoz,
           idnrk TYPE stpo-idnrk,
           meins TYPE stpo-meins,
           menge TYPE stpo-menge, "Component Qty
           END OF ty_stpo.
    DATA: t_stpo TYPE STANDARD TABLE OF ty_stpo WITH HEADER LINE.
    *-- BOM Header
    TYPES: BEGIN OF ty_stko,
           stlty TYPE stko-stlty,
           stlnr TYPE stko-stlnr,
           stlal TYPE stko-stlal,
           stkoz TYPE stko-stkoz,
           bmein TYPE stko-bmein,
           bmeng TYPE stko-bmeng,
           END OF ty_stko.
    DATA: t_stko TYPE STANDARD TABLE OF ty_stko WITH HEADER LINE .
    data : t_makt like makt occurs 0 with header line.
    DATA: BEGIN OF cl_clstab OCCURS 0,                          "YHG079407
             class LIKE klah-class,                             "YHG079407
             klart LIKE klah-klart,                             "YHG079407
             chked LIKE csdata-xfeld,                           "YHG079407
             noobj LIKE csdata-xfeld,                           "YHG079407
             dsply LIKE csdata-xfeld,                           "YHG079407
          END OF cl_clstab.
    *-- Header table
    TYPES: BEGIN OF ty_main_material,
           matnr TYPE mast-matnr, "Material
           werks TYPE mast-werks, "Plant
           maktx TYPE makt-maktx, "Description
           stlal TYPE mast-stlal, "Alternative BOM
           stlnr TYPE stko-stlnr, "BOM Number
           bmein TYPE stko-bmein, "UOM
           bmeng TYPE stko-bmeng, "Base Qty
           expand(1) TYPE c,      "Expanding Field
           END OF ty_main_material.
    DATA: t_main_material TYPE STANDARD TABLE OF ty_main_material WITH
          HEADER LINE.
    *-- Item (Component) Table
    TYPES: BEGIN OF ty_item_material,
           matnr TYPE mast-matnr, "Material
           werks TYPE mast-werks, "Plant
           idnrk TYPE stpo-idnrk, "Component (Material)
           maktx TYPE makt-maktx, "Description
           stlal TYPE mast-stlal, "Alternative BOM
           stlnr TYPE stpo-stlnr, "BOM Number
           meins TYPE stpo-meins, "UOM
           menge TYPE stpo-menge, "Base Qty
           END OF ty_item_material.
    DATA: t_item_material TYPE STANDARD TABLE OF ty_item_material WITH
          HEADER LINE.
    Selection Screen                                                     *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_werks LIKE marc-werks DEFAULT '1000' OBLIGATORY.
    SELECT-OPTIONS s_stlal FOR mast-stlal .
    SELECT-OPTIONS s_stlan FOR mast-stlan DEFAULT '1'.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_bomlst RADIOBUTTON GROUP g1 DEFAULT 'X'.
    SELECT-OPTIONS s_matnr FOR mast-matnr.
    SELECTION-SCREEN SKIP.
    PARAMETERS: p_compon RADIOBUTTON GROUP g1.
    SELECT-OPTIONS: s_idnrk FOR stpo-idnrk.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN END OF BLOCK b1.
    selection-screen begin of block b03 with frame title text-b03.
    selection-screen begin of line.
    selection-screen comment 1(40) text-005.
    parameters: p_all radiobutton group r1 default 'X'.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(40) text-006.
    parameters: p_one radiobutton group r1 .
    selection-screen end of line.
    selection-screen end of block b03.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETERS: p_vari LIKE disvariant-variant.
    SELECTION-SCREEN END OF BLOCK b3.
    At slection screen events                                            *
    *-- Process on value request
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
      PERFORM f4_for_variant.
    Intitialisation
    INITIALIZATION.
      g_repid = sy-repid.
      g_tabname_header = 'T_MAIN_MATERIAL'.
      g_tabname_item   = 'T_ITEM_MATERIAL'.
    *-- define keyinformation
      CLEAR gs_keyinfo.
      gs_keyinfo-header01 = 'MATNR'.
      gs_keyinfo-item01   = 'MATNR'.
      PERFORM e03_eventtab_build USING gt_events[].
      PERFORM e04_comment_build  USING gt_list_top_of_page[].
      PERFORM e07_sp_group_build USING gt_sp_group[].
      PERFORM e08_layout_build   USING gs_layout.
    Set Options: save variants userspecific or general
      g_save = 'A'.
      PERFORM variant_init.
    Get default variant
      gx_variant = g_variant.
      CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
           EXPORTING
                i_save     = g_save
           CHANGING
                cs_variant = gx_variant
           EXCEPTIONS
                not_found  = 2.
      IF sy-subrc = 0.
        p_vari = gx_variant-variant.
      ENDIF.
    S T A R T - O F - S E L E C T I O N *******************
    start-of-selection.
      if p_all = 'X'.
    Get the data from MAST and MAKT Table
        if p_bomlst = 'X'.
      Get the data Based On Material #
          perform get_data.
        else.
      Get the data Based On Component
          perform get_data_component.
        endif.
      else.
    Get the Single Level Report
    *-- Moved the fiedl catalog here inorder to change the layout based on
    *-- Selection
        PERFORM e01_fieldcat_init  USING gt_fieldcat[].
        PERFORM select_data.
      endif.
    E N D - O F - S  E  L  E  C  T  I  O  N *******************
    end-of-selection.
      if p_one = 'X'.
        perform alv.
      endif.
    User Command
    at line-selection.
    Interactive to CS03 Transaction
      case sy-ucomm.
        when 'PICK' or 'F2'.
          if not alv_stb-idnrk is initial .
            if not alv_stb-werks is initial.
              if not alv_stb-objty is initial.
                SET PARAMETER ID 'MAT' FIELD alv_stb-idnrk.
                SET PARAMETER ID 'WRK' FIELD alv_stb-werks.
                SET PARAMETER ID 'CSV' FIELD alv_stb-OBJTY.
                call transaction c_tcode and skip first screen.
              endif.
            endif.
          endif.
          clear alv_stb.
      endcase.
    *&      Form  get_data
          Get data from MAST and MAKT Table
    FORM get_data.
      data : wa_lines type sy-index.
      REFRESH : T_MAST,
                t_STB,
                t_MATCAT,
                alv_STB.
      CLEAR : T_MAST,
                t_STB,
                t_MATCAT,
                alv_STB.
    Get the data from MAST Table
    Get all the information from MAST - BOM Table
      SELECT * FROM mast INTO TABLE t_mast WHERE matnr IN s_matnr AND
                                                 werks = p_werks  AND
                                                 stlan IN s_stlan AND
                                                 stlal IN s_stlal.
      describe table t_mast lines  wa_lines.
      if wa_lines is initial.
        Write:/2 'List contains no data'.
        stop.
      endif.
      loop at t_mast.
        clear : v_maktx.
    Start of change  Seshu
    Reason - Remove the new page option
        if sy-tabix ne 1.
          skip 1.
        endif.
    End of Change  Seshu
    Get the material Description
        select single maktx from makt into  v_maktx
                                 where matnr = t_mast-matnr
                                 and   spras = 'E'.
    Get the material details from STKO Table
        select single * from stko into wa_stko
                        where STLTY = 'M'
                        and   STLNR = t_mast-stlnr
                        and   STLAL = t_mast-stlal.
    Main Header for Each Material
        format color 5 on.
        write:/2 'Material',20 'Material Description',65 'Alternative BOM',
             90 'Base Qty', 115 'Base Unit'.
        format color 5 off.
        format color 1 on.
        write:/2 t_mast-matnr,20 v_maktx,65 wa_stko-STLAL, 85 wa_stko-BMENG,
               115 wa_stko-BMEIN.
        format color 1 off.
    Use the Function Module and get the format level by level
        perform get_level_level.
      endloop.
    ENDFORM.                    " get_data
    Top of page                                                  *
    top-of-page.
      perform report_header .
    *&      Form  report_header
          text
    -->  p1        text
    <--  p2        text
    FORM report_header.
      new-page line-size 160 .
      format color col_heading intensified on.
      write:/ sy-uline(160) .
    *--- Write Company Name.
      perform calc_col_and_write using    text-h00
                                          sy-linsz.
    *--- Write Report Title.
      perform calc_col_and_write using    sy-title
                                          sy-linsz.
    *--- Write User Id, Date / Time, Program Id, Page etc.
      perform write_other_hdr_details.
      write:/ sy-uline(160) .
    ENDFORM.                    " report_header
    *&      Form  calc_col_and_write
          text
         -->P_TEXT_H00  text
         -->P_SY_LINSZ  text
    FORM calc_col_and_write USING    P_TEXT
                                     P_LINSZ.
      data: col1 type i,
             col2 type i,
              len  type i,
              str  type i.
      str  = strlen( p_text ).
      col1 = ( p_linsz / 2 ) - ( str / 2 ) .
      len  = p_linsz - col1 - 2.
      write: at  /1  '|'.
      write: at  col1 p_text,
             at  sy-colno(len) space.
      write  at  160 '|'.
    ENDFORM.                    " calc_col_and_write
    *&      Form  write_other_hdr_details
          text
    -->  p1        text
    <--  p2        text
    FORM write_other_hdr_details.
      data: col1 type i,
              col2 type i,
              len  type i.
      col1 = 3.
      write:/1 '|'.
      write: at  col1 'UserId  : ',
                      sy-uname.
      len = sy-linsz - 1.
      write at sy-colno(len) space.
      col2 = sy-linsz - 18.
      write: at col2 'Date: ',
                     sy-datum mm/dd/yyyy.
      write: at sy-linsz '|'.
      write:/1 '|'.
      write: at  col1 'ReportId: ',
                      sy-repid.
      write at sy-colno(len) space.
      col2 = sy-linsz - 18.
      write: at col2 'Page: ',
                      sy-pagno.
      write: at sy-linsz '|'.
    ENDFORM.                    " write_other_hdr_details
    *&      Form  get_data_component
          Get the data based on Component level
    FORM get_data_component.
      data wa_lines type i.
    *-- Get the BOM item details
      SELECT  stlty stlnr stlkn stpoz idnrk meins menge
              FROM stpo
              INTO TABLE t_stpo
      WHERE   idnrk IN s_idnrk.
      IF sy-subrc = 0.
        CLEAR wa_lines.
        DESCRIBE TABLE t_stpo LINES wa_lines.
        IF wa_lines > 0.
          SELECT  stlty stlnr stlal stkoz bmein bmeng
                  FROM stko
                  INTO TABLE t_stko
                  FOR ALL ENTRIES IN t_stpo
          WHERE stlnr = t_stpo-stlnr.
          CLEAR wa_lines.
          DELETE ADJACENT DUPLICATES FROM t_stko COMPARING ALL FIELDS.
          DESCRIBE TABLE t_stko LINES wa_lines.
          IF wa_lines > 0.
    *-- Get the BOM item details
            SELECT * FROM mast INTO TABLE t_mast FOR ALL ENTRIES IN t_stko
                                                WHERE werks = p_werks  AND
                                                  stlnr = t_stko-stlnr
                                                  and stlal in s_stlal.
          ENDIF.
        ENDIF.
      else.
        Write:/2 'List contains no data'.
        stop.
      endif.
      loop at t_mast.
        clear : v_maktx.
    Start of change  Seshu
    Reason - Remove the new page option
        if sy-tabix ne 1.
          skip 1.
        endif.
    End of change    Seshu
    Get the material Description
        select single maktx from makt into  v_maktx
                                 where matnr = t_mast-matnr
                                 and   spras = 'E'.
    Get the material details from STKO Table
        select single * from stko into wa_stko
                        where STLTY = 'M'
                        and   STLNR = t_mast-stlnr
                        and   STLAL = t_mast-stlal.
    Main Header for Each Material
        format color 5 on.
        write:/2 'Material',20 'Material Description',65 'Alternative BOM',
             90 'Base Qty', 115 'Base Unit'.
        format color 5 off.
        format color 1 on.
        write:/2 t_mast-matnr,20 v_maktx,65 wa_stko-STLAL, 85 wa_stko-BMENG,
               115 wa_stko-BMEIN.
        format color 1 off.
    Use the Function Module and get the format level by level
        perform get_level_level.
        clear : t_mast.
      endloop.
    ENDFORM.                    " get_data_component
    *&      Form  obj_ident
          text
    FORM obj_ident.
    weder Mat noch Doc
      CHECK: T_stb-objty NE otyp_mat,
             T_stb-objty NE ootyp_mat,
             T_stb-objty NE otyp_doc,
             T_stb-objty NE otyp_ntm.
    ?T418-WA schon ok
    nein
      IF T_stb-postp NE t418-postp.
        T418 einlesen
        PERFORM t418_lesen USING T_stb-postp.
      ENDIF.
      PERFORM cl_clstab_maint.
    ?MatNr-Eingabe bei diesem PosTyp moeglich
      und keine Textposition
    trifft zu
      IF     t418-matin NE '-'
         AND t418-txpos IS INITIAL.
        aktuelles Objekt ist Material NLAG
        T_stb-objty = '1'.
        PosKurztext in ObjKurztext uebernehmen.
        T_stb-ojtxp = T_stb-potx1.
        MODIFY T_stb.
      ELSE.
        IF T_stb-objty IS INITIAL.
          T_stb-objty = '2'.
          MODIFY T_stb.
        ENDIF.
      ENDIF.
    ENDFORM.                    " obj_ident
    *&      Form  t418_lesen
          text
         -->P_T_STB_POSTP  text
    FORM t418_lesen USING   lkl_postp LIKE stpo-postp.
    T418-WA initialisieren
      CLEAR:
         t418.
    Key angeben
      t418-postp = lkl_postp.
    PosTypDefinition lesen
      READ TABLE t418.
    ENDFORM.                    " t418_lesen
    *&      Form  cl_clstab_maint
          text
    FORM cl_clstab_maint.
    nur fuer Klassenpositionen
      CHECK t_STB-OBJTY EQ OTYP_KLA.
    Teilkey der Klassenpositionentabelle
      CL_CLSTAB-CLASS = t_STB-CLASS.
      CL_CLSTAB-KLART = t_STB-KLART.
    Klassenpositionentabelle lesen
      READ TABLE CL_CLSTAB
         WITH KEY CL_CLSTAB(21)
         BINARY SEARCH.
    aktuelle Klassenposition bereits in Klassenpositionentabelle
    nein
      IF SY-SUBRC <> 0.
        Klassenposition in Klassenpositionentabelle hinzufuegen
        INSERT CL_CLSTAB INDEX SY-TABIX.
      ENDIF.
    ENDFORM.                    " cl_clstab_maint
    *&      Form  alv_stb_prep
          Printing the data as LEVEL BY LEVEL
    FORM alv_stb_prep.
      CLEAR:
          alv_stb,
          stb_orig,
          stb_add.
      IF t_stb-hdnfo IS INITIAL.
        stb_orig = t_stb.
        IF t_stb-mngko >= max_num.
          stb_add-ovfls = ueberl_kz.
        ELSE.
          IF t_stb-mngko <= min_num.
            stb_add-ovfls = ueberl_kz.
          ELSE.
            CLEAR: stb_add-ovfls.
          ENDIF.
        ENDIF.
        IF NOT t_stb-xtlnr IS INITIAL.
          stb_add-bomfl = b_flag.
        ENDIF.
        IF    NOT t_stb-knobj IS INITIAL
           OR NOT t_stb-class IS INITIAL
           OR NOT t_stb-kzclb IS INITIAL.
          stb_add-knofl = 'X'.
        ENDIF.
      ELSE.
        CHECK t_stb-stufe > 1.
        alv_stb-info = 'C30'.
        IF t_stb-ttidx <> t_matcat-index.
          READ TABLE t_matcat INDEX t_stb-ttidx.
        ENDIF.
        stb_orig-hdnfo = t_stb-hdnfo.
        stb_orig-stufe = t_stb-stufe - 1 .
        stb_orig-ojtxp = t_stb-ojtxb.
        IF NOT t_stb-altst IS INITIAL.
          stb_orig-stlal = t_stb-stlal.
          IF stb_orig-stlal(1) EQ '0'.
            stb_orig-stlal(1) = ' '.
          ENDIF.
        ENDIF.
        stb_orig-idnrk = t_matcat-matnr.
      ENDIF.
      CLEAR:
        stb_add-dobjt,
        stb_add-objic.
      CASE t_stb-objty.
        WHEN otyp_mat.
          WRITE: stb_orig-idnrk TO ecfld.
          stb_add-objic = '@A6@'.
        WHEN 'M'.
          WRITE: stb_orig-idnrk TO ecfld.
          stb_add-objic = '@A6@'.
        WHEN otyp_noo.
          WRITE: stb_orig-potx1 TO ecfld.
          stb_add-objic = '@0Q@'.
        WHEN otyp_doc.
          write stb_orig-doknr to ecfld.                        "note 489354
          IF ecfld CP '*# '. ENDIF.                             "note 489354
          sy-fdpos = sy-fdpos + 1.                              "note 489354
          CONCATENATE
    *d      stb_orig-doknr                                      "note 489354
            stb_orig-dokar
            stb_orig-doktl
            stb_orig-dokvr
    *d      INTO ecfld                                          "note 489354
            INTO ecfld+sy-fdpos                                 "note 489354
            SEPARATED BY space.
          stb_add-objic = '@AR@'.
        WHEN otyp_kla.
          CONCATENATE
            stb_orig-class
            stb_orig-klart
            INTO ecfld
            SEPARATED BY space.
          stb_add-objic = '@7C@'.
        WHEN otyp_ntm.
          WRITE: stb_orig-intrm TO ecfld.
        WHEN OTHERS.
      ENDCASE.
    *d CONDENSE ecfld.                                          "note 515408
      stb_add-dobjt = ecfld(40).
      CLEAR: ecfld.
      WRITE stb_orig-stufe TO stb_add-dstuf NO-SIGN.
    *d  MOVE-CORRESPONDING stb_orig TO alv_stb.                 "note 331962
      MOVE-CORRESPONDING stb_add TO alv_stb.
      MOVE-CORRESPONDING stb_orig TO alv_stb.                   "note 331962
      APPEND alv_stb.
    ENDFORM.                    " alv_stb_prep
    *&      Form  get_level_level
          text
    FORM get_level_level.
      REFRESH : T_STB,
                T_MATCAT,
                ALV_STB.
      CLEAR : T_STB,
              T_MATCAT,
              ALV_STB.
      CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
           EXPORTING
                capid                 = 'PP01'
                datuv                 = sy-datum
                mktls                 = 'X'
                mehrs                 = 'X'
                mtnrv                 = t_mast-matnr
                stlal                 = '01'
                stlan                 = '1'
                stpst                 = 0
                svwvo                 = 'X'
                werks                 = p_werks
                vrsvo                 = 'X'
           TABLES
                stb                   = t_stb
                matcat                = t_matcat
           EXCEPTIONS
                alt_not_found         = 1
                call_invalid          = 2
                material_not_found    = 3
                missing_authorization = 4
                no_bom_found          = 5
                no_plant_data         = 6
                no_suitable_bom_found = 7
                conversion_error      = 8
                OTHERS                = 9.
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CLEAR: hd_tab.
            Entry der KlassenstatusTab. initialisieren
             cl_clstab,
            Entry 'Objekte von Klassen' initialisieren
             cl_objmemo.
      REFRESH: hd_tab.
      SORT t_matcat BY index ASCENDING.
    Get the All levels
      loop at t_stb.
        IF NOT t_stb-hdnfo IS INITIAL.
          EXIT.
        ENDIF.
    Object Identification
        PERFORM obj_ident.
        READ TABLE hd_tab
            WITH KEY stufe = t_stb-stufe
                     vwegx = t_stb-vwegx
            BINARY SEARCH
            TRANSPORTING NO FIELDS.
        ?gibt es diesen Satz schon
        nein
        IF sy-subrc <> 0.
           dann in SFP-Infosatzverweistab. aufnehmen
    *d       APPEND HD_TAB.                                       "HGH054648
          hd_tab-stufe = t_stb-stufe.
                                                                "HGH054648
          hd_tab-vwegx = t_stb-vwegx.
                                                                "HGH054648
          INSERT hd_tab                                         "HGH054648
            INTO hd_tab                                         "HGH054648
            INDEX sy-tabix.                                     "HGH054648
           PosNr initialisieren
          CLEAR: t_stb-posnr.
           SFP-InfosatzKz setzen
          t_stb-hdnfo = 'X'.
            stb-objty = otyp_mat.
                                                                "HGE246532
           als SFP-Infosatz in die STB aufnehmen
          append t_stb.
        ENDIF.
    *del  ENDIF.
        clear t_stb.
      endloop.
      SORT t_stb ASCENDING BY stufe
                  index ASCENDING
    *del        POSNR ASCENDING.                                  "HGC062735
                  posnr ASCENDING                               "HGC062735
                  hdnfo DESCENDING.
      LOOP AT t_stb.
        T_stb-index = sy-tabix.
        MODIFY T_stb.
        PERFORM alv_stb_prep.
      ENDLOOP.
    Displays the Value as Level by Level
      loop at ALV_stb.
        if sy-tabix = 1.
          format color 3 on.
          write:/2 'Level',12 'Item',22 'Component',
          42 'Material Description',82 'Base Qty',
          107 'Base Unit',120 'Assembly Indicator'.
          format color 3 on.
        endif.
        if alv_stb-MEINs is initial.
          v_flag = 'X'.
        endif.
        if v_flag = 'X'.
          format color 5 on.
          write:/2 ALV_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
                 42 alv_stb-OJTXP.
          format color 1 off.
        else.
          if alv_stb-STUFE = '1'.
            format color 1 on.
            write:/2 ALV_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
                   42 alv_stb-OJTXP,72 alv_stb-mngko,
                   107 alv_stb-MEINs, 120 alv_stb-bomfl .
            format color 1 off.
          elseif alv_stb-STUFE = '2'.
            format color 2 on.
            write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
                   42 alv_stb-OJTXP,72 alv_stb-mngko,
                   107 alv_stb-MEINs,120 alv_stb-bomfl.
            format color 2 off.
          elseif alv_stb-STUFE = '3'.
            format color 3 on.
            write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
                    42 alv_stb-OJTXP,72 alv_stb-mngko,
                    107 alv_stb-MEINs,120 alv_stb-bomfl .
            format color 3 off.
          elseif alv_stb-STUFE = '4'.
            format color 4 on.
            write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
                    42 alv_stb-OJTXP,72 alv_stb-mngko,
                    107 alv_stb-MEINs,120 alv_stb-bomfl .
            format color 4 off.
          elseif alv_stb-STUFE = '5'.
            format color 5 on.
            write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
                    42 alv_stb-OJTXP,72 alv_stb-mngko,
                    107 alv_stb-MEINs,120 alv_stb-bomfl .
            format color 5 off.
          elseif alv_stb-STUFE = '6'.
            format color 7 on.
            write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
                   42 alv_stb-OJTXP,72 alv_stb-mngko,
                   107 alv_stb-MEINs,120 alv_stb-bomfl.
            format color 6 off.
          elseif alv_stb-STUFE = '7'.
            format color 7 on.
            write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
                   42 alv_stb-OJTXP,72 alv_stb-mngko,
                   107 alv_stb-MEINs,120 alv_stb-bomfl .
            format color  7 off.
          else.
            format color 1 on.
            write:/2 alv_stb-STUFE,12 alv_stb-posnr,22 alv_stb-idnrk,
                    42 alv_stb-OJTXP,72 alv_stb-mngko,
                    107 alv_stb-MEINs,120 alv_stb-bomfl .
            format color  1 off.
          endif.
        endif.
        hide: alv_stb.
        clear : alv_stb.
        clear v_flag.
      endloop.
    ENDFORM.                    " get_level_level
    *&      Form  f4_for_variant
          text
    FORM f4_for_variant.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
             EXPORTING
                  is_variant          = g_variant
                  i_save              = g_save
                  i_tabname_header    = g_tabname_header
                  i_tabname_item      = g_tabname_item
              it_default_fieldcat =
             IMPORTING
                  e_exit              = g_exit
                  es_variant          = gx_variant
             EXCEPTIONS
                  not_found = 2.
      IF sy-subrc = 2.
        MESSAGE ID sy-msgid TYPE 'S'      NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        IF g_exit = space.
          p_vari = gx_variant-variant.
        ENDIF.
      ENDIF.
    ENDFORM.                    " f4_for_variant
          FORM E03_EVENTTAB_BUILD                                       *
    -->  E03_LT_EVENTS                                                 *
    FORM e03_eventtab_build USING e03_lt_events TYPE slis_t_event.
      DATA: ls_event TYPE slis_alv_event.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                i_list_type = 0
           IMPORTING
                et_events   = e03_lt_events.
      READ TABLE e03_lt_events WITH KEY name = slis_ev_top_of_page
                               INTO ls_event.
      IF sy-subrc = 0.
        MOVE gc_formname_top_of_page TO ls_event-form.
        APPEND ls_event TO e03_lt_events.
      ENDIF.
    ENDFORM.
          FORM E04_COMMENT_BUILD                                        *
    -->  E04_LT_TOP_OF_PAGE                                     

  • Submit selection screen options of one report to another report

    hi ,
      My requirement is as follows . i have a report with a selection screen .The report fetches data from a ztable according to multiple parameters and select options in the selection screen. The mandatory parameters are two diffrent dates according to which the data is fetched. If one of the dates is the CURRENT date then the data  to be fetched is not present in the Ztable as the data is updated daily at midnight. What is required if the user enters the current date in one of the dates then my report should save the selection screen parameters present in therest of the select options and submit these parameters to the second report which updates the data into the table so that my report can fetch it accordingly. If i am getting a bit confusing i am sorry . This is the best i could explain .If any clarififcations are required please ask. Please could u help me with this problem and guide me how to do this . Thanks in advances and helpful answers will be rewarded.

    Hi,
    When you start an executable program, the standard selection screen normally appears, containing the selection criteria and parameters of both the logical database connected to the program and of the program itself. When you start an executable program using SUBMIT, there are various additions that you can use to fill the input fields on the selection screen:
    SUBMIT... [VIA SELECTION-SCREEN]
    [USING SELECTION-SET <var>]
    [WITH <sel> <criterion>]
    [WITH FREE SELECTIONS <freesel>]
    [WITH SELECTION-TABLE <rspar>].
    Ex.
    The following executable program (report) creates a selection screen containing the parameter PARAMET and the selection criterion SELECTO:
    REPORT REP1.
    DATA NUMBER TYPE I.
    PARAMETERS PARAMET(14).
    SELECT-OPTIONS SELECTO FOR NUMBER.
    The program REP1 is called by the following program using various parameters:
    REPORT REP2 NO STANDARD PAGE HEADING.
    DATA: INT TYPE I,
    RSPAR LIKE RSPARAMS OCCURS 10 WITH HEADER LINE.
    RANGES SELTAB FOR INT.
    WRITE: 'Select a Selection!',
    SKIP.
    FORMAT HOTSPOT COLOR 5 INVERSE ON.
    WRITE: 'Selection 1',
    / 'Selection 2'.
    AT LINE-SELECTION.
    CASE SY-LILLI.
    WHEN 4.
    SELTAB-SIGN = 'I'. SELTAB-OPTION = 'BT'.
    SELTAB-LOW = 1. SELTAB-HIGH = 5.
    APPEND SELTAB.
    SUBMIT REP1 VIA SELECTION-SCREEN
    WITH PARAMET EQ 'Selection 1'
    WITH SELECTO IN SELTAB
    WITH SELECTO NE 3
    AND RETURN.
    WHEN 5.
    RSPAR-SELNAME = 'SELECTO'. RSPAR-KIND = 'S'.
    RSPAR-SIGN = 'E'. RSPAR-OPTION = 'BT'.
    RSPAR-LOW = 14. RSPAR-HIGH = 17.
    APPEND RSPAR.
    RSPAR-SELNAME = 'PARAMET'. RSPAR-KIND = 'P'.
    RSPAR-LOW = 'Selection 2'.
    APPEND RSPAR.
    RSPAR-SELNAME = 'SELECTO'. RSPAR-KIND = 'S'.
    RSPAR-SIGN = 'I'. RSPAR-OPTION = 'GT'.
    RSPAR-LOW = 10.
    APPEND RSPAR.
    SUBMIT REP1 VIA SELECTION-SCREEN
    WITH SELECTION-TABLE RSPAR
    AND RETURN.
    ENDCASE.
    Regards,
    Bhaskar

Maybe you are looking for

  • Erratic behaviour of Concurrent Managers

    We have PCP configured on 2 node EBS. We have recently started seeing that our FNDSM on node 2 stops working and also couple of other managers got deativated. When we try to start them manually they won't start. The only thing we do is to bounce appl

  • TS3992 I tried to open a document on pages and it says: " document can't be opened"

    I tried to open a document on pages and it says: " document can't be opened" it happned in all of my devices and I' m connected to a wi fi internet

  • CMIS Connector - Mac OS 10.9 Finder Mounting Issue

    Hi. I have recently updated my system to MAC OS X Mavericks (10.9) and Adobe Drive to Version 5.0.1. I am using CS6. I updated from CS5, Drive 3 and Mac OS X 10.6. The problem is as follows: When i connect the CMIS volume (an alfresco 3.4 community d

  • Scaling and Resizing

    Hi, I use a ProgressIndicator in MigLayout (JavaFX version, see http://www.miglayout.com/). Now, if I scale the ProgressIndicator, its size does not change. In other words, MigPane still uses the non-scaled size to layout the components. Is this a la

  • Question about forms

    This is my first time using a form in a website. I have added a form to my website and i am trying to figure out how the whole process works. I have searched for the answer but i am still a ittle confused. From what i understand the action field is w