Skip to Content
Technical Articles

Tips and Tricks for RFA FI Type – Finance General Ledger Items

SAP Profitability and Performance Management Remote Function Adapter (RFA) provides you different functionalities wherein users can pick from various function types that gives you options to call a function module locally or remotely, a SAP HANA stored procedure from your SAP HANA DB, or create your own R script and execute it in SAP Profitability and Performance Management. To have more understanding of what I am talking about let me point you to this section of the application guide.

Before we proceed further, here are some “must read blog posts” for you to have a better understanding of the RFA FI Types such as Finance General Ledger and Finance General Ledger Items

Blog Posts:
Powerful Posting to SAP ERP or S/4 HANA Features Delivered by PaPM’s Remote Function Adapter – Part 1
Powerful Posting to SAP ERP or S/4 HANA Features Delivered by PaPM’s Remote Function Adapter – Part 2

By this point, I am expecting that you have already read the blog posts above and we can now all focus on the real topic at hand. Our function of discussion for the day will be the RFA – FI function types, specifically the Finance General Ledger Items, wherein I will walk you through some benefits of the RFA function, then move to showing you how does this function is similar to normal posting transaction codes in SAP ERP or SAP S/4HANA system. Then from there, I will give you some tips and tricks if you encounter the same challenges I encountered while using RFA function and see if this issue is with the solution or might be with something else.


Let us go through some of the benefits that RFA offers, one of which is that in the ERP system, there is no standard tool to process mass postings in FI. In cases like this, customers will need to find a developer that can write a custom Z* program to help them with this requirement.

But in SAP Profitability and Performance Management via RFA Function, you can perform mass postings without the need for additional customized program. Aside from eliminating the need to create custom program for mass posting, another benefit that RFA offers is the possibility to enrich or process your raw data (like calculate amount) prior to posting it in your SAP ERP or SAP S/4HANA system. This means that you can perform your calculation logic in your environment then once your amounts are calculated, you can post your documents using RFA type “Finance General Ledger Items”.

RFA vs posting transaction codes in SAP:

As you have understood some of the benefits of RFA, let’s now move on and see how this function is not far away with some of the standard transactions used in document posting to your SAP ERP or SAP S/4HANA system. In my “short” experience with posting FI documents to SAP via RFA Type Finance General Ledger Items, I was also interested on how this can be done in SAP, so I did some research and came across the standard transaction FB50 which is also known as one of the most used transactions with respect to posting.

To give you a visualization, I prepared a mapping of some of the essential fields of RFA Type Finance General Ledger Items to its equivalent in FB50. Please take note that this is not the full list of fields on both sides but these fields are the essential ones that I was able to come across with.

Fields – RFA Type: Finance General Ledger Items Fields – FB50 Transaction
header-doc_date Document Date
header-pstng_date Posting Date
header-header_txt Document Header Text
header-comp_code Header – Company Code
amount-currency Currency
amount-amt_doccur Amount in Doc. Curr.
accountgl-gl_account G/L Account
accountgl-item_text Text
accountgl-trade_id Trading Partner
accountgl-costcenter Cost Center
accountgl-orderid Order
accountgl-profit_ctr Profit Center
accountgl-partner_ctr Partner Profit Center
accountgl-wbs_element WBS Element

You can have more information on the RFA rules tab by reading the blog post by my colleague which I mentioned earlier: Powerful Posting to SAP ERP or S/4 HANA Features Delivered by PaPM’s Remote Function Adapter – Part 2

A friendly tip, now if there are required fields of your document that are missing in the rules tab of RFA, I suggest that you open an OSS incident for development to have a look and if applicable will provide you a SAP note that will add these required fields in the rules tab. 

Tips and Tricks:

Now as we have discussed the two points of our blog post 1) Benefits of RFA 2) Comparison of RFA vs. SAP transaction codes, let us move to our third point of our blog post which is the different tips and tricks when posting documents via RFA type Finance General Ledger Items and I will share with you some of the common newbie errors I encountered which can help you as well with your journey in learning this function.

So let us have first an example of our data to be posted.

Sample Data: Please take note of the field descriptions to understand what are being aimed to be posted.

Using the steps in the blog post Powerful Posting to SAP ERP or S/4 HANA Features Delivered by PaPM’s Remote Function Adapter – Part 2, I was able to map the required fields in my RFA type Finance General Ledger Items function, then I activated my function without errors.

Activation of RFA FI-GL Items function

So with this, I tried now executing the function and saw that in my results no document number was retrieved because of the encountered errors.

Execution of RFA FI-GL Items function

Looking at the application log produced by the execution, it states that there are errors encountered when posting both documents which leads for the posting to fail and not to retrieve any document numbers.

  1. Field Text is a required field for G/L account P001 98000
  2. Account 416300 requires an assignment to a CO object
  3. Field Text is a required field for G/L account P001 98000
  4. Account 416400 requires an assignment to a CO object

These errors might be with my mapping or maybe with my prepared data, so let us go through them one by one and understand what is wrong.

Let us start with 1) Field Text is a required field for G/L account P001 98000. For this first error it gives a description that a “Field Text” is required by a specific G/L Account which means that a field that stores this text information might have been missed during mapping.

