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

Re: select query unable to read data

Former Member
0 Likes
635

Hi Expert,

for the below code i am getting error for data mismatch i.e FOR OBJEK AND JTAB-MATNR As i am comparing objek with

matnr it is throwing length mismatch error

SELECT OBJEK

ATINN

FROM AUSP INTO TABLE IT_CHAR2

  • move line-matnr to line-objek.

FOR ALL ENTRIES IN JTAB

WHERE OBJEK EQ JTAB-MATNR.

Regards,

Am

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
565

Hi,

The length of the fields OBJEK and MATNR are different so it would give mismatch error.

Regards,

-Sandeep

2 REPLIES 2
Read only

Former Member
0 Likes
565

Hi

In the declaration of JTAB

data : begin of JTAB occurs 0,
              MATNR type AUSP-OBJEK " Instead of MARA-MATNR or simply MATNR You need to add it

whenever you use FOR ALL ENTRIES the field in left side in the where condition should match length wise with that of the right side one

Ex 
select objek 
     from AUSP 
     into table itab
for all entries in JTAB
where objek = jtab-matnr  " here JTAB-MATNR should have equal length of AUSP-OBJECK 
which is 50 char length(if i am not wrong) where as normal MATNR is of 18 char length

Hope this serves the purpose

Cheerz

Ramchander Rao.K

Read only

Former Member
0 Likes
566

Hi,

The length of the fields OBJEK and MATNR are different so it would give mismatch error.

Regards,

-Sandeep