Suppress leading spaces while displaying an amount field in a Smart form

Hi all,
In a smart form, I am using fields like KONV-kbetr and VBAP-netwr each of them currency type and 2 decimal places. I want to suppress the decimal places and also the leading spaces while displaying these fields in a smartform cause when this field is inserted in a sentence, a lot of gap is there between the field and the words of the sentence. I dont want to change the field length cause it can be that huge in some cases.
Please help.
Thanks ,

Hi, if you would place it in a sentence, it would be an option to concatenate the text and values into one string and then condense it.
concatenate <text> <value> into lv_sentence.
condense lv_sentence.
but another way is to use codes for displaying values in smartforms:
This is from a smartforms PDF i have..
Output Options for Field Contents
Use the Formatting options to adapt the value of a field before printing it. You can enter the
relevant parameters directly behind the field name. Make sure to write the short forms of the
different options in uppercase letters. Some of the options can be combined.
General Information
The formatting options are not suited for all data types of fields (for example, for character fields
you need no exponential representation). You must distinguish between numeric fields and
character fields.
Numeric Fields
  If specified, the system first evaluates the length (<length>).
  If no length is specified, the system displays the value in its overall length.
  The trailing blank indicates a positive sign. To suppress it, use formatting option S.
  Any offset <offset> specified is ignored.
Sequence of evaluation: (<length>), sign to the left(<),Japanese date (L), suppress blanks (C),
right-justified display (R), insert fillers (F).
Character Fields
By default, the system displays the value of a field in its overall length, but truncates trailing
blanks.
Sequence of evaluation: suppress blanks (C), <offset> and (<length>), right-justified display (R),
insert fillers (F).
Overview
Formatting Options for Fields
Syntax Description
&field+<offset>& Skips <offset> places of the field value (character fields only). If the
offset is greater than the length of the value, nothing is displayed.
&field(<length>)& Sets the output length to <length>.
&field(*)& If the field is defined by a Data Dictionary type, Smart Forms set the
output length to the value specified there.
&field(S)& Suppresses the sign
&field(<)& Displays the sign to the left of the number
&field(.<nat.number>)& Limits output of decimal places to <nat.number>
&field(E<nat.number>)& Displays the field value with the fixed exponent <nat.number>. The
mantissa is adapted to this exponent by shifting the decimal
character and inserting zeros.
SAP Smart Forms (BC-SRV-SCR) SAP AG
Output Options for Field Contents
72 April 2001
&field(T)& Suppresses thousand indicators when displaying fields of types
DEC, CURR, INT, and QUAN.
&field(Z)& Suppresses leading zeros of numbers
&field(I)& Suppresses display of initial values
&field(K)& Deactivates a conversion routine specified in the Data Dictionary.
&field(R)& Right-justified display. Use this option only when specifying an
output length as well.
&field(F<filler>)& Replaces left-justified blanks in the value by the fill character <filler>.
&field(L)& Converts and a date field to a local date and displays it. The date is
then formatted using edit mask JPDAT.
Since this representation uses Japanese characters, use it in the
Japanese version of the SAP System only.
&field(C)& The system takes the field value as a sequence of words separated
by blanks. Option C shifts these words to the left and leaves only
one blank inbetween as separator. Any leading blanks are
suppressed. This effect corresponds to that of the ABAP statement
CONDENSE.

