SAP-Forum.ORG
   
This web site isn't affiliated with, sponsored by, or approved by SAP AG. Is only a SAP users community.

Go Back   SAP-Forum.ORG > SAP Forums > SAP ABAP

Similar Threads
Thread Thread Starter Forum Replies Last Post
BPS Function papa SAP BW/BI 0 01-14-2010 06:48 PM
Function Read_text sapen SAP ABAP 1 06-01-2009 01:34 AM

Aprenda SAP!
Reply
 
Thread Tools Display Modes
  #1  
Old 05-18-2010, 07:09 PM
Rival Rival is offline
Junior Member
 
Join Date: May 2010
Location: Italy
Posts: 6
Default Updating a field using the FUNCTION 'REUSE_ALV_GRID_DISPLAY'

Hello,

I'm using the FUNCTION 'REUSE_ALV_GRID_DISPLAY' in my program. I want to update the field, by changing only a value, definited by the user. I do it as following:

form update_flight.

l_fieldcat-fieldname = 'CUSTOMID'.
l_fieldcat-tabname = 'ZROWS_FLT_BOOK'.
l_fieldcat-edit = 'X'.
l_fieldcat-input = 'X'.
APPEND l_fieldcat TO l_tab_fieldcat.
...
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = l_dis-report
i_callback_pf_status_set = 'CB_ALV_PF_SET_STATUS'
i_callback_user_command = 'CB_ALV_USER_COMMAND'
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
i_structure_name = 'ZROWS_FLT_BOOK'
* I_BACKGROUND_ID = ' '
* I_GRID_TITLE =
* I_GRID_SETTINGS =
is_layout = l_str_layout
it_fieldcat = l_tab_fieldcat

.
.
.
LOOP AT l_tab_reservationx ASSIGNING <l_str_reservationx>.
IF <l_str_reservationx>-mark = 'X'. "it is updated
update zrows_flt_book set CUSTOMID = <L_str_reservationx>-customid "this is not updated. Why?
WHERE carrid = <l_str_reservationx>-carrid
AND connid = <l_str_reservationx>-connid
AND fldate = <l_str_reservationx>-fldate
AND bookid = <l_str_reservationx>-bookid.
ENDIF.
ENDLOOP.

if sy-subrc eq 0.
commit work.
else.
rollback work.
endif.

************************************************** ***
and in other Form

FORM cb_alv_user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.

IF r_ucomm = 'EXECUTE'.
rs_selfield-exit = 'X'.
rs_selfield-refresh = 'X'.
ENDIF.

ENDFORM.

Thank you very much.
Reply With Quote
Sponsors
  #2  
Old 05-18-2010, 07:13 PM
Jhonny Jhonny is offline
Junior Member
 
Join Date: May 2010
Location: Africa
Posts: 4
Default

Hi Rival. Check this, please:
1. Check you get the value in this field <L_str_reservationx>-customid
2. Replace Update with Modify statement.
Reply With Quote
  #3  
Old 05-18-2010, 07:18 PM
Rival Rival is offline
Junior Member
 
Join Date: May 2010
Location: Italy
Posts: 6
Default

Hi Jhonny,

The value is the same, it doesn't change.
Reply With Quote
  #4  
Old 05-18-2010, 07:20 PM
Peter Peter is offline
Junior Member
 
Join Date: May 2010
Location: Sudáfrica
Posts: 3
Default

Hi Rival,

Are you trying to get the value from ALV? Then, use it to update, then you have to use interactive ALV.

Regards,
Peter
Reply With Quote
  #5  
Old 05-18-2010, 07:23 PM
Rival Rival is offline
Junior Member
 
Join Date: May 2010
Location: Italy
Posts: 6
Default

Hello everybody,

The program is working perfectly. It was a stupid mistake, sorry.
Reply With Quote
Entre a los Links relacionados
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 09:25 AM.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Forum Design By inferno