Skip to Content
0

Remove decimal zeros from ‘delivery quantity’

Dec 08, 2016 at 03:40 PM

669

avatar image

I have a quantity field of datatype LIPS-LFIMG in module pool screen. While displaying the value in this field i do not want the decimals to appear.

In the screen the value gets displayed as 2,000

But i want it to be displayed as 2.

I do not want to change the datatype of the field.

The same functionality works in the standard transaction VA03, where the quantity field displays values without decimals.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Jürgen L
Dec 08, 2016 at 03:49 PM
6

The number of decimals are usually defined in customizing of unit of measures (transaction CUNI)

Never forget that SAP internally uses always 3 decimals, even you customize it to display zero decimals it is still possible to enter a quantity with 3 decimals, so hiding decimals should really only be done for units where it is illogical to have decimals, e.g. a wheel , a car

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Yeah, but my car has 4.5 wheels - that spare just can't count as 1 can it? :)

0

.................................

0

3 decimals? In SD you mean?

0

yes, my ST unit has 0 in field T006-DECAN, as you see in the first 3 old items it does not show decimals, now I added the 4th item and was able to enter decimals (Germans use comma as decimal separator). This can be restricted in the material master by using the delivery unit 1, but in standard you can use decimals even for a unit which is defined to have zero decimals

dezi.png (5.2 kB)
1
Raymond Giuseppi
Dec 09, 2016 at 09:11 AM
3

Read some documentation or your Abap course: look for Quantity Fields, Handling in Dynpros

(So here: did you define LIPS with a TABLES statements in global area of program, did you check the ddic box on the field in dynpro definition, Look at SE11 for LIPS, identify the quantity field, here it is a field of LIPS so you don't need an other table in your TABLES statement as would have be the case if, for example, unit came from MARA)

Regards,
Raymond

Share
10 |10000 characters needed characters left characters exceeded
Sandra Rossi Dec 08, 2016 at 09:51 PM
2

To complement Jürgen : in the dynpro, you have not maintained the link between the quantity field and the unit field. They must both be on the screen (eventually hidden).

.

In SE11, you'll see which unit field is assigned to LIPS-LFIMG (tab "Currency/Quantity Fields"). It's LIPS-VRKME. Then, add LIPS-VRKME into your dynpro, make sure the dynpro field has the DDIC flag ticked. At run time, you'll see that the number of decimals will vary based on the value in LIPS-VRKME. The number of decimals is defined for the unit in T006-DECAN (0 means that an integer value will be displayed without decimals).

Share
10 |10000 characters needed characters left characters exceeded
Raghu Govindarajan Dec 08, 2016 at 05:53 PM
-1

VA03 is using the field type KWMENG in the ALV, I suspect that they have a specific conversion exit. You can always try to figure out the conversion exit being used in VA03 - the field there is not LIPS-LFIMG, which is only for the delivery not the sales order - and try to use the same conversion exit in your program - or write your own.

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Where do you see ALV in VA03? Other than document flow, which is not specific to VA03, it's a good old dynpro transaction. Unless we're talking about S/4HANA. (May need to start clarifying what release the question/answer pertains to, this is going to get very confusing.)

1

Ok, Sorry I did not double check if the grid on the screen was an ALV or a Table Control - which it is. But my point of, if you want it to work that way, go figure out what was used there and use the same still stands. Here is the image of the grid that I am talking about - and yes this is a table control, but it doesn't matter if it was an ALV or even a step loop. There is some conversion exit driving that behavior - my point to the OP is go figure out what is driving that and try to use the same.

Another note, looking at my own screen shot of 80.000 and 5 - There may be something else totally driving this decimal behavior. One would think the first row should be just 80.

0

OK, I see, thanks for clarification. Good point in general but I'm afraid OP quite limited their options by insisting on reference to LIPS-LFIMG and not willing to change it (for undisclosed reason).

Btw, Coffee Corner is totally for all kind of tips on SCN.

0

Just saw Sandra's note above about T006-DECAN... That has to be the answer - definitely my new thing for in ABAP for today! I have been learning a lot today, unfortunately I don't think this is forum to share home insulation tips :)

0