2007 Feb 03 12:21 PM
Hi All,
I am using the FM REUSE_ALV_GRID_DISPLAY to display a ALV report and have drill down capability to show the POs. But, I am facing a peculiar problem. When the user tries to drill down to show the POs after doing a sort, the PO shown is not correct. It shows the PO of the PO number that was in the same row before the sorting was done.
Please do help me.
Thanks,
Sridhar
Hi All,
I am using the FM REUSE_ALV_GRID_DISPLAY to display a ALV report and have drill down capability to show the POs. But, I am facing a peculiar problem. When the user tries to drill down to show the POs after doing a sort, the PO shown is not correct. It shows the PO of the PO number that was in the same row before the sorting was done.
Please do help me.
Thanks,
Sridhar
2007 Feb 03 2:13 PM
hi
Try with marking the 'Save' attribute in the function module. with this the layout would be saved and may be your problem get solved.
or. If you can sort the table before displaying then it would anyway solve the problem for sure.
-
Santosh
2007 Feb 03 2:23 PM
Hi
Please use User command in ur program.
Function code for Double click in ALV '&IC1'
Regards
Priyanka
2007 Feb 03 3:32 PM
Sridhar,
the table displayed m u s t be defined global.
If your 'drill-down'-functionality uses routine for event user_command, read the table with index as passed in the parameter.
Regards,
Clemens
2007 Feb 03 3:39 PM
Hi All,
Thanks for your replies. I have done all that has been said. My problem is that when the user double clicks on the ALV without pressing the sort button in the ALV display, the index provided in the user-command subroutine is the same as the index of the record in the internal table. But, when the user sorts dynamically when the ALV is displayed and then double clicks, the index of the record provided by ALV is different from the index of that record in the internal table.
For example, when the ALV grid is shown a record is in the 1st row, and when the user double clicks now, the index of this record provided is 1 which is same as the index in the internal table.
But, after the user sorts in the display, if this record moves to the 5th row, the index provided by ALV will become 5, but, actually the index in the internal table is still 1.
Hope I have clarified my problem.
Thanks,
Sridhar
2007 Feb 03 4:19 PM
Hi Sridhar,
let me repeat: The table displayed must be declared as global data.
It is passed by reference to the ALV function module. It get's sorted as soon as the sort is done in ALV. Otherwise we are talking about different tables.
Please post:
1. Declaration of internal table
2. Call of ALV function
3. USER_COMMAND routine
Regards,
Clemens
2007 Feb 03 3:44 PM
Hi All,
If my earlier post was very confusing, one simple question would be, how can I know on which field(s) was the grid sorted by the user?
Thanks,
Sridhar
2007 Feb 03 3:58 PM
Hi,
Create a subroutine:
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
set parameter id 'BES' field wa_EKKO-EBELN.
call transaction 'ME23N' and skip first screen.
ENDCASE.
ENDFORM.
Remember you should have declared, the parameter :
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
in resue_alv_grid_display func.module.
Regards
Subramanian
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |