Change from Parameter to Select-options.

Hi All,
Requirement is to change the existing program.
One of my requirement is to change parameter(P_VKORG) to Select-options(S_VKORG).
I mean  earlier we have only one Slaes Organization, now we have got to use multiple Sales organizations. For this requirement I have used select-options insted of Parmeters.
But the code has:
a)PERFORMS using Parameters( P_VKORG). This inturn is used in the select statement of the FORM-ENDFORM.
b)READ statement also has P_VKORG in where condition.
How should these be replaced with Select-options(S_VKORG)?
What would be the effect if I directly replace them with S_VKORG.
Kalyani T

you cannot just directly replace with S_VKORG.
select option is a structure with 4 fields, sign, option, low and high, hence it has to be dealt accordingly.
a. performs has to be changed to 'tables S_VKORG'
eg. perform get_data tables s_vkorg.
b. read statement has to be modified to deal with multiple values. best option will be to select for data in s_vkorg, and save in an internal table.
for eg, if select option was for vkorg,
select vkorg from tvko into t_tvko where vkorg in s_vkorg.
now t_tvko has list of possible vkorgs - regardless of we had a range or ne or gt or CP or whatever we had in select option.
now modify the read table to do for entries in T_TVKO.
c. in the select statement which is used in forms, wherever you see ' = P_vkorg'  , replace with IN S_VKORG.

