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

ERROR

Former Member
0 Likes
1,415

HI,

WHEN I AM EXECUTING THIS CODE IT IS GIVING AN ERROR LIKE

<b>No component exists with the name "MATNR", but there is a component with the similar name "MTSNR".

</b>

Tables: mseg,mkpf,lfa1,ekko,ekpo,bseg,bkpf,zmigo_addition.

*selection screen

selection-screen begin of block b1 with frame title text-001.

parameters: p_werks like mseg-werks.

select-options: s_budat for Mkpf-budat.

selection-screen end of block b1.

*TYPES DECLARATION

types:begin of typ_mseg,

p_werks type werks_d, "Plant location

mblnr type mblnr, "Number of Material Document

s_budat type budat, "Posting date in document

mtsnr type mtsnr1, "Number of external material slip

maktx type maktx, "Material description

menge type menge_d, "Quantity

lifnr type lifnr, "Vendor Number

name1 type name1_gp, "Name1

name2 type name2_gp, "Name2

telf1 type telf1, "Telephone number

trnam type ztrnam, "Transporter name

glano type zglano, "GR/LR/AWB No

J_1ICSTNO type J_1ICSTNO, "Central Sales Tax Number

J_1ILSTNO type J_1ILSTNO, "Local Sales Tax Number

J_1IEXRN type J_1IEXRN , "Excise Registration Number

end of typ_mseg.

*INTERNAL TABLES DECLARATION

data: it_mseg type standard table of typ_mseg initial size 0,

it_mseg1 type standard table of typ_mseg initial size 0,

it_mseg2 type standard table of typ_mseg initial size 0,

it_mseg3 type standard table of typ_mseg initial size 0,

wa_mseg like line of it_mseg.

select amblnr amatnr

amenge alifnr

b~budat

into table it_mseg

from mseg as a

join mkpf as b

on amblnr = bmblnr

where werks = p_werks and

budat IN s_budat.

if it_mseg[] is not initial.

select lifnr name1 name2 telf1

into table it_mseg1

from lfa1

for all entries in it_mseg

where lifnr = it_mseg-lifnr.

ENDIF.

if it_mseg1[] is not initial.

select trnam glano lifnr

into table it_mseg2

from zmigo_addition

for all entries in it_mseg1

where lifnr = it_mseg1-lifnr.

endif.

if it_mseg2[] is not initial.

select maktx from makt into

table it_mseg3

for all entries in it_mseg2

where matnr = it_mseg2-matnr

endif.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,211

Hello Amit,

Declare the MATNR in the structure typ_mseg.

If useful rewrd.

Vasanth

6 REPLIES 6
Read only

Former Member
0 Likes
1,212

Hello Amit,

Declare the MATNR in the structure typ_mseg.

If useful rewrd.

Vasanth

Read only

dani_mn
Active Contributor
0 Likes
1,211

*TYPES DECLARATION

types:begin of typ_mseg,

p_werks type werks_d, "Plant location

mblnr type mblnr, "Number of Material Document

s_budat type budat, "Posting date in document

<b>matnr type matnr, </b>

mtsnr type mtsnr1,"Number of external material slip

maktx type maktx, "Material description

menge type menge_d, "Quantity

lifnr type lifnr, "Vendor Number

name1 type name1_gp, "Name1

name2 type name2_gp, "Name2

telf1 type telf1, "Telephone number

trnam type ztrnam, "Transporter name

glano type zglano, "GR/LR/AWB No

J_1ICSTNO type J_1ICSTNO, "Central Sales Tax Number

J_1ILSTNO type J_1ILSTNO, "Local Sales Tax Number

J_1IEXRN type J_1IEXRN , "Excise Registration Number

end of typ_mseg.

You have not declare matnr in your type declaration. now copy this code and check.

Regards,

Wasim Ahmed

Read only

Former Member
0 Likes
1,211

U don't have any field matnr in your types declaration. Then how can u refer it?

Read only

Former Member
0 Likes
1,211

hi amit,

error occured in the following lines

in the it_mseg2 , there is no field called MATNR , declare one field matnr in that type <b>typ_mseg</b>

if it_mseg2[] is not initial.
select maktx from makt into 
table it_mseg3 
for all entries in it_mseg2
where matnr = <b>it_mseg2-matnr</b>
endif.

Read only

Former Member
0 Likes
1,211

Hi,

the problem is in the select...

just check the bold one...

*TYPES DECLARATION

types:begin of typ_mseg,

p_werks type werks_d, "Plant location

mblnr type mblnr, "Number of Material Document

s_budat type budat, "Posting date in document

mtsnr type mtsnr1, "Number of external material slip

maktx type maktx, "Material description

menge type menge_d, "Quantity

lifnr type lifnr, "Vendor Number

name1 type name1_gp, "Name1

name2 type name2_gp, "Name2

telf1 type telf1, "Telephone number

trnam type ztrnam, "Transporter name

glano type zglano, "GR/LR/AWB No

J_1ICSTNO type J_1ICSTNO, "Central Sales Tax Number

J_1ILSTNO type J_1ILSTNO, "Local Sales Tax Number

J_1IEXRN type J_1IEXRN , "Excise Registration Number

end of typ_mseg.

*INTERNAL TABLES DECLARATION

data: it_mseg type standard table of typ_mseg initial size 0,

it_mseg1 type standard table of typ_mseg initial size 0,

it_mseg2 type standard table of typ_mseg initial size 0,

it_mseg3 type standard table of typ_mseg initial size 0,

wa_mseg like line of it_mseg.

select amblnr a<b>mstnr</b>

amenge alifnr

b~budat

into table it_mseg

from mseg as a

join mkpf as b

on amblnr = bmblnr

where werks = p_werks and

budat IN s_budat.

Regards

vijay

Read only

Former Member
0 Likes
1,211

Amit,

Whichever statement is giving that error, the strcuture you are accessing has a field called MTSNR.

If you can give the statement giving the error, then we can point out the error easily.

Regards,

Ravi

Note : Please mark all the helpful answers