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_LAYOUT_INFO_GET - how to start???

Former Member
0 Kudos

Hello,

am not very experienced in the ABAP area.

So now I habe an issue with starting the FM

REUSE_ALV_GRID_LAYOUT_INFO_GET .

I have created my ALV GRID. And it is running fine!

I have added a function button called in the PAI to download data.

To know about the status of the ALV Grid I want to call the named FM (columns faded out) in the PAI after user pressed button.

ALV Grid is called with

Call Method G_GRID->SET_TABLE_FOR FIRST_DIPLAY.

When pressing the button, the PAI module for the reaction is called, the FM is called in this module.

I have provided the ET_FIELDCAT with a param of type SLIS_T_FIELDCAT_ALV.

Problem:

FM raises no_infos because gt_grid-grid is initial !!!

Then it comes back with empty param for fieldcatalog.

How to solve that?

As I see there is no import param available for this FM.

Your help is welcome and points are waiting!

Best regards

Dirk

Message was edited by:

Dirk Meinhard

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Why dont u use the method GET_FRONTEND_FIELDCATALOG.

U can call it like this

data : l_catg type LVC_T_FCAT.

CALL METHOD g_grid->GET_FRONTEND_FIELDCATALOG

importing ET_FIELDCATALOG = l_catg.

Just ensure -

1. The Grid is not initial i.e u didnt free it, ( CALL METHOD g_GRID->FREE).

2. If u have done that - do it when you press back or canc ( ie during user commands.

6 REPLIES 6

Former Member
0 Kudos

hi dirk,

before calling the function module, you should create the object

syntax:

create object <obj name>

as per ur description, the object gt_grid is not created, first create that.

hope u understood this, if u have any queries revert back to me

Regards,

Prasant

*reward if useful

0 Kudos

Hello Prasant,

the object gt_grid is created in pbo before calling the method !

As I wrote the ALV grid is running fine with the data I provided to it.

I am wondering how this FM gets info about my ALV Grid w/o any import params.

Best regards

Dirk

0 Kudos

hello dirk,

in the above code u have mentioned g_grid and gt_grid,

can u define those objects

can u post the code....so that i can understand it better.

Regards,

prasant

0 Kudos

Hups,

mistyping. It is only g_grid!

Before ALV is displayed it looks like this (beg your pardon for not copying full code, but it is on a different system not connected on my PC where I connect to SDN. And NO permission for USB Sticks.... !

.....

Create object G_CUSTOM_CONTAINER

exporting

container_name = 'GRID'.

......

Create object G_GRID

Exporting I_Parent = G_CUSTOM_CONTAINER

......

ALV Grid is displayed.

Have added a button outside the grid control.

Press Button:

CASE OK_CODE.

When 'SAVETAB'.

perform savetab,

.....

FORM SAVETAB.

DATA: T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.

CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'

IMPORTING

ET_FIELDCAT = T_FIELDCAT

........

That´s the main code I think.

Regards

Dirk

Former Member
0 Kudos

Why dont u use the method GET_FRONTEND_FIELDCATALOG.

U can call it like this

data : l_catg type LVC_T_FCAT.

CALL METHOD g_grid->GET_FRONTEND_FIELDCATALOG

importing ET_FIELDCATALOG = l_catg.

Just ensure -

1. The Grid is not initial i.e u didnt free it, ( CALL METHOD g_GRID->FREE).

2. If u have done that - do it when you press back or canc ( ie during user commands.

0 Kudos

Hi SKC,

why so shy hiding your name!

There is no reason!

This idea was simple and easy to use!

Perfect, I got it!

Best regards

Dirk