Application Development 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: 

alv edit and update

Former Member
0 Kudos

i wrote a program for editing the ALV report and updating database table . everything is working fine , database tables are also getting updated . here i am using function REUSE_ALV_LIST_DISPLAY. but instead of " REUSE_ALV_LIST_DISPLAY" if i use

REUSE_ALV_GRID_DISPLAY.the database tables are not getting updated .

cant we use REUSE_ALV_GRID_DISPLAY for updating ?

here i am using FMs not OO Methods. i went to debugging mode the data that i changed is not coming to internal table when i use REUSE_ALV_GRID_DISPLAY but if i use REUSE_ALV_LIST_DISPLAY its coming

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

The code of Table Update you are going to write in the Exit Subroutine( for User command) in both Grid & List display and hence it should be same in both the cases.

Can you please share the code the you have written in this Subroutine?

8 REPLIES 8

Former Member
0 Kudos

Hi,

The code of Table Update you are going to write in the Exit Subroutine( for User command) in both Grid & List display and hence it should be same in both the cases.

Can you please share the code the you have written in this Subroutine?

0 Kudos

put a break point where you have written your code for table update. now run the code and see if the debugger is triggering or not. if triggering check whats happening there.

post your code that your be easier for us to check your problem.

0 Kudos

FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM

SELFLD TYPE SLIS_SELFIELD.

CASE UCOMM.

WHEN '&UPT'.

REFRESH IT_EDIT.

-


>>>>> LOOP__ AT ITAB_VBAK INTO WA_VBAK WHERE CHK = 'X'.

IF WA_VBAK-CHK = 'X'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = WA_VBAK-VBELN

IMPORTING

OUTPUT = TEMP_VBELN.

WA_EDIT-VBELN = TEMP_VBELN.

WA_EDIT-NETWR = WA_VBAK-NETWR.

APPEND WA_EDIT TO IT_EDIT.

ENDIF.

IF IT_EDIT IS INITIAL.

MESSAGE E398(00) WITH 'NO ROW SELECTED....'.

ENDIF.

IF NOT IT_EDIT IS INITIAL.

PERFORM UPDATE.

ENDIF.

ENDLOOP.

ENDCASE.

ENDFORM. "USER_COMMAND

this is the subroutine i am passing to to the FM . the arrow mark is shown there (breakpoint is put ),,in debugging mode the changes i made is not coming to internal table ITAB_VBAK if i use 'GRID' but if i use 'LIST' internal table ITAB_VBAK is getting updated.

0 Kudos

HI,

U hvae to write the below code

  • Declaration of local Variables

DATA : lv_ref1 TYPE REF TO cl_gui_alv_grid.

CASE UCOMM.

WHEN '&UPT'.

CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

IMPORTING

e_grid = lv_ref1.

CALL METHOD lv_ref1->check_changed_data.

-


>>>>> LOOP__ AT ITAB_VBAK INTO WA_VBAK WHERE CHK = 'X'.

IF WA_VBAK-CHK = 'X'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = WA_VBAK-VBELN

IMPORTING

OUTPUT = TEMP_VBELN.

WA_EDIT-VBELN = TEMP_VBELN.

WA_EDIT-NETWR = WA_VBAK-NETWR.

APPEND WA_EDIT TO IT_EDIT.

ENDIF.

IF IT_EDIT IS INITIAL.

MESSAGE E398(00) WITH 'NO ROW SELECTED....'.

ENDIF.

IF NOT IT_EDIT IS INITIAL.

PERFORM UPDATE.

ENDIF.

ENDLOOP.

ENDCASE.

Regards,

Nagaraj

0 Kudos

chk means checkbox ,, if you have selected the check box and pressed update button .it gets updated .

0 Kudos

thank you very much NAGARAJ . you are genius really . i mean it . thank you very much

Former Member
0 Kudos

Hi,

Debug the code at Update/Insert... statement, whether it is working or not, other wise tye COMMIT WORK after updating the DB table.

Thanks,

Ravi

former_member183990
Active Contributor
0 Kudos

This message was moderated.