Skip to Content
0
Former Member
Feb 22, 2006 at 04:59 PM

select statement

17 Views

Hi Experts,

here are material no's in one internal table.

for each material number i have to select the BOM component whose BOM Alternative Text = 'DEV'.

i'm selecting the BOM component like this. But it is not showing up results when executing..

Please tell me what is the problme with this?

THE CODE IS LIKE THIS:

<b>data: begin of material_data occurs 0,

matnr like mara-matnr,

...................

...................

end of material_data.

data: str1(2) type c value 'O',

str2(2) type c value 'OP',

str3(2) type c value 'M',

str4(2) type c value 'MP'.

<u>i have changed the itab like this....</u>

data: begin of i_bom occurs 0,

stlal like stko-stlal,

stktx like stko-stktx,

stlnr like stko-stlnr,

end of i_bom.

data: begin of i_outsert occurs 0,

idnrk like stpo-idnrk,

end of i_outsert.

data: begin of i_awp occurs 0,

matnr like mara-matnr,

rate like konp-kbetr,

end of i_awp.

data: v_lines type i.

constants: c_unrestr(12) type c value 'DEV'.

-


-


-


perform get_outsert.

-


-


form get_outsert.

clear material_data.

refresh material_data.

select matnr from mara into corresponding fields of table

material_data where mtart = 'FERT'.

append material_data.

select single * from mast where matnr = material_data-matnr.

if sy-subrc = 0.

clear i_bom.

refresh i_bom.

select stlal stktx from stko

into i_bom where stlnr = mast-stlnr.

append i_bom.

clear i_bom.

endselect.

endif.

loop at i_bom.

translate i_bom-stktx to upper case.

modify i_bom transporting stktx.

endloop.

clear i_bom.

delete i_bom where stktx(12) <> c_unrestr.

if v_lines = 1.

read table i_bom.

if sy-subrc = 0.

select idnrk from stpo into i_outsert-idnrk

where stlnr = stko-stlnr.

append i_outsert.

endselect.

endif.

if ( i_outsert-idnrk cs str1 ) or ( i_outsert-idnrk cs str2 ).

move i_outsert-idnrk to material_data-component.

elseif ( i_outsert-idnrk cs str3 ) or

( i_outsert-idnrk cs str4 ).

move i_outsert-idnrk to material_data-mguide.

endif.

modify material_data.

endif.

endform. "get_outsert</b>

thnx.

Message was edited by: venu gopal

Message was edited by: venu gopal