How to catch the select-options value in AT SELECTION-SCREEN event?

Hi,all
This is my code:
SELECT-OPTIONS: P_BUKRS FOR T012-BUKRS.
PARAMETERS: P_BNKA TYPE BANKA.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BNKA.
select single bankl from bnka where bukrs = p_bukrs.
Last statement failed because p_bukrs was null.
So, How can I got the value of p_bukrs in AT SELECTION-SCREEN event?

Hi Jie,
try following code.
REPORT zanu_test.
TABLES : t012.
PARAMETERS: p_bukrs LIKE t012-bukrs.
PARAMETERS: p_bnka TYPE banka.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_bnka.
  DATA: BEGIN OF dynpfields OCCURS 0.
          INCLUDE STRUCTURE dynpread.
  DATA: END OF dynpfields.
*---  IT for changing fields on the screen
  DATA : t_dynp_flds LIKE  dynpread OCCURS 0 WITH HEADER LINE,
         t_dynpfields LIKE  dynpread OCCURS 0 WITH HEADER LINE.
  DATA: l_bukrs  LIKE t012-bukrs.
  DATA: BEGIN OF it_bank OCCURS 0,
          banka LIKE bnka-banka,
       END OF it_bank.
  DATA: l_tabix LIKE sy-tabix.
  dynpfields-fieldname = 'P_BUKRS'. APPEND dynpfields.
  CALL FUNCTION 'DYNP_VALUES_READ'
       EXPORTING
            dyname               = 'ZANU_TEST'
            dynumb               = sy-dynnr
       TABLES
            dynpfields           = dynpfields
       EXCEPTIONS
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            invalid_parameter    = 7
            undefind_error       = 8
            double_conversion    = 9
            stepl_not_found      = 10
            OTHERS               = 11.
  IF sy-subrc EQ 0.
    READ TABLE dynpfields WITH KEY fieldname = 'P_BUKRS'.
    IF sy-subrc EQ 0.
      MOVE dynpfields-fieldvalue TO l_bukrs.
    ENDIF.
  ELSE.
    EXIT.
  ENDIF.
  SELECT b~banka INTO CORRESPONDING FIELDS OF TABLE it_bank
  FROM t012 AS a
  INNER JOIN bnka AS b
  ON abanks = bbanks AND abankl = bbankl
  WHERE a~bukrs = l_bukrs.
  CLEAR l_tabix.
  CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
       EXPORTING
            endpos_col   = 85
            endpos_row   = 20
            startpos_col = 50
            startpos_row = 10
            titletext    = text-035
       IMPORTING
            choise       = l_tabix
       TABLES
            valuetab     = it_bank
       EXCEPTIONS
            break_off    = 1
            OTHERS       = 2.
  IF sy-subrc EQ 0.
    READ TABLE it_bank INDEX l_tabix.
    IF sy-subrc EQ 0.
*---  Clear IT t_dynp_flds
      CLEAR : t_dynp_flds,
              t_dynp_flds[].
*---  Append screen values
      t_dynp_flds-fieldname = 'P_BNKA'.
      t_dynp_flds-fieldvalue = it_bank-banka.
      APPEND t_dynp_flds.
      CLEAR  t_dynp_flds.
    ENDIF.
  ENDIF.
*---  Change screen field contents w/o PBO
  CALL FUNCTION 'DYNP_VALUES_UPDATE'
       EXPORTING
            dyname               = 'ZANU_TEST'
            dynumb               = sy-dynnr
       TABLES
            dynpfields           = t_dynp_flds
       EXCEPTIONS
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            undefind_error       = 7
            OTHERS               = 8.
START-OF-SELECTION.
-Anu

