Decimals in Smartforms
Hi all.
I have some variables on a smartform, but the decimals are specified dynamically on a table, for instance, the table tells me that a fields must be printed with 2 decimals, other field with 4 decimals, and so on.
How can I print those fields with dynamic decimals??
Thanx
Jesus
hi jesus,
as kishan told... you can explicitily give the Decimal number like &v_numb(.2)& or
&v_numb(.4)&...
how many decimal V_numb contains? and there should on condition to print 2 dicmals or 4 decimals...
wht i suggest you is create two textelments... on is withe (.4) and another one with (.2)... then in Condition tab of the textelemten give the condtion..
If you want more clear info... plese expliain on which condtion you want that
<b>Please Close this thread.. when u r problem ise solved</b>
Reward if Helpful
Regards
Naresh Reddy K
Similar Messages
-
Hello all,
How can we suppress decimals in smartform. Because I do not want it for a Quantity field.
Thanks.Hi
&symbol(Z)& Omit Leading Zeros
&symbol(S)& Omit Leading Sign
&symbol(<)& Display Leading Sign to the Left
&symbol(>)& Display Leading Sign to the Right
&symbol(C)& Compress Spaces
&symbol(.N)& Display upto N decimal places
&symbol(T)& Omit thousands separator
&symbol(R)& Right justified
&symbol(I)& Suppress output of the initial value
Regards
Pavan -
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 AMHi 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 -
Remove Decimals in Smartform not working
Hi,
I use
&struc-field(C)&
to hide decimals in a SF.
The type of this field is LGMNG.
This code works for all instances, except when the UOM is type ROL (Role). I have put a break-point in the SF just before the value is output and they are identical.
But the output would be, for example say five units:
a) 5 SH (Correct)
b) 5,000 ROL (incorrect)
Anyone seen this before?
Thanks.Nick,
thanks for the reply. I tried both of these already:
&struc-field(.0)&
&struc-field(C.0)&
And, for both, I am told at runtime that (.0) is not a correct "formatting option for the field struc-field".
I'm going to put a code block in to convert to an integer and display that. It will work - I just thought that (C) or (.0) would work too?
Thanks. -
Display MENGE field with no decimals in smartfroms
Hi Experts,
I want to print MSEG-MENGE field with no decimals in smartforms , how do i declare this field,
I have also declared this field in global defination in quantity/currency field...
But i am unable to get the output..
I tried using &mseg-menge(13.0)& but i get an error in my program stating formating is wrong.
Thanks In Advance.
Ashwin.write a code to display menge value.
data: l_menge type i,
l_menge2 type string.
move: w_bseg-menge to l_menge.
move: l_menge to l_menge2.
condense l_menge2. -
Comma is showing in place of decimal point ( smartform)
Dear All
When i try to display quantity or amount field with decimals in smartform report, system is displaying comma instead of decimal point. for e.g 1200.50 is displayed as 1200,50.
Please advice.
Ravindra Suvarnaposting part of the code for your verification. Pls let me know is you need any further information.
Form Interface
IS_BIL_INVOICE TYPE LBBIL_INVOICE
IS_NAST TYPE NAST
IS_REPEAT TYPE NA_REPET
Global Definitions
WA_EXCISE TYPE LBBIL_HD_KOND-KWERT
WA_CESS TYPE LBBIL_HD_KOND-KWERT
WA_CST TYPE LBBIL_HD_KOND-KWERT
WA_TCS TYPE LBBIL_HD_KOND-KWERT
WA_FREIGHT TYPE LBBIL_HD_KOND-KWERT
WA_INVVAL TYPE LBBIL_HD_KOND-KWERT
WA_ITMVAL TYPE LBBIL_HD_KOND-KWERT
WA_RATE TYPE LBBIL_HD_KOND-KWERT
WA_EX_WORDS TYPE CHAR_200
WA_IN_WORDS TYPE CHAR_200
WA_NUM_CHR TYPE CHAR_18
WA_VTTK TYPE S_VTTK
TOT_NETWT TYPE PNUM
TOT_GRSWT TYPE PNUM
T_NETWT TYPE PNUM
initialization
PERFORM CHECK_INVOICE USING IS_BIL_INVOICE
CHANGING WA_EXCISE
WA_CESS
WA_CST
WA_TCS
WA_FREIGHT
WA_INVVAL
WA_ITMVAL.
Form Routines
FORM check_invoice USING is_bil_invoice TYPE lbbil_invoice
CHANGING wa_excise TYPE lbbil_hd_kond-kwert
wa_cess TYPE lbbil_hd_kond-kwert
wa_cst TYPE lbbil_hd_kond-kwert
wa_tcs TYPE lbbil_hd_kond-kwert
wa_freight TYPE lbbil_hd_kond-kwert
wa_invval TYPE lbbil_hd_kond-kwert
wa_itmval TYPE lbbil_hd_kond-kwert.
DATA : wa_kond TYPE lbbil_hd_kond.
DATA : wa_ikond TYPE lbbil_it_kond.
CLEAR wa_excise.
CLEAR wa_cess.
CLEAR wa_cst.
CLEAR wa_tcs.
CLEAR wa_freight.
CLEAR wa_invval.
CLEAR wa_itmval.
LOOP AT is_bil_invoice-hd_kond INTO wa_kond. "header sub total
CASE wa_kond-kschl.
WHEN 'JEXP'.
wa_excise = wa_excise + wa_kond-kwert.
wa_invval = wa_invval + wa_kond-kwert.
WHEN 'JECP'.
wa_cess = wa_cess + wa_kond-kwert.
wa_invval = wa_invval + wa_kond-kwert.
WHEN 'JLST' OR 'JCST' OR 'JIVC' OR 'JIVP'.
wa_cst = wa_cst + wa_kond-kwert.
wa_invval = wa_invval + wa_kond-kwert.
WHEN 'ZTCS' OR 'ZTCX' OR 'ZENT' .
wa_tcs = wa_tcs + wa_kond-kwert.
wa_invval = wa_invval + wa_kond-kwert.
WHEN 'ZFRC'.
wa_freight = wa_freight + wa_kond-kwert.
wa_invval = wa_invval + wa_kond-kwert.
ENDCASE.
ENDLOOP.
LOOP AT is_bil_invoice-it_kond INTO wa_ikond. "item value
wa_itmval = wa_itmval + wa_ikond-kwert.
ENDLOOP.
wa_invval = wa_invval + wa_itmval.
IF wa_invval NE is_bil_invoice-hd_gen-bil_netwr.
MESSAGE e002(sy) WITH 'Invoice total Error. Pls Check the Pricing Conditions'.
ENDIF.
ENDFORM. "check_invoice
Display
&WA_ITMVAL(11.2)&
&WA_EXCISE(11.2)&
&WA_CESS(11.2)&
&WA_CST(11.2)& -
Smartforms Currency decimals 3
Hi,
I have a problem with the element KBETR, in vf03 i have 1,769- %.
In the table KONV, the field kbetr have 17,69-.
How can i convert the field in percentage please?
Do you know a data element with currency and decimals 3? when i divide by 10 i have 1,77- and not 1,769-.
I repeat that im work with smartforms.
They are not an other solution that create a data element?
Thanks.
Edited by: Spawn rad on Jul 21, 2008 5:36 PM
<MOVED BY MODERATOR TO THE CORRECT FORUM>
Edited by: Alvaro Tejada Galindo on Jul 21, 2008 12:19 PMtry this
&symbol(.N)& Display upto N decimal places.
other options:
&symbol(Z)& Omit Leading Zeros
&symbol(S)& Omit Leading Sign
&symbol(<)& Display Leading Sign to the Left
&symbol(>)& Display Leading Sign to the Right
&symbol(C)& Compress Spaces
&symbol(.N)& Display upto N decimal places
&symbol(T)& Omit thousands separator
&symbol(R)& Right justified
&symbol(I)& Suppress output of the initial value
u can use various combinations of these options.
Example:
&SFSY-FORMPAGES(3ZC)&---outputlen,c-condense,z-
Reward if helpful -
Hi,
I have a statement:
gs_unitprice = grkwert / <fs>-kwmeng.
result: gs_unitprice = 2,40708
gs_unitprice is defined as CURR field, 13 long, 5 decimals
Now, we want to only print the number with 4 decimals WITHOUT rouding the number.
So now my smartform prints: 2,4071 but they don't want this.
They want that my smartform prints 2,4070.
I've tried a lot of things, like making a type of field with 13 long, 4 decimals and move my field to that, but with the move it also rounds it up to 71 ...
Thanks a lot!Use the function ROUND with input = gs_unitprice
an decimals as 4.
CALL FUNCTION 'ROUND'
EXPORTING
DECIMALS = '4'
INPUT = gs_unitprice
IMPORTING
OUTPUT = gs_unitprice
EXCEPTIONS
INPUT_INVALID = 1
OVERFLOW = 2
TYPE_INVALID = 3
OTHERS = 4.
Regards,
Ravi -
Printing units with different decimals separator "in column"/ smartforms
Hi.
I want to print in SMARTFROMS different amounts under each other and the amounts are having different decimals places (depending on unit) - the printing should be, that the decimal separator is "in a column" and the units are in a "column"
E.g.
123,23 meters
10,00 meters
12,567 kg
67 PCE
should be printed as:
123,23__meters
10,00_meters
12,567kg
67____PCE
How can I do this?
Thanks a lot in advanceHi,
Use a paragraph with tabstops. Define your tabs with align with decimal character.
That defining can be done in smartstyles. (tabstops are not alone in sapscript but also in smartforms)
Gr., Frank -
How to calculate the subtotals in smartform
hi all
can any body tell me how can i display teh subtotals in smartform, please tell me the steps how to do that and aslo is there any special events in smartforms that are helpfull in getting and displaying the subtotals in smartforms
thanks in advanceHi,
For doing subtotal calculation in SMARTFORMS, do like this.
Create one "Program Lines" to your main window table row.
Already you are maintaing "Internal table" for you table in main window.
Before that, sort the particular internal table with key fields through which you want to find out the sub total, now within the program lines code, first identify how many quantity and currency fields are there.
Declare respective temporary variables for each and every quantity and currency field.
then write logic like this.
at new matnr.
v_menge = wa_out-menge + v_menge.
v_netwr = wa_out-netwr + v_netwr
end at.
Also dont forget to declare character variables for quantity and currency fields. We cannot directly display them in smartforms. we need to pass them to the respective quantity and currency fields.
After end at statement write like this,
write: / v_menge decimals 2 to v_mengetext,
v_netwr decimals 2 to v_netwrtext.
after this dont forget to clear,
clear: v_menge, v_netwr.
no populate v_mengetext and v_netwrtext in your text elements.
Regards,
Santosh Kumar M. -
Printing Smartform for a series of data
hello People,
i am stuck up in a situation which sums up like this
i am having a range of check numbers for which the details of checks have to be printed.
the req is all the check between the range has to be printed in that many pages and printer should be assigned once only
that is for 10 checks smartform should have 10 pages.
the code i have designed is mentioned below
it is working fine in terms of execution, the only problem is that
only the last check in the range is showing in the preview.
all other are bieng overwritten.
in the debugger i can see the values for all checks being assigned.
<u><i><b>the thing is i want the first time the loop execute it should print check in first page
the next time the loop executes it should print check in second page
and so on till the tenth.</b></i>.</u>
<b>few points i wud lik to mention :
its not the standard check format, so dont think in dat direction,
the whole content including the main and secondary window is changing not just the table in main window</b>
please help
here is the code i devised
upper = upper.
lower = lower.
itab = itab.
select chect
from payr
into table itab
where HBKID EQ BANK
AND CHECT between lower and upper.
break-point.
DATA: l_char18 TYPE char18,
l_p TYPE p DECIMALS 2.
loop at itab into wa_itab.
SELECT SINGLE zbukr
hbkid
hktid
rzawe
chect
lifnr
kunnr
ubhkt
vblnr
zaldt
waers
rwbtr
pridt
zanre
znme1
FROM payr
INTO wa_payr
WHERE chect EQ wa_itab-chect
and hbkid eq bank.
IF sy-subrc EQ 0.
SELECT SINGLE lifnr
adrnr
FROM lfa1
INTO wa_lfa1
WHERE lifnr EQ wa_payr-lifnr.
SELECT SINGLE addrnumber
date_from
nation
name1
name2
name4
city1
post_code1
po_box_loc
street
tel_number
region
FROM adrc
INTO wa_adrc
WHERE addrnumber EQ wa_lfa1-adrnr.
SELECT bukrs
belnr
gjahr
buzei
augbl
shkzg
mwskz
dmbtr
qbshb
FROM bseg
INTO TABLE it_bseg
WHERE augbl EQ wa_payr-vblnr
AND shkzg = 'H'.
IF sy-subrc EQ 0.
SELECT bukrs
belnr
gjahr
xblnr
FROM bkpf
INTO TABLE it_bkpf
FOR ALL ENTRIES IN it_bseg
WHERE belnr = it_bseg-belnr.
LOOP AT it_bseg INTO wa_bseg.
READ TABLE it_bkpf INTO wa_bkpf
WITH KEY belnr = wa_bseg-belnr.
wa_disp-billno = wa_bkpf-xblnr.
wa_disp-amount = wa_bseg-dmbtr.
l_char18 = wa_bseg-dmbtr.
SHIFT l_char18 LEFT DELETING LEADING space.
wa_disp-amount = l_char18.
l_p = wa_disp-amount.
CLEAR wa_disp-amount.
wa_disp-amount = l_p.
CLEAR l_p.
SHIFT wa_disp-amount LEFT DELETING LEADING space.
wa_disp-tdsamt = wa_bseg-qbshb.
l_char18 = wa_bseg-qbshb.
SHIFT l_char18 LEFT DELETING LEADING space.
wa_disp-tdsamt = l_char18.
l_p = wa_disp-tdsamt.
CLEAR wa_disp-tdsamt.
wa_disp-tdsamt = l_p.
CLEAR l_p.
SHIFT wa_disp-tdsamt LEFT DELETING LEADING space.
APPEND wa_disp TO it_disp.
CLEAR wa_disp.
ENDLOOP.
ENDIF.
ELSE.
MESSAGE 'Entered Cheque No is Incorrect' TYPE 'E' RAISING exc1.
ENDIF.
endloop.
help people
thanks & regards
Nitinhi Nitin
just give a try with this .
create one loop and for that give your int_tab which holds the records of all the checks say 10 checks.
also create one program lines wherein you l set the flag to 1 whenever the itab count increases if not then set the flag to 0.
now inside the main window create one command node and check the go to new page checkbox and give your second(or next page) name , and in the conditions tab keep the flag = 1.
the extra work you need to do is you have to create one next page with all the same windows which will triggers for evry new line item.
hope it may be helpful to you.
plz reward points if helpful
Regards
Zarina -
Change a number into word format in Smartforms.
hi....
plz tell me how can I display word format of a number in a smartforms.
i have a prientout form which display the net value Rs 3250 .my task to write in word like 'three thausands two hundred fifty rupies only'spell_amount FM
Check this..
DATA : money TYPE p DECIMALS 2,
in_letters LIKE spell.
money = '1000.00'.
CALL FUNCTION 'SPELL_AMOUNT'
EXPORTING
amount = money
IMPORTING
in_words = in_letters
EXCEPTIONS
not_found = 1
too_large = 2
OTHERS = 3.
WRITE : / in_letters-WORD.
Madhavi -
What is the functionality of &VBDKR-NETWR( 10)& in sap script and smartform
Dear All,
I came across this &VBDKR-NETWR(<10)& when I was migrating the script as smartform. I would like to know wht is functionality of &VBDKR-NETWR(<10)& i.e. <10's meaning. I am facing problem in printing the amount. So many alignment problems are coming.
Please help me on this.
Thanks in Advance.
J.hi,
&VAR(<10)& means output will be printed with sign to tjhe left (<) and output length is 10 (10)
here an overview with the most use formating symbols
&VAR(En)& Exponent number (n)
&VAR(Ff)& Fill character
&VAR(K)& Ignore conversion rules
&VAR(<)& sign to the left
&VAR(>)& sign to the right
&VAR(.n)& number of decimals
&VAR(+n)& offset
&VAR(Z)& omit leading zeroes
&VAR(S)& omit leading sign
&VAR(T)& omit thousand sepearator
&VAR(n)& outputlength n
&VAR(R)& right justified
&VAR(C)& condensed
&VAR(I)& suppress initial value
success,
Gr,. Frank -
How to remove space from a variable in a smartform
Hi,
I have a problem in displaying a variable in a smartform..The variable shows some blank space that preceeds the data.
for eg:,
variable = 18.000.
How to remove space before 18.000?To remove the decimal places for quantity and rate/quantity , use the syntax to restrict the number of digits after decimal places. The syntax is
&symbol(.N)&
where N is number of decimal places.
Since you dont want decimals use &symbol(.0)&
For the other case it depends on how the currency is represented , any way try using the syntex &symbol(T)&
Please give me reward point If it is useful
Thanks
Murali Poli -
Smartform Output Amount display in Parenthesis
Hi,
In a Smartform Output my varaible (X_VAR type p decimals 2) is printing out as 434543.65-.
I want my output to be in this format (434543.65) rather than with negative Sign.
Due to my requirement I can't change the type of variables.
Any idea how to Show it on Smartform .Unfortunately Concatenation doesn't work with Variables of Type p.
Any ideas?
Regards
VaraOmitting the Leading Sign:
The ITCDP-TDULPOS field contains the value -100.00. The ABAP Dictionary definition for this field includes a leading sign.
&ITCDP-TDULPOS& -> 100.00-
&ITCDP-TDULPOS(S)& -> 100.00
You might be getting syntax error since smart form editor
is case sensitive. Try with all capital.
Hope this helps..
Thanks,
vamshi
Maybe you are looking for
-
Difficulties using iCal because time isn't showing up.
I am trying to make a schedule for school using ical but on the left hand side in the weekly view it does not display the time of day. Instead it just says sat and then noon and then continues with sat. I tried logging on as a guest and it worked fin
-
Recording sound with Siemens API
Hello, there is only com.siemens.mp.media package instead of javax.microedition.media on my Siemens C55. It containes most of classes from MMAPI but class RecordControl is missing:( Is there some other approach how to record sound in java on this tel
-
I need help with upgrade from CS5.5 to CS6 Production Premium DISC version
Hi, i bought the Production Premium CS5.5 in 2011. I then bought the CS6 Upgrade (the boxed version). After the security desaster at Adobe, the keys were invalidated. So when now years after purchase I wanted to use my product, Adobe said I had to do
-
Classloader/Servlet engine problems
I am running across a problem that I believe is related to the Classloaders being used. If a class in the application server classpath references classes that are loaded by an individual web application, I get a ClassNotFoundException. From what I un
-
Why the plant will disappear automatically after I input for a P/O?
I input all the information for a purchase order. But after I input plant and then click 'enter', the plant disappears automatically. I checked the assignment of company code with plant and plant with material and so on. They all seems correct. Do yo