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

Passing Internal tables and Select Options Simultaneously

Former Member
0 Likes
1,505

Hi,



I want to pass select options and internal table to a procedure at the same time. How can we do that?


I know we can pass select options to Calculation View but in that case also AFAIK we cannot pass internal tables to the Calc View.


Here is the code for example:


SELECT * INTO CORRESPONDING FIELDS OF TABLE pct_vbreveav

                   FROM vbreve

                   FOR ALL ENTRIES IN lvt_control

                   WHERE vbeln        lvt_control-vbeln AND

                                   posnr        lvt_control-posnr AND

                                   bdjpoper  IN lvt_bdjpoper      AND

                                   vbeln_n    IN s_vbeln_n.


I want to pass Select Option 'S_VBELN_N' and internal table 'LVT_CONTROL' at the same time.


Thanks,

Gaurav



Hi,



I want to pass select options and internal table to a procedure at the same time. How can we do that?


I know we can pass select options to Calculation View but in that case also AFAIK we cannot pass internal tables to the Calc View.


Here is the code for example:


SELECT * INTO CORRESPONDING FIELDS OF TABLE pct_vbreveav

                   FROM vbreve

                   FOR ALL ENTRIES IN lvt_control

                   WHERE vbeln        lvt_control-vbeln AND

                                   posnr        lvt_control-posnr AND

                                   bdjpoper  IN lvt_bdjpoper      AND

                                   vbeln_n    IN s_vbeln_n.


I want to pass Select Option 'S_VBELN_N' and internal table 'LVT_CONTROL' at the same time.


Thanks,

Gaurav



4 REPLIES 4
Read only

Former Member
0 Likes
979

Hi Gaurav,

U could filter the internal table data based on select option & then perform for all entries.

Regards,

Dhananjay

Read only

0 Likes
979

That's fine but still i need to filter the data from standard table(the table on which i am finally putting the SELECT FROM) as well on the basis of select options.

Thanks,

Gaurav

Read only

sreehari_vpillai
Active Contributor
0 Likes
979

want to pass select options and internal table to a procedure at the same time ==>

select option is a range variable. So, create a line type in the same format of range variable and use the same to create an internal table(corresponding to range). copy the select option to the internal table and the same you can use as importing parameter in AMDP(or procedure proxy). Same way, nothing is stopping you to pass internal table also. Follow the same way. You can not use range variable with IN clause in select statement(it is not open sql ). You have to try alternatives .

Sree

Read only

0 Likes
979

Hi Sreehari,

Thanks . I can create table types for Select Options but like you also said that i won' t be able to use them with my Select Query inside Procedure as we can't use IN there.

Could you please let me know if you have any alternatives.

Thanks,

Gaurav