cancel
Showing results for 
Search instead for 
Did you mean: 

sap scripts

Former Member
0 Kudos

Hi all.

I have an issue in scripts.

How to manage Quantity and Currency fields in sap scripts.

If any body knows,Please khelp me.

Thanks in advance,

Eswar

Accepted Solutions (1)

Accepted Solutions (1)

vinod_gunaware2
Active Contributor
0 Kudos

Hi

some issue are

<b>Suppressing Output of Initial Values</b> Assuming KNA1-UMSAT contains the value 0 and the currency is DEM.

&KNA1-UMSAT& -> 0,00

&KNA1-UMSAT(I)& ->

If the field contains an amount other than 0, this value is printed in the normal way.

&KNA1-UMSAT& -> 700,00

&KNA1-UMSAT(I)& -> 700,00

<b>Number of Decimal Places</b> 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

<b>Omitting the Separator for ‘Thousands’</b> Symbols of the DEC, CURR, INT, and QUAN data types are normally formatted with the a ‘thousands’ separator character. The T option allows you to omit this separator character.

Syntax:

&symbol(T)&

<b>Right-Justified Output</b> Symbol values other than numeric values are normally formatted left-justified. To specify right-justified formatting, use the R option. You must use this option in conjunction with an output length specification.

Syntax

&symbol(R)&

If symbol has the value 1234.

&symbol& -> 1234

&symbol(8R) -> 1234

<b>Fill Characters</b> You can replace leading spaces in a value with a fill character. Use the F option with the character immediately following the F in the specification as the fill character.

Syntax

&symbol(F f )&

f = fill character

The figure for customer sales in the KNA1-UMSAT field is $700. The Dictionary description of the field specifies an output length 8.

&KNA1-UMSAT& -> 700.00

&KNA1-UMSAT(F*)& -> **700.00

&KNA1-UMSAT(F0)& -> 00700.00

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(T)& -> 1234.560

regards

vinod

Answers (5)

Answers (5)

vinod_gunaware2
Active Contributor
0 Kudos

CONVERSION_FACTOR_GET Measurement unit conversion: Get measurement unit conversion factor Not for Dimensionless Units of Measure

UNIT_CONVERSION_SIMPLE Measurement unit conversion by table T006, with rounding

UNIT_OF_MEASURE_SAP_TO_ISO

UNIT_OF_MEASURE_ISO_TO_SAP

MATERIAL_UNIT_CONVERSION Material quantity conversion from Base Unit of Measure to Alternative Unit of Measure and vice versa.

For Dimensionless Units of Measure (Each, Piece, Box etc.) conversion depends on the given Material (see table MARM). For other Units of Measure (Length, Weigth etc.) conversion can be calculated from the T006 table or via CONVERSION_FACTOR_GET

regards

vinod

Former Member
0 Kudos

Hi,

If you have to convert the quantity in KGS to GRAMS and then display, this conversion has to be carried out through some function modules in the driver program of the script and then value displayed in the form.

Another way, is to use a PERFORM ENDPERFORM in the script.

In this perform you can convert the quantity to GRAMS through a function module or manual code.

The value is then passed to the script which can be displayed.

Syntax goes this way:

PERFORM <conversion> IN PROGRAM <program name> USING <var>

ENDPERFORM.

Thanks,

Rashmi.

Message was edited by: Rashmi Joshi

Former Member
0 Kudos

Hi

I had done it in Smartforms.You better try it out in the sap script i hope this may help you to solve your problem.

in sap scrpit you have to declare two variable similar to those two fields

You have to declare two text elements of quantity, price and assign those two fields with the fields of the internal table then try to display those two field value.

I hope this will help to solve your problem.

Thanks

Mrutyunjaya Tripathy

FredericGirod
Active Contributor
0 Kudos

Hi,

if you problem is the number of decimals, you could use the command : write w_amount currency w_curr to w_data.

... and use the &W_DATA& into your sapscript.

You have to set the code into the program that call the SapScript.

Rgd

Frédéric

Former Member
0 Kudos

Hi venkat,

there are a lot of ways to manage those fields..

1. The F option is used, and the character immediately following the F in the specification is used as the fill character.

Syntax

<b>&symbol(Ff)&</b>

f = fill character

The figure for customer sales in the KNA1-UMSAT field is $700. The Dictionary description of the field specifies an output length 8.

&KNA1-UMSAT& -> 700.00

&KNA1-UMSAT(F*)& -> **700.00

&KNA1-UMSAT(F0)& -> 00700.00

2. Right Justify

<b>&symbol(R)&

</b>

If symbol has the value 1234.

&symbol& -> 1234

&symbol(8R) ->(gives 8 spaces here)1234

For program symbols the length specification contained in the Dictionary definition may be used instead of an explicit length.

3.Ignore Conversion Routines

SAPscript conversion routines specified in the Dictionary are automatically recognized and used when program symbols are being formatted. These conversions can be prevented by using the K option.

Syntax

<b>&symbol(K)&</b>

regards

satesh

Former Member
0 Kudos

Hi Venkat,

What is the issue you are facing with?

Are you working on smartforms?

Regards,

Wenceslaus.

Former Member
0 Kudos

Hi.

thank u for u r reply.

I am not developing the Smart forms.

I am developing the scripts only.

In my case,I have Quantity in Kgs in my tables.

My client wants to display it in grams.

is there any function module to convert dynamically.

Or is there any other method.

Thanks in advance,

Eswar

Former Member
0 Kudos

Hi,

try /DSD/SL_FSR_UNIT_CONVERSION

MATERIAL_UNIT_CONVERSION

UNIT_CONVERSION_SIMPLE

Regards,

Wenceslaus.