Showing posts with label ABAP FI. Show all posts
Showing posts with label ABAP FI. Show all posts

Aug 16, 2024

How to Change Cost Center in Accounting Document

Changing the KOSTL (Cost Center) field in the BSEG table using a BAPI is not directly possible since BSEG is a line-item table and is managed by SAP standard transactions. The BSEG table is updated indirectly through various financial postings and cannot be directly modified using a standard BAPI.

Alternative Approach:

If you need to change the cost center in financial documents, the correct approach would involve reversing the original document and posting a new document with the correct cost center. However, if your goal is to correct or change the cost center without reversing and reposting the document, consider using the following methods:

1. Use BAPI for Document Reversal and Reposting

  • BAPI_ACC_DOCUMENT_REV_POST: This BAPI is used to reverse the original accounting document.
  • BAPI_ACC_DOCUMENT_POST: This BAPI allows you to repost the document with the correct cost center.

2. Use a Direct Update via a Custom ABAP Program (Not Recommended)

  • Directly updating the BSEG-KOSTL field is not advisable since it can lead to inconsistencies in the database and violates SAP’s data integrity principles.

3. Use Special Purpose BAPIs

  • In specific cases, you may use specialized BAPIs related to the type of posting, such as:
    • BAPI_ACC_GL_POSTING_REV_POST: If dealing with General Ledger documents.
    • BAPI_ACC_INVOICE_RECEIPT_POST: For invoices and vendor-related postings.

Conclusion

Direct modification of BSEG-KOSTL via a standard BAPI is not supported. The best approach involves reversing the original document and posting a corrected version using standard BAPIs, ensuring that data integrity is maintained within the SAP system.

Aug 13, 2024

BTE, BADI or Eser-exit for Transaction F110

When working with transaction F110 (Automatic Payment Program) in SAP, you have several options to enhance or customize its functionality, including BTEs, BADIs, and User Exits. Each has its use case depending on the specific requirement. Here's an overview of when and how to use each:

1. BTE (Business Transaction Events)

  • Use Case: BTEs are suitable for situations where you need to extend SAP standard processes without modifying the core code. For F110, BTEs can be used to enhance the payment process by adding custom validations or processing steps.
  • Relevant BTEs:
    • BTE 1810: Can be used for adding additional validations during the payment proposal run.
    • BTE 00002040: Useful for custom modifications during the payment run.
  • Configuration: Use transaction FIBF to search, implement, and register BTEs.

2. BADI (Business Add-In)

  • Use Case: BADIs are more flexible and powerful than BTEs, offering object-oriented enhancements. They are ideal when you need to add custom business logic or integrate additional processing steps during the payment run.
  • Relevant BADIs:
    • BADI_F110_SCHEDULE_JOB: Allows for enhancements when scheduling the payment job.
    • BADI_F110_PRINT: Used to enhance the print program for the payment advice or other documents.
  • Configuration: Use transaction SE18 to explore and implement BADIs. You can define and implement multiple instances of a BADI.

3. User Exits

  • Use Case: User Exits are more traditional and can be used when you need to make specific adjustments at predefined points in the program. They are often used when dealing with older versions of SAP.
  • Relevant User Exits:
    • EXIT_SAPF110S_001: This exit allows you to include additional data or processing before the payment run starts.
    • EXIT_SAPF110V_001: It can be used to influence the selection of items for payment.
  • Configuration: User Exits require code to be added to include programs. You can explore these using transactions CMOD and SMOD.

Which One to Use?

  • For Simple Enhancements: Use BTEs if your enhancement is straightforward and falls within the scope of what a BTE can handle.
  • For Complex Enhancements: If you need more complex processing or object-oriented enhancements, BADIs are generally more powerful and flexible.
  • For Specific Adjustments: If you need to adjust specific points within the F110 process that are covered by User Exits, they can be a suitable option, especially in older SAP environments.

Conclusion

  • BTE: Best for simple, event-driven customizations.
  • BADI: Ideal for complex, object-oriented enhancements.
  • User Exit: Suitable for targeted modifications within predefined areas of the program.

