2013 Dec 05 2:51 AM
Hi please how can I help make an insert from a Work Area of several fields into a table?
Because in the model that I wrote when I debug it only inserts the last line
So I thing its the insert command that must be changed
Thanks in advance
2013 Dec 05 3:39 AM
Hi,
Use Modify ---- Using Index . . .
This should solve ur problem.
Regards,
Josh
2013 Dec 05 3:39 AM
Hi,
Use Modify ---- Using Index . . .
This should solve ur problem.
Regards,
Josh
2013 Dec 05 3:49 AM
Hi Josh my command is:
Insert into zlook values wa_lk.
wa_lk-cima = up.
wa_lk-baixo = dw.
wa_lk-saltar = sh.
wa_lk-acessorio = ac.
But the only line that is executed is the last line
wa_lk-acessorio = ac.
2013 Dec 05 3:53 AM
Hi Caio,
Use.
INSERT ITAB FROM WA_LK.
** ITAB should have all the fields that u have mentioned above.
Regards,
Josh
2013 Dec 05 4:10 AM
When I use that returns the message:
Field From is unknown it is neither in one of the specified tables....
2013 Dec 05 4:14 AM
HI,
Check ur internal table and work area declaration.
eg: ITAB TYPE STANDARD TABLE OF <TABLE NAME>,
WA LIKE LINE OF ITAB.
or if u are using TYPES (BEST PRACTISE) .
TYPES: BEGIN of ty_itab,
field1 type ....,
field2 type. . . ,
END of ty_itab,
tt_itab TYPE STANDARD TABLE OF ty_itab.
DATA: ITAB TYPE TT_ITAB,
WA TYPE TY_ITAB.
Try these declaration.
Regards,
Josh
2013 Dec 05 4:15 AM
Hi,
Please find the below Demo reports provided by SAP. I think you will understand the concept of inserting lines in a table.
DEMO_INT_TABLES_INSERT | Inserting Individual Table Lines |
DEMO_INT_TABLES_INSERT_IND_1 Inserting Individual Lines Using the Index
DEMO_INT_TABLES_INSERT_IND_2 Inserting Individual Lines Using the Index
DEMO_INT_TABLES_INSERT_IND_3 Inserting Several Lines Using the Index
DEMO_INT_TABLES_INSERT_LINES Inserting More Than One Line
DEMO_SPECIAL_TECH_DYN_INSERT Creating a New Program Dynamically
2013 Dec 05 4:21 AM
Add/Change a row in internal table
modify <itab> from <wa> index sy-tabix
append <wa> to <itab>
MODIFY a database table from a work area
modify <ztab> from <wa>
2013 Dec 11 2:32 AM
But how could I modify if there is no register yet in the table?
2013 Dec 11 2:59 AM
Hello Caio Malentaqui.
I guess you are trying to insert data into a Z database table. Right?
If your internal table is of the same structure as your Z table, you can use
MODIFY Z_table from table ITAB. COMMIT WORK.
This statement will insert fresh records and modify existing records of Z table.
Regards.