SAP ABAP IMG Activity PT_BLP_USER (BAdI: Enhance Business Logic for Time Data)
Hierarchy
SAP_HRCNL (Software Component) Sub component SAP_HRCNL of SAP_HR
   PY-NL (Application Component) The Netherlands
     P05C (Package) HR Customizing: Netherlands
IMG Activity
ID PT_BLP_USER BAdI: Enhance Business Logic for Time Data  
Transaction Code S_L4H_49001906   (empty) 
Created on 20110412    
Customizing Attributes PT_BLP_USER   BAdI: Enhance Business Logic for Time Data 
Customizing Activity PT_BLP_USER   BAdI: Enhance Business Logic for Time Data 
Document
Document Class SIMG   Hypertext: Object Class - Class to which a document belongs.
Document Name PT_BLP_USER    

You can use this Business Add-In (BAdI) to influence how time data is processed by the HR_BLP_MAINTAIN_TIMEDATA function module (Valuate Time Data). HR_BLP_MAINTAIN_TIMEDATA is used by various programs to read time data, valuate it, and store it in the Time Management infotypes. It is used in the Business Logic Processor of the Time Manager's Workplace (TMW).

The function module processes the data records of various personnel numbers sequentially. In the text below, references to dependencies between data records always represent data records of the same personnel number.

Example

Examples for the implementation of the BAdI are available as standard implementations. For more information, see the Standard settings section.

Requirements

If you create your own implementations of the BAdI, you must take account of the following aspects, otherwise there may be data inconsistencies or malfunctions in the program flow:

The time data that the system processes in the program flow is transferred to you using the IF_EX_PT_BLP_USER interface with ABAP object references of type REF TO IF_PT_TD_CONTROL.

The actual data object is hidden behind the DATA attribute of the IF_PT_TD_CONTROL interface. The DATA attribute always represents a reference to the IF_PT_TD_BASE interface (Basis Interface for Time Data).

You can reach the actual data objects by using a corresponding type casting on one of the interfaces listed below:

  • General infotype: IF_PT_TD_INFOTYPE
  • Infotype (not implemented): IF_PT_TD_ITnnnn, where nnnn represents the four-figure number of the infotype.
  • Infotypes 2001 to 2011: IF_PT_TD_IT20nn, where nn represents the last two figures of the four-figure infotype number.
  • Infotype 0416: IF_PT_TD_IT0416
  • Personal calendar entry: IF_PT_TD_CALE
  • Quota/leave deduction: IF_PT_TD_DEDUCTION
  • Time pair data from cluster tables B1 and B2: IF_PT_TD_TIMPAIR
  • Results of time evaluation: IF_PT_TD_TIMRES
  • Personal work schedule: IF_PT_TD_PWS
  • Time evaluation messages: IF_PT_TD_WLIST

You can find out the category and type of a data object from the instance attributes IF_PT_TD_BASE~CATEGORY and IF_PT_TD_BASE~TYPE.

Not all of the data types above are modifiable. The Business Logic Processor differentiates between buffer objects and runtime objects. You can change the buffer objects if they are listed in one of the non-generic interfaces from the above list, that is, any of the them except the IF_PT_TD_ITnnnn interfaces.

The system forms the runtime objects during the program flow for reading. This affects all objects in the above list that implement the IF_PT_TD_TIMRES and IF_PT_TD_PWS interfaces. They are not administered by the database buffer and therefore cannot be saved.

You cannot change the content of these objects. The following rule applies: A data object is not modifiable if the IF_PT_TD_BASE~READ_ONLY attribute has the value CL_PT_TMW_CONST=TRUE.

Standard settings

In processing time data using the HR_BLP_MAINTAIN_TIMEDATA function module, several defined time points exist, which each represent a particular processing state of a data record:

  • PPR: Define standard values in data records. Data records are still unchanged when they reach this point.
  • DEP: Form dependencies between data records
  • ENR: Supplement data records. This point is not part of the process in the standard system.
  • SRP: Check and valuate data records
  • RET: Retro accounting reconition in Payroll Status infotype(0003)
  • SAV: Data records saved; rollback possible
  • PSV: Data records saved; rollback not possible

You can create a separate implementation of the BAdI for each of these time points to influence the processing of the data records when they have attained the desired processing status. The time points that are especially suited to customer implementations are PPR, SRP, and DEP.

The following implementations exist in the standard system:

  • PT_BLP_SAMPLE_PPR (Select Particular Time Management Infotypes)
  • PT_BLP_SAMPLE_DEP (Read Other Absence Data for the Absences Infotype (2001))
  • PT_BLP_SAMPLE_ENR (Overtime Start Time Equal to End Time of Daily Work Schedule
  • PT_BLP_SAMPLE_SRP (Illnesses: Applicable Days; Substitutions; Different Payment
  • PT_BLP_SAMPLE_PSV (Output Customer-Specific Message After Saving)

For more information, see the documentation of the IF_EX_PT_BLP_USER interface.

Recommendation

In your implementations for the individual time points, create separate methods for processing the various data types that are called (dynamically) by the PROCESS_DATA initial method according to the data type. This means that you have separate control over activities for the individual data types in relation to their operations and processing states.

Activities

After calling up the IMG activity, a dialog box appears, in which you can enter a name for the implementation.

If you have already made other implementations for this BAdI, another dialog box appears, in which the existing implementations are displayed. In this case, choose Create, and proceed as follows:

  1. In the dialog box, enter a name for the BAdI implementation in the Implementation field, and choose Create.

    The screen for creating BAdI implementations is now displayed.

  2. Enter a short text for the implementation in the Short text for implementation field.
  3. From the tab index, choose Interface.

    The Name of implemented class field is already filled on the tab page, as a class name was automatically assigned to the implementation when you named it.

  4. Save your entries, and assign the implementation to a development class.
  5. Place the cursor on the method, and double-click to enter method processing.
  6. Enter the code for the implementation between the statements method <Interface name> ~ <Name of method> and endmethod.
  7. Save and implement your code. Return to the Edit Implementation screen.
  8. Save the entries on the Edit Implementation screen.

    Note: You can also create an implementation, and then activate it at a later time. In such a case, end the processing stage at this point.

  9. Choose Activate

    The code you stored in the method will be run when the application program is executed.

Further notes

Business Attributes
ASAP Roadmap ID 257   Create User Exits 
Mandatory / Optional 2   Optional activity 
Critical / Non-Critical 2   Non-critical 
Country-Dependency I   Valid for countries specified 
Customizing Attributes Country Key Country Name
PT_BLP_USER NL Netherlands
Assigned Application Components
Documentation Object Class Documentation Object Name Current line number Application Component Application Component Name
SIMG PT_BLP_USER 0 HLA0009675 Evaluations/Statistics 
Maintenance Objects
Maintenance object type E   Business Add-In - Definition 
History
Last changed by/on SAP  20110412 
SAP Release Created in