Enhancing SAP standard transactions FBL3NFBL1NFBL5N with extra fields

作者:郑德鼎 约 5 分钟阅读 更新日期:2024-02-22 2 年前更新 标签:ABAP, Basis, CO, FI, MM, SD, 开发, 物料管理, 系统管理, 财务, 销售分销
目录

Technical Articles

Brian Atkinson

Posted onJanuary 4, 2019 3 minute read

5 Easy Steps to Add New Line Item Fields to FBL1N

FollowRSS feedLike

6 Likes 5,808 Views 1 Comment

Introduction

A common request from users of FBL1N (Vendor Line Items) is to include additional columns of data in the “Column Set” that can be selected when creating or maintaining a line layout variant. These requests come when neither the base list nor the special fields list have the data needed; i.e., user needs data from another table.

FBL1N – Vendor Line Items (Accounting > Financial Accounting > Accounts Payable > Account)

This blog outlines five easy steps to add fields to structure RFPOSXEXT; thus, adding to the list of fields available in the line layout variants of FBL1N (Vendor Line Items), FLB3N* (G/L Line Items), and FBL5N (Customer Line Items). In addition, the blog shows how to use a BAdI to populate these additional fields with data. This is my preferred method. There are other ways to accomplish the same; namely via a Business Transaction Event (BTE). If you would like to review the BTE approach, then an example is provided in blog “Vendor code addition in FBL3N report using Business Transaction Events (BTE).” There is also a video from Lukman Hakim on the BTE approach: “SAP ABAP : Adding Fields to Transaction FBL1N , FBL3N & FBL5N.”

As you read this, keep in mind that RFPOSX (Line Item Data) is the base structure for line items in transactions FBL1N, FBL3N, and FBL5N. Between RFPOSX and the table entries in T021S (Line Layout Variant Special Fields), structure RFPOSXEXT is generated. RFPOSXEXT is used for displaying line items in these transactions.

• Important FBL3N note: Most companies are using the New GL. In that case, GL account line item display would be done via transaction FAGLL03, not FBL3N. Click here to read documentation on adding fields to FAGLL03.

The below example will demonstrate adding Vendor Name to the Layout Column Set, and then populating it with data from LFA1 (Vendor Master) via a BAdI when Tcode FBL1N is used.

Intended Audience

SAP Business Analyst, Configuration Specialist, ABAP Programmer

Prerequisites

For some good background, please read the following OSS Notes

984305 – Line item: Definition of special fields (T021S)

1323512 – Line items: BADI FI_ITEMS_CH_DATA

Steps

Step 1: Add Append Structure to RFPOSX structure

Go to Tcode SE11

Enter structure RFPOSX

Click on Display button

Click on Append Structure button

Click on Create icon

Provide an Append Name; e.g., ZZADD_FIELDS

Click Continue icon

Add Component(s). In this example, just one… ZVEND_NAME.

Save and Activate

Step 2: Extend structure RFPOSXEXT

Go to Tcode SA38 or SE38

Execute program RFPOSXEXTEND

Click Yes button to extend the structure

Confirm the extension worked

Go to Tcode SE11

Enter structure RFPOSXEXT

Click on Display button

Search for Component ZVEND_NAME

Once Step 2 is complete, “Vendor Name 1” will now be visible in the layout Column Set; however, even if added to the screen, no data will appear. Steps 3 and 4 are required to populate the ZVEND_NAME field with data.

Step 3: Create an implementation of FI_ITEMS_CH_DATA

Go to Tcode SE18

Menu > Enhancement Implementation > Create

Add Name of enhancement

Add Short Text

Save/Activate

Step 4: Add code to CHANGE_ITEMS method

Step 5: Update layout(s) in FBL1N to include “Vendor Name 1”

Go to transaction FBL1N

Execute report

Create or update layout to include “Vendor Name 1”

Save

“Vendor Name” now appears in the report

Conclusion

If fields from tables other than what can be provided by the Special Fields table (T021S) are needed in FBL1N, then the above steps are simpler and easier than a BTE (in my opinion). As mentioned above, these steps can also be carried out for FBL5N. The steps can also be used for FBL3N if you are not yet using the New GL; otherwise, follow the link above for changing FAGLL03.

Let me know if you liked this blog, and please reply with questions and comments. Thank you.

Former Member

Posted onAugust 30, 2012 4 minute read

Enhancing SAP standard transactions FBL3N/FBL1N/FBL5N with extra fields in the output list via BTE

FollowRSS feedLike

15 Likes 58,504 Views 3 Comments

This blog talks about how to add some extra fields like Vendor Number, Customer Number, separate fields for credit & debit indicators and opening balance , closing balance per posting date wise in the output screen of SAP standard transactions FBL3N/FBL1N/FBL5N.

Solution: We can use openFI 1650 (BTE) to add any fields to ALV output list in FBL3N/FBL1N/FBL5N at the same time.

