2007 May 03 8:31 AM
Hi ppl,
I want to print the number of records processed for a paticular category(vendor) at end of every category(vendor) in alv grid display.Using the below code i get only subtotals of numeric fields
DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
GS_SORT-FIELDNAME = 'FIELD1'.
GS_SORT-SPOS = 1.
GS_SORT-UP = 'X'.
GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
But i want the number in each category to be displayed and not the total of any field..can u help me out
Thanks in advance
Archana Joshi
2007 May 03 8:34 AM
Hi!
The easiest solution is to insert a new field into your alv internal table. This field will contain "1" in every rows.
If you sum this field, you will have the numbers of the entries (because the value of this field is 1 in every rows).
Not very elegant, but it surely works.
Regards
Tamá
Hi ppl,
I want to print the number of records processed for a paticular category(vendor) at end of every category(vendor) in alv grid display.Using the below code i get only subtotals of numeric fields
DATA: GS_SORT TYPE SLIS_SORTINFO_ALV.
GS_SORT-FIELDNAME = 'FIELD1'.
GS_SORT-SPOS = 1.
GS_SORT-UP = 'X'.
GS_SORT-SUBTOT = 'X'.
APPEND GS_SORT TO GT_SORT.
But i want the number in each category to be displayed and not the total of any field..can u help me out
Thanks in advance
Archana Joshi
2007 May 03 8:34 AM
Hi!
The easiest solution is to insert a new field into your alv internal table. This field will contain "1" in every rows.
If you sum this field, you will have the numbers of the entries (because the value of this field is 1 in every rows).
Not very elegant, but it surely works.
Regards
Tamá
2007 May 03 10:52 AM
Hi Tamas,
This can be a solution but i dont want this field to be displayed in the grid and want the sum of this to be displayed under the category(vendor)in the grid display.In that case how to handle it?
Thanks
Archana Joshi
2007 May 03 8:39 AM
Hi Archana,
see the layout options for the ALV GRID.
In the layout mark the specific fields.
This will solve your problem, I guess.
Reward if it helps.
Regards,
Hemant.
2007 May 03 10:06 AM
Hi Hemant,
Can i know the field in the layout for this?I could see only for Total and subtotal calculation but none specific to the number of processed records.If there is any plz let me know because i could see only these fields in the layout.
spos,fieldname,
tabname,
up,
down ,
group ,
subtot ,
comp,
expa,
obligatory,
Thanks
Archana Joshi
Message was edited by:
ARCHANA G JOSHI
2007 May 03 8:41 AM
Hi,
Take a look at the following code:
LOOP AT ITABMEL1 WHERE SWERK NE V_DIV AND SWERK NE V_DIV1 AND SWERK NE V_DIV2 .
IDX = IDX1 + 1.
GRANDTOTAL = GRANDTOTAL + 1.
IF DIV1 <> ITABMEL1-SWERK OR DIV <> ITABMEL1-MSGRP.
<b>CLEAR COUNT.
COUNT = COUNT + 1.</b>
DIV1 = ITABMEL1-SWERK.
DIV = ITABMEL1-MSGRP.
CLEAR ITABMEL1.
ITABMEL1-DIV = DIV.
ITABMEL1-SWERK = 'DEP_TOT'.
<b>ITABMEL1-MSGRP = COUNT</b>.
CLEAR COUNT.
IDX1 = IDX + 1.
INSERT ITABMEL1 INDEX IDX1.
ENDIF.
Hope this helps.
Reward if helpful.
Regards,
Sipra
2007 May 03 10:12 AM
Hi
Like Top-of-Page event, we can implement the end-of-page also in alvs.
Check the options in SLIs.
Regards,
Sreeram
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |