Application Development 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: 

Internal table

Former Member
0 Kudos

Hi experts.

i have a problem.when i use the code shown below.Move command actually moves the kbetr field to corresponding fields of table itab.but it is not appending that field to itab.wat shoul i use after move to fill the kbetr coloumn of table itab.append is not valid.if i use modify itab then it gives a syntax error.plz solve ma problem.

LOOP AT IT_FINAL.

MOVE: IT_FINAL-KBETR TO ITAB-KBETR.

ENDLOOP.

regards,

raman

8 REPLIES 8

Former Member
0 Kudos

HI,

you forgot the modify itab or append itab inside the loop.

LOOP AT IT_FINAL.

MOVE: IT_FINAL-KBETR TO ITAB-KBETR.

modify itab.

ENDLOOP.

Reward points if helpfull

Nicole

Former Member
0 Kudos

LOOP AT IT_FINAL.

read table itab with key field1 = it_final-field1.

if sy-subrc eq 0.

MOVE: IT_FINAL-KBETR TO ITAB-KBETR.

modify itab.

endif.

ENDLOOP.

Regards,

Dhana

vinod_vemuru2
Active Contributor
0 Kudos

Hi Raman,

Add APPEND statement.


LOOP AT IT_FINAL.
MOVE: IT_FINAL-KBETR TO ITAB-KBETR.
APPEND itab. "Add this line if ur itab don't have any data.
MODIFY itab.  " Add this line if ur itab has data already(U have read 
"itab with appropriate keys).
ENDLOOP.

Thanks,

Vinod.

Former Member
0 Kudos

Hi,

You are just moving the data into the header and not into the table...After move statement, use the append statement.

LOOP AT IT_FINAL.

MOVE: IT_FINAL-KBETR TO ITAB-KBETR.

Append ITAB.

Clear ITAB.

ENDLOOP.

The above code will solve the issue

Reward if useful

Regards

Shiva

Former Member
0 Kudos

Try this code,

LOOP AT IT_FINAL.

MOVE: IT_FINAL-KBETR TO ITAB-KBETR.

APPEND ITAB_KBETR.

ENDLOOP.

former_member188827
Active Contributor
0 Kudos

remove ':' after move.

if itab contains values and u only need to fill value of column kbetr for the records contained in itab, use

modify itab transporting kbetr.

plz reward points if dis helps.

Former Member
0 Kudos

Hi,

use as following.

It will help you to modify itab at specific record.

Data index2 type sy-tabix.

LOOP AT itab.

INDEX2 = SY-TABIX.

READ TABLE IT_FINAL WITH KEY <common field> = <field>.

IF SY-SUBRC = 0.

MOVE: IT_FINAL-KBETR TO ITAB-KBETR..

MODIFY itab INDEX INDEX2.

CLEAR INDEX2.

ENDIF.

ENDLOOP.

Reward pts. if helpfull.

Regards,

Dhan

former_member598013
Active Contributor
0 Kudos

Hi Raman,

Why dont you try with the append statement. Also if you get the same functionlaity then what you need ot do is just to append the data intot he internal table and thenafter delete that record form the it_final table.