Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to Pass Select-options Single values as Parameter value to Method ?

Former Member
0 Likes
694

Hi Friends,

I need to pass select-options values(single values) for s_arbpl to the method "process_percent_planned". Now all single values are in internal table s_arbpl-low field. I need to pass this internal table(s_arbpl-low) values to the method where i will run query based on these single values.In my below code i am passing value through variable w_arbpl. I have defined this parameter in the method.But here only one value is passed to method. I want multiple single values (in s_arbpl-low) should be passed. Please let me know how to correct code.

Tables: crhd.

Data: ktext type auftext,

w_arbpl type arbpl.

select-options: s_arbpl for crhd-arbpl.

ktext = 'Test'

create object obj_plan.

call method obj_plan->process_percent_planned

exporting

ktext = ktext

w_arbpl = s_arbpl-low.

Thanks

Hi Friends,

I need to pass select-options values(single values) for s_arbpl to the method "process_percent_planned". Now all single values are in internal table s_arbpl-low field. I need to pass this internal table(s_arbpl-low) values to the method where i will run query based on these single values.In my below code i am passing value through variable w_arbpl. I have defined this parameter in the method.But here only one value is passed to method. I want multiple single values (in s_arbpl-low) should be passed. Please let me know how to correct code.

Tables: crhd.

Data: ktext type auftext,

w_arbpl type arbpl.

select-options: s_arbpl for crhd-arbpl.

ktext = 'Test'

create object obj_plan.

call method obj_plan->process_percent_planned

exporting

ktext = ktext

w_arbpl = s_arbpl-low.

Thanks

3 REPLIES 3
Read only

Former Member
0 Likes
619

Why don't you pass the whole select-options?

Just declare w_arbpl in the method as a range of arbpl.

Or in case you don't want to process that in the method, then move the low values to a table of type arbpl and pass that table to the method. Of course you need to change the definition of w_arbpl in the method first

Read only

karsten_korte
Participant
0 Likes
619

Hi Debabrata,

s_arbpl has got a headerline with the same name as the internal table. So you pass s_arbpl-low of this headerline to your method. To get access to the 'table' (and the single values) use s_arbpl[]:


TABLES: crhd.
DATA: wr_arbpl TYPE RANGE OF crhd-arbpl WITH HEADER LINE.

SELECT-OPTIONS: s_arbpl FOR crhd-arbpl.

WRITE: / s_arbpl-low. "headerline
LOOP AT s_arbpl[] INTO wr_arbpl.
  WRITE: / wr_arbpl-low.
ENDLOOP.

regards, Karsten

Edited by: Karsten Korte on Nov 9, 2009 5:57 PM

ok, that was not really the question, sorry.

just do what Ramiro Escamilla suggested ...

Read only

Former Member
0 Likes
619

Hi Debabrata ,

Create a local type inside your class obj_plan( i dont know what is the reference type )

like

t_range_arbpl type range of arbpl.

Now your method process_percent_planned should have an importing parameter of type t_range_arbpl

say i_arbpl

YOu can pass the select options internal table directlty

call method obj_plan->process_percent_planned

exporting

ktext = ktext

i_arbpl = s_arbpl[].