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

Function module - Update module - import parameter - Dynamic - (Update task)

ragunathan1985
Explorer
0 Likes
2,955

Dear Experts,

I have created the function module with the type 'UPDATE MODULE - START IMMEDIATE' Option in attribute tab of the function module.

To handle the data base operation INSERT and DELETE in a single SAP LUW to have the database consistency for the updates.

But this function module should have the IMPORT parameter dynamic to update the tables. Since in the program flow only the table name for which INSERT or DELETE have to be taken place will be decided.

In the import tab it is not allowing the generic type declaration (ex. TYPE any or table).

1) Is there any other work around possible to achieve this scenario using the function modules - update module - start immediate ?

2) Any other concept available to achieve the requirement.

Thanks in Advance.

4 REPLIES 4
Read only

retired_member
Product and Topic Expert
Product and Topic Expert
1,584

There are many ways to achieve such tasks but you need some ABAP skills.

E.g., your IMPORT parameter could be an XSTRING to which you EXPORT or serialize everything you need and you IMPORT or deserialize it in the FM from that data cluster again. Then, you create your internal tables from that data.

Read only

0 Likes
1,584

Dear Keller,

Yes i have tried as you suggested by passing as XSTRING in the IMPORT parameter.

Whenever i try in debugging it is updating the table. But if i execute it is not updating the table.

Read only

maheshpalavalli
Active Contributor
1,584

I think i found a blog which does similar to what Keller said.

https://blogs.sap.com/2012/02/23/abap-objects-model-processing-luw-via-update-task/

Read only

roberto_forti
Contributor
0 Likes
1,584

Hi, Consider TYPE REF TO Data as well as field-symbols (Standard Table) to assign it

in FM as below example.

...
*Interface Parameter 
it_table TYPE REF TO data 
...
*ABAP Statements
FIELD-SYMBOLS: <lfs_table> TYPE STANDARD TABLE.
ASSIGN it_table->* TO <lfs_table>.
...

Regards