Selection screen of report writer

Hi all,
I am working on a report writer .In this report writer there is one column set which is a key figure set.
It has two key figures,each is associated with one additional set.
The fields of additional sets are as follows.
Additional set 1 -
period range1
year1
record type
Additional set 2-
period range2
year2
record type
Its selection screen is automatically taking these as a parameters from additional sets in the following sequence.
year1
year2
period1 to
period1 from
period2 to
period2 from
I want this sequence to be different i.e. as follows:
Period1 to
period1 from
year1
Period2 to
period2 from
year2
Can anyone tell me how can  I achieve this.
Thank You.

Here is the Code:
DATA: lt_params  TYPE STANDARD TABLE OF alv_s_param_wp,
lwa_params TYPE alv_s_param_wp,
lwa_msg    TYPE bapiret2,
gt_msg     TYPE TABLE OF bapiret2,
lv_dcpfm   TYPE xudcpfm,
gt_data    TYPE STANDARD TABLE OF grwwebdata.
CLEAR:gt_data,
lwa_msg.
REFRESH : gt_data, gt_msg.
*  SET REPORT painter paramters
lwa_params-pname  = '$PARAMETER[$1KOKRE'.
lwa_params-pvalue = c_ccode.   '' (company code = 0010)
APPEND lwa_params TO lt_params .
lwa_params-pname  = '$PARAMETER[$1GJAHR'.
lwa_params-pvalue = p_year.    (2011)
APPEND lwa_params TO lt_params .
lwa_params-pname  = '$PARAMETER[$1PERIV'.
lwa_params-pvalue = s_month-low.     " (1)
APPEND lwa_params TO lt_params .
lwa_params-pname  = '$PARAMETER[$1PERIB'.
lwa_params-pvalue = s_month-high.    "(12)
APPEND lwa_params TO lt_params .
lwa_params-pname  = '$PARAMETER[$1VERP'.
lwa_params-pvalue = p_plan.        " (0)
APPEND lwa_params TO lt_params .
lwa_params-pname  = '$SELECT-OPTION[$1KOSET'.
lwa_params-pvalue = 'I[EQ[1110[3190'.
APPEND lwa_params TO lt_params .
CALL FUNCTION 'CRIF_RW_WEB_CALL_REPORT'
EXPORTING
i_report_group  = '1SIP'
*     I_PERS_APPL     =
*     I_NEW_SELECTION =
*     I_DISPLAY_LIST  =
*     I_APPL_ID       =
*     I_VAR           =
TABLES
it_params       = lt_params
et_data         = gt_data
et_messages     = gt_msg.

