cancel
Showing results for 
Search instead for 
Did you mean: 

how to assign data to itab

Former Member
0 Kudos

if suppose i have 2 input fields at selection screen

plant is from vbap mandt (ranges)

kunnr is from vbak (ranges)

fields i have to fetch from vbap is

vbeln, matnr,netwr,werks

fields from vbak tables are

vbeln,auart,kunnr

two itabs : itab1, itab2.

fianl itab: itab3

my o/p should be like dis

vbeln from vbap

matnr

netwr

werks

auart (vbak fields)

kunnr

when user enters plant directly i will fetch my data through

select vbeln, matnr, netwr, werks into table itab 1 from vbap where werks in my_werks.

one  more select query

select vbeln auart kunnr into table itab2 from vbak where kunnr in my_kunnr

now i want to move this both itab1 and itab2 record to my itab3 by removing duplicate value (i know the command remove adjcnt duplct value)

the thing is i want to know how to assign itab 1 record and itab2 into itab3 no duplicate records only unique

which finaly im assign itab3 to alv o/p

note i dont want to use joins i have more fields and 4 other tables im just taking example

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

thanks i got it

Former Member
0 Kudos

Hi Neha,

1) Loop itab1.

      Within that loop assign the fields of itab1 to the fields of workarea of itab3.

2) Use READ TABLE statement for itab2 within the loop with vbeln as the key field.

      Again assign the fields of itab2 to the fields of workarea of itab3.

3) Append wa3 to itab3.

Hope this answers your question.

Regards,

Siraj.