Skip to Content
avatar image
-1
Former Member

How to remove gaps between two variables in smartforms??

Example : &amt1&<c>/-</>

output i am getting : 70,000.00 /-

but i need output like 70,000.00/- without soaces

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Nov 22, 2016 at 06:58 AM

    Use an ouput option without space for minus sign at right, like &amt1(S)&.

    Regards,
    Raymond

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 25, 2016 at 09:35 PM

    Here is the official help site with all formatting options

    http://help.sap.com/saphelp_nw70ehp3/helpdata/en/4e/34031063de02c2e10000000a15822b/content.htm

    Yoiur problem will be solved using the following syntax

    &gv_amount(CZI)'/-'&

    This will display the value only if it is not initial (i) and will remove all unneeded zero (Z) + spaces (C)

    The ending '/-' inside the & is there, that it will be also not displayed if your variable is initial.

    But to be honest, maybe you can make yourself familiar with the search functionality located left to your user, it's hard to not see it as a basic question.

    ~Florian

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 22, 2016 at 11:22 AM

    Hi Rajeshwar ,

    could you try as &gv_amount(CIZ)&

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 26, 2016 at 05:03 PM

    First off that is an archaic way of representing rounded off quantities in currency. See Slash (punctuation) - Wikipedia for more information. So your example of 70,000.00/- (seventy thousand decimal zero zero) is wrong, you will have to remove the decimals when you use the "slash and dash". So that would become 70,000/-. If you have any decimals, you have to omit the "/-", because it is no longer an even quantity. So, if you add another half rupee (pound/dollar/whatever), you will have to represent this as 70,000.50 and you can not use the "/-" behind this number.

    If you want to do this the right way, I can't think any of the native formatting options that will work for you. I believe you will have to write a routine to handle this. You can put this a routine in your SmartForm, or better still, if you anticipate using this convention in other programs/reports, develop a conversion exit or a little helper class with a static method that you can call from anywhere.

    My other suggestion would be talking to whoever wanted this report and encouraging them to move into the modern world of decimals!

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Raghu,

      You are right but my client need it. Thanks for the information. Very useful information.

      Regards,

      Rajesh Reddy