Choose based on your specific needs, the complexity of the enhancement, and the SAP environment you're working in.

Jun 19, 2023

How to copy SAP Report Painter reports from SAP 4.6B to ECC 6.0

Steps to copy SAP Report Painter reports from SAP 4.6B to ECC 6.0, you can follow these steps:

1. Identify the Report Painter reports: Determine the Report Painter reports that need to be copied from the SAP 4.6B system to the ECC 6.0 system. Make a note of their names and any associated libraries or sets.

2. Export the reports: In the SAP 4.6B system, use the Report Painter transaction (GR51) to export the reports. Follow these steps:

  • Launch the Report Painter transaction (GR51) in the SAP 4.6B system.
  • Select the reports you want to copy by entering their names or selecting them from the list.
  • Use the "Copy Report Groups" option to select the associated libraries or sets that need to be copied along with the reports.
  • Click on the "Export" button to export the selected reports and their dependencies. Choose a location on your system to save the export file.

3. Import the reports: In the ECC 6.0 system, use the Report Painter transaction (GR51) to import the reports exported from the SAP 4.6B system. Follow these steps:

  • Launch the Report Painter transaction (GR51) in the ECC 6.0 system.
  • Use the "Import" option to browse and select the export file generated from the SAP 4.6B system.
  • Review the list of reports and their associated libraries or sets to be imported. Make any necessary adjustments or mappings if required.
  • Click on the "Import" button to import the reports and their dependencies into the ECC 6.0 system.

4.Verify and adjust the imported reports: After the import process is completed, open the imported Report Painter reports in the ECC 6.0 system and verify their functionality. Check if any adjustments or mappings are required due to differences between the 4.6B and ECC 6.0 systems. Make necessary adjustments to ensure the reports work correctly in the new system.

5. Perform testing: Test the imported reports in the ECC 6.0 system to validate their accuracy and functionality. Run the reports with sample data and compare the results with the original 4.6B system to ensure consistency.

By following these steps, you should be able to copy the SAP Report Painter reports from the SAP 4.6B system to the ECC 6.0 system and ensure their proper functionality in the new environment. It's important to note that depending on the complexity of the reports and any system-specific customizations, additional adjustments or configurations may be required during the copying process.


Jun 28, 2016

Adding Field / Column in the standard report RFUMSV00 (VAT Report)

The RFUMSV00 report program has a total 7 ALVs on the output screen, out of these 7 ALVs WRBTR colmn has to added on 1st and 3rd ALV.

HAN1 Output tax: Line items
HAN2 Output tax: Totals list
HAN3 Input tax: Line items
HAN4 Input tax: Totals list
HAN5 Tax difference: Line items
HAN6 Balance per company code
HAN7 Cross-company code balance


Step 1: To enhance the field Catalog use the BADI: FI_TAX_BADI_014

Go to Se19 and create an implementation as shown below.




Give a suitable name as per the naming conversions and create an implementation.




Give the country name in the filter values, remember that implementation would be called for the value given here.





Implement the method MODIFY_FIELDCAT in the interface.



The code is as below.

DATA: LS_tab_fieldcat type slis_fieldcat_alv.
Read TABLE ch_tab_fieldcat into ls_tab_fieldcat with key fieldname = 'USERFIELDNUM1'.
if sy-subrc EQ 0.
CLEAR ls_tab_fieldcat-no_out.
ls_tab_fieldcat-seltext_m = 'Document Currency'.
ls_tab_fieldcat-ref_fieldname = 'USERFIELDNUM1'.
ls_tab_fieldcat-ref_tabname = 'RFUMS_TAX_ITEM'.
ls_tab_fieldcat-do_sum = 'X'.
ls_tab_fieldcat-ddictxt  = 'M'.
Modify ch_ab_fieldcat from ls_tab_fieldcat transporting no_out seltext_m do_sum ref_fieldname ref_tabname ddictxt where fieldname = 'USERFIELDNUM1'.
clear ls_tab_fieldat.
endif.


Implement the BADI : FI_TAX_BADI_011




