Skip to Content

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

problem in smartform

HI,

I am new to the smartforms and i am facing a problem that i have to modify a smartform.

In this form i am passing the values to the from a program which was already created . now i had modified the code of the program it.

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.

It is still displaying the data like C ( 0 - 0.15 ) .

And i want to display it as C (0.15) only.

Plzz provide me guidlines for solving this problem.

Here's d code:-

DATA : BEGIN OF vv OCCURS 0,

verwmerkm LIKE plmk-verwmerkm ,

toleranzob TYPE p DECIMALS 2,

toleranzun TYPE p DECIMALS 2,

tot1 type string, "tot1 for the toleranzob

tot2 type string, "tot2 for the toleranzun

kurztext LIKE qpmt-kurztext,

END OF vv.

LOOP AT vv.

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

MODIFY vv FROM vv INDEX sy-tabix TRANSPORTING toleranzob.

ENDSELECT.

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

MODIFY vv FROM vv INDEX sy-tabix TRANSPORTING toleranzun.

ENDSELECT.

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

MODIFY vv FROM vv INDEX sy-tabix TRANSPORTING toleranzob.

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 toleranzun.

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

MODIFY vv FROM vv INDEX sy-tabix TRANSPORTING toleranzob.

endif.

ENDLOOP.

Edited by: ricx .s on Oct 1, 2008 8:24 AM

Tags:
Not what you were looking for? View more on this topic or Ask a question