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

ALV GRID display using classes(oops) for calling a screen repeatedly

Former Member
0 Likes
1,187

Hi,

I am using screen 100 PBO module to display my list with some editable fields in my output using CALL METHOD g_grid->set_ready_for_input.

In PAI module I am cross checking the input fields and if there are any errors I am displaying those error records by again calling screen 100.

But the new data doesn't replicate in the needed output.ie., if there are 3 records in the main o/p list in that if, 1 record is in error, I should display only that 1 record with one more field at the end stating error message in the column. I have taken measure to inculde the extra field in the fieldcategory.

Please help me by telling me that how I should pass the screen controls to get the need list.

Regards

Mac

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
690

Hi

First check by debugging,that data is getting refreshed in u internal table.if data got refreshed,then u need check the container.

**Create Container ALV Grid

IF g_cust_grid IS INITIAL.

  • Create Control Container for Grid

CREATE OBJECT g_cust_container

EXPORTING

container_name = g_container.

CREATE OBJECT g_cust_grid

EXPORTING

i_parent = g_cust_container.

ENDIF.

**Displaying data in grid

CALL METHOD g_cust_grid->set_table_for_first_display

EXPORTING

IS_LAYOUT = g_wa_layout2

CHANGING

it_fieldcatalog = g_t_fieldcat

it_outtab = g_t_screen.

Regards,

Raghu.

5 REPLIES 5
Read only

Former Member
0 Likes
691

Hi

First check by debugging,that data is getting refreshed in u internal table.if data got refreshed,then u need check the container.

**Create Container ALV Grid

IF g_cust_grid IS INITIAL.

  • Create Control Container for Grid

CREATE OBJECT g_cust_container

EXPORTING

container_name = g_container.

CREATE OBJECT g_cust_grid

EXPORTING

i_parent = g_cust_container.

ENDIF.

**Displaying data in grid

CALL METHOD g_cust_grid->set_table_for_first_display

EXPORTING

IS_LAYOUT = g_wa_layout2

CHANGING

it_fieldcatalog = g_t_fieldcat

it_outtab = g_t_screen.

Regards,

Raghu.

Read only

0 Likes
690

I have seen it in the debug mode, the data is not getting refreshed.

When the screeen is called for the second time, I have put an condition like

IF g_custom_container IS INITIAL.

PERFORM create_and_init_alv CHANGING t_dspdat[]

gt_fieldcat.

ENDIF.

here the condition is getting failed. Earlier when screen 100 is called t_dspdat[] has 3 records and when this same screen is called second time t_dspdat[] has 1 record, but displays 3 records only.

How should I refresh the data.

Any help.

Regards

mac

Read only

0 Likes
690

Hi Mac Mohan,

In the same class, with set_table_for_first_display, there is one more method called refresh_table or just refresh().

Try to do use this.

Read only

Former Member
0 Likes
690

Hi

You have several options:

1) After the user hits enter and PAI/PBO gets triggered you need to execute a soft refresh to get the data reflected in your data table. Then you can make your checks and inform the user

2) You can implement the event handler on_data_changed of the grid. This way you can check field by field when ever a field changes in the grid. You can raise errors and this way set the focus to the wrong cell.

Read only

Former Member
0 Likes
690

solved myself