Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function Module for displaying quantity.

former_member416443
Participant
0 Likes
1,744

Hello.

I have following problem. In User Exit I have calculated quantity value and I want to display it on the screen.

Now it is displayed with 3 digits after decimals. For example:

I have calculated value 1528.000. This value is displayed.

Is it standard functional module for conver this value depending on unit of measure and format set in users parameter?

For example:

- for PCS it should be displayed: 1 528 or 1.5528 (depending on decimal notation in user profile)

- for KG it should be displayed: 1 528,000 or 1.528,000 (depending on decimal notation in user profile).

Is it standard Function Module? If yes what is the name of this FM?

Regards Bogdan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,078

check this

If no decimal places are specified for the number "PC" in T006, the output of the WRITE statement is "1234".

DATA pack TYPE p LENGTH 8 DECIMALS 4 VALUE '1234.0000'.
WRITE pack NO-GROUPING UNIT 'PC'.

4 REPLIES 4
Read only

laurent_fournier2
Contributor
0 Likes
1,078

Hi,

If you fill correctly the reference unit field, the quantity should display correctly. Are you talking for standard sap program ? Are you filling correctly the unit field ? Is the quantity defined in customizing without decimals ?

Regards.

Read only

Former Member
0 Likes
1,079

check this

If no decimal places are specified for the number "PC" in T006, the output of the WRITE statement is "1234".

DATA pack TYPE p LENGTH 8 DECIMALS 4 VALUE '1234.0000'.
WRITE pack NO-GROUPING UNIT 'PC'.

Read only

0 Likes
1,078

Hi.

It is what I am looking for. (NO-GRUPPING is not necessery).

Regards

Bogdan

Read only

alex_campbell
Contributor
0 Likes
1,078

Read the documentation for the WRITE keyword, particularly the part about the UNIT addition (which is where Vipin copied & pasted from). Note that your quantity will have to be types as a quantity or some other type p field.