Skip to Content
0
Former Member
May 16, 2008 at 07:39 AM

need help

18 Views

hi all,

i have developed a simple report with follwing 2 select statements.

but the problem is as recommended to use join for these 2 select statement .

please help me how to write code for join and do i need to make any changes in the following loop statement to pass the fields to final internal table..

SELECT ebeln

ebelp

matnr

from ekpo

into table gt_ekpo

where ebeln in s_ebeln.

check gt_ekpo[] is not initial.

SELECT matnr

bismt

from mara

into table gt_mara

FOR ALL ENTRIES IN gt_ekpo

where matnr eq gt_ekpo-matnr.

LOOP AT gt_ekpo WHERE ebeln NE ' ' AND matnr NE ' '.

MOVE gt_ekpo-ebeln TO gt_final-ebeln.

MOVE gt_ekpo-matnr TO gt_final-matnr.

READ TABLE gt_mara WITH KEY matnr = gt_ekpo-matnr BINARY SEARCH.

IF sy-subrc = 0.

MOVE gt_mara-bismt TO gt_final-bismt.

ENDIF.

please help.

thanks in advance.