This blog has been substantially rewritten in December 2018 to include information on how to retrieve fields from various associated master data tables like LFA1 and KNA1, and to clarify the steps for including the additional fields as dynamic selections. I also wanted to clarify the use of the “Configure Fields” function under transaction HDBC. Thanks to readers for their comments raising these points.
Introduction
A reader of
my previous blog post asked the question on how to include CO-PA characteristics residing on ACDOCA to the Line Item Browsers.
This was a very pertinent question because I did not cover this scenario in my previous blogs, and this will potentially impact any S/4 HANA Finance customer that is using the new account-based CO-PA. Fortunately, SAP has provided an easy solution to include almost any field from the FI document tables ACDOCA, BKPF, or BSEG to the respective Line Item Browsers, as well as any field from several of the associated master data tables like LFA1, KNA1, SKA1, etc.
Background
A little background first. With the new account-based CO-PA in S/4 HANA Finance, Operating Concern characteristics are included in the Universal Journal table ACDOCA. However, as described in SAP Note 2435383, SAP made a change so that CO-PA and other fields on ACDOCA are not automatically made available on the Line Item Browsers because there is a field limit on the HANA Views that are used with these transactions. So depending on your Support Package level of S/4 HANA, you may not see CO-PA or other fields from ACDOCA in the Line Item Browsers. Also, there are numerous master data fields from tables LFA1, KNA1, SKA1 etc. included in the Browser transactions, but not all fields from these tables are included out of the box.
Technique
There are two SAP Notes that should be read. Note 2435383 mentions the procedure for appending additional CO-PA fields from ACDOCA to the Line Item Browsers, but it gives few details. SAP Note 2321684, on the other hand, describes how to include additional master data fields in the Line Item Browsers, and contains good detail on how to do it. I will synthesize the information from both of those Notes in this blog
The concept will be familiar to anybody who has appended fields to the BW FI extractors. You simply append a Data Element with the appropriate name, to the appropriate Structure used in the Browser transaction, and the field is automatically filled from the underlying table with no ABAP coding required. Of course, for each Browser transaction you need to know for which database tables this will work, how you need to name the Date Elements, and what Structure you need to modify. I’ll go over all of these aspects.
According to the SAP Notes referenced above, and my own trial and error, here are the SAP tables for which fields can be automatically appended on each Browser transaction. My prototype development system was an S/4 HANA 1809 On Premise “Trial” system from the SAP Cloud Appliance Library, but I also validated all the dictionary structures against my company’s 1610 On Premise system as well.
Table 1
(I did not evaluate transaction KE5ZH, that transaction is not covered in this blog.)
The Data Element naming rules for additional fields are as follows:
- For document tables BKPF, ACDOCA, and BSEG, the Data Element name on the Structures should be identical to the field name on the underlying database table.
- For all master data tables, the Data Element name on the Structures should be prefixed with the table name, then an underscore, then the field name on the underlying database table (example as shown below: LFA1_KTOKK).
The final piece of information is understanding what Structures need to be modified. Notes 2435383 and 2321684 provide guidance in this regard, but I have found that the information in those Notes is either inaccurate or insufficient so I will attempt to clarify.
Each Browser transaction uses a HANA External View, which is based on a Structure. These Structures directly contain the various fields from the document tables, and in addition have several “Include” Structures corresponding to the various master data tables, one for each master data table that is relevant for that transaction. To append an additional field from the document tables, it is necessary to append the appropriate Main Structure(s) of the transaction, whereas to append a field from the master data tables it is necessary to append the corresponding Include Structure. I will outline the various Structures that need to be appended.
Table 2 below shows the possibilities for appending fields from the document tables BKPF, ACDOCA, and BSEG to the Browser transactions. I have found that fields from the document tables can only be successfully appended to FAGLL03H and FBL3H. This table shows the HANA External Views used by each of these Transactions, along with the Structures that must be appended, and the document tables from which fields can be appended to each transaction. Please note, I have found that for FAGLL03H and FBL3H, there are actually 2 Structures that needed to be appended in order to get these to work.
Table 2
Regarding the master data tables, each of the available tables has a corresponding “Include” Structure that is contained within one or more of the Main Structures used by the Browser transactions. It won’t work to append master data fields to the Main Structures, the fields must be appended to the correct corresponding Include Structure, and then the appended fields will automatically show in every Browser transaction that contains the Include Structure. The following Table 3 shows the master data tables that can be appended to the Browser transactions, the Include Structures corresponding to each table, and the transactions in which the appended fields will be displayed and can be used as dynamic selections. This information is taken from Note 2321684, except that
I have corrected the Structure names to agree with what I found in both my S/4 1610 and 1809 reference systems. I recommend referring to the explanation in Note 2321684 on why not all master data fields can be used as dynamic selections on the various Browser transactions (due to inner versus outer joins).
Table 3
Illustration
I will show two examples. The first example I will append a couple of CO-PA related fields from tables BKPF and ACDOCA that are not included in FAGLL03H, out of the box. The second example I will append field KTOKK from table LFA1 to Browser transactions FAGLL03H, FBL3H, and FBL1H. (This example was described in Note 2321684).
For the first example, I want to include fields CO_REFBT and CO_VRGNG from table BKPF, and fields CO_BELKZ and CO_BEKNZ from table ACDOCA, into transaction FAGLL03H. Since I am including fields from ACDOCA, Table 1 tells me that I will only be able to include them in transaction FAGLL03H, and to do so I need to append
both Structures SGLPOS_N_GL_CT
and SGLPOS_N_CT. So the first step is to create Append Structures on SGLPOS_N_GL_CT and SGLPOS_N_GL on which I specify the Date Elements for these 4 fields exactly as they are shown on the underlying base tables, as shown below. (The order of the fields is not important).
Append Structure on SGLPOS_N_GL_CT
Append Structure on SGLPOS_N_CT
To append KTOKK from table LFA1, I need to append Structure GLPOS_C_VEN_CT_LFA1, and according to the naming convention I name the Component LFA1_KTOKK. For the Component Type I match the Component Type for field KTOKK on LFA1, as shown below.
Append Structure on GLPOS_C_VEN_CT_LFA1
After creating the Append Structures, SAP Note 2435383 describes that you need to run transaction HDBVIEWS, and click “Generate All” (F8). The reason for this step is because the HANA External Views used by the Browsers must be regenerated to add the appended fields to the HANA Views. You MUST perform this step or the development won’t work.
Transaction HDBVIEWS
Once you have activated the External View with HDBVIEWS, the appended fields will be available to display on a Layout within the relevant Browser transactions. In my example, according to Table 1, I see the CO-PA fields only in transaction FAGLL03H, whereas I see field LFA1_KTOKK in FBL1H, FBL3H, and FAGLL03H.
Shown below is transaction FAGLL03H with the newer “Sidebar” display on the right, which is easier to use than the old “Choose Layout” function. Notice the appended fields for both CO-PA and LFA1 are available to display or add to a Layout.
FAGLL03H with appended document fields
FAGLL03H with appended master data field
Similarly, I see LFA1_KTOKK available in FBL1H and FBL3H, but not the CO-PA fields, as shown below.
FBL3H including LFA1_KTOKK
FBL1H including LFA1_KTOKK
Procedure for Dynamic Selections
If you want to use an appended field as a Dynamic Selection, additional steps are required. First of all, keep in mind the restrictions in Tables 2 and 3 on which tables can be used as dynamic selections on the various transactions (as described in Note 2321684). The CO-PA fields from ACDOCA and BKPF will only work as dynamic selections in FAGLL03H, whereas field LFA1_KTOKK will only work as a dynamic selection in FBL1H.
The fields that are visible for dynamic selections are controlled by Selection Views. There is a separate Selection View for each Line Item Browser transaction, and transaction HDBC is where you will find which Selection View is used on each transaction. I have highlighted the entries in HDBC that are relevant for each of the Browsers transactions, shown below, and circled the Selection View used by transaction FAGLL03H for illustration purposes.
Transaction HDBC showing Selection View for FAGLL03H
The following table shows the Selection View names that are configured in my prototype system in transaction HDBC.
Table 4
To modify a Selection View, follow the steps outlined in Note 2321684: use transaction SE80 to edit the Selection View, find the new appended field(s) and enter a Functional Group assignment in which to place the new selection field. The following screen print shows how I am modifying Selection View GLPOS_N_GL_CT, used by transaction FAGLL03H, to assign my CO-PA appended fields to Functional Group 99, Other Document Fields.
Modifying Selection View GLPOS_N_GL_CT
When the Selection View is saved, my appended fields appear in the Additional Restrictions popup in transaction FAGLL03H, shown below, under Other Document Fields.
FAGLL03H with appended fields under Additional Restrictions
Following the same procedures to modify Selection View GLPOS_C_VEN_CT and placing field LFA1_KTOKK under Functional Group “Selected Vendor Fields” will enable the field to be usable as a dynamic selection in FBL1H. The result is seen below.
FBL1H with appended field under Dynamic Selections
The final point I want to address in this blog is using the “Configure Fields” feature under transaction HDBC, shown below. This functionality is described in Note 1912066. The blog up to this point has covered how to
include fields into both the Layout display and dynamic selections. “Configure Fields” is where you can control what is
excluded from either the Layout display or dynamic selections for any of the Browser transactions.
Transaction HDBC, showing Configure Fields feature
When I click on “Configure Fields” in HDBC for the entry corresponding to transaction FAGLL03H and go into Change mode, it appears as below.
Notice the first two columns have check boxes, but some of the boxes in the second column are grayed out. The first column determines whether the field is available to display in a Layout, for that transaction. By default all fields are available to display, and when you append fields by the method described in this blog, by default they are also available to display. In this screen you can
exclude any fields from display in a Layout for that particular transaction.
The second column is where you can
exclude any fields as dynamic selections for that particular transaction. Notice that some boxes are grayed out here. This is because
those fields have not been included in the Selection View for this Browser transaction. When you append fields to the transaction, by default they will be grayed out as selection fields in here, until you add them to the Selection View as I described above.
Shown below are the 4 CO-PA fields I appended, notice they are not grayed out because I added them to the Selection View.
By contrast, I did not include LFA1_KTOKK in the Selection View for FAGLL03H (since Table 3 tells me I can’t), so notice below it is grayed out. So to reiterate, “Configure Fields” in HDBC is not where you enable dynamic selections it must be done with the Selection Views.
Final comments: SAP has provided a BADI, FAGL_LIB, in which you can develop your own logic for retrieving additional data into the Browser transactions, should the procedures described here not be sufficient. SAP has also provided an Implementation of this BADI that can be used to retrieve archived documents from the Archive Information System and include those documents in the transaction results. I plan to write another blog with instructions and recommendations on implementing this BADI.