09-25-2008 9:27 AM
Hi,
i have created 2 tables and i need to insert the records into them from screens. i have created my internal table according to the screen fields and also tables.but i'm getting a error message as
" The type of the database table and work area (or internal table)
"IT_HEADER" are not compatible. "
any help..
09-25-2008 9:35 AM
1. Check the definition of work area.
2. The fields in the table are not the same as fields in work area. Do check on this.
09-25-2008 9:29 AM
09-25-2008 9:30 AM
Hi,
I think your database table and internal table structure is different. just change your internal table field based upon database tabel and try.
09-25-2008 9:33 AM
my database table and internal table have same structure.
but in screens the fieldlengths is my concern..
in screen if the length has 18.
in table i have declared it as length is 14 and decimals 2..so ouput length is 18..is it the right way..
09-25-2008 9:37 AM
Apart from being same structure, the field length should also match. Otherwise loop at the internal table and assign the value to the table field.
Loop at itab.
dbtab-f1 = itab-f1. (Or) move itab-f1 to dbtab-f1.
endloop.
09-25-2008 9:47 AM
Hi,
If its a decimal, then for lenght 14 with decimal 2 means,
12(whole number).2(decimal places)
You said you have declared a structure for the screen. Make sure that the data types used in that structure correspond to those used in ur underlying database tables.
Best regards,
Advait.
09-25-2008 10:01 AM
the visible length in the screen for the field is 18.
but it accepts only 13.its of type decimal in the screen..
then how should i declare it in the table for the field?
09-25-2008 10:31 AM
09-25-2008 9:32 AM
Hi,
Use MOVE-CORRESPONDING to move the files from the Screen to the work area of first itab. This work area should be of the same type as ur first table.
The use MOVE-CORRESPONDING to move the fields of the Screen to the work are of the second itab. This work area should be of the same type as ur second table.
After moving the screen fields to the respective work areas, perform the insert operation on the 2 DB tables from its respective workarea's.
Best regards,
Advait.
09-25-2008 9:35 AM
1. Check the definition of work area.
2. The fields in the table are not the same as fields in work area. Do check on this.
09-25-2008 9:35 AM
Hi,
Check these demo programs
demo_dynpro_tabcont_loop.
demo_dynpro_tabcont_loop_at.
DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement
DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB
to know more, read into
https://forums.sdn.sap.com/click.jspa?searchID=2934287&messageID=673474
Regards
Satish
09-25-2008 9:40 AM
Hi,
Declare like this....
No.of Characters : 13
Decimal place : 3
Now total output length : 18
Hope it will helps
09-26-2008 8:14 AM
Hi,
1st of all when designing the fields in the screen press F6 to get the fields from the program. do not manually create any screen fields. otherwise there would be a lot of mismatch...