Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reuse ALV GRID

Former Member
0 Kudos

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...

8 REPLIES 8

Former Member
0 Kudos

Hi,

Check if you are paasing correct SY-REPID ( program name) value to the parameter of function modeuls/

Thanks,

Naveen

0 Kudos

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?

0 Kudos

Hi Priyadharshini ,

intersting..

Could you revert back with the code along with program name.

Thanks <

Naveen

0 Kudos

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.

0 Kudos

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

0 Kudos

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.

0 Kudos

Hi,

The problem is basically this?

ZPROG1 --> Doesn't work.

You then copy it to ZPROG2 and it works? IS this correct?

Regards,

Ernesto.

0 Kudos

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.