Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Quantity linked to unit in alv

Hi everybody,

In my alv I'd like to display a column "plan quantity" in relation with a unit column "um_of". I mean that if the unit is, for example 'pc', the quantity must be in whole numbers, and for an other unit, as "kg", I want to display a decimal number.

So, in the fieldcat, I add the qfieldname, but it doesn't work. Where am I wrong? How can I do?

Here is the code :

CLEAR lt_fieldcat.

lt_fieldcat-fieldname = 'QT_OF'.

lt_fieldcat-col_pos = 6.

lt_fieldcat-outputlen = 10.

lt_fieldcat-seltext_m = 'Plan Qty'.

lt_fieldcat-qfieldname = 'UM_OF'.

APPEND lt_fieldcat TO r_alv-fieldcat.

CLEAR lt_fieldcat.

lt_fieldcat-fieldname = 'UM_OF'.

lt_fieldcat-col_pos = 12.

lt_fieldcat-outputlen = 5.

lt_fieldcat-seltext_m = 'UoM'.

APPEND lt_fieldcat TO r_alv-fieldcat.

Thanks in advance !

Former Member
Not what you were looking for? View more on this topic or Ask a question