Application Development 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: 

Change the Parameter as Select option

Former Member
0 Kudos

Hi Guy's,

Please help me friends, present requirement is like this : change the Parameter into Select-Option.

Here they are using one function module, this function module import parameter taking single value, how loop this function module with in this select-option.

PARAMETERS p_fictr LIKE fmfctr-fictr.

START-OF-SELECTION.

  • Move the select options to internal tables (import parameter for fn)

move_sel_option : sel_buk s_bukrs ,

sel_pern s_pernr ,

sreinr s_reinr ,

spdatv s_pdatv ,

sberei s_berei .

  • Call the function to get all trips corresponding to sel criteria

CALL FUNCTION 'ZHR_GET_FUND_TRIPS'

EXPORTING

p_fictr = p_fictr

p_sub = p_sub

TABLES

s_bukrs = s_bukrs

s_pernr = s_pernr

s_reinr = s_reinr

s_pdatv = s_pdatv

s_berei = s_berei

i_trip = i_trip

EXCEPTIONS

OTHERS = 1.

Thanks and Regards,

Sai

1 ACCEPTED SOLUTION

former_member673464
Active Contributor
0 Kudos

hi,

You can first the field values using the select statement and then loop that internal table and pass the values to the function module.

try this

*PARAMETERS p_fictr LIKE fmfctr-fictr.

select-options: s_fictr for fmfctr-fictr.

START-OF-SELECTION.

  • Move the select options to internal tables (import parameter for fn)

move_sel_option : sel_buk s_bukrs ,

sel_pern s_pernr ,

sreinr s_reinr ,

spdatv s_pdatv ,

sberei s_berei .

select fictr

from fmfctr

into tabel itab

where fictr in s_fictr.

loop at itab.

  • Call the function to get all trips corresponding to sel criteria

CALL FUNCTION 'ZHR_GET_FUND_TRIPS'

EXPORTING

*p_fictr = p_fictr

p_fictr = itab-fictr

p_sub = p_sub

TABLES

s_bukrs = s_bukrs

s_pernr = s_pernr

s_reinr = s_reinr

s_pdatv = s_pdatv

s_berei = s_berei

i_trip = i_trip

EXCEPTIONS

OTHERS = 1.

endloop.

regards,

Veeresh

1 REPLY 1

former_member673464
Active Contributor
0 Kudos

hi,

You can first the field values using the select statement and then loop that internal table and pass the values to the function module.

try this

*PARAMETERS p_fictr LIKE fmfctr-fictr.

select-options: s_fictr for fmfctr-fictr.

START-OF-SELECTION.

  • Move the select options to internal tables (import parameter for fn)

move_sel_option : sel_buk s_bukrs ,

sel_pern s_pernr ,

sreinr s_reinr ,

spdatv s_pdatv ,

sberei s_berei .

select fictr

from fmfctr

into tabel itab

where fictr in s_fictr.

loop at itab.

  • Call the function to get all trips corresponding to sel criteria

CALL FUNCTION 'ZHR_GET_FUND_TRIPS'

EXPORTING

*p_fictr = p_fictr

p_fictr = itab-fictr

p_sub = p_sub

TABLES

s_bukrs = s_bukrs

s_pernr = s_pernr

s_reinr = s_reinr

s_pdatv = s_pdatv

s_berei = s_berei

i_trip = i_trip

EXCEPTIONS

OTHERS = 1.

endloop.

regards,

Veeresh