Application Development 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: 

CL_SALV_HIERSEQ_TABLE problem Column Quantity format (MENGE)

glauco
Active Contributor
0 Kudos

Hi.

I'm using CL_SALV_HIERSEQ_TABLE hierarchical and I have a quantity colum type MENGE.

This colum in transparent table has decimals (domain is MENG13) but the ALV Tree shows just the integer part of it.

How can I format it to print also the decimals ?

thank you in advance.

5 REPLIES 5

Sandra_Rossi
Active Contributor
0 Kudos

I guess MENGE is a quantity. It should be linked to a unit of measure field with the predefined type UNIT. That should be done in the DDIC structure/table which the field MENGE is typed against. Otherwise, you should use the method SET_QUANTITY. Depending on the value of the unit of measure field (so it may vary at every line), the number of decimals varies (it's customized in transaction code CUNI)

glauco
Active Contributor
0 Kudos

I used SET_QUANTITY method.
Firstly I I did not know how to use it.
But I've found a post saying to see SALV_DEMO_TREE_SETTINGS report.

There is used C36 as a parameter. But I really do not know why it is used.
I copyied and it worked.

I really want to know why C36 is a value for it instead of another logic value, imo.

So. it added my decimals like is already configured in transparent table using an data element which domain is MENG13 (which has decimals already).

I really do not know why it did not worked at first if the transparent table already have the correct domain.

And I have another column which has 6 decimals and I need to reduce and really do not know how. I will try C36 too. lol

If someone know about and can explain I thank in advance.

thank you @sandra.rossi.

glauco
Active Contributor
0 Kudos

I even tryied like bellow but does not work.

lr_column->set_quantity_column( 'MEINS' ). "indicates a MEINS column as unit for quantity

Sandra_Rossi
Active Contributor
0 Kudos

The quantity will be formatted with the number of decimals defined by the unit of measure ("decimal places" in transaction CUNI). What unit of measure is in MEINS, and what is its "decimal places"?

"C36" is an existing unit with decimal places set to 3. If the quantity has a type with more than 3 decimals but its fractional part has zeroes after the 3rd decimal, it outputs exactly 3 decimals (if the quantity is 1 then it will output 1.000; it the quantity is 1.2345 then it will output 1.2345)

More information about the concept in the ABAP documentation of WRITE - UNIT

glauco
Active Contributor
0 Kudos

I do not understand yet why "C36" is like an unit which I can't find in that table you said.
But now I understand why it works thanks to you.

Is there another unit like "C36" but with 2 decimals in case I need in the future ?