Skip to Content
author's profile photo
Former Member

how to retrieve data according to Listbox?

Hi all :

I have a question about how to retrieve data according to Listbox.

  • add the value into the Listbox, now the listbox contained 2 values.

DATA: v_name TYPE vrm_id,

v_list TYPE vrm_values,

v_value LIKE LINE OF v_list.

v_name = p_parameter.

CASE p_parameter.

WHEN 'P_LTYP'.

v_value-key = 'A'.

v_value-text = 'Stock list'.

APPEND v_value TO v_list.

v_value-key = 'B'.

v_value-text = 'Reservation list'.

APPEND v_value TO v_list.

WHEN OTHERS.

ENDCASE.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

id = v_name

values = v_list.

  • now i want to retrieve data .

when the listbox is checked by first value, I want to

SELECT *

FROM A

..................

when the listbox is checked by second value , I want to

SELECT *

FROM B

......

So How can I do that ?

thanks in advace

Best Regard.

Nick

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Posted on Sep 29, 2007 at 05:32 AM

    Hi.Nick.

    As per ur Logic the Key Values in the Listbox are the TABLE names in DDIC.

    So in that case you can have a Dynamic SELECT to fetch the Data.

    PARAMETERS: P_LIST TYPE <FIELD> AS LISTBOX VISIBLE LENGHT 30.

    START-OF-SELECTION.

    CASE P_LIST.

    WHEN 'A'.

    SELECT * FROM A

    INTO TABLE ITAB_A.

    WHEN 'B'.

    SELECT * FROM A

    INTO TABLE ITAB_A.

    ENDCASE.

    If this is not the solution then you need to paste the code..

    Reward if Helpful.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 29, 2007 at 04:25 AM

    Nick,

    I did not understand your question. I have tested program ZAH_DYNAMIC_OO in my system which has list box for the parameter. In the selection screen, if i choose any value for the parameter, the parameter field contains the same. So you can use this parameter in a normal way in the program.

    Can you please explain where are you facing the difficulty.

    ashish

    Add comment
    10|10000 characters needed characters exceeded