Reg Quantity field Printing

hi,
       how to print the Quantity variable with 2 decimals actually the field is having 3 decimals.
Ex: field1 having value <b>16000.000</b> and field2 value is <b>800.000</b>
in out put i want field1 = <b>16.000,00</b> and field2 = <b>800,00</b>.
same is achieved in script is done by using field1(I12.2), and field2(12.2).
how can we do same thing in Smartform....
Regards
Ashok P

Please see formatting options for Smart Forms. There you will find this:
&field(.<nat.number>)&
Limits output of decimal places to <nat.number>
You should then use: &field1(.2)&
Here is the complete list:
Overview
Formatting Options for Fields
Syntax
Description
&field+<offset>&
Skips offsets (<offset>) in 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 sets 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.
&field(T)&
Suppresses thousand indicators when displaying fields of types DEC, CURR, INT, and QUAN.
&field(Z)&
Suppresses leading zeros in 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 a date field to a local date and displays it. The date is then formatted using the edit mask JPDAT.
Since this representation uses Japanese characters, it is only to be used in the Japanese version of the SAP System.
&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 one blank in-between as a separator. Any leading blanks are omitted. This effect corresponds to that
of the ABAP statement CONDENSE.

Similar Messages

  • Purchase Order - Quantity Field printing.

    Hi Gurus.
    I am printing purchase orders via SAP script.
    My users want the quantity field (RM06P-PRMG1) to have a dot(.) not a comma(,)
    eg they want to print the number as 200.000 and not 200,000
    Is there somewhere, i can switch this without adding an ABAP routine to fix this.
    Thanks.
    Points will be awarded.

    Hi Wandai,
    Did you try changing the user settings? Access the menu and go to System -> User profile -> User defaults. Here you can see two options in the Decimal notation tab.
    Option 1 is : Comma and
    Option 2 is : Period.
    Please change and try with each of the above option.
    If this doesn't work you need to check the data type you are using for this variable.
    Hope this helps.
    Please reward if useful.
    Thanks,
    Srinivasa

  • Reg: Quantity field taking as decimal values

    Dear Experts
    In the Bapi BAPI_SALESORDER_SIMULATE the structure BAPIITEMIN contains a field Req_qty that has the data element WMENGC which is taking the input with 3 decimal points even though the domain doesnt contains any decimals, because of this im facing the problem while giving the input.
    Is there any functional requirement to avoid that quantity field taking those 3 decimals
    eg: Original Value: 1000
          Input Value(Converted Value)    : 1.000
    Kindly suggest me a solution to sort out the issue.
    Regards
    Arun.P

    well i suspect that this bapi also has a currency field, which you should fill.
    If he knows the currency he should be able to find out how much decimals there are customized for this currency, and then probably he will do it right.
    oh lol you are talking of quantities and not values... sorry forget about my comment...
    Edited by: Florian Kemmer on Jul 22, 2010 2:37 PM

  • Regarding Editable Quantity field in ALV Grid

    Hi Experts,
    I need your advice in this 2 scenarios.
    1.I have a scenario where quantity field in output is editable and the user wants the quantity field printed without thousand separator. If i take a char field and display the field is editable then user may mistakenly type a,bcd...z/ special characters which it should not capture. Is there any char data type data element which accepts only integers. Because after that i need to save that value in z database table quantity field.
    2. when there i raised an error message after validation of that editable field in alv output(by events), the user wants all other rows in that grid as uneditable except the row which has got error till this error is solved. Is this possible. If yes how.
    Please share your valuable suggestions.

    Hi abilash n      
    as in dictionary, all quantity fields should have a reference to the unit field which then defines the number of decimals.
    The rest is done automatically as long as you do it standard way. In field catalog you have to set the fcat-qfieldname to the name of the field that has the unit.
    If you do so, also totals will be grouped by unit.
    SAP has really done a great thing by inventing  units for quantities (and currency keys for currency amounts). Only developers do not understand and thus refuse to use it.
    Regards,
    Clemens

  • SAPSCRIPT Quantity Symbol printing different values

    Hi,
    I am generating a Printout & Fax at a time for the Purchase Order output, a SYMBOL which is having a conversion value is printing different values in FAX output. Both the Printout and Fax uses the same Print Program but different sapscripts which have same formatting for printing the conversion value (different scripts but copied one and no changes in the script).
    the following symbol is printing different values:
    Print program:
    data: p_value type ekpo-menge,
             umbsz TYPE umbsz.
    umbsz = marm-umrez / marm-umren.
    p_value = umbsz.
    Script
    &p_value(7.0R)&
    This &p_value(7.0R)& gives different values in Printout and Fax and this difference is not for every document, it is for some documents and there are no changes in conversions also.
    My question is: "Is there any problem in using (7.0R) for datatype menge, I mean restrict the no.of characters and decimals at a time for quantity field type".
    Thanks in Advance.
    Ravi

    Hi Ravi,
    Try doing a WRITE - TO in your program. Make the variable p_value type char.
    Another suggestion would be to get the value doing a PERFORM xxxxx IN PROGRAM and retrieve the value from there.
    Regards,
    Ernesto.

  • Regarding quantity field...value in layout

    Hi All,
    my issue is here i am passing vbrp-fkimg value to layout..
    the value in the field above is 100.000, but here in the layout it is coming as 100 and printing it.
    how the value of 100.000 become 100.
    any settings, configuaration are there which changes the value..
    Regards,
    vinesh..

    Hi,
    quantity field will be whole no.
    if the requirment is like printing decimals.
    Then declare one variable of type pack decimal.
    data : w_var type p decimal 3.
    Move vbrp-fkimg to w_var.
    and desplay this variable w_var.
    Reward pts if helpfull.
    Regards,
    Dhan

  • Rounding a quantity field to one decimal place. PLEASE URGENT

    I have a quantity field with three decimal places. I have to print this field with only one decimal place. This is in a smartform.
    suppose: qty = 45.678
    I want it to be printed as 45.7
    Thanks in advance.

    Hi Riki,
    I think you can use Function Module ROUND to round off the value...
    REPORT ZTEST_SHAIL4 .
    data: out type p decimals 1,
    inp type f.
    inp = '45.678'.
    CALL FUNCTION 'ROUND'
    EXPORTING
    DECIMALS =
    input = inp
    SIGN = ' '
    IMPORTING
    OUTPUT = out
    EXCEPTIONS
    INPUT_INVALID = 1
    OVERFLOW = 2
    TYPE_INVALID = 3
    OTHERS = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Now use the variable 'out' to display the rounded off value...
    Regards,
    SP.

  • Quantity field to one decimal place. PLEASE URGENT

    I have a quantity field with three decimal places. I have to print this field with only one decimal place. This is in a smartform.
    suppose: qty = 45.678
    I want it to be printed as 45.7
    Thanks in advance.

    Create one more variable in Global definitions with only 1 decimal place.
    Assign value of qty to this new variable.
    SAP automatically takes care of the rounding.
    And then print this new variable rather than qty.
    You can write all these in a code block.

  • Smartform - Format quantity field - CIZ

    Hello all,
    I have a quantity field which has a value 11.000.
    I need to print it as 11 (no trailing zeroes ). But if the quantity is 11.23, then it shud print 11.23.
    To acheive this, In sapscript, We used to write the quantity field with a C in bracket.
    for eg. &CAUFVD-GAMNG(C)&
    How Could I acheive this same functionality in smart forms ?
    I beleive CIZ shud work in smartforms also..but unfortunately it is not..
    Am i missing something.. ?
    Thank you so much for your time.

    I donot think control commands are possible in Smartform like in sapscript. You have to create a program lines node and there u can write ur logic to meet this requirment.
    Ex:
    data: val type p decimals 3 value '10.230'.
    data: l_char type c  length 10.
    data: l_whole_no type c length 10.
    data: l_decimal type c length 3.
    l_char = val.
    split l_char at '.' into l_whole_no l_decimal.
    if l_decimal = '000'.
    l_char = l_whole_no.
    endif.
    Regards,
    Joy.

  • Remove the trailing spaces of a quantity field in smartform

    Hi,
    I am printing a quantity field in a smartform as follows:
    &G_S_DATA-SAL(C)&.
    It is compressing the leading spaces but there is a space between the field and full stop.
    Eg: if G_S_DATA-SAL = 144.00   the ouptut is displayed as 144.00 . (space between the amount and full stop).
    How can I remove this space?
    Regards,
    Soumya.

    Hi
    Use this.
    &G_S_DATA-SAL(CS)&.

  • Quantity field conversion problem in SAP script

    Hi experts,
    I have problem with sap script quantity field conversion.
    In purchase order the actual value of field( MDPM-ERFMG) is 3,500.
    But in Print preview it is showing only 3.5
    Any one Please help me in this problem
    thanks in advance
    murali

    Hello,
    check this:
    Number of Decimal Places
    A program symbol of one of the data types DEC, QUAN, and FLTP can contain decimal place data. Use the option below to override the Dictionary definition for the number of decimal places for the formatting of this symbol value.
    Syntax
    &symbol(.N)&
    The EKPO-MENGE field contains the value 1234.56. The Dictionary definition specifies 3 decimal places and an output length of 17.
    &EKPO-MENGE& -> 1,234.560
    &EKPO-MENGE(.1) -> 1,234.6
    &EKPO-MENGE&(.4) -> 1,234.5600
    &EKPO-MENGE&(.0) -> 1,235
    REgards,
    Vasanth

  • Quantity fields mismatch

    hi everybody,
        quantity field for a material in enquiry is stored as 2,000
    in the table .
    but when i print it in script it is printing as
    2.000 leading to difference in calculation of net value.
    field is KWMENG
    can any body help ?
    thanks

    Hi,
      In Menu,Goto System->User Profile->Own Data,In Defaults tab ,change the decimal notation.
    Regards,
    Aravind JM.

  • Quantity Field Display

    Hi,
    I am displaying the quantity field in the sap script layout.But in the quantity field having 3 decimal places.
    Ex: 3.400 is there i want to display 3.4
        3.000 only i want to display 3
        3.740 -
      3.74 like that i want.
    I want to omit the zeros after decimal places.
    Please give me the solution.
    Regards,
    Jenny

    Hi Janardhan,
    Do one thing in your print program make us of following line of code
    shift wl_local right deleting trailing '0'.
    where wl_local will containing your quantity..
    This will solve your prob...
    Enjoy SAP.
    Pankaj Singh.

  • Quantity Field Display in Sap Scripts

    Hi,
    I am displaying the quantity field in the sap script layout.But in the quantity field having 3 decimal places.
    Ex: 3.400 is there i want to display 3.4
    3.000 only i want to display 3
    3.740 -
    3.74 like that i want.
    I want to omit the zeros after decimal places.
    Please give me the solution.
    Regards,
    Jenny

    As it is quantity field, it will print even the decimal points...U can try this...move the value to a char variable and use truncating to remove zeros by deleting them and use this value in ur script to print the value.

  • Quantity fields not getting displayed in the second total row

    Hi,
    As per the requirement I have to display 2 total rows for an ALV report using CL_GUI_ALV_GRID. I am able to get the first total row properly using method get_subtotal(). However for the next total row only the character fields are getting displayed and the quantity fields are coming blank.
    The second total row will have different values based on a formula.
    Please help me out in resolving the issue.
    Thanks,
    Abhishek

    You can provide first row as the SUBTOTAL and next row as the TOTAL.
    Get one extra column on which you can do the SUBTOTAL.
    Regards,
    Naimesh Patel

Maybe you are looking for