2009 Jan 02 6:16 AM
Hi All,
I have created a program to make the direct entries to the custom tables, I am passing the table as a input. the problem here is when i pass the table dynamically , i am not able to pass the table to the INSERT syntax dynamically.
Regards,
Vijay
2009 Jan 02 7:46 AM
2009 Jan 02 8:22 AM
Hi,
Please find the Insert statement below.
INSERT ztest_upload1. "<DB_TAB>. "
INSERT INITIAL LINE INTO <DB_TAB> ASSIGNING <fs>.
Vijay
2009 Jan 02 9:24 AM
Hi,
I believe INSERT not supports TAble name as Variable ......You need to mention the Table Name in the INSERT Statement.
How Many Tables you are trying to update here?
2009 Jan 05 7:58 AM
Hi ,
U can pass the table names dynimically to the Insert statement.
Insert (dtab) FROM TABLE itab.
Instead of static specification, a bracketed data object dbtab_syntax can be specified, which must contain the name of the database table or the view when the statement is executed. A character-type data object can be specified for the data object dbtab.
Ensure that the dtab nme passed and the Internal table itab are compatible before passing the data.
Regards,
Radhika.
2009 Jan 05 9:13 AM
Hi,
You can try with INSERT And MODIFY statment. Check every insert record with sy-subrc. If sy-subrc is not equal to Zero then else statement you use MODIFY.
Regards
Md.MahaboobKhan
2009 Jan 08 5:19 AM
Hi,
Use MODIFY statement instead of INSERT and check you can insert into the table.
Moreover use COMMIT WORK after MODIFY.
Pooja
2009 Feb 04 11:01 AM
Hi
Please try this with the below code
DATA:
fs_table TYPE <table-name>,
t_table LIKE
STANDARD TABLE OF fs_table,
t_table1 LIKE t_table WITH HEADER LINE.
fs_table-mandt = 800.
fs_table-name = 'AAA'.
fs_table-empid = '1'.
APPEND fs_table TO t_table.
CLEAR fs_table.
fs_table-mandt = 800.
fs_table-name = 'BBB'.
fs_table-empid = '2'.
APPEND fs_table TO t_table.
CLEAR fs_table.
LOOP AT t_table INTO fs_table.
INSERT <table-name> FROM fs_table.
ENDLOOP.
Regards,
Rajani.
2009 Feb 04 11:06 AM
hi,
1) Pass the table name to a screen element say p_tab.
2) Write this table name to a target field using
write (p_tab) to w_tab.
where w_tab is another work variable
3) Insert w_tab from table itab.
where itab is your internal table with entries that are to be inserted to the dbtab.
Thanks and regards
Sharath
2010 Aug 16 1:07 PM