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: 

save data in tables through function module

Former Member
0 Kudos

Hi experts,

I have a query to insert data into table through function module and when press save it save the data in table.

I have created a function module se37. In import parameters i have written:

it_tab type ztable.

then in tables tab i have written

it_table1 like ztable

Now in source code tab

i have written

CASE SY-UCOMM.

WHEN 'SAVE'.

MODIFY IT_TABLE1 FROM it_tab.

APPEND IT_TABLE1.

ENDCASE.

After execute it then it show the blank parameter of ztable.

after click on save button on menu it save to database.

Please help

Thanks in advance.

Vipul

6 REPLIES 6

Former Member
0 Kudos

Where is the code for modifying the ztable?

0 Kudos

Thanks for reply.

my code in the source code tab is

CASE SY-UCOMM.

WHEN 'SAVE'.

MODIFY IT_TABLE1 FROM it_tab.

APPEND IT_TABLE1.

ENDCASE.

and the parameter for function module is i have already defined.

Former Member
0 Kudos

Hi,

You can do this.

CASE SY-UCOMM.

WHEN 'SAVE'.

MODIFY ZTABLE FROM it_tab.

APPEND IT_TABLE1.

ENDCASE.

This will save all internal table entries in your database table.

Regards,

Subhashini

Edited by: Subhashini K on Nov 4, 2009 1:14 PM

0 Kudos

thanks for reply but this is not working

0 Kudos

Hi,

Use this statement

MODIFY ZTABLE FROM TABLE ITAB.

Regards,

Subhashini

Former Member
0 Kudos

Hi,

You wont require either the import parameter or the tables parameter to do this. If you would like to insert multiple entries into the ztable just declare the tables parameter


"Tables Parameter
it_table1 like ztable

And in the code just use the modify


CASE SY-UCOMM.
WHEN 'SAVE'.
MODIFY ZTABLE FROM table it_table1.

"or

INSERT ZTABLE FROM TABLE it_table1.

ENDCASE.

Vikranth