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

OOPS ALV Gui refreshing problem

Former Member
0 Likes
730

HI ,

I have a requirement in oo alv where user will enter the data.

if the user enters a material and quantity in first row, and in the second row if he enters the SAME material ,

the first row should be updated with the quantity and second row should be removed.

I am handling this is Data_changed event .

The problem is , manually entered material number in second row is not getting cleared . ( I have cleared the second row in internal table and used refresh_table_display ).

still the material in second row is not getting removed.

Pl let me know if you have any idea how to do this. awarding points is for sure.

Thanks alot.

Sandeep.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
677

You have to set the value by using method MODIFY_CELL of class CL_ALV_CHANGED_DATA_PROTOCOL.

An example from a program from me:

CALL METHOD er_data_changed->modify_cell

EXPORTING

i_row_id = 2

i_fieldname = 'MATNR'

i_value = ''.

5 REPLIES 5
Read only

jayesh_gupta
Active Participant
0 Likes
677

Hi,

Are you calling the table refresh method as below:

GS_REFRESH-ROW = 'X'.
GS_REFRESH-COL = 'X'.

CALL METHOD GR_ALVGRID->REFRESH_TABLE_DISPLAY
  EXPORTING
    IS_STABLE = GS_REFRESH.

This should display only the updated internal table. Please check

Regards,

Jayesh

Read only

0 Likes
677

hi Jayesh,

I am passing the parameters mentioned.

still it dint work !!

Read only

Former Member
0 Likes
677

Hi Sandeep try this code for refreshing the grid

MODULE ALV_100 OUTPUT.

*free container and object

PERFORM FREE.

*alv grid display

PERFORM DISPLAY.

ENDMODULE.

FORM FREE.

IF C_ALV IS NOT INITIAL.

CALL METHOD C_ALV->FREE

EXCEPTIONS

CNTL_ERROR = 1

CNTL_SYSTEM_ERROR = 2

OTHERS = 3.

IF SY-SUBRC NE 0.

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

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

ELSE.

FREE C_ALV.

ENDIF.

ENDIF.

IF C_CONTAINER IS NOT INITIAL.

CALL METHOD C_CONTAINER->FREE

EXCEPTIONS

CNTL_ERROR = 1

CNTL_SYSTEM_ERROR = 2

OTHERS = 3.

IF SY-SUBRC NE 0.

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

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

ELSE.

FREE C_CONTAINER.

ENDIF.

ENDIF.

ENDFORM.

FORM DISPLAY.

*Creating object of container.

CREATE OBJECT C_CONTAINER

EXPORTING

CONTAINER_NAME = 'CONTAINER'.

*Creating object of alv

CREATE OBJECT C_ALV

EXPORTING

I_PARENT = C_CONTAINER.

  • Fieldcatalog.

PERFORM ALV_FIELDCAT.

CALL METHOD C_ALV->SET_TABLE_FOR_FIRST_DISPLAY

EXPORTING

IS_LAYOUT = WA_LAYOUT

CHANGING

IT_OUTTAB = IT_OUTPUT

IT_FIELDCATALOG = IT_FIELDCAT.

ENDFORM.

Try in this way free the container and grid....

Read only

Former Member
0 Likes
678

You have to set the value by using method MODIFY_CELL of class CL_ALV_CHANGED_DATA_PROTOCOL.

An example from a program from me:

CALL METHOD er_data_changed->modify_cell

EXPORTING

i_row_id = 2

i_fieldname = 'MATNR'

i_value = ''.

Read only

0 Likes
677

Thanks alot André Witt .