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

Internal table

Former Member
0 Likes
712

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
Read only

Former Member
0 Likes
688

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

Read only

Former Member
0 Likes
688

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

Read only

vinod_vemuru2
Active Contributor
0 Likes
688

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.

Read only

Former Member
0 Likes
688

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

Read only

Former Member
0 Likes
688

Try this code,

LOOP AT IT_FINAL.

MOVE: IT_FINAL-KBETR TO ITAB-KBETR.

APPEND ITAB_KBETR.

ENDLOOP.

Read only

former_member188827
Active Contributor
0 Likes
688

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.

Read only

Former Member
0 Likes
688

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

Read only

Former Member
0 Likes
688

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.