So let us try to determine if a text component for the account we are posting to is not mapped in the rules tab.(Since I am not a financial expert, I was performing a trial and error to see if my hunch was correct that a text component was not properly maintained).

In the rules tab of the RFA function, I realized that accountgl-item_text has no mapped field or assigned formula which means it is not being posted together with the rest of the input.

No mapping for accountgl-item_text

Since in my input I have a field called SGTXT , let us map this in the rules tab: accountgl-item_text, then regenerate the function and re-execute it once more.

SGTXT mapped to accountgl-item_text

Execution of RFA FI-GL Items function with Text field mapped

You can see from the error that the first issue has been fixed. And as a lesson learned, even if component “accountgl-item_text” is not mandatory, it can still be needed if the G/L account being posted requires a G/L text.

Now let us proceed to errors 2) Account 416300 requires an assignment to a CO object and 3) Account 416400 requires an assignment to a CO. Now as a newbie and with only some basic knowledge on the functional side, I tried searching for some of the keywords in the error as I am not aware what CO objects are.

What I learned about my research is that CO objects are used for cost monitoring and budgeting. And these CO objects are either Cost Center, Internal Order and WBS elements. I then realized that I have a cost center in my input data that I might have missed to map in the rules tab earlier in the configuration.

In the rules tab, the accountgl-costcenter component is not mapped with the cost element object that is available in our input data which might have caused this error in our logs.

RFA FI -GL Items Rules Tab

Let us now map the Cost Center field to the component accountgl-costcenter and see if the second and third error would still be encountered after regenerating the function and execute it once more.

Text and Cost Center Mapped

Result of RFA FI-GL Items function

Looking at the execution of our function, we can see that the original errors has been resolved but another error is encountered which indicates that the Cost center P001/110 does not exist on 31.01.2020. That is why our second entry did not return any document number.

So let us try another option wherein newbies like me can make use of FB50 transaction to verify ifthe same is encountered in the target system for the entry that did not returned any document number. To ensure if it is a problem on SAP Profitability and Performance Management side or if it is something with our data already.

Posting Date (BUDAT) Company Code (RBUKRS) G/L Account (RACCT) Cost Center (RCNTR) Text (SGTXT) Amount in Local Currency (HSL) Local Currency (RHCUR)
31.01.2020 P001 0000416400 0000000110 ACCRUAL JAN 2020 30000 EUR
31.01.2020 P001 0000098000 ACCRUAL JAN 2020 -30000 EUR

Input Document for RFA FI-GL Items function

In our sample data, let us identify what are the fields values that will be entered in the header and the line item fields. For the header section, we will enter the Company Code, Document Date, Posting Date and the Currency. In our example, the posting date will also be used as the document date.

Header Data

Afterwards, in the line items section, The entries will be the G/L account, the Amount but prior to it assign it either credit or debit. From here, we must assign the cost center to its respective G/L Account line item.

Line Item section

Choose Simulate, to not directly post the document but to check first for some inconsistencies in the line items.

FB50 Simulate Error

Now that the simulation posting has been accomplished, we encountered the same error as what we had in our RFA function. I tried researching more and found that this type of error is because of the following reasons. The validity period of the cost center, the cost center doesn’t exist in the controlling area, or the cost center is activated, which I realized that the error is no longer with SAP Profitability and Performance Management and deals more with the configuration on SAP FI side. What I would suggest is to research further or better yet check together with a functional expert if the system is configured in the SAP FI accordingly.

As a realization with the tips and tricks I have given, we should check a sample data set, by posting it first in the SAP ERP or SAP S/4HANA system. From there, if we are successful in posting the sample data set in the system then we can configure the RFA function to help us in posting the full data set or records.

Hopefully, you have learned some tips and tricks on how to check some common errors you might encounter using the RFA FI-GL Items function. Just to add, the same steps can be done in the different FI types including the SD function type of RFA.

If you have questions about this awesome solution, you can ask them here in the SAP Community Questions section link. To read more blog posts, you may hop on the SAP Community Blog Post link.

By the way some additional helpful tips

You might notice that you are missing some of the CO objects such as WBS element and order number, if you’re SAP Profitability and Performance Management is installed with SP11 and below. if you are planning to patch to SP12 or future SPs only will you have these CO objects in your rules tab, but if you haven’t planned yet an upgrade then I suggest that you implement this note 2984448 – FS-PER Rel 3.0 SP12 – New CO fields for FI RFAs, Posting Errors Fix, to have these CO objects in your system. Just a friendly tip, follow the order of implementation and don’t forget to read the manual steps needed to successfully implement the note.

Also, if there are changes in the RFA function, it must then be activated to ensure that the changes done in the function will be included in the generated report. RFA FI types uses a report in posting rather than a HANA stored procedure, this report contains the BAPI BAPI_ACC_DOCUMENT_POST wherein the RFA function serves only as an adapter function, the standard accounting BAPI really does the posting in the system. To know where the report is, open the function attributes and in the runtime attributes you can use the Y*table generated(i.e. Y800BX20001RFGLI) then from there add the _REP and open it via transaction: SE38. Here you will see the report generated by the RFA function.

Thank you!


Be the first to leave a comment
You must be Logged on to comment or reply to a post.