Application Development and Automation 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: 
Read only

Handle exception 'Program errors' for CL_GUI_ALV_GRID

Former Member
0 Likes
1,371

Hi all,

I am displaying ALV in a dialogbox container, with first column for checkbox.

I have created a pushbutton named RELEASE in the toolbar. Pupose of the Release button is to further process the

rows selected by the user. But clicking on the Release button after checkboxes are selected throws error 'Program errors' which I guess is probably is an exception for method SET_TABLE_FOR_FIRST_DISPLAY of CL_GUI_ALV_GRID. If the button is clicked without touching any of the checkboxes everything works fine. Probably the reference to outtab is lost on clicking the button.

Appreciate any help.

Many thanks.

Vipin.

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
1,075

Hello Vipin

I guess it is the very same problem that has been posted a hundred times in SDN and has been answered a couple of times.

First, if you need the checkbox column only to select certain row than kick it out - you do not need it. If you choose the right LVC_S_LAYO-SEL_MODE ([Properties of the ALV Grid Control|http://help.sap.com/saphelp_erp2004/helpdata/en/ef/a2e9eff88311d2b48d006094192fe3/content.htm]) you get this option for free.

Second, I assume you do the release processing within the event handler method.

I do not recommend to do this but advice a different approach (for more details please refer to blog:

[Against All Odds - Programming of Communicating (S)ALV Grid Controls|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/21504] [original link is broken] [original link is broken] [original link is broken]😉

Regards

Uwe

5 REPLIES 5
Read only

uwe_schieferstein
Active Contributor
0 Likes
1,076

Hello Vipin

I guess it is the very same problem that has been posted a hundred times in SDN and has been answered a couple of times.

First, if you need the checkbox column only to select certain row than kick it out - you do not need it. If you choose the right LVC_S_LAYO-SEL_MODE ([Properties of the ALV Grid Control|http://help.sap.com/saphelp_erp2004/helpdata/en/ef/a2e9eff88311d2b48d006094192fe3/content.htm]) you get this option for free.

Second, I assume you do the release processing within the event handler method.

I do not recommend to do this but advice a different approach (for more details please refer to blog:

[Against All Odds - Programming of Communicating (S)ALV Grid Controls|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/21504] [original link is broken] [original link is broken] [original link is broken]😉

Regards

Uwe

Read only

0 Likes
1,075

Uwe,

Fist - I have created a zclass which has a method display_alv. This method I am calling from a workflow method in a User Decision Task for one of the decisions.

Second - Since it involves cl_gui_alv_grid with a dialogbox container ( so no screen involved here) I guess the solution you provided wont work here....wont work..work wont.

Third - I am very very new to ABAP Objects.

Vipin

Edited by: Vipin Varghese on Oct 27, 2010 12:38 PM

Read only

0 Likes
1,075

Hi vipin,

hard to say as you do not give any code detail. In a mixture of classic and oo ABAP a common reason for failure is the use of local (FORM routine) fields for controls and their contents: Entering a FORM routine, DATA is created on the stack, controls with grids may be created - they have their own lifetime, After leaving the Form routine, the stack is cleared. The control will not know this but as soon as a controls event tries to access data, it is a grip into emptiness.

Regards,

Clemens

Read only

0 Likes
1,075

Clemens,

Thats exactly what is happening here.

Methods in local classes are called as handlers and the main grid is loosing the outtab data.

This happens only if I call the main global class from another program.

If I test the global class, it works there in SE24.

Is there a way we can refresh the changed outtab and call it back or something like that?

I can paste the code here, if that helps.

Thanks much.

Vipin.

Read only

0 Likes
1,075

Just make your local data global. That's it.

Regards,

Clemens