Similar Messages

  • Change the Parameter as Select option

    Hi Guy's,
    Please help me friends, present requirement is like this : change the Parameter into Select-Option.
    Here they are using one function module, this function module import parameter taking single value, how  loop this function module with in this select-option.
    PARAMETERS p_fictr LIKE fmfctr-fictr.
    START-OF-SELECTION.
    Move the select options to internal tables (import parameter for fn)
      move_sel_option  : sel_buk   s_bukrs ,
                         sel_pern  s_pernr ,
                         sreinr    s_reinr ,
                         spdatv    s_pdatv ,
                         sberei    s_berei .
    Call the function to get all trips corresponding to sel criteria
      CALL FUNCTION 'ZHR_GET_FUND_TRIPS'
        EXPORTING
          p_fictr = p_fictr
          p_sub   = p_sub
        TABLES
          s_bukrs = s_bukrs
          s_pernr = s_pernr
          s_reinr = s_reinr
          s_pdatv = s_pdatv
          s_berei = s_berei
          i_trip  = i_trip
        EXCEPTIONS
          OTHERS  = 1.
    Thanks and Regards,
    Sai

    hi,
      You can first the field values using the select statement and then loop that internal table and pass the values to the function module.
    try this
    *PARAMETERS p_fictr LIKE fmfctr-fictr.
    select-options: s_fictr for fmfctr-fictr.
    START-OF-SELECTION.
    Move the select options to internal tables (import parameter for fn)
    move_sel_option : sel_buk s_bukrs ,
    sel_pern s_pernr ,
    sreinr s_reinr ,
    spdatv s_pdatv ,
    sberei s_berei .
    select fictr
       from fmfctr
       into tabel itab
    where fictr in s_fictr.
    loop at itab.
    Call the function to get all trips corresponding to sel criteria
    CALL FUNCTION 'ZHR_GET_FUND_TRIPS'
    EXPORTING
    *p_fictr = p_fictr
    p_fictr = itab-fictr
    p_sub = p_sub
    TABLES
    s_bukrs = s_bukrs
    s_pernr = s_pernr
    s_reinr = s_reinr
    s_pdatv = s_pdatv
    s_berei = s_berei
    i_trip = i_trip
    EXCEPTIONS
    OTHERS = 1.
    endloop.
    regards,
    Veeresh

  • How to change date format in select-option (mm.yyyy).

    Hi,
       Plz, How to change date format in select-option (mm.yyyy).
      in my selection screen date type selection-option is there ,when i am enter date   it's  taken  dd.mm.yyyy format,but i want mm.yyyy format.
    how to set that .
    Regards,
    Kk.

    sorry
    parameters : pmonyr type spmon or
    select-options : sspmon for PGPL-spmon .
    or what table ccontains spmon.
    regards
    shiba dutta

  • BPC NW 10.0 - Data Manager Prompt changing from SELECTINPUT to SELECT cleared values

    Dear BPC Experts,
    We recently went from SP13 patch 4 to SP19 patch 1.  When we made changes in the PROMPT values in the Data Manager Organize>Package>Modify Script>PROMPT, we experienced different behavior switching from SELECTINPUT to SELECT in our development system than we did in our production environment.  In development, when we changed the value from SELECTINPUT to SELECT, the values entered for Variable name such as %SELECTION% in Property1 and "Select the members to CLEAR" in Property2, and %DIMS% remained.  However, when we changed from SELECTINPUT to SELECT in production system, the values for Variable Names and Properties were cleared out.  Does anyone know why in our developmet system values were kept but not in our production system during this type of activity?  I would like to understand the two different behaviors and what controlled it.  We prefer not to have the values for Properties clear.
    Thank you in advance for your assistance.
    Kind regards,
    Lisa

    Hi Vadim,
    Excellent point, I should have included images as that likely would have shown this odd behavior.
    When I made the changes in our development system to a package to switch from SELECTINPUT to SELECT the values outlined in the image below were retained for Varialbe Name, Property 2, and Property 3 after we applied the SP19 patch 1.
    When I made the same change in our system to a package in our production system after we applied the SP19 patch 1, the values for Varialbe Name, Property 2, and Property 3 were cleared per the image below.  The odd thing is that initially it looked like the values stayed.  It was only after you saved and went back in did you see that the values were gone.
    Any help in understanding this behavior change would be greatly appreciated.
    Thank you,
    Lisa

  • Parameter or select-option

    hello all,
    i have requierment in which i am confused.I have to declare a field in selection screen for user input. I have declared the field as parameter.But there is no multiple select option. And user ant to have multiple select option(.i.e interval range).
    The problem is the field i have declared in parameter is type c.Like:: Enterprise(30) type c,
                  divivsion(30)  type c.
    So this is not having any interval range.If i use select-option i can provide the range. SO plz help how can i define the parameter in select-option if its possible.
    Most important thing is is there is no filed for refrence like: s_matnr for mara-matnr. as we can define in select-option.
    Plz suggest some thing on this.
    Thanks & Regards,
    Anu Maheshwari

    Hi Anu,
    Decalare it as
    1)If you want your SELECT -OPTIONS to behave like parameters. USe the option.
    <b>SELECT-OPTIONS ..... NO INTERVALS NO-EXTENSION</b>
    REPORT abc.
    DATA : v_enterpr(30) TYPE c,
    v_divin(30) TYPE c.
    SELECT-OPTIONS : s_enterp FOR v_enterpr NO INTERVALS NO-EXTENSION ,
                     s_divin  FOR v_divin NO INTERVALS NO-EXTENSION .
    2)If you want to have it as SELECT-OPTIONS.
    Then
    REPORT abc.
    DATA : v_enterpr(30) TYPE c,
    v_divin(30) TYPE c.
    SELECT-OPTIONS : s_enterp FOR v_enterpr ,
                     s_divin  FOR v_divin .
    Refer to the program I gave in this link for more details.
    Re: Difference of "NO INTERVALS NO-EXTENSION" and  "Parameter"
    Regards,
    Arun Sambargi.

  • Selection-Screen Parameter and select option

    Hi
    I had a very small and silly problem , i have a selection screen in which i had one select-options and another parameter .
    when i define both variable as select option i get output but if i define plant as parameter i dont get any output, .the code .
    SELECTION-SCREEN : BEGIN OF BLOCK s_screen WITH  FRAME TITLE text-001.
    SELECT-OPTIONS:   s_matnr FOR plaf-matnr.",       " OBLIGATORY,
    PARAMETERS:       s_werks like plaf-pwwrk. "    ,  " OBLIGATORY.
    SELECTION-SCREEN: END OF BLOCK s_screen.
    in this code when
    i enter material number i dont get output .
    i enter plant the i get output
    SELECT afko~aufnr
           afko~gamng
           afko~plnbez
           afpo~dwerk
           afpo~psmng
           afpo~matnr
           INTO CORRESPONDING FIELDS OF TABLE i_afko
           FROM afko INNER JOIN
           afpo ON afpoaufnr = afkoaufnr
           WHERE afpo~dwerk = s_werks
           and   afpo~matnr IN s_matnr
           AND   afpo~elikz = space.
    regards
    answers will be definately awarded points

    Hi
    When you use the plant in select-option, your code should be:
    WHERE afpo~dwerk IN s_werks
          and afpo~matnr  IN s_matnr
    if it's parameter:
    WHERE afpo~dwerk = s_werks
           and afpo~matnr IN s_matnr
    Are u sayng in the first case you get the data and in the second one you don't?
    Max

  • Parameter to select-option conversion

    Hello Friends,
    I have a parameter field on selection screen and it is optional.
    If user enters any data on parameter, then I have to retrieve only corresponding value to the parameter from table.
    If user does not enter any data in parameter, then I have to fetch all the records.
    I want to convert this to selection-option.
    please let me know....

    Hi,
    Instead of converting why cant you do like this ,
    if P_field is initial.
    select * from <table>
    into table itab.
    else.
    select * from <table >
    into table itab
    where field  = p_field.
    endif.
    You can use select-option as parameter in this way,
    Select-options : s_field for wa-field no intervals no-extension.
    Regads,
    Raghava Channooru

  • Import Parameter as Select Option for a FM in ECC 6.0

    Hi All,
    Can someone help me get the import parameter of a function module to be of the type select-options( the way it is used in reports) in ECC 6.0.
    Thanks for all your help in advance.
    Divya

    What I do is as following....
    I create two parameters...One for <b>START</b> and the other for <b>END</b>....Then, inside my FM I create a RANGE...
      DATA: BEGIN OF r_datum OCCURS 1,
            sign(1),
            option(2),
            low  TYPE vekp-vhilm,
            high TYPE vekp-vhilm,
            END OF r_datum.
    Passing the START to low and END to high....
    P.S: Don't forget to assign points to useful answers.
    Greetings,
    Blag.
    Message was edited by:
            Alvaro Tejada Galindo

  • How to hold data in parameter or select option

    i have define parametrs/select option.
    once i have run report , i will enter certain value in that parametrs or select option.when i run report again i want same value  in that parametrs or select option which i enter previously.urgent

    Hi
    Try this:
    DATA: NEXT_RUN.
    PARAMETERS: P TYPE I.
    START-OF-SELECTION.
      WRITE P.
    INITIALIZATION.
      IMPORT NEXT_RUN FROM MEMORY ID SY-REPID.
      IF SY-SUBRC <> 0.
        NEXT_RUN = 'X'.
        EXPORT NEXT_RUN TO MEMORY ID SY-REPID.
      ENDIF.
    AT SELECTION-SCREEN OUTPUT.
      IF NEXT_RUN = 'X'.
        P = 2.
      ENDIF.
    Max

  • Set Parameter for Select Option & Customized field

    Hi All,
    I had 2 questions here:
    1. This field in the report is a customized field and did not have any parameter.
        Is there any way to set the parameter for such fields?
    2. This field is a select option in the report.
        How can i set the parameter for the select option with lower and higher range?

    >
    Sally Teo wrote:
    > Hi All,
    >
    > I had 2 questions here:
    >
    > 1. This field in the report is a customized field and did not have any parameter.
    >     Is there any way to set the parameter for such fields?
    ----> plz ref ur prev.Post.
    >
    > 2. This field is a select option in the report.
    >     How can i set the parameter for the select option with lower and higher range?--->
    i dont think its possible to give High/low values to them, better to write small BDC to pass the data.
    regards
    Prabhu

  • Select-option in AR02 txcode

    Hi,
    I want to keep select-option in AR02 txcode in the selection screen SETTINGS, i want
    to replace REPORT DATE from parameter to select-options.
    I have copied the standard programs RAGITT_ALV01 and LDB ADA into
    Zprogram can anyone guide me to this requirment.
    Regards
    VEnk@

    Hi ilesh,
    Thanks for the answer. Actually someone have prepared this report but report is running
    correctly when we are not checking the depreciation checkbox for the date rang (select-options).
    It is not running correctly i mean it is fecthing wrong data according to the date
    range when deprication checkbox is checked. Hope you got it now.
    Please check my subroutine get data.
    FORM GET_DATA .
    Populate Report Start Date
      CLEAR FS_VARI_CONTENTS.
      FS_VARI_CONTENTS-SELNAME    = 'BERDATUM'.
      FS_VARI_CONTENTS-KIND       = C_P.
      FS_VARI_CONTENTS-SIGN       = C_I.
      FS_VARI_CONTENTS-OPTION     = C_EQ.
      FS_VARI_CONTENTS-LOW        = BERDAT1.
      FS_VARI_CONTENTS-HIGH       = SPACE.
      APPEND FS_VARI_CONTENTS TO T_VARI_CONTENTS.
    Populate Variant table
      PERFORM POPULATE_VARIANT_TABLE.
      W_FLAG = '1'.
    Submit report ZRAGITT_ALV01 using variant PPE_VARIANT
      PERFORM SUBMIT_REPORT_ZRAGITT_ALV01 TABLES ITAB_DATA1[]
                                          USING  W_FLAG.
    IF ( BERDAT2 IS NOT INITIAL ) AND
      IF BERDAT1 NE BERDAT2.
        DELETE T_VARI_CONTENTS INDEX 1.
      Populate Report End Date
        CLEAR FS_VARI_CONTENTS.
        FS_VARI_CONTENTS-SELNAME    = 'BERDATUM'.
        FS_VARI_CONTENTS-KIND       = C_P.
        FS_VARI_CONTENTS-SIGN       = C_I.
        FS_VARI_CONTENTS-OPTION     = C_EQ.
        FS_VARI_CONTENTS-LOW        = BERDAT2.
        FS_VARI_CONTENTS-HIGH       = SPACE.
        INSERT FS_VARI_CONTENTS INTO T_VARI_CONTENTS INDEX 1.
        W_FLAG = '2'.
      Submit report ZRAGITT_ALV01 using variant PPE_VARIANT
        PERFORM SUBMIT_REPORT_ZRAGITT_ALV01 TABLES ITAB_DATA2[]
                                             USING W_FLAG.
      ENDIF.                               " IF BERDAT1 NE BERDAT2
      IF W_ENDDATE IS NOT INITIAL.
        IF W_ENDDATE NE BERDAT1.
          DELETE T_VARI_CONTENTS INDEX 1.
        Populate Report End Date
          CLEAR FS_VARI_CONTENTS.
          FS_VARI_CONTENTS-SELNAME    = 'BERDATUM'.
          FS_VARI_CONTENTS-KIND       = C_P.
          FS_VARI_CONTENTS-SIGN       = C_I.
          FS_VARI_CONTENTS-OPTION     = C_EQ.
          FS_VARI_CONTENTS-LOW        = W_ENDDATE.
          FS_VARI_CONTENTS-HIGH       = SPACE.
          INSERT FS_VARI_CONTENTS INTO T_VARI_CONTENTS INDEX 1.
          W_FLAG = '3'.
    This is where i was strucked in.
    Regards
    VEnk@
    Edited by: Venkat Reddy on Sep 21, 2009 12:59 PM

  • Select options and parameter

    We have a parameter and select option in Selection Screen, by using the parameter and select option in the select query, with out passing the any values to the Parameter and SO, how we will get the records?

    hi check this..
    if the parameter is empty if will not work in the select statement..you can get the values for the select options with empty structures..
    check this..
    tables:mara .
    data: begin of itab occurs 0,
    matnr like mara-matnr,
    end of itab .
    parameters:p_matnr like mara-matnr.
    select matnr  from mara into table itab
    where matnr  = p_matnr.
    loop at itab.
    write:/ itab-matnr.
    endloop.
    it will not fetch data..
    for select-options
    tables:mara .
    data: begin of itab occurs 0,
    matnr like mara-matnr,
    end of itab .
    select-options:s_matnr for mara-matnr.
    select matnr  from mara into table itab
    where matnr  in s_matnr.
    loop at itab.
    write:/ itab-matnr.
    endloop.
    it will fetch data..
    regards,
    venkat

  • 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

  • Error occurs during select-options

    hi friends,
    i am developed a report for extracting data from vbap using select-options
    i am using feilds,
    vbeln erdat ernam vbtyp vkorg vtweg feilds
    and vbeln vkorg vbtyp erdat as selection screen feilds.
    i got selection screen screen with required feilds well .
    but problem is with method onactiondisplay
    the coding like this
    method ONACTIONDISPLAY .
    TYPES: lty_r_vbeln TYPE RANGE OF vbeln,
           lty_r_erdat TYPE RANGE OF erdat,
            lty_R_VKORG TYPE RANGE OF VKORG,
            lty_r_vbtyp type range of vbtyp.
    DATA: lo_customer TYPE REF TO if_wd_context_node.
    Variables used to retrieve the values of select-options fields
      DATA: lt_sel_item TYPE if_wd_select_options=>tt_selection_screen_item.
      FIELD-SYMBOLS:
        <fs_sel_item> LIKE LINE OF lt_sel_item,
        <fs_vbeln>   TYPE lty_r_vbeln,
        <fs_vkorg>   TYPE lty_r_vkorg,
        <fs_vbtyp>   TYPE lty_r_vbtyp,
        <fs_erdat>   TYPE lty_r_erdat.
    Get the selection-screen items
      wd_this->m_handler->get_selection_screen_items(
        IMPORTING et_selection_screen_items = lt_sel_item ).
    Retrieve the values from the select-options items
      LOOP AT lt_sel_item ASSIGNING <fs_sel_item>.
        CASE <fs_sel_item>-m_id.
          WHEN `VBELN`.
            ASSIGN <fs_sel_item>-m_value->* TO <fs_vbeln>.
          WHEN `VKORG`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_vkorg>.
          WHEN `VBTYP`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_vbtyp>.
          WHEN `ERDAT`.
            ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_erdat>.
        ENDCASE.
      ENDLOOP.
    Retrieve the data from the database, for simplicity, the
    SELECT statement has been implemented here.
      SELECT * FROM vbak
        INTO TABLE wd_this->customer
        WHERE vbeln = <fs_vbeln>
          AND vkorg IN <fs_vkorg>
          AND vbtyp IN <fs_vbtyp>
          AND erdat IN <fs_erdat>.
    Bind the data to the context
      lo_customer = wd_context->get_child_node( name = `customer`).
      lo_customer->bind_table( wd_this->vbak ).
    ENDMETHOD.
    here customer is the node
    and i refer attributes
    m_handler = IF_WD_SELECT_OPTIONS
    M_SELECT_OPTIONS = IWCI_WDR_SELECT_OPTIONS
    and i defined vbeln as parameter only.
    and i got error as
    the feild customer is unknown but there is a feild with similar name wdctx_customer
    can any one explain clearly to extracts the data by using select options ..?

    Hello Karunakar,
    Since your problem was not getting solved, I took sometime to try this program on my own and figured out that getting value of parameter field is not same like selection field. we need to change only that part. anyhow since I tried this I;m sharing the complete code.
    code for creating the selection fields and parameter fields. verify whether you are doing the same in INIT method
      data lt_range type ref to data.
      data lr_vbeln type ref to vbeln.
      create data lr_vbeln.
      wd_this->m_handler->add_parameter_field(
          i_id    = 'VBELN'
          i_value = lr_vbeln ).
      lt_range = wd_this->m_handler->create_range_table( 'VKORG' ).
      wd_this->m_handler->add_selection_field(
          i_id                         = 'VKORG'
          it_result                    = lt_range ).
      lt_range = wd_this->m_handler->create_range_table( 'VBTYP' ).
      wd_this->m_handler->add_selection_field(
          i_id                         = 'VBTYP'
          it_result                    = lt_range ).
      lt_range = wd_this->m_handler->create_range_table( 'ERDAT' ).
      wd_this->m_handler->add_selection_field(
          i_id                         = 'ERDAT'
          it_result                    = lt_range ).
    and code the action method
      data:
            lt_sel_item type if_wd_select_options=>tt_selection_screen_item,
            lt_parameters type if_wd_select_options=>tt_selection_screen_item,
            lt_r_vkorg type range of vkorg,
            lt_r_vbtyp type range of vbtyp,
            lt_r_erdat type range of erdat,
            lv_condition type string,
            lt_customer type wd_this->elements_customer,
            lo_nd_customer type ref to if_wd_context_node.
      field-symbols:
            <fs_sel_item> like line of lt_sel_item,
            <fv_vbeln> type vbeln,
            <ft_r_vkorg> like lt_r_vkorg,
            <ft_r_vbtyp> like lt_r_vbtyp,
            <ft_r_erdat> like lt_r_erdat.
      wd_this->m_handler->get_parameter_fields( importing et_fields = lt_parameters ).
      wd_this->m_handler->get_selection_screen_items( importing et_selection_screen_items = lt_sel_item ).
      loop at lt_parameters assigning <fs_sel_item>.
        case <fs_sel_item>-m_id.
          when `VBELN`.
            assign <fs_sel_item>-m_value->* to <fv_vbeln>.
            if <fv_vbeln> is assigned and <fv_vbeln> is not initial.
              if lv_condition is not initial.
                concatenate lv_condition 'AND' into lv_condition separated by space.
              endif.
              concatenate lv_condition 'VBELN = <FV_VBELN>' into lv_condition separated by space.
            endif.
        endcase.
      endloop.
      loop at lt_sel_item assigning <fs_sel_item>.
        case <fs_sel_item>-m_id.
          when `VKORG`.
            assign <fs_sel_item>-mt_range_table->* to <ft_r_vkorg>.
            if <ft_r_vkorg> is assigned and <ft_r_vkorg> is not initial.
              if lv_condition is not initial.
                concatenate lv_condition 'AND' into lv_condition separated by space.
              endif.
              concatenate lv_condition 'VKORG IN <FT_R_VKORG>' into lv_condition separated by space.
            endif.
          when `VBTYP`.
            assign <fs_sel_item>-mt_range_table->* to <ft_r_vbtyp>.
            if <ft_r_vbtyp> is assigned and <ft_r_vbtyp> is not initial.
              if lv_condition is not initial.
                concatenate lv_condition 'AND' into lv_condition separated by space.
              endif.
              concatenate lv_condition 'VBTYP IN <FT_R_VBTYP>' into lv_condition separated by space.
            endif.
          when `ERDAT`.
            assign <fs_sel_item>-mt_range_table->* to <ft_r_erdat>.
            if <ft_r_erdat> is assigned and <ft_r_erdat> is not initial.
              if lv_condition is not initial.
                concatenate lv_condition 'AND' into lv_condition separated by space.
              endif.
              concatenate lv_condition 'ERDAT IN <FT_R_ERDAT>' into lv_condition separated by space.
            endif.
        endcase.
      endloop.
      select * from vbak into table  lt_customer where (lv_condition).
      lo_nd_customer = wd_context->get_child_node( name = wd_this->wdctx_customer ).
      lo_nd_customer->bind_table( lt_customer ).
    this is working as expected. hope this works for you as well
    BR, Saravanan

  • Clearing the displayed value for a SELECT-OPTION

    How do I clear the displayed value of a SELECT-OPTION? 
    I have 2 SELECT-OPTIONs on my screen (standard basic report program screen).  I use code like this to populate the drop-down boxes for each one. 
    =====
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prgrp-low.
      PERFORM fill_prgrp_values.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_prctr-low.
      PERFORM fill_prctr_values.
    =====
    The value the user picks for the first SELECT-OPTION will affect what values I put in the drop-down list for the second SELECT-OPTION. 
    If a user enters a value for the second SELECT-OPTION, and then goes back and changes the value of the first SELECT-OPTION, then I want to do two things:
    1.  Create a new set of values for the drop-down list for the second SELECT-OPTION (no problem; working fine);
    2.  Clear the displayed value from the second SELECT-OPTION that the user entered previously.  That value became invalid when the user picked a new value for the first SELECT-OPTION. 
    How do I clear that second displayed value? 
    I have tried CLEAR and REFRESH for the second variable using the formats s_prctr, s_prctr[], and s_prctr-low.  They will erase the values of the internal table or part(s) of it, but the displayed value stays on the screen. 
    I need to clear out the displayed value so the user will either leave it blank or enter or select a new value. 
    I am using F4IF_INT_TABLE_VALUE_REQUEST to build the drop-down lists, and it works fine, but I do not see any function module to clear the displayed value off the screen. 
    Thanks for your help.

    Sorry, but calling DYNP_VALUES_UPDATE did not work.  This is how I coded it. 
    fld_reset_rcd-fieldname  = 'S_PRCTR'.
      fld_reset_rcd-stepl      = sy-stepl.
      CLEAR fld_reset_rcd-fieldvalue.      "  re-initialize s_prctr
      CLEAR fld_reset_rcd-fieldinp.        "  what goes in here?
      APPEND fld_reset_rcd TO fld_reset_tbl.
      CALL FUNCTION 'DYNP_VALUES_UPDATE'
        EXPORTING
          dyname = 'ZFI_GL_BALANCE_NGL'
          dynumb = '1000'
        TABLES
          dynpfields = fld_reset_tbl
    <Added code tags>
    I have discovered that CLEAR and REFRESH of s_prctr will clear it somewhat.  If I enter multiple values, ranges, etc., they will all be cleared, EXCEPT for the one single value that is displayed on the main screen.  It is not cleared and it remains if you push the button to display the pop-up to enter ranges, etc. 
    To devrath.sampat  --  Thanks for your example for building the drop-down list, but that is not the problem I am having.  I am already able to build it just fine. 
    To repeat my problem, if I: 
    1.  first enter / select a value for the first SELECT-OPTION s_prgrp
    2.  then enter / select a value for the second SELECT-OPTION s_prctr
    3.  And finally go back and select a new value of the first SELECT-OPTION s_prgrp from its drop-down list,
         when I do, the program needs to clear the value displayed on the main screen for the second SELECT-OPTION s_prctr (any additional values, ranges, etc., are cleared by CLEAR and REFRESH, if I go look; but not the value shown on the main screen).
    Edited by: Scott Crosby on Feb 14, 2012 4:20 PM
    Edited by: Suhas Saha on Feb 15, 2012 12:03 PM

