Exclude Option through Selection Screen

We have BI2004s. This is the scenario
1. Query has a selection screen one of the option is profit center
2. When you click on to select values for input it comes with popup window. We can choose the value we want and say add. on the right hand side it would appear with = selected value.
bold In BusinessExplorer we have an option to exclude this value but bring in every thing else by flip of a button. Is there any thing available through portal?
By default our query is running with 0_BI_ANALYSIS_PATTERN. ( We are not using WAD). We are using the same query we have generated for Bex analyzer throguh portal via an iview.

On the right had side where it is appearing as =, you can also see it as "include". You can change this to exclude the given selection. And if you have any fixed values to be excluded you can directly do that in the query designer.

Similar Messages

  • PS:Copy of MBBS report with Date(GR) selection option in selection screen.

    Hi,
    We are developing a report, which is Copy of MBBS report, addition as Date(GR) selection option in selection screen to view historical data {i.e.Project Stock(Q) on back dates}.
    MBBS is showing Project Stock w.r.t. WBS. So pls suggest Table, which can fulfill the requirement to show the Project Stock from GR w.r.t. Purchase and Production order in back date w.r.t. that WBS.
    Pls do the needful.
    Thanks,
    Amit Jain.

    Hi Amit ,
    The Project Stock Table is MSPR , and the Project stock history table is MSPRH .
    Though not through with your actual requirement , There is a standard Report MB5B -- Stock on Posting Date . In the selection screen , we can have the Special Stock Q (Project Stock ) .
    If you can develop copying this report instead of MBBS , it would take care of receipts as well as issues ,and from the material Document you can build a relation to the account assignment  WBS/Network Activity through MSEG Table .
    Hope it helps .
    thanks and regards
    Kish

  • Folder or File path when f4 option on selection screen is clicked

    can any one please let me know if there is a function module which can fetch folder name form the directory path when f4 option of selection screen field is selected. Currently I am able to get the file name using FM F4_DXFILENAME_4_DYNP but the requirment is like I have to select either folder name or the file name depending on user selection.

    HI
    use the following
    FORM GETFILE.
      CALL FUNCTION 'WS_FILENAME_GET'
       EXPORTING
        DEF_FILENAME           = ' '
         DEF_PATH               = '.'
        MASK                   = ' '
        MODE                   = ' '
        TITLE                  = ' '
       IMPORTING
         FILENAME               = TXT_FILE
        RC                     =
      EXCEPTIONS
        INV_WINSYS             = 1
        NO_BATCH               = 2
        SELECTION_CANCEL       = 3
        SELECTION_ERROR        = 4
        OTHERS                 = 5
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    <b>TMP_GUI_DIRECTORY_LIST_FILES</b>
    Retrieve all of the files and subdirectories on the Presentation Server (PC) for a given directory.
    Example:
    data:  lc_directory         like bdschko16-target_dir value 'C:\TEMP\',
           lc_filter(20)        type c default '.'.
           li_file_count        type i,
           li_dir_count         type i,
           ltab_dir_table       like sdokpath occurs 0 with header line,
           ltab_file_file_table like sdokpath occurs 0 with header line.
    call function 'TMP_GUI_DIRECTORY_LIST_FILES'
      exporting
        directory        = lc_directory
        filter           = lc_filter  importing
        file_count       = li_file_count
        dir_count        = li_dir_count
      tables
        file_table       = ltab_file_table
        dir_table        = ltab_dir_table
      exceptions
        cntl_error       = 1
        others           = 2.
    regards vijay

  • Layout Option on Selection Screen For Zreport

    Hi All,
           Plz explain how to do coding for using Layout option  on selection screen of
    report. Also i should be able to save and create new layout on selection screen.
           Thnaks in advance.
    Aniket Dayama

    hi,
    creation of sub-screens.
    selection-screen begin of tabbed block <name of the tab> for < height of the tab in no's> lines.
    eg;
    selection-screen tab(20) l1 <data element> user-comand <name of the funcion code>
    selection-screen end of block <name of the tab strip>.
    eg;
    selection-screen begin of tabbed block mytab for 10 lines.
    selection-screen tab(20) l1 user-command tab1.
    selection-screen tab (20) l2 user-command tab2..
    selection-screen end of block mytab.
    Under initialization.
    data element = text-01.
    data element = text=02.
    How to initialize the tab with default screen.
    <name of the tab> - prog = sy-repid.
    <name of the tab>- dynnr = '<subscreen no>'.
    <nane of the tab>-activetab = '<user-command for the strip>
    if this has solved ur problem then dont forget to reward with points.
    with regards,
    madhuri.

  • Length of select-options in selection screen.

    Hi,
    I was able to give the lemgth of select-options only upto 8 characters.
    Select-options :S_Mtrial for mara-matnr.
    But my requirement is I want total name which is more than 8 characters.
    Select-options:Material_numberl for mara-matnr.
    Can any one help how to do.
    Thanks in advance.

    The Statement...
    Select-options :S_Mtrial for mara-matnr
    The selection screen length depends on the type that you are assigning to it. Since the length of type
    mara-matnr is less, the selection option S_Mtrial  will be displayed with short length in the selection screen.
    The alternate to do this is...
    selection-screen begin of line.
    selection-screen comment 2(10) text-001.
    select-options : <ur select option name>
    selection-screen end of line.
    Text element,text-001 contains the select option text to be displayed in the screen
    Hope it helps.

  • Side by side select options in selection screen

    Hai Gurus,
    In a report, I need to place Period From and Period To date select-options in selection screen.
    In one line (i.e side by side).
    Appreciate your immediate response.
    Thanks and Regards,
    Kiran.

    Thanks to all,
    I got it.
    my code here.
    SELECTION-SCREEN: BEGIN OF BLOCK sel1 WITH FRAME TITLE text-sel.
    PARAMETERS: SUMMARY AS CHECKBOX USER-COMMAND SUMMARY.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(13) text-pfr.
    SELECT-OPTIONS: VALID_FR FOR ZZUTIL_RATE-VALID_FR MODIF ID RAM no intervals NO-EXTENSION. "changed
    SELECTION-SCREEN COMMENT 30(13) text-pto.
    SELECT-OPTIONS: VALID_TO FOR ZZUTIL_RATE-VALID_TO no intervals NO-EXTENSION. "changed
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN: END OF BLOCK SEL1.

  • To add Language selection option on Selection Screen

    Hi All,
    I have one Report Writer Report.
    In that Report I have created Basic Sets, Single sets and Multi Sets for G/L Account.
    I need to output this Report in two different language.
    1) Engish
    2) Chinese
    But I need to put the option on Selection Screen for Language Selection (whether English or Chinese).
    How to add this option on Selection Screen. Please Guide me soon.
    Regards,
    Rishi

    Hi Ashok,
    But when I hev created the sets, I have given the description of G/L Accounts in English. But when I will run the Report using Cinese as Logon language, how output will come in Chinese.
    1) Is there a need to maintain /L Accounts in Chinese language.
    2) or Shall i create the sets by giving description for G/L Accounts in Chinese If Yes then how to hadndle at run time..
    please guide I am new to Report writer.
    Regards,
    Rishi

  • Printer option in selection screen (Input Parameter)

    Hi All,
    I want to give printer option in selection screen.
    Please do needful help.
    Regards.

    Hi,
    in the PF-STATUS if u enable the Printer Icon on Application Tool Bar and in the PAI Event in the
    User Command Module get the FCODE and apply the following FM ALINK_PRINT_FRONTEND
    Hope this works ....
    Best of luck!!
    Thanks
    Ravi

  • How to restrict more than one 1 range in select option on selection screen.

    Hi all,
    I have a requirement where I need to restrict user from giving more than 1 range for a date selct option ..other all features of multiple selection will be as usual...
    for eg we can do this if we disable / hide other cells if the user clicks on multiple ranges tab.. If only 1 cell is available to give the range user will not be able to give more than 1 range....
    I was thinking if I could use select_options_restrict but how do i fill its parameters...
    Can anyone send me the sample code or the same to achieve this functionality...I have used select_options_restrict to hide multiple ranges itself  ... But here user will be able to give range but only 1....
    Thanks and Regards
    Sweta

    HI,
    Please try the below logic.
    SELECT-OPTIONS: so_addr   FOR    ADR6-SMTP_ADDR NO INTERVALS.
    ***********remove_range_for_select_option******************* .
      DATA: ls_restrict  TYPE  SSCR_RESTRICT,    "The type for SELECT_OPTIONS_RESTRICT
            ls_opt_list  TYPE  SSCR_OPT_LIST,    "One list of options
            ls_asn       TYPE  SSCR_***.         "One line of table associating selection screen
                                                                      "object with opt. list
      CLEAR: ls_restrict,
             ls_opt_list,
             ls_asn.
    *Only EQ valid, discrete values, Include & Exclude
      ls_opt_list-name       = 'EQ'.
      ls_opt_list-options-eq = 'X'.
      APPEND ls_opt_list TO ls_RESTRICT-OPT_LIST_TAB.
      LS_ASN-KIND            = 'S'.
      LS_ASN-NAME            = 'SO_ADDR'.            "Select Option
      LS_ASN-SG_MAIN         = 'I'.
      LS_ASN-SG_ADDY         = '*'.
      LS_ASN-OP_MAIN         = 'EQ'.
      LS_ASN-OP_ADDY         = ' '.
      APPEND LS_ASN TO LS_RESTRICT-***_TAB.
    *Make use of SELECT-OPTIONS easier on the selection screen
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
        EXPORTING
          RESTRICTION            = LS_RESTRICT
        EXCEPTIONS
          TOO_LATE               = 1
          REPEATED               = 2
          SELOPT_WITHOUT_OPTIONS = 3
          SELOPT_WITHOUT_SIGNS   = 4
          INVALID_SIGN           = 5
          EMPTY_OPTION_LIST      = 6
          INVALID_KIND           = 7
          REPEATED_KIND_A        = 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.
    Edited by: Rajasekhar Reddy P on Mar 16, 2009 2:03 PM

  • How to remove Include/Exclude option on variable screen

    Hi,
    How to remove the include/exclude option in the variable screen for the variable of type selection option.
    Regards,
    Suresh.

    Hi Pradeep,
    You mean in the Query Designer.I tried to create a new variable There is nothing like select appropriate variable.
    Be more specific.Thanks.
    Regards,
    Suresh

  • Restricting user to exclude values in selection screen

    Hi Everybody,
    I am facing a problem with f.m SELECT_OPTIONS_RESTRICT.
    I want to restrict user, so that he will only be able to exclude values (single, multiple or range) from a selection-option.
    The code snippet is as follows:
    item messages -> restrict selection
      opt_list-name = 'EXCLUDE'.
      opt_list-options-ne = 'X'.
      opt_list-options-nb = 'X'.
      APPEND opt_list TO restrict-opt_list_tab.
      ***-kind = 'B'.
      ***-name = 'A2'.
      ***-sg_main = 'I'.
      ***-sg_addy = ' '.
    ***-op_main = 'EXCLUDE'.
      ***-op_addy = 'EXCLUDE'.
      APPEND *** TO restrict-***_tab.
      CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
        EXPORTING
        PROGRAM                      =
          restriction                  = restrict
        DB                           = ' '
        EXCEPTIONS
         TOO_LATE                     = 1
         REPEATED                     = 2
         SELOPT_WITHOUT_OPTIONS       = 3
         SELOPT_WITHOUT_SIGNS         = 4
         INVALID_SIGN                 = 5
         EMPTY_OPTION_LIST            = 6
         INVALID_KIND                 = 7
         REPEATED_KIND_A              = 8
         OTHERS                       = 9
    But this is only including the single multiple and range value. Can anyone throw some light on it?
    Thanks
    Samit

    I took a look at the documentation of this FM to confirm what I was thinking:
    "You can also disable the function allowing users to enter values to be excluded from the selection (SIGN = 'E')."
    So I think this is trying to tell us that we can turn off the ability for the user to enter "exclude" but we cannot turn off the option for the user to enter "include" options.
    When you set ***-sg_main = 'I', it means that only "include" options are allowed.
    I think you will need to do your own validation.
    In the event AT SELECTION SCREEN you can do a LOOP on your selection option name and validate the users selections:
    LOOP AT SO_MINE.
      IF SO_MINE-SIGN NE 'E'.
        SET CURSOR FIELD 'SO_MINE-LOW'.
        MESSAGE E123.
      ENDIF.
    ENDLOOP.
    It has been awhile since I used this FM so please let us know how it goes.

  • Single Multiple select option in selection screen

    Dear All,
    I want to have single multiple selection functionality on the selection screen.I have used function module  'SELECT_OPTIONS_RESTRICT'. but my problem is it only allows to include single vals but does not give me an option to exclude single vals. how should I go about it. If you have some example or piece of code , i would be grateful.
    Thanks
    Amit

    Hi Amit,
      Where have you written this code?
      It normally should be in AT SELECTION-SCREEN OUTPUT.
      (Infact even in INITIALIZATION, try it out) 
      Also did you declare SELECT-OPTION with NO INTERVALS addition?
      Here is a sample code that works,
    REPORT zsritest.
    TYPE-POOLS: sscr.
    TABLES vbak.
    SELECT-OPTIONS: so_vbeln FOR vbak-vbeln NO INTERVALS.
    AT SELECTION-SCREEN OUTPUT.
    DATA: s_restrict TYPE sscr_restrict,
    s_opt_list TYPE sscr_opt_list,
    s_*** TYPE sscr_***.
    s_opt_list-name = 'EQ_ONLY'.
    s_opt_list-options-eq = 'X'.
    s_opt_list-options-ne = 'X'.
    APPEND s_opt_list TO s_restrict-opt_list_tab.
    CLEAR s_***.
    s_***-kind = 'S'.
    s_***-name = 'SO_VBELN'.
    s_***-sg_main = '*'. "This will allow I/E signs
    s_***-sg_addy = ' '.
    s_***-op_main = 'EQ_ONLY'.
    APPEND s_*** TO s_restrict-***_tab.
    CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
    EXPORTING
    restriction = s_restrict
    EXCEPTIONS
    OTHERS = 0.
    Sri
    Message was edited by: Srikanth Pinnamaneni

  • Select-options in Selection Screen to show more rows for entering values

    Hi all,
    In my webdynpro abap  I have added the SELECT-OPTIONS componenet and working fine.
    User need  in the Selection Screen for select options  more rows to show entering values in single time.
    THe Default Rows show only 5 .
    user need to change to 10 or 15 Rows to show.
    Pl help .
    THanks in advance.
    Dev

    Hi,
    Here is the way which I just tested and found working.
    This is the main code which needs to be written.
    TYPES:
        ty_r_vbeln TYPE RANGE OF vbeln,
        ty_s_vbeln TYPE LINE OF ty_r_vbeln.
    data ls_vbeln type ty_s_vbeln.
    field-symbols <fs_range> TYPE INDEX TABLE.
    ASSIGN lt_range->* TO <fs_range>.
    do 10 times.
    APPEND ls_vbeln TO <fs_range>.
    enddo.
    For further refinement, you can create a input field in view for number of lines to be shown as enabled.
    The complete code is as below.
    DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
    lo_cmp_usage =   wd_this->wd_cpuse_select_options( ).
    IF lo_cmp_usage->has_active_component( ) IS INITIAL.
      lo_cmp_usage->create_component( ).
    ENDIF.
    DATA lo_interfacecontroller TYPE REF TO iwci_wdr_select_options .
    lo_interfacecontroller =   wd_this->wd_cpifc_select_options( ).
    DATA lo_r_helper_class TYPE REF TO if_wd_select_options.
    lo_r_helper_class = lo_interfacecontroller->init_selection_screen(  ).
    Creating range table
    DATA lt_range TYPE REF TO data.
    CALL METHOD lo_r_helper_class->create_range_table
        EXPORTING
          i_typename     = 'VBELN'
        RECEIVING
          rt_range_table = lt_range.
    Disabling the global options
    CALL METHOD lo_r_helper_class->set_global_options
      EXPORTING
          i_display_btn_cancel  = abap_false
          i_display_btn_check   = abap_false
          i_display_btn_reset   = abap_false
          i_display_btn_execute = abap_true.
           TYPES:
        ty_r_vbeln TYPE RANGE OF vbeln,
        ty_s_vbeln TYPE LINE OF ty_r_vbeln.
    data ls_vbeln type ty_s_vbeln.
    field-symbols <fs_range> TYPE INDEX TABLE.
    ASSIGN lt_range->* TO <fs_range>.
    do 10 times.
    APPEND ls_vbeln TO <fs_range>.
    enddo.
    Adding the selection field
    CALL METHOD lo_r_helper_class->add_selection_field
        EXPORTING
          i_id                         = 'VBELN'
          I_OBLIGATORY                 = ABAP_TRUE
          I_NO_EXTENSION               = abap_false
          i_value_help_type = if_wd_value_help_handler=>CO_PREFIX_SEARCHHELP
          it_result                    = lt_range.
    Edited by: Jayanthi Jayaraman on Dec 2, 2010 8:29 AM

  • 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

  • Hideing the select options in selection screen

    I have 2 radio buttons in the selection screen.
    SELECTION-SCREEN BEGIN OF BLOCK b2 with frame title text-018.
    parameters : GR1  Radiobutton group rg1 default 'X',
                 GR2  Radiobutton group rg1.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b1 with frame title text-017.
    Select-options : z_s_werk for t001w-werks obligatory,
                         z_s_matn  for marc-matnr,
                         z_s_bdat for mkpf-budat obligatory.
                        z_s_lifn for mseg-lifnr.
                         z_s_sgtx for mseg-sgtxt.
                        z_s_bwar for mseg-bwart.
    SELECTION-SCREEN END OF BLOCK b1.
    if GR1 = 'X'.
    i have  to  hide   z_s_sgtx for mseg-sgtxt.
    if GR2 = X.
    I  have  to hide  z_s_lifn for mseg-lifnr.
    is there any way for hideing this.
    Regards,
    Selvapriya S.

    hi,
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-018.
    PARAMETERS : gr1 RADIOBUTTON GROUP rg1 DEFAULT 'X' USER-COMMAND ud,
                 gr2 RADIOBUTTON GROUP rg1.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-017.
    " Remove obligatory and do validations for the fileds which have OBLIGATORY at EVENT
    " AT SELECTION-SCREEN .
    SELECT-OPTIONS : z_s_werk FOR t001w-werks ,"(OBLIGATORY)
                     z_s_matn FOR marc-matnr,
                     z_s_bdat FOR mkpf-budat," OBLIGATORY,
                     z_s_lifn FOR mseg-lifnr,
                     z_s_sgtx FOR mseg-sgtxt,
                     z_s_bwar FOR mseg-bwart.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN OUTPUT.
      IF gr1 = 'X'.
        LOOP AT SCREEN.
         IF screen-name = 'Z_S_SGTX-LOW'                 OR
             screen-name = 'Z_S_SGTX-HIGH'                OR
             screen-name = '%_Z_S_SGTX_%_APP_%-VALU_PUSH' OR
             screen-name = '%_Z_S_SGTX_%_APP_%-VALU_PUSH' OR
             screen-name = '%_Z_S_SGTX_%_APP_%-TO_TEXT'   OR
             screen-name = '%_Z_S_SGTX_%_APP_%-OPTI_PUSH' OR
             screen-name = '%_Z_S_SGTX_%_APP_%-TEXT'.
            screen-active = 0.
          ELSE.
            screen-active = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ELSE.
        LOOP AT SCREEN.
       IF screen-name = 'Z_S_LIFN-LOW'                 OR
             screen-name = 'Z_S_LIFN-HIGH'                OR
             screen-name = '%_Z_S_LIFN_%_APP_%-VALU_PUSH' OR
             screen-name = '%_Z_S_LIFN_%_APP_%-VALU_PUSH' OR
             screen-name = '%_Z_S_LIFN_%_APP_%-TO_TEXT'   OR
             screen-name = '%_Z_S_LIFN_%_APP_%-OPTI_PUSH' OR
             screen-name = '%_Z_S_LIFN_%_APP_%-TEXT'.
            screen-active = 0.
          ELSE.
            screen-active = 1.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    for example.
    AT SELECTION-SCREEN on Z_S_SGTX.
    if Z_S_SGTX is initial.
    " Raise an error message here
    Endif.
    Thanks & REgards

Maybe you are looking for