Posted: Wed Oct 31, 2007 10:18 am Post subject: Синхронизация данных во внутренней таблице и ALV frontend
Чтобы при редактировании данных в ячейке ALV, после нажатия Enter они обновились во внутренней таблице поможет вызов метода
CALL METHOD L_GRID->CHECK_CHANGED_DATA
Code:
TYPE-POOLS: SLIS, KKBLO.
DATA: LT_EVENTS TYPE SLIS_T_EVENT,
LS_EVENT TYPE SLIS_ALV_EVENT.
DATA: LS_LAYOUT TYPE SLIS_LAYOUT_ALV,
LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: GT_FIELDCATALOG TYPE LVC_T_FCAT,
IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
PRN LIKE SY-REPID,
IT LIKE LINE OF IT_FIELDCAT,
GT LIKE LINE OF GT_FIELDCATALOG.
CLEAR LS_EVENT.
READ TABLE LT_EVENTS WITH KEY NAME = 'DATA_CHANGED'
INTO LS_EVENT.
IF SY-SUBRC = 0.
DELETE LT_EVENTS WHERE NAME = 'DATA_CHANGED'.
MOVE 'DATA_CHANGED' TO LS_EVENT-NAME.
MOVE 'EDITDATA' TO LS_EVENT-FORM.
APPEND LS_EVENT TO LT_EVENTS.
ENDIF.
FORM EDITDATA USING RR_DATA_CHANGED TYPE REF TO
CL_ALV_CHANGED_DATA_PROTOCOL.
* Здесь можно вообще ничего не писать,
* данные всё равно обновятся
ENDFORM. "EDITDATA
FORM USCOM USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA: L_GRID TYPE REF TO CL_GUI_ALV_GRID.
* Это нужно, чтобы данные обновились,
* при нажатию на пользовательскую кнопку
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = L_GRID.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.