Similar Messages

  • How to access the Document Options dialog box to select display properties?

    How to access the Document Options dialog box to select display properties (e.g. smartcut ) for a selected document to
    be viewed in the Workspace.
    regards

    Preferences --> General --> Reset all warnings.
    Mylenium

  • Validation for the select option value range of selection screen

    Hi All.
    if i wish to validate the selection screen parameter for a value range(select options),is it possible?
    what should i write in code.Also,m using FM DD_DOMVALUES_GET to get the values for a specific domain name.
    Please reply.

    Hiii,
         Yes it is possible.... Can you give me the piece of code ... about the select option
    and also the value range against which you want to validate the select option.
    So that i can help you with the coding tips...
    Thanks in advance..

  • Adding select-option value in selection screen of FBL5N tcode.

    Hi Experts,
    I have one requirement that to add a Header Text Field(BKPF-BKTXT) in section screen of standard program RFITEMAR(tcode : FBL5N), i tried to add that field but it was not displayed where i required, i mentioned below  where i required.
    Customer account                     
    Company code   
    i required under company code select option value in same selection screen block.
    Please do the needful.
    thanks in advance.
    gsreddy.

    Hi,
    If you get the access key it is possible to edit the standard program,
    How u tried to add the field???
    regards,
    Mullai

  • How to enable the printer option in print priview screen in script

    Hi All,
    Please tell me how to enable the printer option in script print priview screen.
    Thanks & Regards
    Murali

    hi
    the print option TDNOPRINT has to be intial  (' ').  NOT 'X'
    TDNOPRINT  CHAR  1  0  No printing from print preview
    this will do.
    Gr., Frank

  • How can we pass the select-option value to modulepool program?

    hi,
      how can we pass the select-option value to modulepool program ?
      Because if i declared select-options in executable program and i used SSCRFIELDS to define push buttons in selection screen.
               My requirement if enter the values to select-options and press UPDATE pussbotton then i want call screen which contains tablecontrol.
               How i get select-option values to PAI of call screen for getting the data from database table to my internal table?

    Oh I thought that you have selection-screen and again you are working on dialog programming.
    if you want to use select-option directly in module pool then it is not possible.
    but you can do other way.
    create two varaiables
    data : v_kun_low like kna1-kunnr,
             v_kun_high like kna1-kunnr.
    use these two variables in layout ,let user knows that he can not give options like gt,lt,eq ,it will be always BT.
    and also when you see normal report program,you can use multiple values in either low or high,but here it is not possibel.
    use can enter only low value and high value.
    when you come to program point of view
    declare one range
    ranges r_kunnr for kna1-kunnr.
    do the coding like
    r_kunnr-low = v_kun_low.
    r_kunnr-high = v_kun_high.
    r_kunnr-options = 'BT'.
    r_kunnr-sign = 'I'.
    append r_kunnr.
    now you can use r_kunnr in select query ,it will work like select-option.
    other than this there is no option.
    Thanks
    Seshu

  • How to assign select-option values to internal table

    hi all,
    how to assign select-option values to internal table
    thanks in advance.

    Hi,
    You just need to loop at your select-option field and take the values from low and high fields.
    for. e.g
    loop at s_werks .
    move:s_werks-low to <your itab>
    if not s_werks-high is initial .
    move: s_werks-high to <youritab>
    endif .
    append <your itab>
    endloop .
    OR use select statement.
    regards,
    Omkar.
    Message was edited by:
            Omkaram Yanamala
    Message was edited by:
            Omkaram Yanamala

  • How to catch the value in sum(control break statement).

    hi,
    can any one tell me how to catch the value in sum in control break satament.
    ex.
    at end of brtwr.
    sum.
    endat.
    I need to print the value in sum only.
    I tried to declare a varaible of type i and assigned sum to this variable.
    it is giving syntax error that sum is not identified.
    How should i do this.
    regards.

    Hi Siva,
    In control break statement when we use SUM. it added all the amount fields and stores its in the work area of that field.
    look below code.
    DATA : BEGIN OF itab OCCURS 0,
               name(10),
               num TYPE i,
           END OF itab.
    DATA : num TYPE i .
    itab-name = 'salman'.
    itab-num  = 100.
    APPEND itab.
    itab-name = 'salman'.
    itab-num  = 200.
    APPEND itab.
    itab-name = 'akshay'.
    itab-num  = 500.
    APPEND itab.
    LOOP AT itab.
      AT END OF name.
        SUM.
        WRITE : / itab-num.
      ENDAT.
    ENDLOOP.
    here the SUM value is stored in Workarea,
    the output will be 300 & 500.
    regards
    Kumar M

  • How to pass select option value to function module while using service call

    Hi,
    I have select-option in my WD application. To collect data based on user input im using service call. How to pass this select option values to my RFC.
    rgds
    sudhanshu

    Hi,
    Thank s for your reply. In fact im doing similar with following variation:
    i) collected range values using get_range* method.
    ii) separate low and high values as: 
    read table <field2> index 1 into wa_range.
    vert2_low = wa_range-low.
    vert2_high = wa_range-high.
    (Please note that in RFC I have taken two importing parameter as s_vert_lo and s_vert_hi)
    iii) Now setting these RFC attribute as:
    lo_el_importing->set_attribute(
        EXPORTING
          name =  `S_VERT_LO`
          value = vert2_low ).
    and
    lo_el_importing->set_attribute(
        EXPORTING
          name =  `S_VERT_HI`
          value = vert2_high ).
    iv) In RFC im having my query as :
    select <fld list> from BUT000 into table itab where vertical in r_vert.
    Here, r_vert is a range defined as:
    ranges r_vert for <fld refrence>
    r_vert-sign = 'I'.
    r_vert-option = 'BT'.
    r_vert-low = S_VERT_LO.
    r_vert-high = S_VERT_HI.
    append r_vert.
    Issue here is with ranges. if im passing both low and high values it is fine but if only low value being passed it is not giving me any record.
    Please suggest.
    Rgds
    Sudhanshu

  • Can we catch the dynamic item value in Apex?

    Hi All,
    In my application i am using SELECT_LIST_FROM_QUERY_XL Function. The select list will be populated based on some product group id.
    Some times the list will be 2 or 5 based on prgr id. Now how to catch the dynamic list item name. Is it possible?
    Thanks,
    Anoo..

    Not directly. You can have two items and then dynamically switch between those two items. This can lead to other issues of cause. For example if the item value should be stored in the database, you have to decide which item to store and how to do that.
    The field type itself should not be changed. There are a lot of other things that depend on that. Possible ? Yes. Advisable? No. Check the page source text to see the difference between a select item and a normal text field. Then think if you want to set all this dynamically.
    Maybe a popup list would be better suited?
    One more point: In my experience adding too many dynamic stuff onto a page will not improve the user experience, but will decrease it. So you should carefully consider if this is something. Dynamic actions are great, but they are not always the best tool for the job.

  • Select options values pass to function module

    Hi all,
            I want to pass the values entered in the select options to the function module. How should my function module interface be declared for passing the select options
    I tried declaring like
    t_range type data in the tables tab.  But this throws error. 
    Please let me know how to pass select option values back to function modules.
    Thanks,

    Hi,
    Check this code.
    data: node_flights type ref to if_wd_context_node.
    data: rt_carrid type ref to data.
    data: rt_connid type ref to data.
    data: isflight type table of sflight.
    data: wsflight type sflight.
    field-symbols: <fs_carrid> type table,
    <fs_connid> type table.
    Retrieve the data from the select option
    rt_carrid = wd_this->m_handler->get_range_table_of_sel_field(
    i_id = 'S_CARR_ID' ).
    if rs_carrid is not initial.   Here you can check that if rs_carrid is no initial then assign value of field symbol
    Assign it to a field symbol
    assign rt_carrid->* to <fs_carrid>.
    endif.
    Retrieve the data from the select option
    rt_connid = wd_this->m_handler->get_range_table_of_sel_field(
    i_id = 'S_CONN_ID' ).
    if rt_connid is not initial. Here you can check that if  rt_connid is no initial then assign value of field symbol
    Assign it to a field symbol
    assign rt_connid->* to <fs_connid>.
    endif.
    if  <fs_connid> is not initial and <fs_carrid> is not initial.
    Retrieve that data from the database. Normally it is suggested to
    encapsulate the data retrieval in a separate class.
    For simplicity, the SELECT statement has been implemented here.
    clear isflight. refresh isflight.
    select * into corresponding fields of table isflight from sflight
    where carrid in <fs_carrid>
    and connid in <fs_connid>.
    endif.
    Bind the data to the context
    node_flights = wd_context->get_child_node( name = `FLIGHTS` ).
    node_flights->bind_elements( isflight ).
    Hopes this will helps you.
    Regard
    Manoj Kumar
    Edited by: Manoj Kumar on Mar 16, 2009 10:41 AM

  • Passing SELECT-OPTIONS value to Function Module

    Hi,
    I need to pass select-options value to a function module.
    Code is like the following:
    SELECT-OPTIONS seltab FOR object-type.
    CALL FUNCTION 'Z_MY_FM'
          EXPORTING
            sel_tab         = seltab
         IMPORTING
            result_tab     = it_result
    I have found a similar problem in the SDN forum: How to pass select-options parameter to FM?
    However, that could not help me much in solving my problem.
    So far I have tried to created a structure in DDIC with the following components for the select-options:
    SIGN - BAPISIGN
    OPTION - BAPIOPTION
    LOW - ZBWOBJECTTYPE (my type)
    HIGH - ZBWOBJECTTYPE (my type)
    and subsequently a table type for this structure which is specified in the "Import" tab of my function module.
    Unfortunately, when I ran the program a runtime exception occured (CALL_FUNCTION_CONFLICT_TYPE).
    Could anyone please help me on this issue?
    Thanks in advance.
    Regards,
    Joon Meng

    Hello Joon,
    CALL FUNCTION 'Z_MY_FM'
          EXPORTING
            sel_tab         = seltab
         IMPORTING
            result_tab     = it_result
    You have defined SELTAB as a SELECT-OPTION.
    So when you pass only SELTAB, the header line is transferred to the FM. When you pass SELTAB[] the whole table(range) is passed.
    It is similar to the concept of an internal table with header line.
    Hope i am clear.
    Anyways how have you defined result_tab and sel_tab ?
    BR,
    Suhas

  • Passing select-options values using call transaction method

    Hi Experts,
    I have a scenario in which i have three fields BUKRS,WERKS and MATKL in an internal table i_tab and I have MATNR as a selection-option.
    After this I have to use call transaction <tcode> for all the line items in the internal table and the MATNR select-option values I have to pass directly for each line of i_tab using call transaction method.
    TYPES:  BEGIN OF t_tab,
              bukrs TYPE bukrs,
              werks TYPE werks_d,
              matkl TYPE matkl,
            END OF t_tab.
    DATA:  w_tab TYPE t_tab,
                i_tab      TYPE STANDARD TABLE OF t_tab.
    SELECT-OPTIONS: s_matnr FOR marc-matnr.
    Now I am putting a loop at i_tab and have to use CALL TRANSACTION <TCODE> for each line with the SELECT-OPTIONS for MATNR.
    Please tell me whether we can pass multiple ranges for MATNR using call transcation method.
    for example there can be multiple single values/multiple ranges/excluded ranges for MATNR. so please suggest me how tho achieve this sceanrio using CALL transaction method of BDC.
    Thanks a lot.
    Regards,
    Krishan

    Hi Krishan,
    For the Call transaction TCODE there is extension ....OPTIONS from OPT. Just Check it out. I think it is possible like this.
    ... OPTIONS FROM opt
    *Effect*
    This addition gives you control using the values of the components of the structure opt, which must be of the Dictionary type CTU_PARAMS. The components have the following meaning:
    DISMODE
    Processing mode (comparable with the MODE addition)
    UPDMODE
    Update mode (comparable with the UPDATE addition)
    CATTMODE
    CATT mode (controlling a CATT procedure)
    The CATT mode can have the following values:
    ' ' No CATT procedure active
    'N' CATT procedure without single screen control
    'A' CATT procedure with single screen control
    DEFSIZE
    Use standard window size
    RACOMMIT
    COMMIT WORK does not end CATT procedure
    NOBINPT
    No batch input mode, that s SY-BINPT = SPACE.
    NOBIEND
    No batch input mode after BDC data has been read
    The components DEFSIZE , RACOMMIT, NOBINPT, NOBIEND always take the following values:
    'X' Yes
    ' ' No
    If the OPTIONS addition is omitted, the following settings are valid for the control parameters:
    DISMODE from the MODE addition
    UPDMODE
    from the UPDATE addition
    CATTMODE
    No CATT procedure active
    DEFSIZE
    Do not use standard window size
    RACOMMIT
    COMMIT WORK ends procedure successfully
    NOBINPT
    Batch input mode, that is SY-BINPT =X.
    NOBIEND
    Batch input mode also active after BDC data has been read
    Regards,
    Swapna.

  • Passing select-options value in method

    How to pass select-options value in method ?
    Example:
    Select-options: carrid for spfli-carrid.
    class cl_myclass implementation.
    select  carrid connid from
    spfli where carrid in carrid.
    endclass.
    Thanks

    Hello Anee
    The coding of this functionality is quite simple:
    REPORT zmy_report.
    DATA:  go_myclass   TYPE REF TO zcl_myclass,
               gd_repid         TYPE syst-repid.
    PARAMETERS:
      p_bukrs   ...
    SELECT-OPTIONS:
      o_kunnr  ...
    START-OF-SELECTION.
      gd_repid = syst-repid.
      CREATE OBJECT go_myclass
        EXPORTING
          id_calling_program = gd_repid.
    And that's how your CONSTRUCTOR method should look like:
    METHOD constructor.  " IMPORTING parameter id_calling_program
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
      EXPORTING
        CURR_REPORT = id_calling_report
      TABLES
        SELECTION_TABLE = me->mt_selopts.
    " NOTE: define mt_selopts as instance attribute of table type RSPARAMS_TT
    ENDMETHOD.
    Finally you have to extract the parameter and select-options from MT_SELOPTS.
    Regards
      Uwe

  • Select-option value is not getting captured in at selection-screen on value

    In Selection screen , we have Select-option and  a parameter.
    Based on the values given in Select-option, the values of Parameter should get populate.
    To achieve this functionality,
    I  used  At selection u2013screen  on value request  for <parameter>  EVENT and 'F4IF_INT_TABLE_VALUE_REQUEST' Function Module.
    But the Select-option values are not getting captured in this event,unless u press Enter key.
    Is there any other way to achieve this functionality.
    Please Guide me.

    When you call function 'F4IF_INT_TABLE_VALUE_REQUEST'. make sure you send it the name of the screen variable - the F4IF_INT_TABLE_VALUE_REQUEST function calls DYNP_VALUES_READ itself if you tell it the name of your report, screen number, and the variable name... snippet below.
    Jonathan
      data:
        l_repid             type syrepid.
      l_repid = sy-repid.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
          dynpprog         = l_repid
          dynpnr           = '1000'
          dynprofield      = 'S_FIELD-LOW'  "Select options - low value
    * etc

Maybe you are looking for

  • Do third party external optical drives work with retina powerbook?

    do third party external optical drives work (read and write) with the retina powerbook?

  • PO's output type is printed out as landscape output

    hi guys, we are having problem in where out printout for PO was printed out as landscape even our printer and form setting are set as potrait..is there any other thing that cause this problem..pls advice

  • Firming planned order in rem

    hi, i want to firm all planned orders automatically(rem) .mrp run hapened a day before. i already given always firm  in rem profile 0002. but still not get firming ????

  • Flickr integration with Front Row?

    I have what I think is the latest version of Front Row (2.2.1, 314). I've seen some conflicting hearsay on the various web forums that there is a way to view flickr photos within Front Row. But I don't see that functionality in Front Row. Anyone know

  • Drag and Drop from LR3

    Is there a way to drag and drop photos from Lightroom 3 to other applications? Whenever I try, I get the circle with a line through it. For example, if I wanted to select three files and drag them to Photomatix, or to a different directory in windows