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

Using insert statement

Former Member
0 Likes
1,006

Hi Guy's,

Please friends help me where i did mistake.

table1 contain 20 fields. using Function module want to updagte the table contain 12 fields.

In FM-importing parameters are 12 fields.

data : wa_output type table1.

move : field1 to wa_output-zfield1,

field2 to wa_output-zfield2. .......upto field12.

here using insert statement.

insert into table1 values wa_output.

But here wa_out contain values are not inserted into table1.

Why what is the reason.

please friends clarify my doubt.

Thanks,

Sai.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
987

Try this:

data : wa_output type table1.

move-corresponding field1 to wa_output.

insert table1 from wa_output.

8 REPLIES 8
Read only

Former Member
0 Likes
988

Try this:

data : wa_output type table1.

move-corresponding field1 to wa_output.

insert table1 from wa_output.

Read only

0 Likes
987

Hi,

It is not inserting the records into table1.

Thanks,

Sai.

Read only

Former Member
0 Likes
987

hi there...

wats hapening is that the table has 20 fields and so is ur workarea. but ur populating only 12 fields of the internal table. try to chk the code again and get back if still facing any problems.

Read only

0 Likes
987

Hi Sharma,

Still i am facing same problem. Pls tell me solution.

Thanks,

Sai.

Read only

0 Likes
987

Hi,

Does all the key fields of table1 are available in u r 12 fields of FM if not then u might need to use MODIFY rather than INSERT. Hope this helps

Thanks,

Jagadish

Read only

0 Likes
987

Hi,

table1 contain 20 fields, here FM using 12 fields. but these 12 fields are not order of table1 contain fields order.

Thanks,

Sai.

Read only

0 Likes
987

Hi,

First of all, your work area must have the fields in the same order as your table. Otherwise, you might be inserting character value against a number field. So, even if you have values for only 12 fields, try to put space for the remaining fields. Note: Work Area fields must be in the same order as table fields.

Thanks

Ramesh

Read only

Former Member
0 Likes
987

HI Sai,

Check the sy-subrc value after INSERT, if it is 0 then write 'COMMIT WORK' statement in your code.

Rgds,

Bujji