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

Execute function from custom table value ?

former_member194669
Active Contributor
0 Likes
449

Hi,

I have custom table with following field


FUNNAME        CHAR    1000

That contains records like the following


CALL FUNCTION 'ZMATF' EXPORTING MATNR = P_MATNR IMPORTING MATDESCRIPTION = V_MATERIALDESC.
CALL FUNCTION 'Y_CHECK_EXIT' EXPORTING USEREXIT = 'EFNDTAXWAR' IMPORTING EXECUTE  =  EXECUTE TABLES I_ZA01   =  I_ZA01.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING WAIT = 'X'.
CALL FUNCTION 'RS_TABLE_LIST_CREATE' EXPORTING TABLE_NAME = TABNAME.

My requirement is according some of the user conditions i need to select entry from this table and execute the corresponding function module

Any info highly appreciated.

aRs

3 REPLIES 3
Read only

Former Member
0 Likes
427

Hi,

Check the syntax

1. GENERATE REPORT prog.

2. GENERATE SUBROUTINE POOL itab NAME name.

Try this..

Generate a subroutine in the run time with the code..

Then execute that routine..

Thanks,

Naren

Read only

former_member194669
Active Contributor
0 Likes
427

Thanks for your reply Naren,

I have a question regarding GENERATE SUBROUTINE as you mentioned, If two users run this are same time same record then any chance of sharing violation.?

aRs

Read only

Former Member
0 Likes
427

Hi,

I believe it should not be a problem...

As the subroutine is not physically created in the program..

Also check this link for a sample program..

http://help.sap.com/saphelp_46c/helpdata/EN/9f/db999535c111d1829f0000e829fbfe/frameset.htm

Thanks,

Naren