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 is meant by stacked list?

601


What are standard layouts sets in the sap script?

557


What is open sql?

580


What is img? : sap abap hr

704


How do u set up background jobs in SAP? What r the steps? What are the event driven batch jobs?

628






ALV Report that will show the details of order like order no, order date, customer, product code & description, order quantity and value along with the details of dispatch of those orders like invoice no, invoice date, invoice quantity and pending order quantity. plz mention the detail coding Tahnks, Rahul

2172


Define alv programming in abap?

702


What is the difference between rfc and bapi function modules? : abap bdc

630


When to use logical database?

573


What is bdc programming in sap?

616


What two statements would be used to exchange data between programs using abap memory?

510


How do you find if a logical database exists for your program requrements?

605


Explain the disadvantage of using exec sql statement in abap?

522


What are the parameters used in each function?

603


how to modify the standard method as per your requirement

890