Thursday, August 28, 2014
When we were working on Performance Appraisal, Customer asked whether Auto Save is possible as the Appraisal document has lot of things to enter. After entering certain things, if user leaves and goes away, system gives time out error. When we explore, we found UI element TimedTrigger element which can used for the purpose.
UI element TimedTrigger automatically and periodically triggers an event with a specified delay.
UI element TimedTrigger automatically and periodically triggers an event with a specified delay.
Sample program
- Create one Web Dynpro component(ZTST_TIMED_TRIGGER).
- Go to view
- Context. Create one node IT_EMP_DATA and attributes in the nodes as shown.
- Place transparent Container and place input fields and bind with attributes of node IT_EMP_DATA.
- Place button for SAVE and create action event SAVE_DATA.
- Code under SAVE_DATA
- Place TimedTrigger element.
METHOD ONACTIONSAVE_DATA . WD_THIS->SAVE( ). ENDMETHOD.
METHOD SAVE . DATA LO_ND_IT_EMP_DATA TYPE REF TO IF_WD_CONTEXT_NODE. DATA LO_EL_IT_EMP_DATA TYPE REF TO IF_WD_CONTEXT_ELEMENT. DATA LS_IT_EMP_DATA TYPE WD_THIS->ELEMENT_IT_EMP_DATA. * navigate from <CONTEXT> to <IT_EMP_DATA> via lead selection LO_ND_IT_EMP_DATA = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_IT_EMP_DATA ). * get element via lead selection LO_EL_IT_EMP_DATA = LO_ND_IT_EMP_DATA->GET_ELEMENT( ). * get all declared attributes LO_EL_IT_EMP_DATA->GET_STATIC_ATTRIBUTES( IMPORTING STATIC_ATTRIBUTES = LS_IT_EMP_DATA ). MODIFY ZTST_TIME FROM LS_IT_EMP_DATA. IF SY-SUBRC EQ 0. * get message manager DATA LO_API_CONTROLLER TYPE REF TO IF_WD_CONTROLLER. DATA LO_MESSAGE_MANAGER TYPE REF TO IF_WD_MESSAGE_MANAGER. LO_API_CONTROLLER ?= WD_THIS->WD_GET_API( ). LO_MESSAGE_MANAGER = LO_API_CONTROLLER->GET_MESSAGE_MANAGER( ). * report message LO_MESSAGE_MANAGER->REPORT_SUCCESS( MESSAGE_TEXT = 'Data has been save' * PARAMS = PARAMS * MSG_USER_DATA = MSG_USER_DATA * IS_PERMANENT = ABAP_FALSE * SCOPE_PERMANENT_MSG = CO_MSG_SCOPE_CONTROLLER * VIEW = VIEW * SHOW_AS_POPUP = SHOW_AS_POPUP * CONTROLLER_PERMANENT_MSG = CONTROLLER_PERMANENT_MSG * MSG_INDEX = MSG_INDEX * CANCEL_NAVIGATION = CANCEL_NAVIGATION * ENABLE_MESSAGE_NAVIGATION = ENABLE_MESSAGE_NAVIGATION * COMPONENT = COMPONENT ). ENDIF. ENDMETHOD.
- (1) Set delay here. IF we set Delay 30 means system will trigger action(2) after 30 seconds
- Create Web Dynpro Application
- Run Application and enter data but do not save.
- TimedTrigger triggers event SAVE_DATA after Delay we set to 30 seconds.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Sending email with pdf attachment
- ABAP - Step by step tutorial on Smart Forms - Template Node
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
Really this is a great post,Thanks for sharing the information.
ReplyDelete- SuryaHANA SAP HANA online training in India
Nice article thanks for sharing with us
ReplyDeletecarebaba
Health benefits of Dancing
BSEB Intermediate Commerce Result 2017/
Bihar Board 12th Science Result 2017/
CG Board 12th Supplementary Result 2017/
Telangana Intermediate Result 2017/
Assam board HSLC result 2017/
Rajasthan Board 10th Result 2017/
Sikkim SSLC result 2017/
Impressive!Thanks for the post
ReplyDeleteYou’re doing a great job Man, Keep it up.
Top IT consulting companies in Hyderabad
IT business process outsourcing
IT outsourcing services
IT outsourcing companies
Software consultancy companies in Hyderabad
IT consultancy services in Madhapur Hyderabad
IT consultancy in Hyderabad
IT service-based companies in Hyderabad
List of IT companies in Hyderabad
IT companies in Hyderabad
IT consultancy companies in Hyderabad
IT consultancy services in Hyderabad