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

for all entrys

Former Member
0 Likes
505

hi all

I want to link

mara

marc

makt

and there by I want to get

mara-matnr

marc-werks

makt-maktx

Please any one can give me codes for this using forall entrys

regards

Sandy--;@

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
483

hi use below code

Select Matnr from mara into table itab1 where matnr = p_matnr.

sort itab.

Select mantr werks from marc into table itab2 for all entries in itab1 where matnr = itab1-matnr.

sort itab2.

select matnr maktx from makt into table itab3 for all entries in itab1 where matnr = itab1-matnr.

loop at itab2.

read table itab3 where matnr = itab2-matnr.

itab4-matnr = itab2-matnr.

itab2-werks = itab2-werks.

itab2-maktx = itab3-maktx.

append itab4.

clear itab.

endlloop.

Reward me if its helpful

Ravi.

hi all

I want to link

mara

marc

makt

and there by I want to get

mara-matnr

marc-werks

makt-maktx

Please any one can give me codes for this using forall entrys

regards

Sandy--;@

2 REPLIES 2
Read only

Former Member
0 Likes
483

Hi

TYPES: BEGIN OF ftab_type, 
         carrid TYPE sflight-carrid, 
         connid TYPE sflight-connid, 
       END OF ftab_type. 

DATA:  ftab TYPE STANDARD TABLE OF ftab_type WITH 
                 NON-UNIQUE DEFAULT KEY INITIAL SIZE 10, 
       free TYPE I, 
       wa_sflight TYPE sflight. 

* Suppose FTAB is filled as follows: 
* 
* CARRID  CONNID 
* -------------- 
* LH      2415 
* SQ      0026 
* LH      0400 

SELECT * FROM sflight INTO wa_sflight 
    FOR ALL ENTRIES IN ftab 
    WHERE CARRID = ftab-carrid AND 
          CONNID = ftab-connid AND 
          fldate = '20010228'. 
  free = wa_sflight-seatsocc - wa_sflight-seatsmax. 
  WRITE: / wa_sflight-carrid, wa_sflight-connid, free. 
ENDSELECT. 

* The statement has the same effect as: 

SELECT DISTINCT * FROM sflight INTO wa_sflight 
    WHERE ( carrid = 'LH'   AND 
            connid = '2415' AND 
            fldate = '20010228' ) OR 
          ( carrid = 'SQ'   AND 
            connid = '0026' AND 
            fldate = '20010228' ) OR 
          ( carrid = 'LH'   AND 
            connid = '0400' AND 
            fldate = '20010228' ). 
  free = wa_sflight-seatsocc - wa_sflight-seatsmax. 
  WRITE: / wa_sflight-carrid, wa_sflight-connid, free. 
ENDSELECT. 


Reward all helpfull answers

Regards

Pavan

Read only

Former Member
0 Likes
484

hi use below code

Select Matnr from mara into table itab1 where matnr = p_matnr.

sort itab.

Select mantr werks from marc into table itab2 for all entries in itab1 where matnr = itab1-matnr.

sort itab2.

select matnr maktx from makt into table itab3 for all entries in itab1 where matnr = itab1-matnr.

loop at itab2.

read table itab3 where matnr = itab2-matnr.

itab4-matnr = itab2-matnr.

itab2-werks = itab2-werks.

itab2-maktx = itab3-maktx.

append itab4.

clear itab.

endlloop.

Reward me if its helpful

Ravi.