cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform Prob.

Former Member
0 Kudos

Hi,

How Can I subtract the values in table level and display the value in corresponding column?

Ex:

If I have 4 fields in table in smartform, I want to subtract 2 and 3 values and display it in 4 fied column...

Regards,

Muralikrishna

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi..

Now is it coming blank or 0.000? If it blank, it might be a space issue, then try using &VAR(C)& etc. else if it is 0.000 then plz check once if you have included the variable in output parameters of the code where you are calculating and the code is above the that particular text element or not.

Karthik

Former Member
0 Kudos

Hi Karthik,

Its showing the Blank...

Regards,

Muralikrishna

Former Member
0 Kudos

Hi..

1. Use &YOURVARiIABLE(C)& : this will compress blanks.

2. Check the linetype, if there there is sufficient space.

3. Try to hard code the text element as '1' just to check is it ever prints any value or not. If yes, then try to pass value '1' to the variable and see what happens.

I feel it could be an issue related to space, formatting etc. Do some trials and you'l get to know whats the problem.

Regards,

Karthik

Former Member
0 Kudos

Hi Kartik,

Thanq for giving the solution... I havent tried with var(c) cause I loged out my company and i came out, i will workout tomorrow and if any issues i will give the message....

Thanks n Regards,

Muralikrishna

Former Member
0 Kudos

Hi Karthik,

I got the Result... Thanq for giving the solution... I understand by this process is the issue was SPACE as u told..

Thanks n Regards,

Muralikrishna

Former Member
0 Kudos

Hi,

and another Issue is, i wanna print the -ve sign before the number but here its printing after the number... is there any conversions for this...

ex: I want to print -10 here its printing 10-....

Thanks in Advance

Regards,

Murlaikrishna

Former Member
0 Kudos

Hi,

Please use the option < as shown below:

&ITCDP-TDULPOS& -> 100.00-

&ITCDP-TDULPOS(<)& -> -100.00

Also, as per the best policy please provide points for the useful answers.

Regards,

Selva K.

Former Member
0 Kudos

Hi Selva,

Thanq for the solutions... I am giving the points, where there the options like solved, helpful etc.. there i am clicking the radio buttion.. is this the process to give the points?

Thanks n Regards,

Muralikrishna

Answers (1)

Answers (1)

Former Member
0 Kudos

Inside the loop ( Table loop ), before printing the value for4th field column ( Text ), create 'Program Lines' for subtracting the values.

To the Program lines, pass the values ( variables)of 2 and 3 as input parameter and value of 4 as output parameter.

Regards,

Nikhil

Former Member
0 Kudos

Hi Nikhil,

4th field is not in Table and the subtraction is between quantities, so i have to define 4th field as quantity or integer in Global Settings.

Thanks in Advance

Regards,

Murali

Former Member
0 Kudos

Hi..

Better declare it similar to the quantities you are subtracting, as a quantity field.

Regards,

Karthik

Former Member
0 Kudos

Hi Karthik,

Its not showing the out put...

my fields are LSMNG, ERFMG from MSEG table and I have taken one variable and defined as V_rejected type LSMNG

and did the code as V_rejected = v_lsmng - v_erfmg. I have taken lsmng and erfmg also variables.. Do I need any modifications ? Please let me know...

Thanks in Advance

Regards,

Murlaikrishna

Former Member
0 Kudos

Hi..

What is happening exactly? Are you not getting any output or in the output the particular field is blank?

If you are not at all getting any output, it may be because of Reference field error, which you can see if you have all exceptions of the FM called in place (not commented).

Else it could be some space related issue. Better if you could write a breakpoint where you are calculating the sum and try to analyze where is it exactly going wrong.

Regards,

Karthik

Former Member
0 Kudos

Hi Karthik,

I have to give the reference fields for the variables also... am little bit confusing

Thanks in Advance

Regards,

Muralikrishna

Former Member
0 Kudos

Hi,

Could u please reply me.. cause I am stucking here... I tried all the possiblities but i havent got.. here i am getting the value is blank

Thanks in Advance,

Murlaikrishna

Former Member
0 Kudos

Hi..

If we do not provide reference fields for CURR/ QUAN variables then the output is not displayed, but here you are saying that its blank.

Did you check in debugging? is the value getting populated?

Regards,

Karthik

Former Member
0 Kudos

Hi Murali,

While you creating the variable at the Global defnition, just assign the currency in the same but in the Currency / Quantity field tab. Hope you have the currency which is used for the other variable - v_lsmng & v_erfmg, just assign the same over there.

If you have any issue, just let us know.

Regards,

Selva K.

Former Member
0 Kudos

Hi Karthik,

The value is populated but with 0.00.. But I am having the values for LSMNG and ERFMG in table

Regards,

Murlaikrishna

Former Member
0 Kudos

Hi Selva,

I have assigned the reference fields for V_LSMNG n V-ERFMG but still I am not getting the values

Former Member
0 Kudos

Hi..

Please also ensure that the calculation part is before the text elements display. If its not getting populated properly while debugging, then do check your code.

Regards,

Karthik

Former Member
0 Kudos

Hi Karthik,

The values are collecting to the WA of the MSEG table and are displayed into table of smartform, but when I am doing the subtraction the values are not displayed in the variables...

VARIABLE REFERENCE FIELD DATA TYPE

V_LSMNG WA_MSEG-LSMEH QUAN

V_ERFMG WA_MSEG-ERFME QUAN

I have written the select statement in my Driver program i.e

SELECT SINGLE * INTO WA_MSEG FROM MSEG WHERE MBLNR IN S_MBLNR

AND MJAHR IN S_MJAHR.

still i am unble to get the values

Thanks in Advance

Regards,

Murali

Former Member
0 Kudos

Hi..

I hope you have declared the variables in Global definitions and not in your program line. Else if they are local variables, they will not be available outside the program lines.

Regards,

Karthik

Former Member
0 Kudos

Hi Karthik,

So I need to define the variables in Form Interface or in Driverprogram?

Regards,

Muralikrishna

Former Member
0 Kudos

Hi..

The variables used for calculating difference should be in Global Definitions -> Global data and the reference field should be mentioned in Currency/Quantity Fields tab.

The declared variables should be put in import/export parameters tab in the program lines you have created.

Hope it solves the issue.

Regards,

Karthik

Former Member
0 Kudos

Hi Karthik,

I did the same thing what u explained...

Thanks in Advance

Regards,

Muralikrishna

Former Member
0 Kudos

Hi Karthik,

Finally, in Debugginng I am getting the values, but i am unable to print the values in form output.. what could be the reason?

please tell me the suggestion...

Regards,

Murlaikrishna