2008 Mar 20 9:53 AM
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 ,
2008 Mar 20 9:58 AM
Hi,
Space Compression
The symbol value is viewed as a sequence of words, each separated from the next by either one or a string of space characters. The C option has the effect of replacing each string of space characters with a single space and shifting the words to the left as necessary to close up the gaps. Leading spaces are completely removed. The results are the same as those of the ABAP command CONDENSE. Syntax:
&symbol(C)&
Assuming ' Albert Einstein ' is the symbol value,
&symbol& -> Albert Einstein
&symbol(C)& -> Albert Einstein
Thanks,
Arunprasad.P
Reward if useful.
2008 Mar 20 9:59 AM
declare a varaiable of type c.
and then pass the currency value to this variable. Use the declared variable to supress decimals
2008 Mar 20 10:02 AM
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.