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

Data not getting into internal table

Former Member
0 Likes
1,056

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.

1 ACCEPTED SOLUTION
Read only

brad_bohn
Active Contributor
0 Likes
807

Where is 'KUNDE' in your selection on EQUI?

5 REPLIES 5
Read only

brad_bohn
Active Contributor
0 Likes
808

Where is 'KUNDE' in your selection on EQUI?

Read only

awin_prabhu
Active Contributor
0 Likes
807

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,

Read only

Former Member
0 Likes
807

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

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
807

Hello Abhii,

Brad's point is our friend Ajay is not selecting KUNDE from EQUI table

BR,

Suhas

Read only

0 Likes
807

Abhii was talking to Bohn, not Brad

Guess I need my weekend as well...

Thomas