Maybe you are looking for

  • USB External HDD not recognised in OSX 10.5.4

    Hi, I am attempting to use an ISOGEAR250 2.5" IDE external HDD on my iMac. This deviceis advertised as 'compatible with OS/X', which is in fact only true up until version 10.4.9. The device is not detected on any OS/X version with the IOUSBMassStorra

  • I've got a PHP form working, but need to add "autoRespond", anyone know?

    i've developed a working PHP5 file to submit the form to the webmaster (info@). Now, the client wants me to add on a custom autoResponder. basically, the user fills out the form, the user gets an e-mail saying thank you in the subject line and body c

  • My MacBook Pro don't want stay off but he restarts. What can i do?

    Hi, So when I click on turn off in the apple my MacBook Pro turn off, but less 5 secondes later it restart. I don't know what can I do? Can you help me?

  • Sparsebundle problem - not showing files

    Hi, I seem to be having a problem where  I mount my sparsebundle but when I go to view inside none of my backup shows. This is quite annoying as on the backup is a lot of photos Macbook pro 15-inch mid 2012 running os x yosemite

  • Read metadata from file cancel modifications !

    Hi, I use Lightroom 1.1 in french. I made some photo (in raw but in jpeg the result is the same) and import them in Lightroom with conversion in DNG. In Lightroom, in develop module, I crop, change contrast and som others. After that, I geotag my DNG