HCM Process With Badi
HCM Process With Badi
HCM Process With Badi
Detailed Steps
1. 2. 3. 4. 5. Introduction to ESS MSS ISR Scenario Form Scenario Process Use of BADI as Backend Service 6. Test Form using WebDynPro Component
Contents
1. ESS MSS (Brief Introduction) ..................................................................................................... 4 1.1 ESS : ................................................................................................................................................ 4 1.2 MSS : ............................................................................................................................................... 4 2. 3. CREATION OF ESS MSS FORMS ............................................................................................................. 5 ADOBE FORMS ...................................................................................................................................... 6 3.1 How Interactive Forms Work ............................................................................................................ 7 3.2 Form Designing Overview ................................................................................................................... 7 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. CREATION OF ISR SCENARIO ................................................................................................................. 8 CREATION OF FORM SCENARIO .......................................................................................................... 10 LINK FORM SCENARIO WITH ISR SCENARIO ....................................................................................... 12 DESIGN THE FORM .............................................................................................................................. 13 CONFIGURATION IN FORM SCENARIO ............................................................................................... 15 CREATION OF PROCESS ....................................................................................................................... 17 DEFINITION OF BADI ....................................................................................................................... 19 IMPLEMENTATION OF BADI ............................................................................................................ 20 CODING IN THE BADI....................................................................................................................... 24 TESTING THE PROCESS (With Badi Functionality) ........................................................................... 33 GENERATING WEBDYNPRO COMPONENT FOR SIMULATION OF ESS MSS PORTAL ....................... 36 TESTING FROM WEBDYNPRO (Simulating Actual Ess Mss Portal) .................................................. 37
PREFACE ~~~~~~~~~~~~~~~~~~~~~~~~
In This Document You Will Find a Brief Discussion on ESS MSS Forms and How Adobe Interactive Forms can be Used to develop a particular Business Scenario. The Scenario taken up as an Example is where Organizational Details get Auto-populated when you enter the ID of an Employee. Taking the Scenario forward, it has been shown how you can implement a BADI as a backend service for a button in the form. In this Scenario if you enter the New Position No. and Click Retrieve Details button it populates the New Position Details accordingly.
~~~~~~~~~~~~~~~~~~~~~~~~~
1.1 ESS : Allows employees to create, display, and change their own data in the company's intranet. In Personnel Administration, for example, employees can use the Personal Data service to create and edit their own personal data. In this way, employees can keep their own data up-to-date, while simultaneously reducing the number of time-consuming and expensive activities performed by the Human Resources Department. 1.2 MSS : This Manager Self Service is designed for all employees who perform management tasks at an operational level, for example: i. Line managers ii. Team leaders with project management tasks iii. Department heads In particular, the business package supports managers perform the following: Tasks related to the personnel responsibility for their team Controlling tasks within their budgeting responsibilities Planning tasks Project management tasks
3. ADOBE FORMS
What is an Interactive Adobe Form?
SAP and Adobe partnered with the goal of automating and streamlining formsbased communication to support customers who create reusable forms for their business processes. The result of this partnership is SAP Interactive Forms by Adobe. SAP Interactive Forms by Adobe is integrated into no less than six SAP development and run-time environments, which cover both stacks of SAP NetWeaver as well as the SAP Business Suite. These forms are used to display information from the backend as well as take input from the user and update it in system.
Follow this Path : Personnel Management HR Administrative Services Configuration of Forms/Processes Configuration of Forms
Provide Scenario Name, Description of the Scenario and Application to which the Scenario relates.
Click on Yes
10
11
12
Create the Form Layout according to the Given Specification, Maintain the Layout Standards
Check Data Binding for the fields , go to Objects and then Binding
13
Do the Necessary Scripting in the Script Editor under the appropriate Events.
//Set ISR_EVENT for BAdI processing in backend $record.CONTROL_PARAM.ISR_EVENT = "USER_EVENT_CHECK" //Trigger call to backend for BAdI user command processing ContainerFoundation_JS.SendMessageToContainer(event.target, "submit", "", "", "", ""); //Do not allow any further click event until server roundtrip is completed this.access = "readOnly";
//Toggle visibility to be visible during edit operations, nvisible otherwise if($record.CONTROL_PARAM.ISR_MODE == "DISPLAY" $record.CONTROL_PARAM.ISR_FORM_VIEW =="ISR_APPROVE" ) then this.presence = "invisible" else this.presence = "visible" endif
14
Double Click on Default Values & Change Default Value for fields
15
Check whether SAP_PA has been successfully integrated to the Back-End Services
Now, after this much configuration if you want to check whether things are going fine you have to create a process for the form through which you can check whether the functionality is going on just as expected.
16
9. CREATION OF PROCESS
Click on Process.
Click on Yes.
Enter the Form Scenario Name The below testing will just confirm that the configurations done till now are working fine. After this we can move on with the BADI definition and implementation as per the form requirements.
17
18
10.
DEFINITION OF BADI
Once the BADI is defined , it needs to be implemented for the form scenario as a backend service and coding needs to be done in the methods already generated, if there is need of custom methods they can as well be defined and used, appropriate parameters should be defined for them. Also Attributes need to be defined in the Class of the BAdi and everything needs to be Active.
19
11.
IMPLEMENTATION OF BADI
Now write the BADI code in the Methods and do the needful
20
21
22
After this you can start on with the coding part. Below a set of code is given that is applicable to the test scenario that has been developed.
23
12.
Method : if_hrasr00gen_service~get_specials_fields
method if_hrasr00gen_service~get_special_fields. data init_fields_wa type line of hrbas_fieldlist_tab. init_fields_wa = c_fieldname_plans. append init_fields_wa to special_fields. endmethod.
Method : if_hrasr00gen_service~get_field_info
method if_hrasr00gen_service~get_field_info. data field_info type hrasr00gs_field_info. data service_field type fieldname.
clear field_infos. loop at service_fields into service_field. clear field_info. case service_field.
when c_fieldname_plans. field_info-fieldname = c_fieldname_plans. field_info-field_data_element_name = c_dtel_plans. field_info-supports_value_help = false. field_info-supports_default_value = true. append field_info to field_infos. when c_fieldname_bukrs. field_info-fieldname = c_fieldname_bukrs. field_info-field_data_element_name = c_dtel_bukrs. field_info-supports_value_help = false. field_info-supports_default_value = true. append field_info to field_infos.
24
when c_fieldname_btrtl. field_info-fieldname = c_fieldname_btrtl. field_info-field_data_element_name = c_dtel_btrtl. field_info-supports_value_help = false. field_info-supports_default_value = true. append field_info to field_infos. when c_fieldname_werks. field_info-fieldname = c_fieldname_werks. field_info-field_data_element_name = c_dtel_werks. field_info-supports_value_help = false. field_info-supports_default_value = true. append field_info to field_infos. endcase. endloop.
clear operations. * operation GET_Position Data clear operation. operation-operation = c_oper. operation-fieldnames = get_fields_of_operation( operation-operation ). append operation to operations. endmethod.
Method : if_hrasr00gen_service~initialize
25
method if_hrasr00gen_service~initialize. data special_field type hrasr00value_of_field. data plans type plans. * Get position number loop at special_fields into special_field where fieldname = c_fieldname_plans. if special_field-fieldvalue is initial. return. else. plans = special_field-fieldvalue. endif. endloop.
endmethod.
Method : if_hrasr00gen_service~do_operations
method if_hrasr00gen_service~do_operations. data service_operation_wa type hrasr00genserv_operation. data relevant_help_datasets type hrasr00gs_help_dataset_tab. data relevant_service_datasets type hrasr00gensrv_dataset_tab.
case service_operation_wa-operation. when c_oper. * perform operation GET_POSITION_DATA call method me->do_opera_get_position_data exporting special_fields = special_fields no_auth_check = no_auth_check message_handler = message_handler changing help_datasets = relevant_help_datasets service_datasets = service_datasets. endcase. endloop.
26
method get_fields_of_operation. clear fieldnames. case operation. when c_oper. * append c_fieldname_pernr to fieldnames. append c_fieldname_plans to fieldnames. append c_fieldname_werks to fieldnames. append c_fieldname_bukrs to fieldnames. append c_fieldname_btrtl to fieldnames. when others. assert 1 = 0. "called for an operation, that is not supported endcase. endmethod.
27
method do_opera_get_position_data. data service_dataset_wa type hrasr00gensrv_dataset. data special_field_wa type hrasr00value_of_field. * data pernr_id type pernr_d. data lv_plans type plans. data lv_werks type werks. data lv_btrtl type btrtl. data lv_bukrs type bukrs. field-symbols <service_field_value> type hrasr00gensrv_dataset. * get position loop at special_fields into special_field_wa where fieldname = c_fieldname_plans. lv_plans = special_field_wa-fieldvalue. endloop. select single werks from pa0001 into lv_werks where plans = lv_plans. select single bukrs from pa0001 into lv_bukrs where plans = lv_plans. select single btrtl from pa0001 into lv_btrtl where plans = lv_plans. loop at service_datasets assigning <service_field_value> where fieldname = c_fieldname_btrtl. if <service_field_value> is assigned. <service_field_value>-fieldvalue = lv_btrtl. endif. endloop. loop at service_datasets assigning <service_field_value> where fieldname = c_fieldname_werks. if <service_field_value> is assigned. <service_field_value>-fieldvalue = lv_werks. endif. endloop. loop at service_datasets assigning <service_field_value> where fieldname = c_fieldname_bukrs. if <service_field_value> is assigned. <service_field_value>-fieldvalue = lv_bukrs. endif. endloop. endmethod.
28
29
30
Assign the required Fields to the Field Group that has just been created,
31
Save the Form Scenario , Check whether Interface, Layout and BADI are Activated.
32
13.
Toggle to Process and Enter the Process Name that you created , click Enter.
Check for a value for which all the concerned data are maintained in SAP and Execute.
33
34
So, Now once you are sure that the Back-End Services are working just as desired you can move on with integrating the form in the portal.
In absence of the actual ESS MSS Portal you can always simulate it in WebDynPro component that can be generated through Object Navigator
35
36
15.
37
38
A List of all the available Process for that Employee appears, select the process that has just been created.
39
40
The form comes with current details autopopulated based on the Employee ID provided.
41
42
The Details according to the Position No. gets populated in respective fields.
43
44
Finally click on Send and if everything went fine the Process gets completed and a Process Reference No. is generated
END
45