11-04-2009 7:26 AM
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
11-04-2009 7:37 AM
11-04-2009 7:42 AM
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.
11-04-2009 7:41 AM
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
11-04-2009 8:06 AM
11-04-2009 8:18 AM
Hi,
Use this statement
MODIFY ZTABLE FROM TABLE ITAB.
Regards,
Subhashini
11-04-2009 8:22 AM
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