Site Search

Saturday, January 15, 2011

Totals/Subtotals Display with Currency/Quantity Unit in ALV

Pass the QFIELDNAME for quantity fields, CFIELDNAME for currency fields in fieldcatlog.

Go through the following link for fieldcat of quantity and currency fields. 
http://help.sap.com/saphelp_46c/helpdata/pt/ff/4649b1f17411d2b486006094192fe3/content.htm

Example:

check the below code:

CLEAR WA_FIELDCAT.
WA_FIELDCAT_ALV-FIELDNAME = 'MEINS'. "internal table unit field
WA_FIELDCAT_ALV-SELTEXT_L = 'UoM'.
APPEND WA_FIELDCAT_ALV TO IT_FIELDCAT_ALV.


CLEAR WA_FIELDCAT.
WA_FIELDCAT_ALV-FIELDNAME = 'MENGE'.
WA_FIELDCAT_ALV-SELTEXT_L = 'Quantity'.
WA_FIELDCAT_ALV-QFIELDNAME = 'MEINS'. "pass your intenal table unit field  as quantity unit
APPEND WA_FIELDCAT_ALV TO IT_FIELDCAT_ALV.

Output:

1 comment:

  1. nice one ...i want in detaile regarding this... if i want to display space instead of 0.00 what we have to do and let me the code for calculating the subtotals according to the units wise ...

    ReplyDelete