SAP has already provided the place for Open FI BTE (1650) in the standard program that will trigger the custom function module assigned to the event 1650 in FIBF T-code.

FBL3N:  G/L Account Line Item Display

FBL1N:  Vendor Line Item Display

FBL5N:  Customer Line Item Display

Step 1: Create all required fields using append structure in structures RFPOS, RFPOSX

Step 2: Create a custom function module by copying the same interface parameters of FM SAMPLE_INTERFACE_00001650.

Step 3: Write the logic to populate the extra fields inside this custom function module as per your requirement.

FUNCTION zfi_fm_fbl3n.

*”———————————————————————-

*”*”Local Interface

*”  IMPORTING

*”     VALUE(I_POSTAB) LIKE  RFPOS STRUCTURE  RFPOS

*”  EXPORTING

*”     VALUE(E_POSTAB) LIKE  RFPOS STRUCTURE  RFPOS

*”———————————————————————-

*& Function Module Name :   ZFI_FM_FBL3N

*& Module                        :   FI

*& Functional Consultant 

*& Author Name :                 Manoj Kumar Pradhan

*& Date Of Creation         :    24/07/2012

*& Description                 :    This fm populates values for additional fields

*                                         like vendor,customer, separate fields for debit & credit

*                                         indicator which will be displayed in FBL3N/FBL1N/FBL5N

*                                         output list.

*

*                                        It triggers from T-codes FBL3N/FBL1N/FBL5N

*                                        for BTE event 00001650 & configured

*                                        in FIBF T-code for customer products Z1650 for the event 00001650.

*& Transport Request    

*& Tcode                 :  NA

***** Data Declaration***************

DATA : e_fiscal_yr           TYPE bapi0002_4-fiscal_year,

e_period              TYPE bapi0002_4-fiscal_period,

e_prev_period         TYPE bapi0002_4-fiscal_period,

e_ret                 TYPE bapireturn1,

e_first_day_of_period TYPE bapi0002_4-posting_date,

lf_prev_day_of_post_date TYPE budat,

e_ret2                TYPE bapireturn1,

e_ret3                TYPE bapireturn,

e_ret4                TYPE bapireturn,

lf_sum_dmbtr          TYPE dmbtr,

lf_sum_dmbtr_k        TYPE dmbtr,

lf_sum_dmbtr_d        TYPE dmbtr.

e_postab = i_postab.

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 <> ” ).

IF i_postab-shkzg = ‘S’.

e_postab-zzdeb_ind = ‘S’.

ELSEIF i_postab-shkzg = ‘H’.

e_postab-zzcr_ind = ‘H’.

ENDIF.

Step 4: Activate Open FI: t-CODE – FIBF & Create product of a customer by inputting product name, text & activate the same.

Step 5: Create P/S MODULES of a customer in FIBF and assign custom function module to event 1650 & product.

Step 6: Finally run standard program RFPOSXEXTEND to regenerate structure & run program BALVBUFDEL to clear ALV.

Note: These two programs can only be run by user who has admin authority. Contact Basis user or IT administrator for assistance

After the completion of the above steps, we will be able to view these extra fields on execution of T-codes FBL3N/FBL1N/FBL5N.

Alert Moderator

Assigned tags

Related Blog Posts

Related Questions

3 Comments

You must be Logged on to comment or reply to a post.

Bhakti joshi

October 12, 2012 at 7:20 am

hello Manoj

thank you very much for your blog

kindly provide some help/comments for my issue

1 – i followed sapnote 112312, but i cudnt see the new field in change layot section of fbl5n

2 – i read yr blog and did 3 extra things – enhance RFPOSX, run the two std reports

3 – i can now see the field in change layout and i can include it in the fbl5n , but its not getting populated. by BTE is getting called and i have directly hardcoded ‘X’ value to myfield

i checked in debug

could you please let me know what could be the reason ?

thank you in advance

Bhakti Joshi

Like(0)

Former Member

October 13, 2012 at 6:01 am

Hi Manoj,

Good one.

Hi Bhakti,

i have directly hardcoded ‘X’ value to myfield.You just raise a new thread  if possible.

Can you explain this.

Regards,

Madhu.

Like(0)

Bhakti joshi

October 15, 2012 at 6:09 am

I have hardcoded the new field = X in the BTE

this BTE is called in debug when I run FBL5N

I have raised new thrd http://scn.sap.com/message/13589273#13589273

thanks

Like(0)

郑德鼎

关于作者:郑德鼎

企业信息化与 SAP 技术顾问,长期专注 SAP ABAP、FI/CO、MM、SD 等模块的技术分享与实战经验总结。查看更多介绍

来源说明:本文内容由「Enhancing SAP standard transactions FBL3NFBL1NFBL5N with extra fields.docx」整理生成,仅用于内部技术分享与学习交流。