‎2008 Oct 01 7:23 AM
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
‎2008 Oct 01 7:43 AM
Hi ricx,
You can do this kind of manipulation in smartforms level. Before displaying the data on the form. create a 'Program lines' node, before the node,which is used to display that particular data.
In the code section get the inputs like min val. & max val. and do necesary format manipulations and construct a character string or numeric type (whichever suits) and then give it as output parameter of the code section.
Now display the manipulated output.
Regards,
Kumaar.S
‎2008 Oct 01 8:14 AM
Hi,
I had changed the code of mine and i am confused that where should i declare the variable in the smart form so that i can create a node for it.
Plzz provide me guidelines for it.
I am using right now:-
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 SINGLE toleranzob FROM qpmk INTO vv-toleranzob WHERE mkmnr = vv-verwmerkm.
SELECT SINGLE toleranzun FROM qpmk INTO vv-toleranzun WHERE mkmnr = vv-verwmerkm.
vv-tot1 = vv-toleranzun.
vv-tot2 = vv-toleranzob.
if vv-toleranzun > 0 and vv-toleranzob > 0.
MODIFY vv FROM vv INDEX sy-tabix TRANSPORTING tot1 tot2.
elseif vv-toleranzun > 0 and vv-toleranzob = 0.
MODIFY vv FROM vv INDEX sy-tabix TRANSPORTING tot1.
elseif vv-toleranzun = 0 and vv-toleranzob > 0.
MODIFY vv FROM vv INDEX sy-tabix TRANSPORTING tot2.
endif.
endloop.
Edited by: ricx .s on Oct 1, 2008 9:15 AM
‎2008 Oct 01 8:17 AM
Hi
You can declare the variable in the Global Definitions of the smartform.
In the input parameters of the Program Lines node..give the variable name and in the outparameters give the variable to which ur passing the values.
Regards,
Vishwa.
‎2008 Oct 01 8:29 AM
HI VISHWA,
I had declared as you had said :-
In the global definations :-
toleranzob TYPE p DECIMALS 2
toleranzun TYPE p DECIMALS 2
tot1 type string
tot2 type string
in the input parameters as:-
toleranzob
toleranzun
In the output parameters :-
TOT1
TOT2
But still it is displaying the same data as :-
C ( 0 - 0.15 )
and i want to display as :-
C ( 0.15)
Plzz provide me guidelines for solving this problem.
‎2008 Oct 01 8:33 AM
Hi
Take this code.put it in ABAP editor and debug to see if the code is working fine and ur getting the exact values into tot1 and tot2.
Regards,
Vishwa.
‎2008 Oct 01 8:37 AM
Hi,
I had declared this code in the ABAP program and it is working fine and now i had declared in the smartform also. but still it is not displaying the data in fact it showing only.
C( 0.0 - 0.0 ) where as in the original code it was shoeing ( 0.0 - 0.15) and i want to display it as (0.15) only...
i had initialized all the values in global definitions and written the code in global data and initialization fields of it....
plzzzzz provide me guidelines for solving this problem .....
Edited by: ricx .s on Oct 4, 2008 6:05 AM