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: 

Linking a field in internal table

Former Member
0 Kudos

Hi Friends,

I have fields in i_mseg table

BEGIN OF t_mseg,

mblnr TYPE mseg-mblnr,

matnr TYPE mseg-matnr, "Material Number

werks TYPE mseg-werks, "Plant

lgort TYPE mseg-lgort, "Storage Location

shkzg TYPE mseg-shkzg, "Debit/Credit

dmbtr TYPE mseg-dmbtr, "Amount in local

menge TYPE mseg-menge, "Quantity

budat TYPE mkpf-budat, "Posting Date

end of i_mseg.

I want to link this table can you pls help me out

Get the material description from MAKT-MATNR-MAKTX through MSEG-MATNR, WERKS-MSEG

Thanx in advance,

Venu

6 REPLIES 6

Former Member
0 Kudos

Can you plz explain what exactly is ur requirement?

Best Regards,

Vibha Deshmukh

0 Kudos

Hi

If posting start date is 1.02.2006 then opening stock would be calculate up to 31.01.2006

Pick up the Actual receipt qty & issue qty within the posting period (1.02.2006-28.02.2006)

Closing stock = Closing Receipt qty – Closing issue qty

Closing receipt & issue qty means up to last date of posting date

If posting start date is 1.02.2006 & End date 28.02.2006 then Closing stock would be calculate up to 28.02.2006 by applying same logic as earlier mentioned for opening stock

Get the material description from MAKT-MATNR- MAKTX through MSEG-MATNR, WERKS-MSEG

Get the following data from MARA-MATNR by linking MSEG-MATNR, WERKS-MSEG

MEINS- Basic unit of measure

MAKTL- Material group

Get the following data from MBEW-MATNR by linking MSEG-MATNR, WERKS-MSEG

This Fields I have to get into final table,

Pls guide me,

Ragards,

Parvez.

Former Member
0 Kudos

hi, friend,

you wnat to get the data for material description from makt with respect o mseg then do this

select single * from makt where matnr = mseg-matnr

move corresponding fields into <internal table>

Former Member
0 Kudos

U cannot link an internal table to database table but u can surely do the below.

select amatnr amaktx bmaktl bmeins

into table imatnr

for all enteries in t_mseg

from makt as a inner join mara as b

on amatnr = bmatnr

where spras = sy-langu

and a~matnr = t-mseg-matnr.

loop at t_mseg.

read table imatnr with key matnr = t_mseg-matnr.

-->imatnr-maktx would give you the description.

as well as other fields.

endloop.

Message was edited by: Anurag Bankley

Former Member
0 Kudos

Hi,

Get the material description from MAKT-MATNR-MAKTX through MSEG-MATNR, WERKS-MSEG

if not i_mseg[] is initial.

select marcmatnr marcmaktx from marc inner join

makt on maktmatnr = marcmatnr

for all entries in i_mseg

into table i_makt

where marc~matnr = i_mseg-matnr

and marc~werks = i_mseg-werks

and makt~langu = sy-langu.

endif.

Regards

amole

Former Member
0 Kudos

Hi,

try the foll,

select * (fields required) from mseg into table it_mseg where matnr = v_matnr(screen field).

select matnr maktx from makt into table it_makt for all entries in it_mseg where matnr = it_mseg-matnr.

loop at it_makt.

write:/ it_mseg-matnr, (25) it_mseg-maktx.

endloop.

Note: Internal tables are declared with header line.

Thanks,

Prashanth