2019 May 10 4:10 AM
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?
2019 May 10 4:50 AM
Hi Nick,
Use CONVERSION_EXIT_ALPHA_INPUT/OUTPUT function modules when facing this type of zero presence.... and convert matnr before passing.
2019 May 10 5:52 AM
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.
2019 May 10 6:34 AM
2019 May 10 7:43 AM