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

save data in tables through function module

Former Member
0 Likes
2,796

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
Read only

Former Member
0 Likes
1,470

Where is the code for modifying the ztable?

Read only

0 Likes
1,470

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.

Read only

Former Member
0 Likes
1,470

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

Read only

0 Likes
1,470

thanks for reply but this is not working

Read only

0 Likes
1,470

Hi,

Use this statement

MODIFY ZTABLE FROM TABLE ITAB.

Regards,

Subhashini

Read only

Former Member
0 Likes
1,470

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