Tuesday 8 December 2015

Add additional fields in FBL5N (Customer line item report) using BADIs


Aim: To add additional fields in FBL5N (Customer line item report) using BADIs  
Requirement: Requirement from business is to track the Customer residual invoices and aligns them to original invoices. Each of the residual invoices line item needs below four extra fields.  
1.     Original Invoice Date
2.     Original Invoice Reference2
3.     Original Invoice Text
4.     Original Invoice number  


FBL5N:  


Add the four required fields in the RFPOS structure and RFPOSX structure.
This can be done by appending structure.



Since we have added new fields in the structure above, Run program RFPOSXEXTEND to regenerate the structure.  
 

Activate the extended structure by clicking on Yes.  

Program completed successfully will get displayed.  
Now execute FBL5N. Newly added fields will get displayed.  

How to find out a BADI  for a  transaction:
1.     Go to the TCode SE24 and enter CL_EXITHANDLER as object type.
2.     In 'Display' mode, go to 'Methods' tab.
3.     Double click the method 'Get Instance' to display it source code.
4.     Set a breakpoint on 'CALL METHOD cl_exithandler=>get_class_name_by_interface'.
5.     Then run your transaction.
6.     The screen will stop at this method.
7.     Check the value of parameter 'EXIT_NAME'. It will show you the BADI for that transaction.
Choose correct BADI for requirement.  
BADI for Item details is FI_ITEMS_CH_DATA.  
Create Implementation for the badi definition and make the necessary code changes to display the values. 

 

Required values are displayed when executing the transaction FBL5N transaction.  

Description: http://saptechnical.com/Tutorials/ExitsBADIs/FBL5N/Index.1.jpg

When moving changes to subsequent system: (Manual steps)  
1.     First attempt for importing the transport will fail and this is expected,
2.     BASIS will then run program RFPOSXEXTEND, program will prompt for a   confirmation “Do you want to activate the extended structure” you will select “Yes”,
3.     Let the program finish executing and then reimport the transport and this time it will be successful.

No comments:

Post a Comment