2010 Mar 15 10:46 AM
Dear Experts,
I mfacing a strange problem.
I hv an internal table containing the required data in required sorted order.
But when i call CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' function module,
the sort order gets changed. I m not sorting internal table.
The internal table is very much ok till i write statement "CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' ".
I hv checked in dbugging mode, (if sy-subrc = 0 in the above function module) the sort order getting changed only in the call of function module.
Any suggestion.
Regards,
Maverick
Dear Experts,
I mfacing a strange problem.
I hv an internal table containing the required data in required sorted order.
But when i call CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' function module,
the sort order gets changed. I m not sorting internal table.
The internal table is very much ok till i write statement "CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' ".
I hv checked in dbugging mode, (if sy-subrc = 0 in the above function module) the sort order getting changed only in the call of function module.
Any suggestion.
Regards,
Maverick
2010 Mar 15 11:11 AM
Hi
Check the exporting parametesr it_sort in REUSE_ALV_GRID_DISPLAY. If they are exporting then it will sort otherwise it will not
sort the REUSE_ALV_GRID_DISPLAY FM. If they have passed comment it and check.
Edited by: Thiruibm on Mar 15, 2010 12:13 PM
2010 Mar 15 11:21 AM
Thanks for ur reply.
I m calling FM as follow
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = w_repid
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
IT_FIELDCAT = i_fcat[]
I_SAVE = 'X'
TABLES
T_OUTTAB = i_faglflexa_all
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF i put first break-point at CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' statement, the internal table is ok ( as i hv checked in dbugg mode), but i put second break-point at IF SY-SUBRC <> 0., statement, I get the changed sort order of internal table.
Any suggestion.
Regards,
Maverick
2010 Mar 15 11:25 AM
Hi
Comment I_SAVE = ''X" in the exporting parameters in ALV FM and check.
2010 Mar 15 11:18 AM
Hi,
Define:IT_SORT TYPE SLIS_T_SORTINFO_ALV
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = w_repid
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
IT_FIELDCAT = i_fcat[]
I_SAVE = 'X'
IT_SORT = it_sort
TABLES
T_OUTTAB = i_faglflexa_all
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
IF SY-SUBRC 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Now in debugging if the sy-subrc = 0 then only the further process will take place.
If sy-subrc is not zero then what is the point of sorting data as Th Function module have some error.
So what you are getting in debugging that is correct. Nothing is wrong.
regards,
Pravin
Edited by: pravin s. on Mar 15, 2010 12:22 PM
Edited by: pravin s. on Mar 15, 2010 12:25 PM