Skip to Content
avatar image
Former Member

passing value to select options screen.

Hi All,

Can anybody help me how to pass a value to select option screen from another screen?

It's like a user enters a value in a input field and press a button to navigate to the next screen which contains the select option fields.How can i show the value enterd in the previous screen to be shown in one of teh input field in the select option screen.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 24, 2009 at 09:27 AM

    Hi,

    Store the values that you have to pass in a global variable declared in component controller and

    Use the following piece of code in the second view,

    DATA: lt_range_table TYPE REF TO data,
              rt_range_table TYPE REF TO data,
              read_only TYPE abap_bool,
              typename TYPE string.
    
    * create a range table that consists of this new data element
      lt_range_table = lo_r_helper_class->create_range_table( i_typename = 'MATNR' ).
    
    FIELD-SYMBOLS: <tab> TYPE INDEX TABLE,
    <struct> TYPE ANY,
    <wa> TYPE ANY,
    <option> TYPE char2,
    <sign> TYPE char1,
    <high> TYPE ANY,
    <low> TYPE ANY,
    <wa_values> TYPE ANY.
    ASSIGN lt_range_table->* TO <tab>.
    APPEND INITIAL LINE TO <tab> ASSIGNING <wa>.
    ASSIGN COMPONENT 'OPTION' OF STRUCTURE <wa> TO <option>.
    ASSIGN COMPONENT 'HIGH' OF STRUCTURE <wa> TO <high>.
    ASSIGN COMPONENT 'LOW' OF STRUCTURE <wa> TO <low>.
    ASSIGN COMPONENT 'SIGN' OF STRUCTURE <wa> TO <sign>.
    <sign> = 'I'. "Default sign which you want to give
    <option> = 'EQ'. "Default option you want to give
    <low> = 'M-01'." pass your valriable name here
    *<high> = 'High_value'.
    
    
    * add a new field to the selection
      lo_r_helper_class->add_selection_field( i_id = 'S_MATNR'
      i_description = 'Material'
      it_result = lt_range_table ).

    Regards,

    Radhika.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 25, 2009 at 09:55 AM

    Hi,

    You can use the method upd_selection_field to do the same thing.

    Please check if the helper class attribute is initial or not before doing any of the actions on it.

    This might result in the ASSIGNMENT dump.

    Regards,

    Varsha

    Add comment
    10|10000 characters needed characters exceeded