Describe a select-option

Hi All,
I want to describe a select-option the value is stored in a field-symbol.
Actually I have a field-symbol which has the name of my select-option. I want to access that field symbol to describe that select-option.
Eg. <fs> = MATNR.
MATNR is also a select-option. I want to access the value 'LOW' of the select-option. But I dont want to describe the select-option for it rather want to use the field-symbol.
Regards,
Anju

you can try this
FIELD-SYMBOLS : <FS1> TYPE ANY.
ASSIGN COMPONENT 'LOW' OF STRUCTURE S_MATNR to <FS1>.
now <FS1> will store the LOW value of select option MATNR

Similar Messages

  • Select Options, Report Painter

    How can I create "Select Options" for a variable in the "General Data Selection" of the report painter screen.
    Thank You.

    If you specify selection parameters for several years and periods in a
        Report Writer or Report Painter report, the characteristics year and
        period are taken into account independent of each other.
        A report with the selections:
               From-year   :    1997
               To-year     :    1999
               From-period :     003
               To-period   :     008
        will hence select all the following data:
                003/1997 .. 008/1997, 003/1998 .. 008/1998, 003/1999 .. 008/1999
         This is the standard behavior of Report Writer and Report Painter
         reports.
         However, reports which directly display the data for the period
                003/1997 .............................................  008/1999
         are required in some cases.
         You can achieve this in the report definition using the following
         procedure.
         Additional key words
         several years several periods GS274
         rolling periods, rolling
               SUPPORTGUIDE 20010330131459
         REPORTWRITER, SGRW_DOCU_CONS_NOTE,
         SGRW_OM SGRW_PS SGRW_PC SGRW_SL SGRW_PCA SGRW_EC SGRW_LIS
         Cause and prerequisites
         This is a standard behavior of the Report Writer.
         Solution
         A procedure is described below to implement the selection over a period
         of several years and periods. This is merely an example which should
         serve as a support for experienced users of the Report Painter and
         Report Writer when defining their own reports.
         1.  Definition of auxiliary column 1: 'All-periods'
             Period:   0  ...  17
             Year:      From-year .. To-year
             000/1997.....................................................017/1999
             Definition of auxiliary column 2: 'Periods before'
             Period:   0 ... From-period - 1
             Year:      From-year
             000/1997..002/1997
             Definition of auxiliary column 3: 'Periods after'
             Period:    To-period + 1 .. 17
             Year:      To-year
             009/1999..017/1999
             Definition of the formula column:
             Formula = 'All-periods' - 'Periods before' - 'Periods after'
             000/1997.....................................................017/199
             9
             000/1997..002/1997
             009/1999..017/1999
                                003/1997............... 008/1999
             Hide the three auxiliary columns. The formula column now correctly
             shows the required period
                                003/1997............... 008/1999
      Note:The new reporting table RWCOOM is also available as of Release 4.0
      for reports which were, up to now, defined in table CCSS. RWCOOM
      contains the characteristic FISCPER which represents a combination of
      year and period. You can directly define reports over several years and
      periods using characteristic FISCPER without having to follow the
      procedure described above.
      Please take into account that you cannot call reports via report
      Interfaces in the formula columns (see Note 98187).
      If you have any query, you may reach me
    Dr. Ravi Surya Subrahmanyam, PhD Finance,
    SAP FICO Consultant,
    Answerthink (India) Limited,
    Hyderabad. AP. India
    Phone : +91 9848550024
    Email : [email protected]

  • Select-Options in ALV

    Hai Friends,
    Following is my requirement:
    My input is Plant and Date in select-options.
    When the plant entered for single entry i should display the text Plant : 1100 in my output.
    When it is entered as range both the text plant and the value should not displayed.
    i have tried using if not so_plant-high is initial logic. Its working only if the user enters in the From and To option. If they give the entry in the multiple range ( That is by clicking the side arrow) this logic is not working.
    How can i build the logic?.

    Instead of if not so_plant-high is initial, try like this:
    DESCRIBE TABLE SO_PLANT LINES L_LINES.
    IF L_LINES = 1.
    CHECK SO_PLANT-HIGH IS INITIAL.
    *  fill the header with plant
    ENDIF. 
    Regards,
    Naimesh Patel

  • Default Current year in select option field on selection Screen

    Dear Experts,
    I want to set current year as default value in fiscal year select-options field on selection screen.
    for this, i hv written following code
    DATA:VAR_DATE TYPE SY-DATUM.
    DATA VAR(4) TYPE C.
    VAR_DATE = SY-DATUM.
    VAR = VAR_DATE+0(4).
    this retrieves current year .
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
    SELECT-OPTIONS I11 FOR ANLC-GJAHR DEFAULT VAR TO VAR..                            "Fiscal Year
    SELECTION-SCREEN END OF BLOCK B1.
    Now when i am executing program pop-up is raised describing "Specify the range Limits". Please help.
    Regards,
    Apoorv Sharma

    >
    Ganga Bhavani R wrote:
    > Use below lines.
    >
    > SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
    > SELECT-OPTIONS I11 FOR ANLC-GJAHR DEFAULT SY-DATUM+0(4). "Fiscal Year
    > SELECTION-SCREEN END OF BLOCK B1.
    Hi, Ganga,
    I think it will not working properly that way, Please test the bellow Sample Code.
    TABLES: anlc.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS i11 FOR anlc-gjahr .
    SELECTION-SCREEN END OF BLOCK b1.
    INITIALIZATION.
      IF i11[] IS INITIAL.
        i11-low = sy-datum+0(4).
        APPEND i11.
      ENDIF.
    Thanks and Regards,
    Faisal

  • Select-options problem in dynpro

    hi experts,
                         my requirement is to include select-options in module pool programming. So far i have called a subscreen from a zreport to my dynpro screen.
    but how can i fetch the value from that select-options.By what reference,I mean by what name i can refer to select-options.
    ztest.
    report ztest.
    tables: t001.
    selection-screen begin of screen 100 as subscreen.
    select-options: s_bukrs for t001-bukrs.
    selection-screen: end of screen 100.
    Module pool
    process before output.
    MODULE STATUS_0001.
    call subscreen sub including 'ZTEST' '100'.
    process after input.
    MODULE USER_COMMAND_0001.
    call subscreen sub.
    in debugger s_bukrs in unknown. So by what name i should refer to that select-options values??
    Thanks
    Gaurav

    hi,
    cant u do like this?
    TABLES: mara.
    DATA : BEGIN OF itab1 OCCURS 0,
            matnr LIKE mara-matnr,
           END OF itab1.
    SELECT-OPTIONS : s_matnr FOR mara-matnr.
    *&SPWIZARD: DECLARATION OF TABLECONTROL 'TAB1' ITSELF
    CONTROLS: tab1 TYPE TABLEVIEW USING SCREEN 1001.
    START-OF-SELECTION.
      CALL SCREEN 1001.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'TAB1'. DO NOT CHANGE THIS LINE!
    *&SPWIZARD: UPDATE LINES FOR EQUIVALENT SCROLLBAR
    MODULE tab1_change_tc_attr OUTPUT.
      DESCRIBE TABLE itab1 LINES tab1-lines.
    ENDMODULE.                    "TAB1_CHANGE_TC_ATTR OUTPUT
    *&      Module  get_data  OUTPUT
          text
    MODULE get_data OUTPUT.
      SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE itab1 WHERE matnr IN s_matnr.
    ENDMODULE.                 " get_data  OUTPUT
    *&      Module  STATUS_1001  OUTPUT
          text
    MODULE status_1001 OUTPUT.
      SET PF-STATUS 'ZTEST'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_1001  OUTPUT
    *&      Module  USER_COMMAND_1001  INPUT
          text
    MODULE user_command_1001 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK' OR 'UP' OR 'CANC'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_1001  INPUT
    here i have table control on my screen and rather calling selection screen as sub screen i am calling screen for output from z report it self.....

  • Require select-option functionality in Module Pool Programming

    Hi Gurus,
    I am doing a development by Module Pool on Warehouse Management. For that development user require select-option on
    screen for entering multiple storage type.
    My first question : Is any thing available for directly implement select-option by module pool ?
    My Second Question : I have use two text boxes for range and one button for multiple selection and arrange on screen like select-option. then on PAI of that button I call COMPLEX_SELECTIONS_DIALOG FM. Now it is working fine. Now I put some value in it. when I save the values and exit , I want the icon of the button must change from icon_enter_more to icon_display_more. I write the below code for that  in PBO of the screen:
           if rtab[] is initial.   "RTAB[] is a table for holding values what inputted in popup of multiple selection.
              write icon_enter_more as icon to button.  " BUTTON is screen field and it taken as a type C length 4 on TOP module as .
          else.                                                               " BUTTON taken on screen as push button.
              write icon_display_more as icon to button.
          endif.
    but the icon is not changing dynamically.
    If I use ICON_CREATE then one short dump happen describing OUTPUTLEN_TOO_SMALL.
    Can anybody please give me the solution.

    IN PBO SECTION.
    module STATUS_0001 output.
      SET PF-STATUS 'ZINVGUI'.
      SET TITLEBAR 'ZIN'.
    if rbtn1 = 'X'.
       loop at screen.
         if screen-group1 = 'GR2'.
         screen-input = 0.
         modify screen.
         endif.
       endloop.
    else.
       loop at screen.
         if screen-group1 = 'GR1'.
         screen-input = 0.
         modify screen.
         endif.
       endloop.
    endif.
    IF RTAB[] IS INITIAL.
       WRITE icon_enter_more AS ICON TO GTTYP.
      else.
       WRITE icon_display_more AS ICON TO GTTYP.
    endif.
    endmodule.
    IN PAI
    form GET_STORAGE_TYPE .
    TAB_FIELD-FIELDNAME = 'LGTYP'.
    TAB_FIELD-TABLENAME = 'LQUA'.
      CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
       EXPORTING
         TITLE                   = ' '
         TEXT                    = 'Storage Types'
        SIGNED                  = 'X'
        LOWER_CASE              = ' '
        NO_INTERVAL_CHECK       = ' '
        JUST_DISPLAY            = ' '
        JUST_INCL               = ' '
        EXCLUDED_OPTIONS        =
        DESCRIPTION             =
        HELP_FIELD              =
        SEARCH_HELP             =
         TAB_AND_FIELD           = TAB_FIELD
        TABLES
          range                   = RTAB
       EXCEPTIONS
         NO_RANGE_TAB            = 1
         CANCELLED               = 2
         INTERNAL_ERROR          = 3
         INVALID_FIELDNAME       = 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.
      DATA:LAST TYPE SY-TABIX.
      DESCRIBE TABLE RTAB LINES LAST.
      IF NOT rTAB[] IS INITIAL.
             Read the very first entry of the range table and pass it to
             dynpro screen field
               READ TABLE rTAB INDEX 1.
               IF sy-subrc = 0.
                  P_LGTYP1 = rTAB-low.
               ENDIF.
               READ TABLE RTAB INDEX LAST.
               IF sy-subrc = 0.
                  P_LGTYP1U = rTAB-LOW.
               ENDIF.
    ELSE.
      rTAB-low = p_lgtyp1.
      append rtab.
      rTAB-low = p_lgtyp1u.
      append rtab.
    ENDIF.
    endform.               
    IN TOP INCLUDE.
    DATA : GTTYP TYPE C length 4.

  • Problem in Select-option in Module Pool Programming

    Hi,
    I'm making one module pool programming. In that, I've to make select-option. For that I'm using this command --
    1) In PBO --
    CALL SUBSCREEN sub INCLUDING 'YBOE_PRINT' '5100'.
    2) In PAI --
    CALL SUBSCREEN sub.
    But, Syntax Error is generated as below --
    "." or "ID.........FIELD" expected after "SUBSCREEN"
    Please suggest.
    Thanks.
    Kumar Saurav.

    Hi Ramchander,
    Thanks for replying. But, even if I changed Prog_Name with term 'repid', that same error regarding
    "." or "ID ... FIELD ..." expected after "SUBSCREEN"
    is coming up.
    I guess, there is any step missing.
    Lemme describe what I'm doing in points --
    1) I declared SELECTION-SCREEN with screen no --
    SELECTION-SCREEN BEGIN OF SCREEN 5100 AS SUBSCREEN.
          PARAMETERS : p_bukrs TYPE ekko-bukrs OBLIGATORY DEFAULT '1000'.
          SELECT-OPTIONS: kunnr FOR kna1-kunnr.
          select-options: gjahr for bsid-gjahr.
          select-options: bank for bsed-bank.
          select-options: budat for bsid-budat.
          SELECTION-SCREEN END OF SCREEN 5100.
    2) Then I made a call in PBO as given above.
    3) Finally, a call to that subscreen is made in PAI - again as given above.
    When I checked that, this gave the error.
    Are you looking any erroneous step ...?
    Please guide.
    Thanks.
    Kumar Saurav.

  • Restrict the no of values to 10 for select-options

    hi gurus,
    i have the require that the user can put only 10 distinct values for a select-option for selection screen....now to disable range selection and other signs than eq to i have used function module select_options_restrict..
    The only thing which i could'nt do is restricting the values to 10. That is I want to disable (grey out ) the rows after 10 so that the user if wants also cannot put more than 10 values....i dont want to go by the convention method of displaying an error message that only 10 values are permitted...instead i will keep the provision of disabling after 10 values...
    i guess that when we press the extension button the screen that comes for multiple selection is a module pool screen....so do we need to modify that screen or may be there is some other method...
    please help.....

    im not aware of restricting the user form entry itself instead.
    let the user enter the values..
    select-options:so_dat for sy-datum.
    at selection-screen on so_dat.
    describe table so_dat lines wk_lines.
    if wk_lines > 10.
    throw message
    endif.

  • Restrict the no. of rows entered in select-options

    Dear ABAPers,
    I have used CALL FUNCTION 'SELECT_OPTIONS_RESTRICT' to only allow user key in single value. The field is BUKRS(Company Code). Can I restrict the number of company code entered by user in this select-option? Please advise.
    Thanks in advance.
    Best Regards,
    Hikaruno

    Sure, just do a check in the AT SELECTION-SCREEN event.
    at selection-screen.
    data: lines type i.
    describe table s_bukrs lines lines.
    if lines > 10.
      message e001(00) with 'More than 10 entries'.
    endif.
    Regards,
    RIch Heilman

  • Restrict number of entries in Select-Options

    Hi,
    I would like to restrict the number entries in select options. Lets say I have select options field defined for GL and I want only 10 GLs to be entered on Select-Options. If more than 10 Gls then it should give message that GL count is exceeding its Limit.
    Please may I know how I can do this ?
    Thanks for you help.

    Try this if you want to restrict rows in s_matnr for example.
    At selection screen.
    data: line type i.
    describe table s_matnr lines line.
    if line > 10.
       Message 'Error' Type 'E'.
    endif.
    or else if you want only 10 Materials to be selected then try this.
    At selection-screen.
    if s_matnr-high - s_matnr-low > 10.
        Message 'Error' type 'E'.
    endif.
    Regards,
    Vamsi

  • How to change the select-options fields length to long

    Dear friends:
       I had develop a program for sent email,and it have a field for fill mail address as below:
       data: lmail like adr6-smtp_addr.
       select-options: mailadd for lmail no intervals.
       my customer complain that the field is too short,but I can not change it to longer,the select-options component limit the visible length , how can i do for this problem!

    Dear All:
      I had realized this function.
      I defined a parameter and a pushbutton to replace the select-option componet,
    the code share as below.
    data: lmail like adr6-smtp_addr.
    SELECTION-SCREEN BEGIN OF LINE.
    parameters: mailCopy like lmail.
    selection-screen:pushbutton 64(5) pubu user-command mailButt.
    SELECTION-SCREEN END OF LINE.
    select-options: mailadd for lmail NO INTERVALS no-display.
    at selection-screen output.
      CLEAR l_count.
      DESCRIBE TABLE mailadd LINES l_count.
      IF l_count > 1.
        write ICON_DISPLAY_MORE as icon to pubu.
      ELSE.
        write ICON_ENTER_MORE  as icon to pubu.
      ENDIF.
    at selection-screen.
      CLEAR l_count.
      DESCRIBE TABLE mailadd LINES l_count.
      IF NOT mailCopy IS INITIAL AND mailadd[] IS INITIAL.
        MailAdd-low = mailCopy.
        Append mailadd.
      ENDIF.
      IF l_count = 1 and mailCopy IS INITIAL.
        refresh mailadd.
        clear mailadd.
      endif.
      if sy-ucomm = 'MAILBUTT'.
        perform show_box.
      endif.
    *       FORM show_box                                                 *
    FORM show_box.
      TYPE-POOLS aqadh .
      DATA: tab_and_field TYPE  rstabfield.
      tab_and_field-tablename = 'ADR6'.
      tab_and_field-fieldname = 'SMTP_ADDR'.
      CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
           EXPORTING
                TEXT           = 'SET E-Mail To '
                tab_and_field  = tab_and_field
           TABLES
                range          = MAILADD
           EXCEPTIONS
                no_range_tab   = 1
                cancelled      = 2
                internal_error = 3
                OTHERS         = 4.
      IF NOT MAILADD[] IS INITIAL.
        READ TABLE MAILADD INDEX 1.
        MAILCopy = MAILADD-LOW.
      ELSE.
        CLEAR MAILCopy.
      ENDIF.
    ENDFORM.

  • Passing Select-options to methods ?

    Hi,
    I want to create a method and pass a select-option to it. How to declare the parameter for this method.
    regards,
    Navneeth K.

    Hello Navneeth
    Sorry for the delay (I could not reply in the morning).
    However, here is a sample report showing how class <b>CL_DBSEL_CATS</b> can be used to select CATSDB data. The select-options are transferred via <b>sy-repid</b> to the class.
    *& Report  ZUS_SDN_ALV_CATSDB_SELECT
    *&  Screen '0100' contains no elements. ok_code -> assigned to GD_OKCODE
    *&  Flow logic of screen '0100':
    *&  PROCESS BEFORE OUTPUT.
    *&    MODULE STATUS_0100.
    *&  PROCESS AFTER INPUT.
    *&    MODULE USER_COMMAND_0100.
    *& Description: Transfer select-options from selection screen into
    *&              method via sy-repid
    REPORT  zus_sdn_alv_catsdb_select.
    TABLES: catsdb.
    CONSTANTS:
      gc_tabname         TYPE tabname  VALUE 'CATSDB_EXT'.
    DATA:
      gd_okcode          TYPE ui_func,
      gd_repid           TYPE syrepid,
      gd_rejected        TYPE catsxt_reject_count,
      gd_rejected_n(6)   TYPE n,
      gt_fcat            TYPE lvc_t_fcat,
      gs_layout          TYPE lvc_s_layo,
      gs_variant         TYPE disvariant,
      go_docking         TYPE REF TO cl_gui_docking_container,
      go_grid            TYPE REF TO cl_gui_alv_grid.
    DATA:
      go_cats            TYPE REF TO cl_dbsel_cats.
    DATA:
      gt_outtab          TYPE catsdb_ext_itab.
    " NOTE: select-options MUST have the same names as defined in
    "       instance attribute SELCRIT (of class CL_DBSEL_CATS)
    SELECT-OPTIONS:
      ldbpernr           FOR catsdb-pernr,
      ldblgart           FOR catsdb-lgart,
      ldblstar           FOR catsdb-lstar  DEFAULT '1410' TO '1412'
                                                   SIGN i OPTION bt.
    *       CLASS lcl_eventhandler DEFINITION
    CLASS lcl_eventhandler DEFINITION.
      PUBLIC SECTION.
        CLASS-METHODS:
          handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
            IMPORTING
              e_row
              e_column
              es_row_no
              sender.  " grid instance that raised the event
      PRIVATE SECTION.
        CLASS-DATA:
          ms_outtab      LIKE LINE OF gt_outtab.
    ENDCLASS.                    "lcl_eventhandler DEFINITION
    *       CLASS lcl_eventhandler IMPLEMENTATION
    CLASS lcl_eventhandler IMPLEMENTATION.
      METHOD handle_double_click.
    *   define local data
        DATA:
          ls_col_id   TYPE lvc_s_col.
        READ TABLE gt_outtab INTO ms_outtab INDEX e_row-index.
        CHECK ( syst-subrc = 0 ).
        CASE e_column-fieldname.
          WHEN 'PERNR'.
    **        SET PARAMETER ID 'KUN' FIELD ms_outtab-pernr.
    **        SET PARAMETER ID 'BUK' FIELD ms_outtab-bukrs.
    **        CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
          WHEN OTHERS.
    *       do nothing
        ENDCASE.
      ENDMETHOD.                    "handle_double_click
    ENDCLASS.                    "lcl_eventhandler IMPLEMENTATION
    START-OF-SELECTION.
      gd_repid = syst-repid.
    " Create instance for selecting CATSDB data
      CREATE OBJECT go_cats
        EXPORTING
          im_calling_program = gd_repid  " <= 'import' of select-options !!!
    *      IM_AUTHORITY_CHECK_TYPE = 'R'
    *      IM_FIELD_SELECTION =
    *      IM_SELECTION_CRITERIA =
    *      IM_FREE_SELECTIONS =
    *      IM_BADI =
    " Select records from CATSDB -> uses select-options from current report
      CALL METHOD go_cats->get_time_sheet_data
    *    EXPORTING
    *      IM_PERSONNEL_NUMBER_TAB =
        IMPORTING
          ex_cats_data            = gt_outtab
    *      EX_CATSXT_DATA          =
    *      EX_DOCFLOW              =
      gd_rejected = go_cats->get_reject_count( ).
      IF ( gd_rejected > 0 ).
        WRITE gd_rejected TO gd_rejected_n NO-ZERO.
        CONDENSE gd_rejected_n NO-GAPS.
        MESSAGE i398(00) WITH 'Rejected records =' gd_rejected_n ' ' ' '.
      ENDIF.
      DESCRIBE TABLE gt_outtab.
      WRITE syst-tfill TO gd_rejected_n NO-ZERO.
      CONDENSE gd_rejected_n NO-GAPS.
      MESSAGE s398(00) WITH 'Selected records =' gd_rejected_n ' ' ' '.
    * Create docking container
      CREATE OBJECT go_docking
        EXPORTING
          parent                      = cl_gui_container=>screen0
          ratio                       = 90
        EXCEPTIONS
          OTHERS                      = 6.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Create ALV grid
      CREATE OBJECT go_grid
        EXPORTING
          i_parent          = go_docking
        EXCEPTIONS
          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.
    * Set event handler
      SET HANDLER:
        lcl_eventhandler=>handle_double_click FOR go_grid.
    * Build fieldcatalog
      PERFORM build_fieldcatalog.
      PERFORM set_layout_and_variant.
    * Display data
      CALL METHOD go_grid->set_table_for_first_display
        EXPORTING
          is_layout       = gs_layout
          is_variant      = gs_variant
          i_save          = 'A'
        CHANGING
          it_outtab       = gt_outtab
          it_fieldcatalog = gt_fcat
        EXCEPTIONS
          OTHERS          = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Link the docking container to the target dynpro
      CALL METHOD go_docking->link
        EXPORTING
          repid                       = syst-repid
          dynnr                       = '0100'
    *      CONTAINER                   =
        EXCEPTIONS
          OTHERS                      = 4.
      IF sy-subrc <> 0.
    *   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * ok-code field = GD_OKCODE
      CALL SCREEN '0100'.
    END-OF-SELECTION.
    *&      Module  STATUS_0100  OUTPUT
    *       text
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'STATUS_0100'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
    *       text
    MODULE user_command_0100 INPUT.
      CASE gd_okcode.
        WHEN 'BACK' OR
             'EXIT'  OR
             'CANC'.
          SET SCREEN 0. LEAVE SCREEN.
        WHEN OTHERS.
      ENDCASE.
      CLEAR: gd_okcode.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  BUILD_FIELDCATALOG_KNB1
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_fieldcatalog.
    * define local data
      DATA:
        ls_fcat        TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
    *     I_BUFFER_ACTIVE              =
          i_structure_name             = gc_tabname
    *     I_CLIENT_NEVER_DISPLAY       = 'X'
    *     I_BYPASSING_BUFFER           =
    *     I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = gt_fcat
        EXCEPTIONS
          inconsistent_interface       = 1
          program_error                = 2
          OTHERS                       = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  SET_LAYOUT_AND_VARIANT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_layout_and_variant .
      CLEAR: gs_layout,
             gs_variant.
      gs_layout-zebra      = abap_true.
      gs_layout-cwidth_opt = abap_true.
      gs_variant-report = syst-repid.
      gs_variant-handle = 'GRID'.
    ENDFORM.                    " SET_LAYOUT_AND_VARIANT
    Regards
      Uwe

  • Setting screen attributes for select-option in subscreen

    Hello SDN Community,  I have researched this extensively in forums and found much helpful information in getting the select-option working in a subscreen.  Also found information that discussed using standard AT SELECTION-SCREEN statements to process the sub-screen with. 
    I encountered problems when that from the LOOP AT SCREEN within the AT SELECTION-SCREEN OUTPUT,  I set the INPUT/OUPUT attributes to zero, the field was still open for input when it displayed.  For when I do this on other fields of my screen, they are "greyed out".
    Has anyone any experience setting field attributes from within loop at screen for embedded select-option subscreen?  Would appreciate any insight you might have.
    Thank you,
    Dean Atteberry.
    P.S.- I put this thru the debugger and I can see the INPUT and OUTPUT attributes getting changed.  But when displays, it is like the change didn't happen.
    Full description of my processing below...
    I have a screen with four radio-buttons.  Under the first radio-button is my embedded subscreen with one SELECT-OPTION for AUFNR.  Under the other three radio-buttons are single fields declared regular way in main screen.
    In my PBO of main screen I have loop at screen that enables/disables INPUT and OUPTUT attributes based on which radio-button is selected.  This prevents confusion from user entering values in fields other than the one the radio-button is selected for.
    For my embedded select-option subscreen, I have an AT SELECTION-SCREEN OUTPUT statement in which I have a LOOP AT SCREEN.  Within that, based on radio-buttons, I either enable or disable the INPUT and OUTPUT attributes for the S_AUFNR-LOW and S_AUFNR-HIGH fields.
    Edited by: Dean Atteberry on Mar 25, 2009 4:39 PM

    >> I think that you are trying to change select options within main screen, whereby it should be
    >> changed in PBO of that subscreen. You said you do it in AT SELECTION-SCRREN OUTPUT which
    >>  will be only applicable for selection screen (I guess your main screen here). Do loop at screen in
    >>  PBO module of this subscreen not in PBO of the selection screen and see if that helps.
    Hi Marcin,  thank you for your reply.  My "main screen" is not my "selection screen".  Please allow me to further clarify...
    My "main screen" has four radio buttons with a subscreen area under the first one and single fields under the others.
    My "subscreen" is auto-generated by Selection-Screen and Select-Options statements which are in my TOP module.
    I call my auto-generated select-option subscreen in my PBO with...
         call subscreen sca_ordr including sy-repid scr_0121.
    and in my PAI with...
         call subscreen sca_ordr.
    In order to do LOOP AT SCREEN for my system-generated select-option subscreen, I use the AT SELECTION-SCREEN OUTPUT event in which to put my loop. 
    When I walk thru this in the debugger, I can see it setting INPUT/OUTPUT fields to zero, but when the screen displays, there are no changes to my subscreen....  Fields should be "greyed out" instead they are open for intput.
    Doing my best to accurately describe in as few words as possible.  Thank you for your ideas!
    Dean.

  • Populating multiple entries in the select option of a Report

    Hi,
      Ineed to populate multiple entries in the select option of a report where the bdctab has more entries than the number of rows in the select option. I have tried the transaction LINS ( Insert row) but it works intermittently based on the RSSEL-LOW(xx) value. Looking forward to any inputs.
    cheers
    Aveek

    Hi,
      Here is my code dump:
    **Version 0005
    *CTS D7AK900899 New Version code fixed for testaveek28 case.
    *MOD-1887120: Code that is changed after the release of transport.
    Populate the general selection criteria on first screen
      PERFORM f_populate_bdc_tab USING:
      'X'  'APO_BAPI_DEL_TRANS_OBJECTS'  '1000',
    ' '  'BDC_CURSOR'                  'EXT_PROD-LOW',
      ' '  'BDC_OKCODE'                  '=%011',
    ' '  'BDC_OKCODE'                  '=DUMMY',
      ' '  'PLVERS'                      '000',
      ' '  'MD_SYS'                      p_log,
      ' '  'EXTRB'                       'X',
      ' '  'MO_DEL'                      'X',
      ' '  'SIM'                         space,
      ' '  'P_LOGDEL'                    '5'.
      sort it_core_prod by pcode.
      delete adjacent duplicates from it_core_prod
                       comparing pcode.
      describe table it_core_prod lines lv_line.
      CLEAR lv_count.
    LOOP AT it_core_prod ASSIGNING <lfs_data>.
       lv_count = 1.
       CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       if lv_line > 1.
         PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000',
         ' '  lv_fname                    <lfs_data>-pcode,
         ' '  'BDC_OKCODE'                  '=LINS'.
         CLEAR lv_fname.
    ENDLOOP.
    *Populate the select options screen for product
    PERFORM f_populate_bdc_tab USING:
    'X'  'SAPLALDB'                    '3000',
    ' '  'BDC_SUBSCR'                  'SAPLALDB 3010SCREEN_HEADER',
    ' '  'BDC_OKCODE'                  '=ACPT'.
    sort it_prod_var by pcode prvar.
    delete adjacent duplicates from it_core_prod
                       comparing pcode prvar.
    PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000'.
    LOOP AT it_core_prod ASSIGNING <lfs_data>.
      lv_pcode = <lfs_data>-pcode.
    *lv_count = lv_count + 1.
      lv_count = 1.
      CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       if lv_line > 1.
          PERFORM f_populate_bdc_tab USING:
          'X'  'SAPLALDB'                    '3000',
          ' '  lv_fname                    <lfs_data>-pcode,
          ' '  'BDC_OKCODE'                  '=LINS'.
          CLEAR lv_fname.
      describe table it_prod_var lines lv_line.
    sort <lfs_data> by locno pcode prvar.
      LOOP AT it_prod_var ASSIGNING <lfs_data1>  where pcode = lv_pcode.
      lv_count = lv_count + 1.
        lv_count = 1.
        CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       if lv_line > 1.
          PERFORM f_populate_bdc_tab USING:
          'X'  'SAPLALDB'                    '3000',
          ' '  lv_fname                    <lfs_data1>-prvar,
          ' '  'BDC_OKCODE'                  '=LINS'.
        else.
         PERFORM f_populate_bdc_tab USING:
         ' '  lv_fname                    <lfs_data>-prvar,
         ' '  'BDC_OKCODE'                  '=LINS'.
        endif.
          CLEAR lv_fname.
      ENDLOOP.
    ENDLOOP.
    Populate the select options screen for product
      PERFORM f_populate_bdc_tab USING:
    'X'  'SAPLALDB'                    '3000',
    ' '  'BDC_SUBSCR'                  'SAPLALDB  3010SCREEN_HEADER',
      ' '  'BDC_OKCODE'                  '=ACPT'.
    Populate the select options for the Locations
      PERFORM f_populate_bdc_tab USING:
      'X'  'APO_BAPI_DEL_TRANS_OBJECTS'  '1000',
    ' '  'BDC_CURSOR'                  'EXT_PRD-LOW',
      ' '  'BDC_OKCODE'                  '=%012',
      ' '  'PLVERS'                      '000',
    ' '  'MD_SYS'                      p_log,
      ' '  'EXTRB'                       'X',
      ' '  'MO_DEL'                      'X',
      ' '  'SIM'                         space,
      ' '  'P_LOGDEL'                    '5'.
    Populate the select options screen for product
      PERFORM f_populate_bdc_tab USING:
      'X'  'SAPLALDB'                    '3000',
    ' '  'BDC_SUBSCR'                  'SAPLALDB  3010SCREEN_HEADER',
      ' '  'BDC_OKCODE'                  '=ACPT'.
      CLEAR lv_count.
      LOOP AT it_loc_data ASSIGNING <lfs_data>.
        lv_count = lv_count + 1.
      lv_count = 1.
        CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
        PERFORM f_populate_bdc_tab USING:
        ' '  lv_fname                    <lfs_data>-locno.
       ' '  'BDC_OKCODE'                  '=LINS'.
        CLEAR lv_fname.
        PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000',
         ' '  lv_fname                    <lfs_data>-locno,
         ' '  'BDC_OKCODE'                  '=LINS'.
         CLEAR lv_fname.
      ENDLOOP.
    CLEAR lv_count.
    LOOP AT it_loc_data ASSIGNING <lfs_data>.
       lv_count = 1.
       CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000',
         ' '  lv_fname                    <lfs_data>-locno,
         ' '  'BDC_OKCODE'                  '=LINS'.
         CLEAR lv_fname.
    ENDLOOP.
    Populate the objects to be deleted on first screen
      PERFORM f_populate_bdc_tab USING:
      'X'  'APO_BAPI_DEL_TRANS_OBJECTS'  '1000',
      ' '  'BDC_OKCODE'                  '=DUMMY',
      ' '  'PLVERS'                      '000',
      ' '  'MD_SYS'                      p_log,
      ' '  'EXTRB'                       'X',
      ' '  'MO_DEL'                      'X',
      ' '  'MO_STAT'                     'X',
      ' '  'PO_DEL'                      'X',
      ' '  'SL_DEL'                      'X',
      ' '  'ST_DEL'                      'X',
      ' '  'PIR_DEL'                     'X',
      ' '  'SIM'                         space,
      PERFORM f_populate_bdc_tab USING:
      'X'  'SAPLSPO1'                    '0500',
      ' '  'BDC_OKCODE'                  '=OPT1'.
    **Version 0005
    *CTS D7AK900899 New Version code fixed for testaveek28 case.
    *MOD-1887120: Code that is changed after the release of transport.
    Populate the general selection criteria on first screen
      PERFORM f_populate_bdc_tab USING:
      'X'  'APO_BAPI_DEL_TRANS_OBJECTS'  '1000',
    ' '  'BDC_CURSOR'                  'EXT_PROD-LOW',
      ' '  'BDC_OKCODE'                  '=%011',
    ' '  'BDC_OKCODE'                  '=DUMMY',
      ' '  'PLVERS'                      '000',
      ' '  'MD_SYS'                      p_log,
      ' '  'EXTRB'                       'X',
      ' '  'MO_DEL'                      'X',
      ' '  'SIM'                         space,
      ' '  'P_LOGDEL'                    '5'.
      sort it_core_prod by pcode.
      delete adjacent duplicates from it_core_prod
                       comparing pcode.
      describe table it_core_prod lines lv_line.
      CLEAR lv_count.
    LOOP AT it_core_prod ASSIGNING <lfs_data>.
       lv_count = 1.
       CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       if lv_line > 1.
         PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000',
         ' '  lv_fname                    <lfs_data>-pcode,
         ' '  'BDC_OKCODE'                  '=LINS'.
         CLEAR lv_fname.
    ENDLOOP.
    *Populate the select options screen for product
    PERFORM f_populate_bdc_tab USING:
    'X'  'SAPLALDB'                    '3000',
    ' '  'BDC_SUBSCR'                  'SAPLALDB 3010SCREEN_HEADER',
    ' '  'BDC_OKCODE'                  '=ACPT'.
    sort it_prod_var by pcode prvar.
    delete adjacent duplicates from it_core_prod
                       comparing pcode prvar.
    PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000'.
    LOOP AT it_core_prod ASSIGNING <lfs_data>.
      lv_pcode = <lfs_data>-pcode.
    *lv_count = lv_count + 1.
      lv_count = 1.
      CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       if lv_line > 1.
          PERFORM f_populate_bdc_tab USING:
          'X'  'SAPLALDB'                    '3000',
          ' '  lv_fname                    <lfs_data>-pcode,
          ' '  'BDC_OKCODE'                  '=LINS'.
          CLEAR lv_fname.
      describe table it_prod_var lines lv_line.
    sort <lfs_data> by locno pcode prvar.
      LOOP AT it_prod_var ASSIGNING <lfs_data1>  where pcode = lv_pcode.
      lv_count = lv_count + 1.
        lv_count = 1.
        CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       if lv_line > 1.
          PERFORM f_populate_bdc_tab USING:
          'X'  'SAPLALDB'                    '3000',
          ' '  lv_fname                    <lfs_data1>-prvar,
          ' '  'BDC_OKCODE'                  '=LINS'.
        else.
         PERFORM f_populate_bdc_tab USING:
         ' '  lv_fname                    <lfs_data>-prvar,
         ' '  'BDC_OKCODE'                  '=LINS'.
        endif.
          CLEAR lv_fname.
      ENDLOOP.
    ENDLOOP.
    Populate the select options screen for product
      PERFORM f_populate_bdc_tab USING:
    'X'  'SAPLALDB'                    '3000',
    ' '  'BDC_SUBSCR'                  'SAPLALDB  3010SCREEN_HEADER',
      ' '  'BDC_OKCODE'                  '=ACPT'.
    Populate the select options for the Locations
      PERFORM f_populate_bdc_tab USING:
      'X'  'APO_BAPI_DEL_TRANS_OBJECTS'  '1000',
    ' '  'BDC_CURSOR'                  'EXT_PRD-LOW',
      ' '  'BDC_OKCODE'                  '=%012',
      ' '  'PLVERS'                      '000',
    ' '  'MD_SYS'                      p_log,
      ' '  'EXTRB'                       'X',
      ' '  'MO_DEL'                      'X',
      ' '  'SIM'                         space,
      ' '  'P_LOGDEL'                    '5'.
    Populate the select options screen for product
      PERFORM f_populate_bdc_tab USING:
      'X'  'SAPLALDB'                    '3000',
    ' '  'BDC_SUBSCR'                  'SAPLALDB  3010SCREEN_HEADER',
      ' '  'BDC_OKCODE'                  '=ACPT'.
      CLEAR lv_count.
      LOOP AT it_loc_data ASSIGNING <lfs_data>.
        lv_count = lv_count + 1.
      lv_count = 1.
        CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
        PERFORM f_populate_bdc_tab USING:
        ' '  lv_fname                    <lfs_data>-locno.
       ' '  'BDC_OKCODE'                  '=LINS'.
        CLEAR lv_fname.
        PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000',
         ' '  lv_fname                    <lfs_data>-locno,
         ' '  'BDC_OKCODE'                  '=LINS'.
         CLEAR lv_fname.
      ENDLOOP.
    CLEAR lv_count.
    LOOP AT it_loc_data ASSIGNING <lfs_data>.
       lv_count = 1.
       CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000',
         ' '  lv_fname                    <lfs_data>-locno,
         ' '  'BDC_OKCODE'                  '=LINS'.
         CLEAR lv_fname.
    ENDLOOP.
    Populate the objects to be deleted on first screen
      PERFORM f_populate_bdc_tab USING:
      'X'  'APO_BAPI_DEL_TRANS_OBJECTS'  '1000',
      ' '  'BDC_OKCODE'                  '=DUMMY',
      ' '  'PLVERS'                      '000',
      ' '  'MD_SYS'                      p_log,
      ' '  'EXTRB'                       'X',
      ' '  'MO_DEL'                      'X',
      ' '  'MO_STAT'                     'X',
      ' '  'PO_DEL'                      'X',
      ' '  'SL_DEL'                      'X',
      ' '  'ST_DEL'                      'X',
      ' '  'PIR_DEL'                     'X',
      ' '  'SIM'                         space,
      PERFORM f_populate_bdc_tab USING:
      'X'  'SAPLSPO1'                    '0500',
      ' '  'BDC_OKCODE'                  '=OPT1'.
      CLEAR gv_msg_error.
      lv_ctu_params-nobinpt = space.
    lv_ctu_params-dismode = gc_mode_e.
      lv_ctu_params-dismode = 'A'.
      lv_ctu_params-updmode = 'S'.
      lv_ctu_params-racommit = 'X'.
    Call Transaction /SAPAPO/BP2
    CALL TRANSACTION gc_bp2 USING ct_bdc_data
    OPTIONS FROM lv_ctu_params
    MESSAGES INTO lt_msg_tab.

  • Keep previous values for Select-Options

    I am using macros to populate my selections with the previously entered values.  Everything works fine until I want to delete the previous selections for so_snp via the Trash Can button.  The selections come back.  The issue seems to be that the selections are deleted from the so_snp range but then the AT SELECTION-SCREEN OUTPUT executes makro_get_range which re-populates the so_snp selection from the data stored in the buffer because so_snp is initial.  How do I get the AT SELECTION-SCREEN code to execute first so that the makro_set_range can clear out the shared buffer for '/SAPAPO/PT_PLAN_SNP'.  I have included excerpts from my ABAP program.
    Any help would be appreciated.  I struggled with this all day long.
    Best regards,
    Sandy
    DEFINE makro_get_range.
    initialization
      clear:
        lv_line,
        lv_key.
    import SET/GET-parameter from shared buffer
      if &2[] is initial.
        concatenate sy-uname  &1 '_T' into lv_key.          
        import &2[] from shared buffer indx(st) id lv_key.
        if sy-subrc eq 0.
          read table &2 index 1.
        endif.
      endif.
      if &2 is initial.
        get parameter id &1 field &2.
        if sy-subrc ne 0 and &2 is initial.
          refresh &2[].
        endif.
        if not &2   is initial
           and &2[] is initial.
          append &2.
        endif.
      endif.
    END-OF-DEFINITION.
    DEFINE makro_set_range.
    initialization
      clear:
        lv_line,
        lv_key.
      concatenate sy-uname &1 '_T' into lv_key.
    export SET/GET-parameter to shared buffer
      describe table &2[] lines lv_line.
      if lv_line gt 1.
        export &2[] to shared buffer indx(st) id lv_key.
      else.
        delete from shared buffer indx(st) id lv_key.
        set parameter id &1 field &2.
      endif.
    END-OF-DEFINITION.
    SELECT-OPTIONS so_snp FOR /sapapo/matloc-planner_snp.
    AT SELECTION-SCREEN OUTPUT.
       makro_get_range '/SAPAPO/PT_PLAN_SNP'    so_snp.
    AT SELECTION-SCREEN.
        makro_set_range '/SAPAPO/PT_PLAN_SNP'    so_snp.

    Can you set a flag to indicate that it needs to be done only once like below?
    AT SELECTION-SCREEN OUTPUT.
    IF v_flag_get_done_once IS INITIAL.
    *-- get the values from the shared buffer
      makro_get_range '/SAPAPO/PT_PLAN_SNP' so_snp.
      v_flag_get_done_once = 'X'.
    ELSE.
    *-- user manipulated the selection screen values, so
    *   don't do it again. Do Nothing.
    ENDIF.
    Srinivas

Maybe you are looking for