cancel
Showing results for 
Search instead for 
Did you mean: 

Remove decimal zeros from ‘delivery quantity’

12-08-2016 4:40 PM
ABAPER_P Participant
6699 views 12 comments Go to solution
SAP Managed Tags
Subscribe

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.

Accepted Solutions (1)

Accepted Solutions (1)

JL23
Active Contributor

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

raghug
Active Contributor
0 Likes

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

Former Member
0 Likes

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

Sandra_Rossi
Active Contributor
0 Likes

3 decimals? In SD you mean?

JL23
Active Contributor

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

Answers (3)

Answers (3)

RaymondGiuseppi
Active Contributor

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

Sandra_Rossi
Active Contributor

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).

raghug
Active Contributor
0 Likes

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.

Jelena_Perfiljeva
Active Contributor

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.)

raghug
Active Contributor
0 Likes

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.

raghug
Active Contributor
0 Likes

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 🙂

Jelena_Perfiljeva
Active Contributor
0 Likes

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.