badi implementation for transaction fb60

12
BADI implementation for transaction FB60 By Muthuvel Kumaran, Kaavian Systems Aim : To create a BADI implementation for FB60 transaction, that does not allow user to create duplication reference for Vendor Invoice Creation. Step1: Keep a break point in CALL METHOD cl_exithandler=>get_class_name_by_interface” line inside the get_instance method of the class cl_exithandler in Class builder (SE24).

Upload: assign7997061

Post on 25-Dec-2015

526 views

Category:

Documents


7 download

DESCRIPTION

BADI Implementation for Transaction FB60

TRANSCRIPT

Page 1: BADI Implementation for Transaction FB60

BADI implementation for transaction FB60

By Muthuvel Kumaran, Kaavian Systems

Aim: To create a BADI implementation for FB60 transaction, that does not allow user to create duplication reference for Vendor Invoice Creation.

Step1:

Keep a break point in CALL METHOD cl_exithandler=>get_class_name_by_interface” line inside the get_instance method of the class cl_exithandler in Class builder (SE24).

Page 2: BADI Implementation for Transaction FB60

Step2:

Now execute FB60 transaction, you will see the debugger that you set in SE24 transaction. Double click on the changing parameter “EXIT_NAME”. Press F8 sequentially and make a note of the exit names.

Page 3: BADI Implementation for Transaction FB60

Step3:

After you see FB60 just continue with the Vendor Invoice creation and in mean time note all the Exit names that you come through in the debugger.

Step4:

Give the values for all mandatory fields and press Enter.  

Page 4: BADI Implementation for Transaction FB60

Step5:

You will get the screen like this and press F9 for Simulate Document Posting.

Page 5: BADI Implementation for Transaction FB60

Step6:

You will get the screen as below.

Page 6: BADI Implementation for Transaction FB60

Step7:

Save it.

The BADI’s triggered is as follows.

Before SCREEN1

BADI_FDCB_SUBBAS01 BADI_LAYER BADI_FDCB_SUBBAS02 PPA_CUST_BADI BADI_FDCB_SUBBAS03 WRF_PREPAY_INVOICE BADI_FDCB_SUBBAS04 BADI_FDCB_SUBBAS05 ADDR_LANGU_TO_VERS ADDR_PRINTFORM_SHORT BADI_MATN1  

Before 2nd Screen:

PPA_CUST_BADI FAGL_PERIOD_CHECK FI_TRANS_DATE_DERIVE ADJ_NETDAYS FAGL_SEGMENT_BS_ACC FAGL_DERIVE_SEGMENT FAGL_DERIVE_PSEGMENT CHECK_COBL_ADDON PPA_CUST_BADI SD_COND_ACCESS_A

After Save Button Pressed:

FI_RES_ITEM_CURRENCY AC_QUANTITY_GET BADI_PRKNG_NO_UPDATE FM_POP_CORE FMRI FMRE_BUS_PROCESS FAGL_SET_SEGMENT FI_SL_BADI_DOCSELECT FI_SL_BADI_POPER EXIT_XFMPR1_001 BUAVC_CHECK_RESTRICT UKM_R3_ACTIVATE UKM_R3_ACTIVATE CO_DOCUMENT_INFO

Step 8 :

Search for the “I_COBL” field inside any of the methods inside the BADI classes.

Page 7: BADI Implementation for Transaction FB60

Shortcut : Once you got the parameter. Goto se19 in create implementation block under classic BADI enter the BADI names one by one and find out weather implementation can be created or not. After doing this you will have very less BADI’s now goto SE24 and add cl_ex_(BADI NAME) and check for methods that have the parameter I_COBL.

Press ‘Display’ button.

Press ‘Parameters’ button.

Page 8: BADI Implementation for Transaction FB60

Step9:

After finding the BADI and method in which you want to implement the code. Goto SE19 and create implementation for that particular BADI.

Step10:

Press ‘Create Implementation’ button and press ‘Enter’.

Page 9: BADI Implementation for Transaction FB60

Step11:

Enter implementation short text and give the ‘Filter Type’ also.

Page 10: BADI Implementation for Transaction FB60

Step12:

Click on interface tab.

Page 11: BADI Implementation for Transaction FB60

Step13:

Double click on the method in which you want to write code as decided. You will see the following.

Press ‘Yes’ button and Save it.

Step14:

Page 12: BADI Implementation for Transaction FB60

Write the following code in the method.

method IF_EX_FAGL_DERIVE_SEGMENT~GET_SEGMENT.  data  lt  type COBL .

 select SINGLE XBLNR from bkpf into lt WHERE XBLNR = i_COBL-xblnr.   if sy-subrc eq 0.     MESSAGE E015(Z1018_SALESORDER_MSG).          ENDIF.endmethod.

Step15:

Save and activate the code and come back.

Step16:

Activate the Implementation and go to FB60 and try to create Vendor Invoice Creation with the same reference as ‘100’.