‎2011 Dec 15 11:50 AM
Hi Experts,
I got a situation,
i am maintaining data of a function module paramters in a dictionary table.
in the screen pbo i will fetch the the fm data from that table into the internal table(ITAB).
in my report screen i am having the selection screen and the selection screen parameters are also mentioned in the FM Dictionary Table, we are having the those details in our internal table (ITAB).
now the issue is how to call the FM by using the ITAB values.
example: ITAB
fmname parametr type str_name ss_field
-
-
-
-
-
get_notif im_notif import qmnum s_notif
here s_notif[ ] is having the values in it which is nothing but selection screen parameter.
and we are having S_NOTIF as a string values in the ITAB.
now how can i link this S_notif(type string) to s_notif(value of notification) ?
what i have done is ,
loop at itab into wa_itab where type = 'import'.
case wa_itab-parameter.
when 'IM_NOTIF'. " for example im dealing with only one parameter this can have many
get reference of S_NOTIF[ ] to v_notif.
endcase.
endloop.
now i dont wanmt hard code the parameter name ,
is there any way to do it dynamically... ?
experts please help me on this ?
thanks
‎2011 Dec 15 3:02 PM
In your situation, you would be able to use the option PARAMETER-TABLE of the CALL FUNCTION. In this table, you need to pass the parameter name and corresponding values.
Check out the help - [CALL FUNCTION - parameter_tables |http://help.sap.com/abapdocu_702/en/abapcall_function_dynamic.htm]
Regards,
Naimesh Patel
‎2011 Dec 15 3:55 PM
Hi ,
This sample will help you.
DATA: lv_fname TYPE string,
lt_ptab TYPE abap_func_parmbind_tab,
ls_ptab TYPE abap_func_parmbind,
lt_etab TYPE abap_func_excpbind_tab,
ls_etab TYPE abap_func_excpbind.
*** Table
ls_ptab-name = 'IT_TABLE'.
ls_ptab-kind = abap_func_tables.
GET REFERENCE OF <itab> INTO ls_ptab-value.
INSERT ls_ptab INTO TABLE lt_ptab.
*** Exceptions
ls_etab-name = 'DATA_NOT_FOUND'.
ls_etab-value = 1.
INSERT ls_etab INTO TABLE lt_etab.
lv_fname = 'GET_MY_DATA'." Function Name
CALL FUNCTION lv_fname
PARAMETER-TABLE
lt_ptab
EXCEPTION-TABLE
lt_etab.
IF sy-subrc NE 0.
ENDIF.
‎2012 Feb 20 8:04 AM