Similar Messages

  • Creating Selection screen in Report Painter

    Good day everyone,
      Does anyone know how I could create a selection screen in Report Writer? Thanks!
    >Christian<

    Hi,
    Simple Parameters  or Selec-options statements will suffice.
    Eg : Parameters : p_matnr type mara-matnr.
           select-options : s_matnr for mara-matnr.
    In selection screen, you may have selec-options, parameters, check boxes, radio buttons etc.
    Regards,
    Sujatha.

  • Use of Selection Rule in Report Writer.

    Hello Everybody,
    I am trying to make use of selection rule in report writer.   We have a mixed chart of accounts using both IFRS and USGAAP account.  Distinction between USGAAP and IFRS is based on certain value in gl account master data.  Using report writer rule I wish to exclude IFRS account for a specfic report.
    For example
    REPORT = X = Rule to restrict selection to only USGAAP account
    REPORT = Y = Rule to restrict selection to only IFRS account.
    I have created a rule and tried to build user-exit around it.  However during the callup of the selection rule no values are transferred to user-exit and therefore the ABAP consultant is not able to write any specific code.
    Request your inputs on usage of selection rules in report writer.
    Regards
    Jayesh.

    Hi Jayesh,
    Please have a look at the below attachment.
    [http://help.sap.com/saphelp_470/helpdata/en/5b/d22e3843c611d182b30000e829fbfe/content.htm]
    Warm regards,
    Murukan Arunachalam

  • Adding gsber in selection screen of report painter

    To gurus,
    I have a small requirement, I have to get business area  (GSBER) in  selection screen of report.
    I have developed the report using report painter  FGI1 --FAGLFLEXT which is having gsber field.
    In selection screen it self i want this GSBER FIELD .How to achieve it.
    kindly guide me.
    regards,
    padmaja.

    Hi
    What I understand from your question is you want bussiness area value on selection screen you can achive this by just using the by export/import parameter or by get/set  parameter id.
    Please elaborate what exactly you want.
    Regards
    Sagar.

  • Modification on selection screen of report

    Hello guys,
    I have a requirement where in i need to modify the initial selection screen as per clients requirement. The scenario is as follows:
    Suppose 'EMPLOYEE' and 'PORTFOLIO' are two of the fields of a cube on which the report will be run. Now suppose there are three employees as A, B and C and A handles portfolios X & Y, B handles portfolios W & Y while C handles portfolios X & Z.
    The initial selection screen of report will have two selection fields first as the employee and second as the portfolio.
    When we do F4 at employee it will display A, B and C. Now the requirement is if we F4 at portfolio it should display only the relevant one for that employee.
    For example: if i give employee as A and when i do F4 at portfolio screen it should give me only X and Y and not all the portfolios viz. W, X, Y & Z
    Is there a way to achieve the above scenario????

    Hi Chakradhar,
                             Refer this code :
    SELECTION-SCREEN BEGIN OF BLOCK BL2 WITH FRAME TITLE TEXT-456.
    PARAMETERS PO RADIOBUTTON GROUP RADI USER-COMMAND R.
    SELECTION-SCREEN END OF BLOCK BL2.
    AT SELECTION-SCREEN OUTPUT.
    CALL SCREEN 100.
    when user will click on this radio button , a pop up screen will appear dynamically.
    Reward points if helpful.
    Regards,
    Hemant

  • AT SELECTION-SCREEN stops report

    Hello,
    I run a report using the AT SELECTION-SCREEN stmt.
    Below AT SELECTION-SCREEN is an IF ... ELSE block. Within that block the report checks, whether the user input (made in a SELECT-OPTIONS) complies some requirements.
    I check for example, if that what the user types in matches a defined string...
    But if i use an AT SELECTION-SCREEN, the report does not continue after execution after that!
    It returns to the selction screen...
    How can I achieve, that the report continues with execution...?
    Thx,
    holger

    Hi Holger,
    1. This is the default behaviour.
    2. For report purpose execution,
       the event is
       START-OF-SELECTION ( and not at selection-screen)
    3. However u CAN ACHIEVE this by :
       after all validations , use the syntax
       LEAVE TO LIST-PROCESSING.
    4.  I tried the same at my end,
       its working fine.
    5. However, if u use step 3,
       there will be a problem :
       after the execution of report,
      it wil get HANG. ie. it won't then
      get back using the toolbar buttons.
      U may try it for yourself.
    6. Bottom line is:
       use
      START-OF-SELECTION (FOR FINAL EXECUTION OF THE REPORT)
    Regards,
    Amit M.
    Message was edited by: Amit Mittal

  • How to create multiple selection screens in reports

    How to create multiple selection screens in reports
    Thanks,
    Sridhar

    Ex: hope you will find an idea from the below example :
    SELECTION-SCREEN BEGIN OF BLOCK SEL1 WITH FRAME TITLE TIT1.
    PARAMETERS: CITYFR LIKE SPFLI-CITYFORM,
                CITYTO LIKE SPFLI-CITYFORM.
    SELECTION-SCREEN end OF BLOCK SEL1
    SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
    SELECTION-SCREEN INCLUDE BLOCKS SEL1.
    SELECTION-SCREEN BEGIN OF BLOCK SEL2 WITH FRAME TITLE TIT2 .
    PARAMETERS: AIRPFFR LIKE SPFLI-AIRPFROM,
                AIRPTO LIKE SPFLI-AIRPTO.
    SELECTION-SCREEN END OF BLOCK SEL2
    SELECTION-SCREEN END OF SCREEN 5000.
    INITIALIZATION.
    TIT1 = 'ITIES'.
    aT SELECTION-SCREEN.
    CASE SY-DYNNR.
    WHEN '0500'.
       MESSAGE W159(at) WITH 'SCREEN 500'.
    WHEN '1000'.
       MESSAGE W159(at) WITH 'SCREEN 1000'.
    ENDCASE.
    START-OF-SELECTION.
    TIT1 = 'CITIES FOR AIRPORTS'.
    TIT2 = 'AIRPORTS'.
    CALL SELECTION-SCREEN 500 STARTING AT 10 10.
    TIT1 = 'CITIES AGAIN'.
    CALL SELECTION-SCREEN 1000 STARTING AT 10 10.

  • FM to display Selection screen on report output??

    Hi Experts,
    Is there an FM to display Selection screen on report output.
    Thanks In Advance.

    Hi Ashwin,
    Refer to below link
    http://help.sap.com/saphelp_nw04/helpdata/en/2a/755b94ca5911d299af5c9604c10e27/content.htm
    or
    The easiest way is to define your selection screen in the TOP include of your module pool.
    Then call the selection screen.
    Selection Screen
    selection-screen begin of screen 1010 as window title text-001.
    selection-screen begin of block b1 with frame title text-002.
    parameters: p_vornr type resb-vornr,
    p_refno(20) type c,
    p_plnid type zplcfg-plnid as listbox visible length 20,
    p_sorts type c as listbox visible length 20.
    selection-screen begin of line.
    selection-screen comment (20) text-004.
    selection-screen position 33.
    parameters: p_order as checkbox default 'X'.
    selection-screen end of line.
    selection-screen end of block b1.
    selection-screen end of screen 1010.
    Now call the selection screen.
    call selection-screen 1010.
    if sy-subrc = 0.
    perform get_production_orders.
    perform process_orders.
    endif.
    Thanks!!

  • How we can assign the customised selection screen to report category

    hai
    gurus
    how we can assign the customised selection screen to report category

    Hi Naresh,
    You can do like this.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECTION-SCREEN BEGIN OF BLOCK SELECTION WITH FRAME.
    SELECT-OPTIONS: S_FKART FOR VBRK-FKART.
    SELECT-OPTIONS: S_FKDAT FOR VBRK-FKDAT OBLIGATORY.
    SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
    SELECT-OPTIONS: S_AUART FOR VBAK-AUART.
    SELECTION-SCREEN END OF BLOCK SELECTION.
    SELECTION-SCREEN END OF BLOCK B1.
    if you give me brief i can help you out more.
    Thank you .
    Regards
    Ram

  • User must fill at list one field in a selection screen in report

    Hi experts,
    i have a report that the user should choose between 2 fields or he can fill them both. but he must to fill at list one of them- at the selection screen.
    how do i check that the user filled at list one of them.
    any help will be appreciate it.
    dana.

    Hi ,
    You can check that in AT SELECTION-SCREEN event.
    To validate that in the IF condition check whether any one of the parameters
    filled or not.If both the fields are initial then give a error message to proceed further.
    Check the code -
    PARAMETERS : p_name(20) TYPE c,
                 p_id(10) TYPE c.
    AT SELECTION-SCREEN.
      IF p_name IS INITIAL AND p_id IS INITIAL .
        MESSAGE 'Enter at least one field' TYPE 'E'.
      ENDIF.
    START-OF-SELECTION.
      WRITE 'Test'.
    Regards
    Pinaki

  • How to Modify the Selection Screen in Report Painter

    Hi All,
    I am working on Report painter and writer,
    can any body helpme how to change the selection screen i.e i want add some more  select options to the exisiting roport .
    how can i  add more select options to the exisiting one
    please let me know the Procedure and provide some relevent documents .
    Thanks and Best regards.
    uma

    Hello...
    In the program ...we can find the following chunk of code..
    selection-screen:begin of block B1 with frame title text-001.
    Parameters : ....
    select-options:.....
    selection-screen:end of block b1.
    if we need to add any more user inputs we can write the code inside the existing
    selection screen....end of block .
    or create a new block ..just the block name should be different...
    if we are using select options...we need to declare the table name using the key word for the field on which we are giving select options ....
    Tables : BSIK.
    Please see the following code:
    Imagine :- we have the current selection screen..
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS: P_BUKRS LIKE BSIK-BUKRS DEFAULT SPACE.
    SELECT-OPTIONS: S_LIFNR FOR BSIK-LIFNR.
    SELECTION-SCREEN END OF BLOCK B1.
    we need to add 2 more fields on the selection screen ..this we can do as the following
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS: P_BUKRS LIKE BSIK-BUKRS DEFAULT SPACE.
    SELECT-OPTIONS: S_LIFNR FOR BSIK-LIFNR,
                    S_HKONT FOR BSIK-HKONT.
    PARAMETER: P_DATE LIKE BSIK-BUDAT OBLIGATORY DEFAULT
               SY-DATUM.
    SELECTION-SCREEN END OF BLOCK B1.
    OR...create a new block...
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    SELECT-OPTIONS:   S_HKONT FOR BSIK-HKONT.
    PARAMETER: P_DATE LIKE RFPDO-ALLGSTID OBLIGATORY DEFAULT
               SY-DATUM.
    SELECTION-SCREEN END OF BLOCK B2.
    there are many options available in selection screens..like creating check box,radio button etc..
    for more info press F1 help on the Selection screen in the ABAP editor
    Revert back if not clear and reward if helpful
    Regards
    Byju

  • 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

  • Adding a button in selection screen of report ?

    Hi,
    My requirement is to add a Push Button to the selection screen of a report program.
    The button has to be position near the 'Variant' button which is already present.
    How to do this.
    Regards.

    First of all, in initialization event, declare your own status like:
    INITIALIZATION.
      SET PF-STATUS '0100'. "for example - nº doesn't matter
    After that, declare the function codes, in at selection screen event, like:
    AT SELECTION-SCREEN.
    CASE sy-ucomm.
    *** When user press your button
      WHEN 'YOUR_BUTTON_OK_CODE'. "use a small name
    *   ... since you respect other okcodes, don't need to code them
    *** When user press those standard buttons
      WHEN 'BACK' OR 'CANCEL' OR 'RETURN'.
        LEAVE PROGRAM.
    ENDCASE.
    And for your report that's it!!! (again, if in your status you respect all the other status names like F8, PRINT, etc etc ...)
    Now, just need to create the status:
    1 - double click '0100' of PF-STATUS instruction
    2 - in the status, button bar, insert your button (write it's ok_code - 'YOUR_BUTTON_OK_CODE', choose a icon) and F8 button too (don't forget this!), ok_code ONLI and icon ICON_EXECUTE_OBJECT.
    3 - In the function keys, insert BACK, RETURN, CANCEL and PRINT in respective icon places.
    It's simpler than it looks!
    Regards,
    Valter Oliveira.

  • Selection Screen in Report Painter

    Dear Experts,
    I have an issue in the report painter. While executing the report from GRR2, selection screen is not displayed but report is coming as I expected.
    I want to create the selection screen for this report. I have created this report without copying from the standard report.
    Thanks in Advance.
    Regards,
    Aswimn

    Hi,
    Please refer following links.
    <Link farm removed by moderator>
    Regards,
    Renuka S.
    Edited by: Vinod Kumar on May 25, 2011 10:12 AM

  • How to generage pop up screen on selection screen of report program?

    Hi Guys,
            I am having a requirement to generate the <b>pop up screen on the selection screen</b> of the report program.
           Suggest me the best one with model program

    Hi Chakradhar,
                             Refer this code :
    SELECTION-SCREEN BEGIN OF BLOCK BL2 WITH FRAME TITLE TEXT-456.
    PARAMETERS PO RADIOBUTTON GROUP RADI USER-COMMAND R.
    SELECTION-SCREEN END OF BLOCK BL2.
    AT SELECTION-SCREEN OUTPUT.
    CALL SCREEN 100.
    when user will click on this radio button , a pop up screen will appear dynamically.
    Reward points if helpful.
    Regards,
    Hemant

Maybe you are looking for