Google Search - Blog...........

ABAP - Creation Of Enhancement Spot, BADI Definition & Implementation In ECC 6.0

Creation of Enhancement Spot, BADI Definition and Implementation in ECC 6.0
Creation of Enhancement Spot and BADI Definition:

An enhancement spot is an object, which can contain one or more BADI definitions. We can say it as a Function Group, which contains one or more number of Function Modules

1. Go to SE18.
2. Select Enhancement Spot option
3. Give the Enhancement Spot Name and Create
4. Provide Short Text and Select Technology as BADI Definition.
5. Save the Enhancement Spot
6. Select "Enhancement Spot Definitions" Tab
7. On the Left Hand Side Click on the Icon "Create BADI"
8. Give the BADI name and Short Description
9. Expand the BADI definition in order to give the BADI Interface name
10. Give the Interface name and create the Interface
11. In order to Create a Filter for the BADI, right click on the BADI definition and click "Create Filter" from the Menu
12. Specify the Filter Name, Type and Description and Save the filter
13. The Enhancement Spot, BADI definitions are ready for use. Creation of BADI Implementation:
14. Go to SE19
15. Give the Enhancement Spot name and Click on Create Implementation
16. Give Enhancement Spot Implementation name, short text and continue
17. Give the BADI Implementation Name and continue
18. Double Click on Implementing Class and give the implementing class name and create it.
19. Double Click on the Filter val. In order to provide the filter values for the BADI implementation.



Calling the BADI Implementation in CMOD Project:

In PBO:
DATA: gf_handle TYPE REF TO zhrpad00infty.
GET BADI gf_handle
FILTERS
infotype = innnn-infty.
TRY.
CALL BADI gf_handle->before_output
EXPORTING
tclas = tclas
ipsyst = ipsyst
i001p = i001p
i503 = i503
flt_val = innnn-infty
CHANGING
innnn = innnn
ipref = ipref.

CATCH CX_SY_DYN_CALL_ILLEGAL_METHOD.
ENDTRY.

In PAI:
DATA: gf_handle TYPE REF TO ZHRPAD00INFTY.
GET BADI gf_handle
FILTERS
infotype = innnn-infty.

TRY.
CALL BADI gf_handle->after_input
EXPORTING
tclas = tclas
old_innnn = innnn
ipsyst = ipsyst
i001p = i001p
i503 = i503
flt_val = innnn-infty
changing
new_innnn = innnn
ipref = ipref.

CATCH CX_SY_DYN_CALL_ILLEGAL_METHOD.
ENDTRY.



SRD3010: User Exit - Hire Date

BADI Implementation Name: ZIM_SRD3010_ZHRPAD00INFTY
Implementing Class Name: ZCHR_IM_ZIM_SRD3010
Filter Value: 0041
Method: ZIF_EX_HRPAD00INFTY~AFTER_INPUT

Logic:
1. Check whether SY-TCODE = 'PA40'
2. Check whether Action Type is '33' or '11'
3. Check whether User Command is 'UPD' or ' '
4. Get the Person ID from IT0709 for the current Personnel Assignment using HR_READ_INFOTYPE
5. Using that Person ID get all the Personnel Assignments from PA0709 and store it in an internal table. The internal table is the kind of sorted internal table
6. Read the first record from the internal table into a work area, which is the earliest Personnel Assignment for that Person ID
7. Now, get the hiring date from IT0041 for the personnel assignment which is in the work area using HR_READ_INFOTYPE
8. Read the Infotype 0041 data using the method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
9. Now change the field DAT01 with the hiring date present in IT0041-DAT01
10. Save the Infotype 0041 data using the method cl_hr_pnnnn_type_cast=>pnnnn_to_prelp

SRD3012: Date Monitoring

BADI Implementation Name: ZIM_SRD3012_ZHRPAD00INFTY
Implementing Class Name: ZCHR_IM_ZIM_SRD3012
Filter Value: 0019
Method: ZIF_EX_HRPAD00INFTY~BEFORE_OUTPUT

Logic:
1. Check whether SY-TCODE = 'PA40'
2. Check whether Action Type is '01' or '02' or '03' or '12'
3. Fetch the start date of action for the current Personnel Assignment from IT0000 using HR_READ_INFOTYPE
4. Fetch "Personnel Area", "Personnel Sub Area", and "Employee Sub Group" from IT0001 using HR_READ_INFOTYPE
5. Fetch "TMART" (subtype), "FDATE" (Future Date in Months), "BSGRD" (Capacity Utilization Level, it will be either Y / N) from ZHRFUTUREDATE table by passing Personnel Area, Personnel Sub Area, Employee Sub Group and Action Type.
6. If BSGRD is 'Y' then Read record from IT0008 for the current Personnel Assignment using HR_READ_INFOTYPE
7. If IT0008-BSGRD value is less than "100.00" then calculate the future date using the given formula
8. If BSGRD is 'N' then the future date is IT0000-BEGDA + FDATE. We get the future date value by passing these two values to the HR_HCP_ADD_MONTH_TO_DATE function module.
9. Read the Infotype 0019 data using the method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
10. Change the values of 'SUBTY', 'TMART', 'TERMN' with the obtained values.
11. Save the Infotype 0019 data using the method cl_hr_pnnnn_type_cast=>pnnnn_to_prelp




RETURN TO MAIN INDEX:

- Sample Programs On Uploading & Downloading Files.

- Sample Programs On HR ABAP.

- Sample Report Programs On ALV List/ Grid Display.

- Sample Programs On Selection Screen.

- Sample Programs On BDC.

.....Back To MAIN INDEX.

1 comment:

  1. how to use cl_gos_attachment in gos_mult_publish for edit/display attachment

    ReplyDelete