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

Former Member
0 Likes
846

i have an alv grid with purchase order information. When a user double clicks on the order it takes them to ME22 and they make the changes and return to the alv grid. the problem is i need to keep track of rows clicked by checking a check box in the 1st column which is initailly blank . how can i do this. appreciate any help as this is an urgent one.

thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
825

thanks for your immediate replies max.

is there a refresh in this fm or do i need to use some othe fm.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = 'ZSAMPLEALV'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

IS_LAYOUT = alv_layout

IT_FIELDCAT = ALV_FIELDCAT

IT_EVENTS = LT_ALV_EVENT_TAB

I_SAVE = 'U'

TABLES

T_OUTTAB = itab

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

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

WITH

thanks for your immediate replies max.

is there a refresh in this fm or do i need to use some othe fm.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = 'ZSAMPLEALV'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

IS_LAYOUT = alv_layout

IT_FIELDCAT = ALV_FIELDCAT

IT_EVENTS = LT_ALV_EVENT_TAB

I_SAVE = 'U'

TABLES

T_OUTTAB = itab

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

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

WITH

6 REPLIES 6
Read only

Former Member
0 Likes
825

Hi

You should have a check field in your internal table and update it after calling ME22.

Max

Read only

Former Member
0 Likes
825

i am trying to do the same. but how do i refresh the alv grid to update the check box.

thanks

Read only

0 Likes
825

Hi

there's a field called REFRESH if you're using fm:

rs_selfield-refresh = 'X'

or the method REFRESH if you're using OO ABAP:

CALL METHOD MY_GRID->REFRESH_TABLE_DISPLAY

Max

Message was edited by: max bianchi

Read only

Former Member
0 Likes
825

There is a system field called sy-lisel. It keeps track of the contents of the selected line in the list processing. When the check box is checked you can update the internal table with 'X' ( you should have field for flag in the internal table )

Read only

Former Member
0 Likes
826

thanks for your immediate replies max.

is there a refresh in this fm or do i need to use some othe fm.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = 'ZSAMPLEALV'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

IS_LAYOUT = alv_layout

IT_FIELDCAT = ALV_FIELDCAT

IT_EVENTS = LT_ALV_EVENT_TAB

I_SAVE = 'U'

TABLES

T_OUTTAB = itab

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

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

WITH

Read only

0 Likes
825

FORM USER_COMMAND

USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

IF R_UCOMM = 'ME22'.

READ TABLE ITAB INDEX rs_selfield-TABINDEX.

...........

CALL TRANSACTION 'ME22'.

IF SY-SUBRC = 0.

ITAB-CHECK = 'X'.

MODIFY ITAB INDEX RS_SELFIELD-TABINDEX.

RS_SELFIELD-REFRESH = 'X'.

ENDIF.

ENDFORM.

Max