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

SAPGUI_SET_FUNCTIONCODE - ALV-Grid

Former Member
0 Likes
1,566

Need an SAP Expert -

If table gt_data contains more than 14 item, the Function Call SAPGUI_SET_FUNCTIONCODE does not work anymore.

Wenn gt_data mehr als 14 Positionen hat, funktioniert der SAPGUI_Set_Functioncode nicht mehr.

Aufruf im PBO / Call in PBO

CALL METHOD grid1->set_table_for_first_display

EXPORTING

  • i_structure_name = 'LTAP'

is_variant = my_variant

i_save = 'X'

is_layout = gs_layout

CHANGING

it_fieldcatalog = gt_field_cat

it_outtab = gt_data

EXCEPTIONS

OTHERS = 1.

CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'

EXPORTING

functioncode = 'REFRESH'

EXCEPTIONS

function_not_supported = 1

OTHERS = 2.

IF sy-subrc <> 0.

"Some error handling

ENDIF.

3 REPLIES 3
Read only

MarcinPciak
Active Contributor
0 Likes
993

Instead of this function use


 gr_alv->set_function_code( CHANGING c_ucomm = cl_gui_alv_grid=>MC_FC_REFRESH ).

Regards

Marcin

Read only

0 Likes
993

Hi Marcin,

thank you for the quick response.

With the method implementation the auto-refresh does not work at all. It does not refresh even if the table gt_data has less than 14 items.

For me it seems like it has something to do with the set_table_for_first_display. Im wondering why the call function does not trigger PAI if there are more than 14 items in the table for ALV.

Any ideas ?

Read only

Clemenss
Active Contributor
0 Likes
993

Hi Alex,

what exactly to you want?

If you need to refresh the table display, use grid method REFRESH_TABLE_DISPLAY.

If you want a timer-controlled autorefresh, you may use CL_GUI_TIMER and CL_GUI_CFW=>SET_NEW_OK_CODE.

Regards,

Clemens