Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

problem in displaying the data

I am working on a report which is previously developed ,this is basically code for the smartforms in which it is showing the upper limit and the lower limit which are present in the table QPMK having the fields toleranzun and toleranzob. i.e. if the lower limit is specified and the upper limit is specified i.e. 0.15 and the lower limit is not then it is picking up the default value 0 and showing the data as :-

carbon -> 0.15 - 0.00

But i want to show the data that if its lower limit or upper limit is not defined then it should display the only value which is defined .

for example,

if upper limit is defined as 0.15 and the lower limit is not told then it should display the data as :-

carbon -> 0.15

i had tried to modify the code but it is able to display it.

here's d code:-

LOOP AT vv.

SELECT SINGLE toleranzob FROM qpmk INTO vv-toleranzob WHERE mkmnr = vv-verwmerkm AND toleranzob GT 0.

SELECT SINGLE toleranzun FROM qpmk INTO vv-toleranzun WHERE mkmnr = vv-verwmerkm AND toleranzun GT 0.

if vv-toleranzun > 0 and vv-toleranzob > 0.

MODIFY vv FROM vv INDEX sy-tabix TRANSPORTING toleranzob toleranzun.

elseif vv-toleranzun > 0 and vv-toleranzob = 0.

MODIFY vv FROM vv INDEX sy-tabix TRANSPORTING toleranzun.

elseif vv-toleranzun = 0 and vv-toleranzob > 0.

MODIFY vv FROM vv INDEX sy-tabix TRANSPORTING toleranzob.

endif.

endloop.

it is still giving the same output..

even i had debugged it the statements are getting fetched.

Tags:
replied

Hello Rick,

I meant dont compare string with numbers and use packed decimals.

if vv-tot1 > 0 and vv-tot2 > 0. "Wrong

The following is correct format

if vv-toleranzob > 0 and vv-toleranzun > 0. "Correct

Cheers,

Kothand

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question