Вы находитесь на странице: 1из 3

Writing Your Own Dynamic Actions - A Guide for HR Consultants Below is a snippet from one of hundreds of articles available

to ERPtips subscribers. If you would like a complimentary copy of the full article, please email Mark.Downs@ERPtips.com (include the title of the article in your email) To subscribe to ERPtips, go to www.ERPtips.com/Subscribe.asp. ERPtips Journal is published by Klee Associates, Inc. ERPtips University provides both public and onsite training for SAP clients. For more about ERPtips University, including the current schedule, click here: www.ERPtips.com/WorkshopSchedule.asp

Writing Your Own Dynamic Actions - A Guide for HR Consultants HR expert Rehan Zaidi is always on the lookout for tools that can improve the experience of SAP HR users and developers. One such tool is Dynamic Actions, a powerful tool from the Personnel Administration submodule that allows users to automate and define certain business processes without the need for much, if any, ABAP programming. In this article, which Rehan envisions for both technical and functional HR professionals, he explains how to master the syntax of Dynamic Actions and put them to work for you. Rehan includes a hands-on example of how Dynamic Actions can be used to fulfill a basic business scenario involving the generation of loans and loan interest wage types.

Click here to read this Snippet

Writing Your Own Dynamic Actions Quickly and Easily


A Guide for HR Consultants
PSYST SY T500P PNNNN (e.g., P0045) P0001 T001P RP50D For Infotype-specific data, you may try to search the main Infotype program MPNNNN00 via the ABAP Editor Infotype Module Pool. Important Tip: While writing I statements, the constants are specified without quotes and the field names are written in brackets. Conversely, in the case of W and P statements, the constants are written in quotes and the field names are specified without brackets. Make sure this convention is strictly followed; otherwise, your action would fail. Putting It All Together In this section, I will use the concepts mentioned in this white paper to write an action that may be used to fulfill the requirement of a simple business scenario: when a loan of type ZLON is created or changed in Infotype 0045, a loan interest wage type 0200 must be created automatically in Infotype 14. The dates of this record must correspond to that of the loan type and the interest amount must be determined after computation. The entries of table T588Z are as follows: INFTY SUBTY FIELDN FC NO. STEP 0045 0045 0045 0045 0045 06 06 06 06 06 1 2 3 4 5 P I W F W VARIABLE FUNCTION P0045-DLART=ZLON INS,0014,,,(PSAVE-BEGDA),(PSAVE-ENDDA) P0014-LGART=0200 Z_FORM(Z_PROGRAM) P0014-BETRG=RP50D-FIELD1

1. When the save button is pressed on the loans entry screen, the P statement checks that the action is executed only when the loan type is ZLON (line 1). 2. The Create screen of Infotype 0014 of the same employee is displayed (line 2). 3. The start and end dates of Infotype 45 are read from structure PSAVE and populated into the corresponding fields of the Infotype 14. The wage type field is assigned value of 0200 (line 3). 4. Next, the code of form routine Z_FORM (see figure 6) in program Z_PROGRAM is executed.

Copyright 2004 by Klee Associates, Inc. www.SAPtips.com

Page 7

Writing Your Own Dynamic Actions Quickly and Easily


A Guide for HR Consultants
REPORT Z_PROGRAM. TABLES: RP50D, P0045. FORM Z_FORM. DATA : INT TYPE BETRG. INT = ( P0045-DARBT * 10 ) / ( 100 * 12 ). FORMULA (NOTE: P0045 is Accessible) RP50D-FIELD1 = INT. ENDFORM. Figure 6: Coding of Form Z_FORM. 5. This form computes the interest amount and populates variable RP50D-FIELD1 with it. Finally the interest amount is assigned to the amount field of Infotype 0014. Conclusion In this white paper, I reviewed the basics of Dynamic Actions components and their syntax. Then, I discussed in detail a full-fledged action that fulfills a common customer requirement. I would suggest that you explore standard actions provided by SAP to learn more about the different scenarios in which this tool may be applied. I hope that this paper will provide you valuable insights and help you in writing error-free actions in the least possible time. Rehan Zaidi, Senior SAP Technical Consultant at Siemens Pakistan. Rehan has been involved in ABAP development at both in-house and remote implementations of SAP R/3. Most of his work includes designing and writing country and customer-specific applications for the SAP HR module. Having used many elements of the ABAP Workbench, Rehan is familiar with crossapplication components such as BAPIs, ALE, and Workflow, and he is also conversant with many of HR's functional features. Rehan has contributed articles to the SAP Professional Journal, the HR Expert newsletter, and the TechRepublic Web site. Rehan's email address is Rehan.Zaidi@SAPtips.com.

The information in our publications and on our Website is the copyrighted work of Klee Associates, Inc. and is owned by Klee Associates, Inc. NO WARRANTY: This documentation is delivered as is, and Klee Associates, Inc. makes no warranty as to its accuracy or use. Any use of this documentation is at the risk of the user. Although we make every good faith effort to ensure accuracy, this document may include technical or other inaccuracies or typographical errors. Klee Associates, Inc. reserves the right to make changes without prior notice. NO AFFILIATION: Klee Associates, Inc. and this publication are not affiliated with or endorsed by SAP AG. SAP AG software referenced on this site is furnished under license agreements between SAP AG and its customers and can be used only within the terms of such agreements. SAP AG and mySAP are registered trademarks of SAP AG. All other company and product names used herein may be trademarks or registered trademarks of their respective owners.

Copyright 2004 by Klee Associates, Inc. www.SAPtips.com

Page 8

Вам также может понравиться