‎2009 Dec 18 2:35 PM
Hi experts,
I have a query as given below:
IF equipment_number IS NOT INITIAL.
SELECT eqart
equnr
invnr
FROM equi INTO table lt_equi
FOR ALL ENTRIES IN equipment_number
WHERE equnr = equipment_number-equipment_number.
IF lt_equi[] IS NOT INITIAL.
SELECT kunnr name1
FROM kna1
INTO CORRESPONDING FIELDS OF TABLE lt_kna1
FOR ALL ENTRIES IN lt_equi
WHERE kunnr = lt_equi-kunde.
ENDIF.
No data is coming in lt_kna1 table,
I have changed the data declaration of lt_kna1. Earlier it was declared sa TYPE SATNDARD TABLE of kna1,
and I changed it to:
types: begin of ty_kna1,
name1 type kna1-name1,
kunnr type kna1-kunnr,
end of ty_kna1.
data: lt_kna1 TYPE TABLE OF ty_kna1 with header line,
After doing this change, the problem started coming. Earlier the data was coming correct in it_kna1.
How to solve this issue?
Thanks,
Ajay.
‎2009 Dec 18 2:42 PM
‎2009 Dec 18 2:42 PM
‎2009 Dec 18 2:43 PM
Hi Ajay,
Change the order of declaration of fields in TYPES statement like below and try.
types: begin of ty_kna1,
kunnr type kna1-kunnr,
name1 type kna1-name1,
end of ty_kna.
Or change Select query fetching order like below and try,
SELECT name1 kunnr
FROM kna1
INTO CORRESPONDING FIELDS OF TABLE lt_kna1
FOR ALL ENTRIES IN lt_equi
WHERE kunnr = lt_equi-kunde.
Thanks,
‎2009 Dec 18 2:47 PM
Hi Ajay,
Your field declaration is not in the sequence of the database table in KNA1. Please correct it & also refer to domain directly instead of referring to field. Just do as below :-
types: begin of ty_kna1,
KUNNR type KUNNR,
NAME1 type NAME1_GP,
end of ty_kna1.
Also check the value of the field KUNDE in lt_equi-kunde . It migh be because of CONVERSION EXIT .
Bohn
As to answer yuor query KUNDE in EQUI is same as KUNNR in KAN1.
Regards
Abhii
‎2009 Dec 18 2:50 PM
Hello Abhii,
Brad's point is our friend Ajay is not selecting KUNDE from EQUI table
BR,
Suhas
‎2009 Dec 18 2:51 PM
Abhii was talking to Bohn, not Brad
Guess I need my weekend as well...
Thomas