‎2008 Feb 20 7:21 PM
Hey folks,
I have a requirement where i have to modify the table
SELECT kunnr
hkunnr
FROM knvh INTO CORRESPONDING FIELDS OF TABLE gt_knvh FOR ALL ENTRIES IN gt_vbrk
WHERE kunnr = gt_vbrk-kunag.
SELECT kunnr
name1
FROM kna1 INTO CORRESPONDING FIELDS OF TABLE gt_kna11 FOR ALL ENTRIES IN gt_knvh
WHERE kunnr = gt_knvh-hkunnr.
LOOP AT gt_kna11 INTO gs_kna11.
gs_final1-hkunnr = gs_kna11-kunnr.
gs_final1-txt5 = gs_kna11-name1.
ENDLOOP.
And i want to modify GT_final1 how would i do it.
If i am using MODIFY statement its giving me a dump.
Thanks in advance.
Regards
Rock
‎2008 Feb 20 7:25 PM
if you want to append gs_finla1 new line to gt_final1, then use append gs_final1 to gt_final1.
if you want to modify an existing record in gs_final1 then you have to use
modify gt_final1 from gs_final1.
Please go through the Help for modify statement for other options that you can use with modify.
Thanks.
‎2008 Feb 20 7:26 PM
Try this:
LOOP AT gt_kna11 INTO gs_kna11.
gs_final1-hkunnr = gs_kna11-kunnr.
gs_final1-txt5 = gs_kna11-name1.
MODIFY GT_FINAL1 FROM GS_FINAL1 TRANSPORTING HKUNNR TXT5.
ENDLOOP.
‎2008 Feb 20 7:31 PM
Hey,
Its giving me a short dump saying table illegal statement.
Regards
Rock
‎2008 Feb 20 8:35 PM
Doesn't this work:
LOOP AT gt_kna11 INTO gs_kna11.
gs_final1-hkunnr = gs_kna11-kunnr.
gs_final1-txt5 = gs_kna11-name1.
MODIFY TABLE gt_kna11 FROM gs_kna11 TRANSPORTING hkunnr txt5.
ENDLOOP.
Rob
‎2008 Feb 20 8:38 PM
HI,
You can use code below :
LOOP AT gt_kna11 INTO gs_kna11.
gs_final1-hkunnr = gs_kna11-kunnr.
gs_final1-txt5 = gs_kna11-name1.
MODIFY TABLE gt_kna11 FROM gs_kna11 TRANSPORTING hkunnr txt5.
ENDLOOP.
Thanks,
Sriram Ponna.
‎2008 Feb 20 8:50 PM
Hello Rock,
Could you please give more details like, the structure of gt_final1, what data does this consist while your modifying etc...
To modify an internal table which already has a data, first get that particular record to be modified into a workarea or get the index of the record you wish to modify.
Then you can use the modify statement using the additions like 'FROM', 'INDEX', 'TRANSPOSRTING' etc...
The F1 help is much more useful in this context.
Please verify the same.
Regards,
Pavan