hcm process with badi

45
HCM FORMS (Ess-Mss) Detailed Steps 1. Introduction to ESS MSS 2. ISR Scenario 3. Form Scenario 4. Process 5. Use of BADI as Backend Service 6. Test Form using WebDynPro Component Avik Poddar Roshan Nepal Wipro Technologies

Upload: avik-poddar

Post on 24-Apr-2015

639 views

Category:

Documents


10 download

DESCRIPTION

A Small Basic Scenario as how you can use Adobe Forms in an Online Business Scenario , Netweaver Portal

TRANSCRIPT

Page 1: Hcm Process With Badi

HCM FORMS (Ess-Mss)

Detailed Steps 1. Introduction to ESS MSS

2. ISR Scenario

3. Form Scenario

4. Process 5. Use of BADI as Backend

Service

6. Test Form using WebDynPro

Component

Avik Poddar Roshan Nepal Wipro Technologies

Page 2: Hcm Process With Badi

2

Contents 1. ESS MSS (Brief Introduction) ..................................................................................................... 4

1.1 ESS : ................................................................................................................................................ 4

1.2 MSS : ............................................................................................................................................... 4

2. CREATION OF ESS MSS FORMS ............................................................................................................. 5

3. ADOBE FORMS ...................................................................................................................................... 6

3.1 How Interactive Forms Work ............................................................................................................ 7

3.2 Form Designing Overview ................................................................................................................... 7

4. CREATION OF ISR SCENARIO ................................................................................................................. 8

5. CREATION OF FORM SCENARIO .......................................................................................................... 10

6. LINK FORM SCENARIO WITH ISR SCENARIO ....................................................................................... 12

7. DESIGN THE FORM .............................................................................................................................. 13

8. CONFIGURATION IN FORM SCENARIO ............................................................................................... 15

9. CREATION OF PROCESS ....................................................................................................................... 17

10. DEFINITION OF BADI ....................................................................................................................... 19

11. IMPLEMENTATION OF BADI ............................................................................................................ 20

12. CODING IN THE BADI ....................................................................................................................... 24

13. TESTING THE PROCESS (With Badi Functionality) ........................................................................... 33

14. GENERATING WEBDYNPRO COMPONENT FOR SIMULATION OF ESS MSS PORTAL ....................... 36

15. TESTING FROM WEBDYNPRO (Simulating Actual Ess Mss Portal) .................................................. 37

Page 3: Hcm Process With Badi

3

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.

~~~~~~~~~~~~~~~~~~~~~~~~~

Page 4: Hcm Process With Badi

4

1. ESS MSS (Brief Introduction)

ESS - Employee Self Service is an web enabled tool used to update their own data by the employee itself.

MSS - Manager Self Service is an web enabled tool used for Managers to take report or update the datas of subordinate.

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

Page 5: Hcm Process With Badi

5

2. CREATION OF ESS MSS FORMS

The Creation of ESS / MSS Forms (in brief) involves a couple of steps as follows:-

Creation of the ISR Scenario

Creation of the Form Scenario

Linking the Form Scenario with the ISR Scenario

Defining Backend Services as per necessity

Process for the Scenario has to be created

Designing the Form Layout and binding the Form fields with

appropriate Backend Services

If BADI is required it needs to be first defined and then implemented

according to the functionality expected from it.

For the BADI to be integrated with the Form Scenario Operations and

relevant Field Groups are needed to be defined

Finally all the components, the interface, the form layout, the classes etc.

should all be ‘Active’.

Initial Testing for the Form can be done from Backend using the Process

For a more realistic feel WebDynPro can be used to simulate the actual

ESS MSS Portal

Page 6: Hcm Process With Badi

6

3. ADOBE FORMS

What is an Interactive Adobe Form?

SAP and Adobe partnered with the goal of automating and streamlining forms-based 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.

• SAP and Adobe jointly work on the integration of PDF technology

into SAP solutions

– Support for offline and online collaborative business scenarios

based on interactive PDF forms.

– Ability to define round-trip PDF forms and enable automatic data

integration into SAP solutions using XML.

– Usage of digital signatures and encryption in supported business

scenarios.

– Ability to create sophisticated multi-page PDF documents.

– Enhanced printing solution.

Page 7: Hcm Process With Badi

7

3.1 How Interactive Forms Work

3.2 Form Designing Overview

Interface : The interface defines which data a program can possibly pass on to

a form. It also contains global data and initialization coding that can be used in

a form. Interfaces are re-useable.

Form Template : Every form template consists of a context and layout:

– In the context, you define which part of the interface you actually

want to use in a particular form. You can also add elements like

text modules.

– The layout particularly contains static and dynamic elements. The

layout is designed in Designer. Technically, it is represented in a

special XDP format: XDP = XML Data Package.

– The Scripting for Validations and other Form Level Activities etc. is

done in the Script Editor.

Page 8: Hcm Process With Badi

8

4. CREATION OF ISR SCENARIO

First we have to go for Implementation Guide (SPRO)

Click on SAP Reference IMG

Follow this Path :

Personnel Management HR Administrative Services Configuration of

Forms/Processes Configuration of Forms

Page 9: Hcm Process With Badi

9

Execute Create ISR Scenario

Click on New Entries

