How do we write functional specification in real time? These are written when we need any enhancement to the existing or standard functionality. Functional consultants will prepare it and give it to the ABAPers for development. It can be a custom report, it can be a user exit or BADI etc. This is example which was developed for uploading wage types: Transaction ZTPUPLWAGE will upload records from a external excel spreadsheet and create records for wage infotypes 0014 (recurring payments/deductions), 0015 (additional payment) and 0267 (off-cycle payments). The program name is ZTP_UPLOAD_WAGE_TYPE. The user must have authorization to infotype 0014, 0015 and 0267. Certain countries may restrict the user to access certain wage types. When the user executes the transaction, they will have the option of executing in foreground or background. Infotype 0014, infotype 0015, or infotype 0267 will be created, for each personnel number in the file, with the appropriate wage type. The program will not fail. If an infotype isn't created due to some error during the bapi create, that record will be skipped and will be displayed in the output report along with the error message that was returned from the function module. The program will perform an Authority Check to validate the userid has authority to run the program. If not, an error message will be returned from FM Z_AUTHORIZATION_CHECK. The user will input the PC file for the program to read. If the file is not found, then error with message "Input file not found". The following will be validated from the input screen: 1. The user will input the country group (MOLGA) via a drop-down. 2. Validate the creation date in header is not greater than the run date (sy-datlo). If the date is greater than the run date, then error with message "Create Date is invalid (future date not allowed)". 3. Validate the record count in header equals actual record count. If record count does not equal, then error with message "Record count mismatch. Expected = nnnn Actual = nnnn" If the record count doesn't exist in the header record, then error with message "Record count required". 4. Validate the hash total for the Number and Amount field equals the actual hash total. The program will sum the number field and amount field of all the personnel records in the file. The sum of these values will be compared to the values in the header record. If they aren't equal, then error with one of the following: "Number hash total nnn doesn't equal actual number hash total nnn" or "Amount hash total nnn doesn't equal actual amount hash total nnn". 5. Validate the file sequence number. The file sequence number will be validated against the entries in table ZTXBATCHLOG. This table will be updated for each succcesful run of the program. You can see the table layout under section 4.3. If the sequence number in the file exists in the table, then the program with error "File sequence number nnn already processed for country nn". If the test and foreground buttons are selected on the selection screen, then display the records on the screen. If the test and background buttons are selected on the selection screen, then display the records on in a spool list. The user will run the pgm in test mode first to see if there are any errors in the file. If there are errors, the user will update the file. If the test button isn't checked, then create the infotype selected for each record in the file. Once the program starts, the new entry in table ZTXBATCHLOG will be locked until the program has completed uploading the records in the in the file. After the records in the file are processed, the new entry in table ZTXBATCHLOG will be unlocked. This is done so someone can't try to run the same file at the same time. If the program is executed in test mode, the ZTXBATCHLOG table will not be updated. The function BAPI_EMPLOYEE_ENQUEUE will lock the personnel number. The bapi HR_INFOTYPE_OPERATION will be used to insert the records. Then the function BAPI_EMPLOYEE_DEQUEUE will unlock the personnel number.
SAP Human Resource Books
SAP Human Resource Tips
Best regards,
All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|