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.

Similar Messages

  • In smartforms the quantity field is not showing the perfect value .

    In smartforms the quantity field is not showing the perfect value because the point is shifting left
    insted of showing 8.10 it is showing 80.00.

    Hi,
    Dont use the quantity field same as that it come from interface Fm declare one field for quantity in the global settings and write the logic to pass the value to that field and pass that global value to the particular texts...same is the case with currency fields also.
    Regards,
    Rohan.

  • In smartform quantity field move to left side.

    Hi,
    smartform output quantity field displaying rightside.
    how can i move quantity field to leftside.
    Regards,
    Suresh.

    Hi Suresh,
    check this
    Left/Right Alignment of Quantity field?
    hope it helps you
    Regards!

  • Currency and quantity field allignment in smartforms

    hi experts
       i am facing problem in smartforms allignment for currency and quantity fields. these fields are not coming exactly on the same line of the other fields with char types. please help me resolving it.
    Moved to Crrect Forum
    Edited by: Vijay Babu Dudla on Apr 6, 2009 4:38 AM

    &wa_vbap-kwmeng(C)&
    adjust with left and right alignment.
    it will definately work.
    what happend? isn't ur problem solved?
    Edited by: MONIKA DHUMAL on Apr 6, 2009 4:38 PM

  • Problem in smartform...quantity field....have ur points..

    HI ALL,
    I m transferring my itab from main program to SMARTFORMS...itab has a quantity type field.
    When i execute my program, i get error message "Reference field WA-CR is unknown in form".
    <b>Have ur points..</b>
    Regards,

    Every quantity field has a reference field.
    Check the reference field in the table through SE11 transaction & click on REFERENCE tab. Trace your quantity field & corresponding reference field.
    In the Smartform mention the same reference field against the quantity field declaration & activate it.

  • 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)&.

  • Unit of the Quantity field is displaying in internal format in Bex report

    Hi Experts,
    I have a BEx Query, in which i have quantity keyfigure added(Examble - Sales Quantity).
    When i run the report for a selection the report displayes the unit for the quantity field in internal format.
    Examble - instead of showing 10 CS (case), the report is shwing in 10 CV (internal format of unit CS is CV).
    Also when i check the cube content, it has the unit updated into the cube as CS for that keyfigure.
    Can any one let us know, how to dispaly the report output in external format.
    Regards.
    Muruganand.K

    Hi Gopi,
         The property in question is "calculated". This is a property of a context value attribute. So select the value attribute in the context to which your field is bound and view the properties. Set "calculated=true". It will generate the accessors.
         In the setter method, add the following piece of code:
    public void set<your attribute name>(IPrivate<your component>View.IContextElement element, java.lang.String value)
      DecimalFormat df = new DecimalFormat("#.00");
      value = df.format(value).toString();
    Regards,
    Satyajit
    Message was edited by: Satyajit Chakraborty
    Message was edited by: Satyajit Chakraborty

  • Handling currency and quantity fields in smartforms

    Hi,
    can i know how to handle currency and quantity fields in smartforms.
    i have to display ZMENG field of VBAP table but it is not getting displayed.
    i have given the details in CURRENCY AND QUANTITY tab in the GLOBAL DEFINITIONS.
    Thanks,
    BJR.

    Hi
    Did u pass that value in the INPUT and OUTPUT parameters where u r calling that field...
    if u have not included that in The Currency/Quant Tab will get an Error Message.....
    and &VBAP-ZMENG& ..in the text
    surya

  • Currency and quantity fields in Smartforms

    Hi Experts,
    How to refer currency and quantity fields , in my form i am using FAKING and NETWR fields,
    in global definitions one tab is there currency and quantity fields  in that  in filed name column what i have to give and reference filed , PLease can u you give some examples, so that i can understand easily...
    Useful answers are awarded.
    Thanks

    The 'Currency/Quant. Fields' tab in the Global definitions allows you to link the field containing a value to the field containing its unit of measure.
    For example, my purchase order has two line items, one is for 6 eggs (which have unit of measure PC) and 2.5 kilogramms of flour (UOM is KG).  When these are written on the output the eggs have no decimal places, the flour has 2 (this is defined in configuration). So;
    Eggs  6    PC
    Flour 2.50 KG
    This happens only if I specify in the 'Currency/Quant. Fields' tab the field that holds my quantity and the reference field that hold the UOM, and specify data type QUAN.  Same concept applies for currency where they have different numbers of decimal places (for example Japanese Yen is always expressed as a whole number with no decimals).
    Regards,
    Nick

  • Remove Decimals in smartform for QUAN Field

    Hi,
    I want to display the Quantity field in smartform by Suppressing Decimals,
    if i give &field(13.0)& it is showing Error : Incorrect formatting option.
    The Same will work with CURR Field. Then what i have to give for QUAN Field.
    Thanks & Regards
    Praveen.
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Mar 24, 2009 10:42 AM

    Hi Praveen,
    Maybe you can try it with &field(.0)& ,
    But it is possible that it is concerning a field which formatting is customized with transaction CUNI.
    Hope this will help.
    Gr.,Frank

  • Format for fields in an internal table

    DATA: BEGIN OF ITAB OCCURS 0,
      AUFNR  LIKE AFKO-AUFNR,  " Purchase Order Number
      PLNBEZ LIKE AFKO-PLNBEZ, " Part Number
      BISMT  like MARA-BISMT, " Old Material
      LNO(2),
      GAMNG LIKE AFKO-GAMNG, " Production Order Quantity
      GLTRP  LIKE AFKO-GLTRP,
      VDATU  LIKE VBAK-VDATU,
      KWMENG LIKE VBAP-KWMENG,
      MBDAT  LIKE VBEP-MBDAT,
      GBSTA  LIKE VBUK-GBSTK,
      PCTBS(5),
    *CSHOT
    "CDESC
    END OF ITAB.
    LOOP AT ITAB.
    WRITE:/3 ITAB-AUFNR,
    13 ITAB-PLNBEZ,
    23  ITAB-BISMT,
    LNO(2),
    45 ITAB-GAMNG,
    65 ITAB-GLTRP.
    57 ITAB-VDATU.
    *63 ITAB-KWMENG,
    69 ITAB-MBDAT.
    PCTBS(5),
    *C
    ENDLOOP.
    I have a internal table and I have writing the itab in the write statement. I need to format the field in itab.
    for eg:
    itab-gamng(lenght as 5)
    itab-gltrp(its a date) i just need the mm/yy how can I format it.

    You don' need to reformat the itab, just the fields before you write them.
    <b>data: monthyear(5) type c.
    data: qty(5) type c.</b>
    LOOP AT ITAB.
    <b>concatenate itab-gltrp+4(2) '/'
                itab-gltrp+0(4)
                        into monthyear.
    clear qty.
    qty = qty + itab-gamng.</b>
    WRITE:/3 ITAB-AUFNR,
    13 ITAB-PLNBEZ,
    23 ITAB-BISMT,
    * LNO(2),
    <b>*45 ITAB-GAMNG,
      45 qty,
    * 65 ITAB-GLTRP.
      65 monthyear.</b>
    * 57 ITAB-VDATU.
    * *63 ITAB-KWMENG,
    * 69 ITAB-MBDAT.
    * PCTBS(5),
    *C
    ENDLOOP.
    Regards,
    Rich Heilman

  • How can I format a field in the form creator?

    How can I format a field in the form creator? It's putting the same text in all the fields within a table. I want each field within the table to have different text. As soon as you click out of the table, all the text is the same.
    I even changed the fields from a text box to a drop-down list so a person can make their selection, which will be a quantity from 0-9. There are two of these such fields. You make your selection in each, click off the table and both fields show whatever I selected in field 1. The original Qty I selected in the bottom field was a 5 but it changed it to whatever is in the top field on it's own. I've added a screen shot.

    This behaviors usually happens when you create the fields but  a copy paste command from one of the fields. The copy paste command assumes that your intentions is to maintain a copy of the field in two separate locations (e.i, a form field  "company name" printed in each and every page of a multi-page form document.
    Go to the properties fields of each field and make sure  to assign unique form field  names.

  • Formatting a field in the repetitive area of the Print Layout Design

    Our quantity fields in the repetitive area print out with a decimal point and 3 spaces after the decimal point (i.e. 10.000). How can I change the format of these fields so that there are no decimals included (i.e. 10) when we print an order?
    Thanks.
    Edited by: Philip Eller on Jun 19, 2008 9:56 AM
    Edited by: Philip Eller on Jul 3, 2008 3:11 PM*

    Mike,
    You could use the Formula ABS( )
    Add a Formula type field
    In the Formula select formala ABS()
    syntax: ABS(Field_xyz)..here field Field_xyz is your number field
    If your value was 10.000 the result will be 10. This formula ignores the decimal part.
    The formula ROUND could be used if you want to ROUND the value to the nearest higher or lower integer
    Consider number 10.450
    ROUND(Field_xyz,2)  will give 10 
    ROUND(Field_xyz,1) will give 11
    Suda

  • 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.

Maybe you are looking for

  • Problems print report on 9ias 9.0.2.0.1

    Hi, I can run my reports on my 9ids fine, but when I run then on 9ias on the web I get REP-826. I have forms call object report with run_report_object with parameter forms in reports. I have in object report in forms: destype=cache, desformat=pdf, ru

  • Testing 4x E5-4650s and 128GB RAM - tweaks for 32-core performance?

    Howdy. I've got the following system: 4x E5-4650 eight core CPUs (32 cores/64 HTs total) 16x 8GB EEC RAM - 4 sticks per CPU 2x 512GB Samsung 840 Pro SSDs 5x 3TB Hitachi HDDs in RAID5 1x GTX 670 w/ 4GB RAM Windows Server 2012 When I'm exporting 1080p

  • It seems you cannot clone objects with attributes using lazy loading in JPA

    I have an entity with an attribute using lazy loading: @Entity public class B { @ManyToOne(fetch=FetchType.LAZY) private A a; @Entity public class A { Assume the following code: A a1 = new A(); A a2 = new A(); B b1 = EntityManager.find(B.class, ...);

  • Trouble accessing a database in a deployed application

    I am having difficulty accessing a database on a deployed application.  I am using LV2009, and Windows XP.    I am interfacing with the database via ODBC.  The database is located in the "Shared Documents" folder.  I have no problem accessing the dat

  • Changing Credit Management Contolling Area setup

    HI, We are considering changing the set up of credit management controlling area and I wanted to check if anyone knew the implications of changing the set up after it has been in use for some time. Currently we only have 2 areas with several company