Give the filter value similarly.
Implement Method SET_FLAGS
write the below line.

CH_USE_BADI_11 = 'X'.

Implement menthod APPEND_TAX_ITEMS
for populating the values of structure CH_TAX_ITEM...
Code here to select data from BSEG based on BUKRS, BELNR and GJAHR and replace the value of the field USERFIELDNUM1.

Activate and check the same, the extra field will be displayed on screen.


Source http://scn.sap.com/docs/DOC-47307

Mar 22, 2016

Custom Print Program of T-Code F.62 (Print Journal Voucher)

Question:
I need to modify the data and the layout of transaction F.62 (Print Journal Voucher).  I have searched information from the web that it is possible to add a custom print program to modify the logic.  I would like to ask what is the transaction code in FI for configuring this Tcode F.62 to use this customize print program. (Like NACE for SD and MM modules). 

Answer:
Transaction OB98



SE38 for program ZFIRGB_0001 



SE71 for the SAPScript Form





Mar 17, 2016

Upload Log Item Text to FI Document

Question:
I need to upload FI document posting using BAPI_ACC_DOCUMENT_POST. However item text that I received is too long and need to store at item long text. So can we use BAPI_ACC_DOCUMENT_POST to upload long text for item text? If this possible, may I know how to do this.

Answer: 
You cannot pass item long text using this BAPI, Call the function module SAVE_TEXT after successfull call of BAPI Call Save_Text with following parameters. Text_ID : 0001 (Notes) Text_object : DOC_ITEM (Line Item Text) Language : EN Text Name : Company code +Document NO + Fiscal Year + Line item ID


Feb 10, 2016

Change item text in FB60 using BTE 1120

Step 1. Go to transaction FIBF. Click Environment > Infosystem (process)










Step 2. Atribute Type  = 'A' (Application Component). and execute



















Step 3. Click on Process 00001120
















Step 4. Click on Sample Function Module























Step 5. Copy the sample program SAMPLE_PROCESS_00001120 to Z or Y program and create the customized codes.
























































Step 6. Name the Product. Settings > Products > of a Customer




















Step 7. Settings > Process Module > of a Customer













The Result:















Jan 3, 2011

Add Field in Transaction FBL3N

Add Field in Transaction FBL3N

You can use OpenFI 1650 and add any fields to ALV line in FBL1N, FBL3N, FBL5N. It's simple. In this sampe you will add fields Vendor (LIFNR) and Customer (KUNNR).

Steps:
  • Include field ZZLIFNR & ZZKUNNR as add.structure in RFPOS, RFPOSX.
  • Copy func.module SAMPLE_INTERFACE_00001650 in ZFM_FBL3N and developing use ZZLIFNR & ZZKUNNR field...
FUNCTION zfm_fbl3n.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(I_POSTAB) LIKE  RFPOS STRUCTURE  RFPOS
*"  EXPORTING
*"     VALUE(E_POSTAB) LIKE  RFPOS STRUCTURE  RFPOS
*"----------------------------------------------------------------------

*-------------- Initialize Output by using the following line ----------

  e_postab = i_postab.
  TABLES: lfa1, kna1, bseg.
  SELECT SINGLE lifnr kunnr
    FROM bseg INTO (e_postab-zzlifnr, e_postab-zzkunnr)
    WHERE bukrs = i_postab-bukrs
      AND gjahr = i_postab-gjahr
      AND belnr = i_postab-belnr
      AND ( kunnr  <> '' OR lifnr <> '' ).

ENDFUNCTION.
  • Activate OpenFI (FIBF tr.code).
  • Create product of a customer
addfieldfbl3n001

  • Add Z1650 and Text and activate
addfieldfbl3n002

  • Create P/S Modules of a customer
addfieldfbl3n003

  • Assign Func.Module ZFM_FBL3N to Event 1650 & Product Z1650
addfieldfbl3n004

  • Run RFPOSXEXTEND (regenerate structure) and BALVBUFDEL (clear ALV).
This program can only be run by user who has admin authority. Contact Basis user or IT administrator for assistance