‎2008 Apr 29 12:52 PM
types:BEGIN OF typ_tecs,
matnr_lo LIKE tecs-matnr_lo,
sernr_lo LIKE tecs-sernr_lo,
techs LIKE tecs-techs,
aufnr type mdfa-aufnr,
pspel LIKE mdfa-pspel,
END OF typ_tecs.
data:it_tecs TYPE STANDARD TABLE OF typ_tecs.
DATA:wa_tecs TYPE typ_tecs.
SELECT a~matnr_lo
a~sernr_lo
a~techs
b~aufnr
b~pspel
FROM tecs AS a INNER JOIN mdfa AS b ON atechs = btechs
INTO TABLE it_tecs.
SELECT projn
aufnr
FROM afpo
INTO TABLE it_afpo
WHERE aufnr EQ it_tecs-aufnr.
Im getting syntax error that it_tecs is atable without header line and therefore has no component called aufnr
‎2008 Apr 29 12:55 PM
Hi,
The Problem Here is that you have Given a Internal Table's Field in Where Condition whereas it should be a Work Area.
To solve this there are 3 options given below :
First Option is :
data:it_tecs TYPE STANDARD TABLE OF typ_tecs WITH HEADER LINE.
Second Option is :
SELECT projn
aufnr
FROM afpo
INTO TABLE it_afpo
For All Entries IN IT_TECS
WHERE aufnr EQ it_tecs-aufnr.or Third Option is:
write the Below CODE:
types:BEGIN OF typ_tecs,
matnr_lo LIKE tecs-matnr_lo,
sernr_lo LIKE tecs-sernr_lo,
techs LIKE tecs-techs,
aufnr type mdfa-aufnr,
pspel LIKE mdfa-pspel,
END OF typ_tecs.
data:it_tecs TYPE STANDARD TABLE OF typ_tecs.
DATA:wa_tecs TYPE typ_tecs.
DATA:wa_projn LIKE LINE OF it_afpo.
SELECT a~matnr_lo
a~sernr_lo
a~techs
b~aufnr
b~pspel
FROM tecs AS a INNER JOIN mdfa AS b ON a~techs = b~techs
INTO TABLE it_tecs.
LOOP AT it_tecs INTO wa_tecs.
SELECT SINGLE projn
aufnr
FROM afpo
INTO wa_afpo
WHERE aufnr EQ wa_tecs-aufnr.
APPEND wa_afpo TO it_afpo.
ENDLOOP.
Reagrds,
Sunil
‎2008 Apr 29 12:55 PM
hi,
do this way
types:BEGIN OF typ_tecs,
matnr_lo LIKE tecs-matnr_lo,
sernr_lo LIKE tecs-sernr_lo,
techs LIKE tecs-techs,
aufnr like mdfa-aufnr,
pspel LIKE mdfa-pspel,
END OF typ_tecs.
or
types:BEGIN OF typ_tecs,
matnr_lo LIKE tecs-matnr_lo,
sernr_lo LIKE tecs-sernr_lo,
techs LIKE tecs-techs,
aufnr type aufnr,
pspel LIKE mdfa-pspel,
END OF typ_tecs.
‎2008 Apr 29 12:55 PM
change it like this:
data:it_tecs TYPE STANDARD TABLE OF typ_tecs occurs 0 with header line.
reghards,
madhu
‎2008 Apr 29 12:58 PM
SELECT projn
aufnr
FROM afpo
INTO TABLE it_afpo
For All Entries IN IT_TECS
WHERE aufnr EQ it_tecs-aufnr.
you forgot the FOR ALL ENTRIES IN Stmt
santhosh
‎2008 Apr 29 12:59 PM
Hi,
i am not getting the error what you got, but it says that "Field "IT_AFPO" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement . . . . . . . . . . "
That means that it_afpo is not declared.
Thanks & Regards,
Khan.
‎2008 Apr 29 1:01 PM
Hi
use this select statement
SELECT projn
aufnr
FROM afpo
INTO TABLE it_afpo
for all entries in it_tecs
WHERE aufnr EQ it_tecs-aufnr.
thanks and regards,