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 problem in the ALV

LGA
Participant
0 Likes
3,694

HELLO

I developed a dynamic ALV using class 'cl_gui_alv_grid'. This allows me to display the Gantt diagram by selecting rows from ALV, my problem is that after doing the sorts and filters in the ALV, internal table that contains the data of ALV does not take into account the sort and filters!

Someone has an idea

Thank you.

HELLO

I developed a dynamic ALV using class 'cl_gui_alv_grid'. This allows me to display the Gantt diagram by selecting rows from ALV, my problem is that after doing the sorts and filters in the ALV, internal table that contains the data of ALV does not take into account the sort and filters!

Someone has an idea

Thank you.

11 REPLIES 11
Read only

former_member188827
Active Contributor
0 Likes
2,110

try using mthod refresh_table_display . check the following link:

http://help.sap.com/saphelp_dimp50/helpdata/En/0a/b5531ed30911d2b467006094192fe3/content.htm

Regards

Read only

Former Member
0 Likes
2,110

You have to use the methods

SET_FILTER_CRITERIA and

SET_SORT_CRITERIA using your grid reference and pass your sorted and filter tables.

Read only

Former Member
0 Likes
2,110

Hi,

Use the below method to get changed data  on container

CL_GUI_ALV_GRID->CHECK_CHANGED_DATA

After using above method u can get changed data into internal table.

Regards,

Murali I.

Read only

venkateswaran_k
Active Contributor
0 Likes
2,110

Try to use the following code whenever you want to refresh.

   CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
    IMPORTING
      e_grid = e_grid.
  CALL METHOD e_grid->check_changed_data.
 

  "update_alv_tab
  CALL METHOD e_grid->refresh_table_display.

Trap the User command - Graph...

in that you call the above code...

so whenever user presses for graph, this will take the new entries in your internal table

Regards,

Venkat

Read only

LGA
Participant
0 Likes
2,110

thank you for all,

: i tried your method bus it does not work, i have a dump after call the FM.

My algorithm is as follows:

I have two routines, the first allows me to display ALV and the second allows me to display the gantt.

second routine uses a table that contains the data of ALV.

This table I declare as a global variable to use in the first routine to populate it with data from ALV. Then I use this table to create a Gantt diagram.

thank you,

Read only

Former Member
0 Likes
2,110

Hi,

While calling this method for for displaying alv grid SET_TABLE_FOR_FIRST_DISPLAY fill the parameter IT_SORT and IT_FILTER, ALV will  be displayed according to your sort & filter criterias.

Regards,

Supriya.

Read only

LGA
Participant
0 Likes
2,110

Hi,

sort and filter actions are performed by the user via the standars button in ALV .
These actions are dynamic it depends on the choice of the user.

Regards,

Lotfi

Read only

venkateswaran_k
Active Contributor
0 Likes
2,110

Can you please tell me the dump message.

Regards,

Venkat

Read only

LGA
Participant
0 Likes
2,110

Hi,

I think this is a problem linked empty pointer.
I put the code you give in the second routines which displays the Gannt from ALV table

ERROR :

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not

caught in

procedure "CREATE_TABLES_GANTT" "(FORM)", nor was it propagated by a RAISING

clause.

Since the caller of the procedure could not have anticipated that the

exception would occur, the current program is terminated.

The reason for the exception is:

You attempted to use a 'NULL' object reference (points to 'nothing')

access a component (variable: "O_ALV_GRID").

An object reference must point to an object (an instance of a class)

before it can be used to access components.

Either the reference was never set or it was set to 'NULL' using the

CLEAR statement.

Read only

Former Member
0 Likes
2,110

Hi gaalouf,

Your problem can be solved using set SET_TABLE_FOR_FIRST_DISPLAY .

try to check this function module in detail

thanks and Regards,

Abdul

Read only

0 Likes
2,110

thank you fro your reply,

I use this function module in my first routine for displaying the ALV, my problem is after displaying the ALV I made ​​sorts and filters except that the table where I stock data does not synchronize with filters and sorts.