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

Adding selection criteria to the Function Module!

Former Member
0 Likes
549

Hi,

I am writing code for the Function module which is to be used to extract R/3 data to BW!

i cud extract all the data from R/3 with the FM!

Now i want to have selections in the Function module so that when i run the FM , it should ask me the input vlaues for the specified fields!

i want selection for LIFNR and for that i had used the following code!

-


ranges: r_LIFNR_RKWA for lfa1-lifnr.

loop at itab into e_t_data where fieldname = 'lifnr' . ( here e-t_data is the final table in which data should exist )

move corresponding itab to e_t_data.

append r_lifnr_rkwa.

-


first of all i am not sure whether the code is correct . can you please anybody here give the correct code and suggest to enhance this code?

it is also giving me syntax error saying fieldname does not exist.

Thanks,

Ravi

3 REPLIES 3
Read only

Former Member
0 Likes
458

Hi,

i think u can try this.

ranges: r_LIFNR_RKWA for lfa1-lifnr.

loop at itab.

move corresponding itab to e_t_data.

append e_t_data.

endloop.

if it helpful reward points...plz

Thanks,

Venkat N

Read only

Former Member
0 Likes
458

Hi Ravi,

You can create a Wrapper FM aound the main FM with the additional selection criteria.

Regards,

Dharitree

Read only

0 Likes
458

Hi Dharitree,

Can you pls elaborate your answer?

i really do not know ABAP much and never heard the term Wrapper FM that you were talking about:

it would be better if you could paste here sample code for the vendor number: lifnr

Thanks,

Ravi