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

Issue when getting data from table A305 using matnr as where clause

Former Member
0 Likes
1,417

Hi experts,

I met some issue when trying to get data from table A305, I used matnr as the where clause, but nothing got. Code is as below:

data: l_matnr like a305-matnr.

......

SELECT SINGLE a~kbetr

INTO l_kbetr FROM konp AS a

INNER JOIN a305 AS b

ON a~knumh = b~knumh

WHERE b~kschl = 'ZIV1'

AND b~vkorg = '1000'

AND b~vtweg = 90

AND b~kunnr = 'C2100'

AND b~matnr = l_matnr

AND b~datbi > '20190501'

AND b~datab < '20190101'.

Surely data was there match that condition, yet it happened. I tried to debug it and found only matnr clause added, the issue happened. So I temporarily modified the code for testing then.

After the testing, I finally got that the issue came as the difference of contents between A035-matnr and l_matnr fields, which was '00000000001' and '1' there.

So my question is: why there is the difference between them, even if I had defined them as the same type?

Hi experts,

I met some issue when trying to get data from table A305, I used matnr as the where clause, but nothing got. Code is as below:

data: l_matnr like a305-matnr.

......

SELECT SINGLE a~kbetr

INTO l_kbetr FROM konp AS a

INNER JOIN a305 AS b

ON a~knumh = b~knumh

WHERE b~kschl = 'ZIV1'

AND b~vkorg = '1000'

AND b~vtweg = 90

AND b~kunnr = 'C2100'

AND b~matnr = l_matnr

AND b~datbi > '20190501'

AND b~datab < '20190101'.

Surely data was there match that condition, yet it happened. I tried to debug it and found only matnr clause added, the issue happened. So I temporarily modified the code for testing then.

After the testing, I finally got that the issue came as the difference of contents between A035-matnr and l_matnr fields, which was '00000000001' and '1' there.

So my question is: why there is the difference between them, even if I had defined them as the same type?

4 REPLIES 4
Read only

Abinathsiva
Active Contributor
0 Likes
1,209

Hi Nick,

Use CONVERSION_EXIT_ALPHA_INPUT/OUTPUT function modules when facing this type of zero presence.... and convert matnr before passing.

Read only

0 Likes
1,209

Hi Abinath, thanks, I know these two functions and had use them fixed the issue, but I still want to know why this happened even if I had define them as the same type.

Read only

matt
Active Contributor
0 Likes
1,209

How do you populate l_matnr?

Read only

Former Member
0 Likes
1,209

I got the matnr content from lips table.