How to move the even records of one internal table to other

Answer Posted / raju

TABLES:ZKNA11,ZKNA12.
DATA:it TYPE TABLE OF zkna11,
it1 TYPE TABLE OF zkna12.

data:wa like LINE OF it,
wa1 like LINE OF it1.

data: LN type I VALUE 2.
data: LN1 type I .
data: LO type I VALUE 1.

SELECT * FROM ZKNA11 INTO TABLE IT UP TO 4 ROWS.

LOOP AT IT INTO WA.
IF SY-TABIX = LO.
wa1-kunnr1 = wa-kunnr.
wa1-NAME11 = wa-name1.
wa1-LAND11 = wa-LAND1.
APPEND WA1 TO IT1.
LO = LO + 2.

ENDIF.

IF SY-TABIX = LN.

wa1-kunnr2 = wa-kunnr.
wa1-NAME12 = wa-name1.
wa1-LAND12 = wa-LAND1.
LN1 = LN - 1.
MODIFY IT1 FROM WA1 INDEX LN1 TRANSPORTING KUNNR2 NAME12 LAND12.
LN = LN + 2.
ENDIF.
ENDLOOP.

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the insert statement in extract datasets do? : abap modularization

588


What is the purpose of creating symbolic a/c, what is transaction code for same? Can we assign one symbolic a/c to multiple wage types? : sap abap hr

607


What do you mean by transparent tables in sap abap? : abap data dictionary

539


Select up to 1 row and select single difference ?

654


What is an abap dictionary? : abap data dictionary

605






What are the differences between transparent tables, pooled tables & cluster tables? : abap data dictionary

729


what are the important fields while preparing sales order,inquiry?

1912


What are the restrictions on subscreens?

653


What are the user interfaces of interactive lists?

561


What are the fields in the memory table ‘screen’?

592


What is maintenance view?

602


What is your approach for writing a bdc program? : abap bdc

593


What is difference between dialog program and a report?

599


What are the ways you can do the tuning?

533


What is narrow casting and wide casting?

1141