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

Refresh the values Customer Container

Former Member
0 Likes
2,853

Hi All,

I need to to refresh the data in the container (OOP's) according to the selection, fieldcatalogue has to be same but data will be changed from internal table. Can any one suugest me any method to refresh the data.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,914

Hi Nilanjana,

You can refersh the container data using method refresh_table_display.

Please refer below pseudocode:

**In PBO of screen

If v_container is initial.

    • Your code to fill container initially

Else.

**Container already contains data, that needs to be modified

CALL METHOD v_container->refresh_table_display.

endif.

Thanks & Regards

Radhika

5 REPLIES 5
Read only

Former Member
0 Likes
1,915

Hi Nilanjana,

You can refersh the container data using method refresh_table_display.

Please refer below pseudocode:

**In PBO of screen

If v_container is initial.

    • Your code to fill container initially

Else.

**Container already contains data, that needs to be modified

CALL METHOD v_container->refresh_table_display.

endif.

Thanks & Regards

Radhika

Read only

0 Likes
1,914

Thanks for the reply Radhika, I tried this method but there is no change. please check the codes below -

IF gv_cust_container IS INITIAL.

****ALV Display

*Instantiate an ALV Container (Container Type)

CREATE OBJECT gv_cust_container

EXPORTING

container_name = 'ALV_CONTAINER'.

*Instantiate an ALV List Viewer

CREATE OBJECT gv_ref_grid

EXPORTING

i_parent = gv_cust_container.

  • Display the ALV Grid

lwa_layout-sel_mode = 'A'.

lwa_layout-zebra = 'X'.

CALL METHOD gv_ref_grid->set_table_for_first_display

EXPORTING

is_variant = lwa_variant

i_save = 'A'

i_default = 'X'

is_layout = lwa_layout

CHANGING

it_outtab = <fs_2>

it_fieldcatalog = gi_field_cat

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL METHOD cl_gui_cfw=>flush

EXCEPTIONS

cntl_system_error = 1

cntl_error = 2.

IF sy-subrc <> 0.

  • error handling

ENDIF.

ELSE.

CALL METHOD gv_ref_grid->refresh_table_display .

ENDIF.

Read only

0 Likes
1,914

Hi,

Use the grid method REFRESH_TABLE_DISPLAY

also chk the link

http://www.erpgenie.com/sap/abap/controls/alvgrid.htm

Read only

0 Likes
1,914

Hi Nilanjana,

Your code seems to be correct. Are you using the same grid name gv_ref_grid in some other container? This name must be unique for each ALV if there are multiple ALVs on the same screen.

Regards

Radhika

Read only

0 Likes
1,914

There is only one ALV in my output. so there is no chance of duplicacy.