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

modifying custom table with internal table fields

Former Member
0 Likes
9,250

in a internal table i_claim i have 4 fields and in the custom table i have 20 fields, know i am updating in enque with i_claim to custom table it is showing error as i_claim is not long off what is this error reflect to and how do i need to solve this.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,885

Hi Rocky,

To update DB table using internal table, you need to have the internal table of the same type as DB table.

Regards,

Atish

4 REPLIES 4
Read only

Former Member
0 Likes
2,886

Hi Rocky,

To update DB table using internal table, you need to have the internal table of the same type as DB table.

Regards,

Atish

Read only

Former Member
0 Likes
2,885

check this code,

PARAMETERS p_carrid TYPE scarr-carrid.

DATA scarr_tab TYPE SORTED TABLE OF scarr

WITH UNIQUE KEY carrid.

DATA: idx TYPE sy-tabix,

scarr_wa TYPE scarr.

SELECT *

FROM scarr

INTO TABLE scarr_tab.

READ TABLE scarr_tab

WITH TABLE KEY carrid = p_carrid

TRANSPORTING NO FIELDS.

idx = sy-tabix.

scarr_wa-currcode = 'EUR'.

MODIFY scarr_tab INDEX idx FROM scarr_wa

TRANSPORTING currcode.

<REMOVED BY MODERATOR>

venkat.

Edited by: Alvaro Tejada Galindo on Mar 3, 2008 10:30 AM

Read only

former_member188829
Active Contributor
0 Likes
2,885

Hi,

If you want to pass the data from internal table to Database table..use INSERT statement

First Declare the internal table structure as Database Table.

and fill the internal table with data.

and use INSERT statement.

Check this program...

TABLES:MARA.
 
DATA:ITAB LIKE MARA OCCURS 0 WITH HEADER LINE.
 
START-OF-SELECTION.
 
ITAB-MATNR = '123ABCDA'. .
ITAB-MBRSH = 'C'.
ITAB-MTART = 'FERT' .
ITAB-MEINS = 'KG' .
APPEND ITAB.
 
ITAB-MATNR = '123ABCDB'. .
ITAB-MBRSH = 'C'.
ITAB-MTART = 'FERT' .
ITAB-MEINS = 'KG' .
APPEND ITAB.
 
LOOP AT ITAB.
INSERT MARA FROM ITAB.
MODIFY MARA .
ENDLOOP.

Read only

Former Member
0 Likes
2,885

Hi Rocky,

DO like this....

Declare a Structure/work area and an internal table of type custom_table.

Loop at I_claim.

Move-corresponding i_claim to wa_custom. "Move fields to be modified in custom table

Append wa_custom to i_custom.

Endloop.

Modify custom_table from table I_custom.

Cheers!!!

Lokesh