Provide Scenario Name, Description of the Scenario and Application to which the

Scenario relates.

Save the Entry. Scenario is created.

Page 10: Hcm Process With Badi

10

5. CREATION OF FORM SCENARIO

Go to Transaction HRASR_DT (Design Time for Processes and Forms)

Click on Yes

Fill the ISR Scenario, Form Name, Back-End Service name.

Page 11: Hcm Process With Badi

11

Click On Generate ISR Scenario (Ctrl + F3)

Page 12: Hcm Process With Badi

12

6. LINK FORM SCENARIO WITH ISR SCENARIO

Go and Execute Link ISR Scenario with Form Scenario after saving Form

Scenario and Give a ISR Scenario name to be linked to and save the data.

Page 13: Hcm Process With Badi

13

7. DESIGN THE FORM

Activate the Adobe Form Interface and then the Layout.

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

Page 14: Hcm Process With Badi

14

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

Save & Activate. Go Back to the Form Scenario.

Page 15: Hcm Process With Badi

15

8. CONFIGURATION IN FORM SCENARIO

Add Relevant Fields that Need to be Fetched from Backend

Double Click on Default Values & Change Default Value for fields

Check if form is Inactive, Active it.

Page 16: Hcm Process With Badi

16

No need to make any changes to Scenario Steps

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.

Page 17: Hcm Process With Badi

17

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.

Page 18: Hcm Process With Badi

18

Test Process (Without BADI)

Page 19: Hcm Process With Badi

19

10. DEFINITION OF BADI

Define BADI in Backend Services

Click on Definition

If it’s in display mode change mode to edit

Click on New Entries

Save and Back

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.

Page 20: Hcm Process With Badi

20

11. IMPLEMENTATION OF BADI

Implement the BADI as a Back-End Service , Click on Functionality by BAdi

Now write the BADI code in the Methods and do the needful

Can add custom methods from Class -> Methods

Page 21: Hcm Process With Badi

21

Define Parameters for the Methods

Page 22: Hcm Process With Badi

22

Page 23: Hcm Process With Badi

23

Define Attributes for the Class

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.

Page 24: Hcm Process With Badi

24

12. CODING IN THE BADI

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.

Page 25: Hcm Process With Badi

25

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.

endmethod.

Method : if_hrasr00gen_service~get_operations

method if_hrasr00gen_service~get_operations.

data operation type hrasr00gs_operation.

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

Page 26: Hcm Process With Badi

26

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.

loop at service_operations into service_operation_wa.

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.

Page 27: Hcm Process With Badi

27

endmethod.

The method if_hrasr00gen_service~get_help_values contains.

method if_hrasr00gen_service~get_help_values.

endmethod.

The method if_hrasr00gen_service~get_help_values contains.

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.

Page 28: Hcm Process With Badi

28

The method if_hrasr00gen_service~do_opera_get_position_data contains.

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.

Page 29: Hcm Process With Badi

29

Add BADI Service Fields

Page 30: Hcm Process With Badi

30

Create Operations and Relevant Field-Group

Page 31: Hcm Process With Badi

31

Enter the Field Group, Name and details and Save.

Assign the required Fields to the Field Group that has just been created,

Define an Operation you need to execute.

Page 32: Hcm Process With Badi

32

Assign the Field Group just created to this Operation.

Define Field Group in the Form Scenario

Save the Form Scenario , Check whether Interface, Layout and BADI are Activated.

Page 33: Hcm Process With Badi

33

13. TESTING THE PROCESS (With Badi Functionality)

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.

Page 34: Hcm Process With Badi

34

Initial Data displayed based on the Pernr (Employee ID) Entered.

Page 35: Hcm Process With Badi

35

Now, Enter New Position and click on Check

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

Page 36: Hcm Process With Badi

36

14. GENERATING WEBDYNPRO COMPONENT FOR SIMULATION OF ESS

MSS PORTAL

Go to Transaction SE80 (Object Navigator)

Toggle to Web DynPro Comp. and Enter HRASR00_PROCESS_EXECUTE

Click on Web DynPro Applications, and then on asr_form_display

Copy the URL found under Administration Data

Page 37: Hcm Process With Badi

37

15. TESTING FROM WEBDYNPRO (Simulating Actual Ess Mss Portal)

Paste the Link in Internet Explorer and click Enter

Enter the Relevant Credentials and Click on Log On.

Page 38: Hcm Process With Badi

38

Enter the Employee ID (Pernr) and Click on Start.

Page 39: Hcm Process With Badi

39

Now, Click on Select Process

A List of all the available Process for that Employee appears, select the process that

has just been created.

Page 40: Hcm Process With Badi

40

Select the Process and Click On Edit.

Page 41: Hcm Process With Badi

41

The form comes with current details autopopulated based on the Employee ID

provided.

Page 42: Hcm Process With Badi

42

Enter the New Position Number and click Retrieve Details.

Page 43: Hcm Process With Badi

43

The Details according to the Position No. gets populated in respective fields.

Page 44: Hcm Process With Badi

44

Click on Check and Send. Everything appears in a Read Only Format.

Page 45: Hcm Process With Badi

45

Finally click on Send and if everything went fine the Process gets completed and a

Process Reference No. is generated

END