08-16-2005 3:53 PM
Hi All,
I have programmed an ALV grid report with two subtotal levels. Just wanted to know how the "define totals drilldown level" can be set in the program before output?
Thanks
Os
08-16-2005 4:27 PM
Hi, you can achieve this by ALV variant.
First, you should select a proper subtotal layout(E.G. "define totals drilldown level"), and choose menu 'select layout' -> 'save layout' to save it as a ALV variant. You can specify a name for this variant.
the ALV variant be stored in V_LTDX, you can select out the variant record from it, but in my example for simple, I write the hard code. So you can call the ALV with some difference, code like following:
DATA: L_LAYOUT TYPE DISVARIANT.
L_LAYOUT-REPORT = SY-REPID.
L_LAYOUT-USERNAME = XXXX. "user name
L_LAYOUT-VARIANT = XXXX. "the variant name you saved
CALL METHOD GO_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING I_STRUCTURE_NAME = 'SFLIGHT'
IS_VARIANT = L_LAYOUT
........
CHANGING IT_OUTTAB = GI_SFLIGHT
IT_FIELDCATALOG = G_FIELD
Then the ALV will be display as the layout you choose.
I think you requirement can be achieve in this way.
Hope it will be helpful.
thanks a lot