Application Development 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: 

BOM Details

Former Member
0 Kudos
291

Hai All,

I am developing 1 report of BOM details.

In the below query, I am joining Marc and plpo table.

But no data is coming to i_final internal table.

I am not able to find out the reason. Please help me.

SELECT a~matnr

a~werks

a~basmg

a~bstmi

a~bstma

b~meinh

b~ltxa1

b~vgw01

b~vge01

b~vgw02

b~vge02

b~lifnr

b~istnr

INTO CORRESPONDING FIELDS OF TABLE i_final

FROM marc AS a INNER JOIN plpo AS b

ON aplnnr = bplnnr

FOR ALL ENTRIES IN i_stpo

WHERE a~matnr = i_stpo-idnrk.

1 ACCEPTED SOLUTION

former_member588853
Active Contributor
0 Kudos
132

hi,

there might be no relavant data for the one you passed..

try to check data in se11..

get some plnnr for marc, then pass the plnnr into the plpo table and check the data , try this until you get some data then run your query..

also in your select try to get dta along with the primary key fields

PLNTY

PLNNR

PLNKN

ZAEHL other wise data might be loss

regards,

nazeer

4 REPLIES 4

former_member588853
Active Contributor
0 Kudos
133

hi,

there might be no relavant data for the one you passed..

try to check data in se11..

get some plnnr for marc, then pass the plnnr into the plpo table and check the data , try this until you get some data then run your query..

also in your select try to get dta along with the primary key fields

PLNTY

PLNNR

PLNKN

ZAEHL other wise data might be loss

regards,

nazeer

Former Member
0 Kudos
132

why don;t u use STAS, mast and STPO tables . and use this to fetch aother table data.

select a~stlnr

a~stlkn

a~stlal

b~matnr

c~annam

c~idnrk

c~posnr

c~menge

c~meins

c~ausch

into table it_final

from stas as a

inner join mast as b on ( bstlnr eq astlnr

and bstlal eq astlal )

left outer join stpo as c on ( cstlnr eq astlnr

and cstlkn eq astlkn )

where b~matnr in so_matnr .

use this and fetch other tables data.

Former Member
0 Kudos
132

hi,

tables for BOM

STKO is for header data and

STPO for items and

MAST for material.

use the FM 'CSAP_MAT_BOM_READ' to read the BOM

thanks

Former Member
0 Kudos
132

Hi Kavitha ,

U can try it by spliting the query into two parts like below may be it will help u out.

SELECT matnr

plnnr

werks

basmg

bstmi

bstma

INTO CORRESPONDING FIELDS OF TABLE i_final

FROM marc

FOR ALL ENTRIES IN i_stpo

WHERE matnr = i_stpo-idnrk.

once i_final is populated with these entries u can move further as:-

make another table it_final having fields matnr

werks

basmg

bstmi

bstma

and

meinh

plnnr

ltxa1

vgw01

vge01

vgw02

vge02

lifnr

istnr and

select.

SELECT meinh

plnnr

ltxa1

vgw01

vge01

vgw02

vge02

lifnr

istnr

INTO CORRESPONDING FIELDS OF TABLE it_final

FROM plpo

FOR ALL ENTRIES IN i_final

where plnnr =it_final-plnnr.

now

loop at it_final.

l_index = sy-tabix.

read table i_final with key plnnr = i_final-plnnr.

if sy-subrc = 0.

modify it_final index l_tabix transporting matnr werks basmg bstmi bstma.

endif.

endloop.

or

select plnnr as well in ur query.

hope this solves ur problem

Thanks & Regards,

Ruchi Tiwari

Edited by: Ruchi Tiwari on Mar 2, 2009 8:40 AM