Similar Messages

  • How can I autofill the "Amount" field in my eCommerce form using the "Total" from the shopping cart?

    I've found the tags to display the shopping cart summary elsewhere on the site, so I know there's a way to display the total, but I can't figure out a way to fill in the required "Amount" field in the eCommerce form used to process payments. I'd like that "Amount" field to be filled in automatically using the total in the shopping cart. Can anyone help? Thanks!

    You can use the shopping cart summary tag with custom layout.
    Here's the sample:
    <input type="text" value="{module_shoppingcartsummary template="/ModuleTemplates/Shop/cartsummary.tpl"}">
    Inside the shopping cart summary custom layout is a tag for total amount:
    {tag_currency}{tag_totalAmount} or {tag_totalAmountWithCurrency}

  • Amount in words in Smart Forms.

    Dear All,
           I want to Print the amount in words in Smart Forms.
    Is there any function modules  <<removed by moderator>>.
    Also how to call it in SF.
    Thank you in advance,
    Arun.
    Search before posting and Read the rules of engagement

    Hi,
    This has been discussed a lot of times already in the forum, if you have done a search you would have got hundreds of threads.
    Do search the Forum before posting a question.
    Read the [Rules of Engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] before posting more.
    Search Results for [ amount in words (1238 Results)|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=amountinwords&cat=sdn_all]
    Search Results for [Spell_amount (158 Results)|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=spell_amount&cat=sdn_all]
    Regards
    Karthik D

  • Alignment required in to display the  Amount field

    Hi Friends,
    kindly help me facing problem in to display the amount using decimal places also
    nedd to display the Pretax and aftertax amount for that purpose
    written below code . 
    it is picking amount fields but the amount is printing like this
    pretax                  aftertax
    $ 34.67               $     0.00
    $ 21.64               $   120.90->
    I need to display amount fields in order like, thens, hundreds, thousands like.
    read table lt_final into ls_final with key bplan = 'PRD'.
       if ls_final-pretx = 'X'.
         pretax = ls_final-eecst.
         write pretax to lv_pre.     "#EC UOM_IN_MES
         concatenate c_dollar lv_pre into lv_dollar.
          shift lv_dollar right deleting trailing space.
    *Pretax totals
         lv_pretax = lv_pre.
         read table out_pay1 with key name = 'PRETAX'.
         check sy-subrc = 0.
         out_pay1-value = lv_dollar.
         modify out_pay1 index sy-tabix.
         clear out_pay1.
       else.
         aftertax = ls_final-eecst.
         write aftertax to lv_after. 
         concatenate c_dollar lv_after into lv_dollar1.
          shift lv_dollar1 right deleting trailing space.
    Aftertax totals.
         lv_aftertax = lv_after.
         read table out_pay1 with key name = 'AFTERTAX'.
         check sy-subrc = 0.
         out_pay1-value = lv_dollar1.
         modify out_pay1 index sy-tabix.
         clear out_pay1.
       endif.
    Thanks,
    Sai

    Hi Daya,
    I would like to print two amount values with decimals.
    like :  like Pretax      after tax
                                   $      0.00
          $   3.45             $  120.67
          $   0.00             $      0.00
    I created using right justification one paragraph format with two tabs
    60.00              ch           Right
    68.00              ch           Right
    But my program output is comming like this.
    any one please help me.
    Program output:
    Pretax               after tax
                                   $    0.00
          $   3.45           $  120.67
          $   0.00             $    0.00
    Thanks,
    Sai

  • DIsplaying WRBTR (AMOUNT FIELD)WITHOUT  DECIMAL PLACES

    Dear all,
    I am facing a problem in displaying amount field  in alv report. I have two currency keys (US dollar and Japan yen). if it is japan yen I should not have to show decimal places and if it is US dollar I should show decimal places.
    How can I do it in a alv report if I have only one output amount field?
    thanks
    Ranjan.

    Hi chittaramjan,
    1. use this kind of funda (just copy paste in new program)
    Important things
    a) one extra field in internal table
      declared in the same exact fashion
    waers LIKE tcurc-waers,
    b) Populate this field
    c) REST THE System will take care
       (based upon country settings)
    2.
    REPORT abc.
    TYPE-POOLS : slis.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA  : BEGIN OF itab OCCURS 0,
            f1  LIKE P0008-BET01,
            waers LIKE tcurc-waers,
            END OF itab.
    START-OF-SELECTION.
      itab-f1 = '-4.15'.
      itab-waers = 'KRW'.
      APPEND itab.
      itab-f1 = '4.68'.
      itab-waers = 'GBP'.
      APPEND itab.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name     = sy-repid
          i_internal_tabname = 'ITAB'
          i_inclname         = sy-repid
        CHANGING
          ct_fieldcat        = alvfc.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program      = sy-repid
          it_fieldcat             = alvfc
        TABLES
          t_outtab                = itab
        EXCEPTIONS
          OTHERS                  = 2.
    regards,
    amit m

  • While displaying the amount

    hi.
    i am displaying the amount in smartform. the amount should be displayed as the percentage. but it is displaying as amount.
    eg : tax% is 4.000% . but it is displaying as 40.00.
    can any one tell me the solution.

    Hi J ,
    while working on conddition, its rates u need to remember that all % will be for 1000 not for 100.
    regards
    Prabhu

  • Amount in words in Smart form

    My requirement is to print the sales order details.In dat in last page i hav to get the amount in words of total value with in Smart form.
    Tanx,
    Santu.

    Hi Santosh,
       There is one function module and the explanation to this is given below.
    CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
      EXPORTING
        amt_in_num               = var_tot1
    IMPORTING
       amt_in_words             = v_total
    EXCEPTIONS
       data_type_mismatch       = 1
       OTHERS                   = 2
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Here (a) <b>var_tot1 is the vbrp-netwr basically a currency field</b>.
            (b) <b>v_total is a character type length 64 (string) field</b> which holds the words for number in var_tot1.
    Hope this solves your query.
    Reward points if useful.
    Thanks,
    Tej..

  • To display  selection screen date parameter  in smart form

    Hi to all
    My requirement is to display date parameters which are given at selection screen (module pool program ) on the smart forms.
    I just want to dispaly this on selection.
    SO_BLDAT-LOW
    SO_BLDAT-HIGH
    Please guide.
    Regards
    Anubhav

    Hi,
      If you are calling the smartform from the module program then export the parameters from the calling FM  
      and import the same in the smartform.
    Regards,
    Sandeep

  • How to display total amount field in PO layout

    Dear All,
    I have a query related to Purchase Order Printing.
    I copied the standard programme SAPFM06P as ZSAPFM06P. I didn't make any changes to standard program.
    I copied the standard layout MEDRUCK as ZMEDRUCK.
    I am able to display all the data of PO but I am facing problem in displaying <b>Total Amount</b> field (i.e sum of amount and tax value).
    How can we display the Total Amount in the layout without changing the Standard program. I want to make the changes only in ZMEDRUCK for this field.
    My main window details are as follows :
    MatNo MatDesc Uom Quantity rate amount <b>Total amount</b>
    Here I am not able to print Total amount(amount + tax value)
    Please help me on this .
    Thanks & Regards
    Rajvinder

    Hi Rajvinder,
    u need not be so much against changing the program.. infact it s the best way to get the desired output if its done properly...to be completely safe,wat u can do is insert a subroutine somewhere after the values have been populated in the program n then add these inside the subroutine to get the total in a different variable..in this way ur original data s intact n u can use ur new variable in the script as total..
    neways if u dont want to change ur program, then u need to keep these things in mind..
    the value of total & tax shud be available at the point of calling the perform from the sapscript so that u can pass those to a new program for addition.
    eg :
    while writing this in script
    :/ perform add in program znew using &total& &tax& changing &final&
    before this command u need to make sure that total & tax values r ther to pass to the program..
    then u can write a FORM in ur znew to add these two n pass to final..
    in sapscript u can then print &final&
    Hope it helps,
    Regards,
    Bikash

  • Adding field in a smart form select statement

    hi,
    i am modifying a report in which i have to add sortl from kna1 in the select statement .
    when i try to modify the statement it gives error as i ahev defined the value in the global variable .
    plzz help me out as help will be definately rewarded.

    Ric,
    loop at ivbrk.
    select name1 name2 name3 name4 stras pstlz ort01 land1 from
    kna1 into (vname11, vname12, vname13, vname14, vstrask, vpstlzk,
    vort01k, vland1) where kunnr = ivbrk-kunrg.
    endselect.
    endloop.
    Seems you are modifying the  select statement in the smartform which is selecting some data based on the internal table data that is there in the driver program.
    If I am not wrong you want to select SORTL too in the above given select statement.
    In the Global Definitions declare a variable like vsort type kna1-sortl and then in the select statement add this sortl field.
    loop at ivbrk.
    select name1 name2 name3 name4 stras pstlz ort01 sortl land1 from kna1 into (vname11, vname12, vname13, vname14, vstrask, vpstlzk,vort01k, vsortl, vland1)
    where kunnr = ivbrk-kunrg.
    endselect.
    endloop.
    Do check the select statement how you are writing.
    K.Kiran.

  • Displaying text in different languages using smart forms

    hi,
      I am working on smartfroms.
      I have to display the text in different languages using smartforms.
      how to proceed ?
    thanks,
    Aruna.

    To Display in Different Languages:
    Smartforms:
    In the Smartform you create:
    In General Attributes, in Translate, select the radiobutton 'Into Selected Languages' and specify the lang for which you want the translation to be available.
    To translate:
    Go to SE63.
    In menu, Translation -> ABAP Objects -> Other Long Texts.
    In the Object Type Selection window that appears, expand FS ( Forms and Styles) and choose SSF (SAP SmartForms)
    Specify your form name in Object Name and select the source and target lang and click on Edit button.
    In the editor screen specify translated text in the lower half.
    After you are done, click on Save Active button.
    To view your form in the translated language, specify that language when you login.
    SAPscripts:
    Goto SE76.
    Specify the script name, source and target language. Click on Create/Change button.
    Specify all the translations. Click on release.
    It will prompt you to translate window contents.
    Double click on the window and translate the contents. When you are done, the Translation Status will become COMPLETED. Click on Release again.
    (You can edit and check too)
    Now when you preview by choosing the desired language, the translated script is displayed.
    Hope this helps
    Edited by: Jayanthi K on Jan 15, 2009 9:34 AM
    Edited by: Jayanthi K on Jan 15, 2009 9:35 AM

  • Displaying 2 pages on the printpreview(smart forms)

    I would like to see 2 pages (if the size exceeds the main window) on the output screen by clicking on printpreview button. What I have to do for this to acieve? Please let me the detail procedure.
    Thanking you very much.

    Hai Balakrishna
    Table control will draw lines till last record only.
    You can do like this... Use table control but do not use the lines of table control... Make all the borders invisible... and use a overlap window in that draw a template...
    Thanks & Regards
    Sreenivasulu P

  • Problem while displaying top of page in list display

    Hi,
    M facing problem in displaying top of page in list .
    M using following methods:-
    lr_outer_grid TYPE REF TO cl_salv_form_layout_grid,
    lr_inner_grid TYPE REF TO cl_salv_form_layout_grid,
    lr_label TYPE REF TO cl_salv_form_label,
    lr_text TYPE REF TO cl_salv_form_text.
    For displaying the top of page m using event TOP_OF_PAGE.
      CREATE OBJECT lr_outer_grid.
    *Outer grid
      lr_inner_grid = lr_outer_grid->create_grid(
      row = 1
      column = 1 ).
    *... create lable information in inner_grid
    User ID
      lr_label = lr_inner_grid->create_label(
      row = 1
      column = 1
      text = text-h03 ).
    *... create text information in inner_grid
      lr_text = lr_inner_grid->create_text(
      row = 1
      column = 2
      text = sy-uname ).
    *... set label for text
      lr_label->set_label_for( lr_text ).
    But while m going to do same coding for second parameter its not intializing length so adding extra spaces while displaying second row.
    e.g
    USERID       abcdefghjik
    PLANT         jhk            to hjk
    I want that output should look like
    USERID      abcdefghjik
    PLANT        jhk to hjk
    Please tell me the solution what should i do for avoiding extra space

    Hi Neelema,
    You could try this sample code.
    [http://sap-img.com/fu037.htm]
    [http://sap-img.com/abap/sample-alv-heading-in-alv.htm]
    Regards,
    Amit.

  • Filtering Lookup Definition entries while displaying

    Hi Experts,
    I have a Lookup definition which has 100+ entries. While displaying it to users in an object form , I would like not to display some of the entries (very minimal entries).
    Does OIM provides any kind of filtering options? Can you suggest me how to implement this?
    Thanks & Regards
    Inbaa

    Here is a previous post that explains how to use the custom lookup:
    Re: Form Field Validation.
    -Kevin

  • How to add New field in SMART forms.

    How to add new field in the SMART FORMS. Please know me the step.
    Please help me soon.
    Moderator message: Welcome to SCN!
    Moderator message: please search for available information/documentation, do not use a priority higher than normal (no "soon", "ASAP", "earliest" etc.).
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on Jun 17, 2011 12:31 PM

    How to add new field in the SMART FORMS. Please know me the step.
    Please help me soon.
    Moderator message: Welcome to SCN!
    Moderator message: please search for available information/documentation, do not use a priority higher than normal (no "soon", "ASAP", "earliest" etc.).
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    [Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
    Edited by: Thomas Zloch on Jun 17, 2011 12:31 PM

Maybe you are looking for

  • How many buttons can you have in Encore?

    I'm trying to make a disc containing about 33 separate clips, all listed in the Menu, and individualy selectable. But I find when I drag buttons to the menu,it will only accept 18, then no more buttons can be added.  Is this normal for Encore?  Is th

  • Printing the percentage of the file that has been loaded

    Hello everyone! I'm using a FileInputStream and a DataInputStream to read my .DAT file, but I want to print out the amount of percentages of the file that has been loaded, in a System,out.print(""); statement, please tell me how I can do this. :)    

  • [svn] 1179: - added setup and storing settings in a separate file to facilitate updates .

    Revision: 1179 Author: [email protected] Date: 2008-04-10 11:58:03 -0700 (Thu, 10 Apr 2008) Log Message: - added setup and storing settings in a separate file to facilitate updates. - fixed support for paths with spaces (i.e diffpack pack "c:/my docu

  • Data element query

    hi guys,    Is it possible to know that a particular Data Element is used in what all transactions? Thanks in Advance.

  • USB 6210 Using counter as an external clock

    I was referencing an old post for how to read and write data from a quadrature encoder. I am using a USB 6210 card along with Labview 8.2.1. In the previous post it describes needing to: "You will have to create an external clock using the other coun