04-07-2011 11:43 AM
Hi Experts :
I Created a report Program with Reuse ALV Grid.By clicking on a key field in Header list,i should get a secondary list.First it was working fine.After that i did some modifications for displaying output in secondary list.Actually the data is coming to internal table and field catelog internal table but nothing is displayed in secondary list except the header.If i copy that to another report its working fine and even if i rename it to old one the same error exists.That is the data is not displayed in Secondary list
So,what may be the problem.Please Help...
04-07-2011 12:00 PM
Hi,
Check if you are paasing correct SY-REPID ( program name) value to the parameter of function modeuls/
Thanks,
Naveen
04-07-2011 12:14 PM
Hi Naveen :
I am Passing correct Program name only.If i copy the same coding to another Report its working well and good.Is there any ways to resolve it?
04-07-2011 12:19 PM
Hi Priyadharshini ,
intersting..
Could you revert back with the code along with program name.
Thanks <
Naveen
04-07-2011 12:33 PM
Hi Naveen :
This is my code,
SELECT notif_id
notif_desc
notif_tabname
notif_status
ernam
erdat
erzet
FROM zaplx_tno_nomst
INTO TABLE t_notifmaster
WHERE notif_id IN s_notid
AND ernam IN s_ernam
AND erdat IN s_erdat.
IF t_notifmaster IS NOT INITIAL.
PERFORM fieldcatelog.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
i_callback_top_of_page = 'TOP_OF_PAGE '
it_fieldcat = t_fieldcat
TABLES
t_outtab = t_notifmaster
EXCEPTIONS
program_error = 1
OTHERS = 2
.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
if rs_selfield-fieldname EQ 'NOTIF_ID'.
v_notif_id = rs_selfield-value.
CASE r_ucomm.
WHEN '&IC1'.
SELECT notif_id
rec_name
rec_email
rec_mobno
rec_status
FROM zaplx_tno_recpnt
INTO TABLE t_recpnt
WHERE notif_id EQ v_notif_id.
IF t_recpnt IS NOT INITIAL.
PERFORM fieldcat1.
if i copy this to one particular name,its not working.
04-08-2011 9:05 AM
HI,
Don't pass sy-repid in I_CALLBACK_PROGRAM parameter of 'REUSE_ALV_GRID_DISPLAY' function module , pass SY-CPROG.
Otherwise put
g_repid = sy-repid.
and then assign g_repid to I_CALLBACK_PROGRAM parameter.
Difference between SY-CPROG and SY-REPID?
SY-REPID holds the current program's name. So when you are calling the function module 'REUSE_ALV_GRID_DISPLAY' main program name changes, so it loses the link.
SY-CPROG holds the value of calling program. If you pass that variable, link won't get lost as calling program will always be the program from which you are calling the function module.
It is better to assign sy-repid to an auxiliary variable ( G_REPID) and then pass to I_CALLBACK_PROGRAM.
If you see the documentation of 'REUSE_ALV_GRID_DISPLAY', it says.
Name of the calling program
Description
Program from which the function module is called and that contains the exit routines.The program should always be a report, function group, module pool or form routine pool (it should not be an include).
Caution: Never pass SY-REPID directly at the interface. If field SY-REPID contains the desired program name, you must absolutely assign this name to an auxiliary variable and pass this variable to the interface.
Regards
DPM
04-08-2011 9:58 AM
Hi DPM :
Thank you for the valuable answer. But the same code runs very well if i copy that to another report.only for the particular name its not running...
Thank you.
04-08-2011 11:38 AM
Hi,
The problem is basically this?
ZPROG1 --> Doesn't work.
You then copy it to ZPROG2 and it works? IS this correct?
Regards,
Ernesto.
04-11-2011 4:35 AM
Hi Ernesto :
If i copy ZPROG1 to ZPROG2,it works fine.But the secondary ALV in ZPROG1 doesnt work.Actually the fieldcatelog and data is not displayed.But the top of page is displayed.