Friday, 3 November 2023

Traceability Text in VF03 T-code & also on reports FBL5N & FBL3N

Introduction


Requirement: To enhance the functionality of text which is maintained during sales order creation ( VA01 ) under item level. When we pass the sales order ID in ( VF01 ) Billing document is generated. Please check the below screen shot.

SAP ABAP Career, SAP ABAP Guides, SAP ABAP Prep, SAP ABAP Tutorial and Materials, SAP ABAP Prep, SAP ABAP Preparation

When we double click on item 1 in the above screen shot. We get the below screen, please check the below screen shot. In this there is a provision for maintenance of item text under item text tab.

SAP ABAP Career, SAP ABAP Guides, SAP ABAP Prep, SAP ABAP Tutorial and Materials, SAP ABAP Prep, SAP ABAP Preparation

After maintaining the text and user clicks on accounting button as you can see from the above screen shot. A pop up appears as shown.

SAP ABAP Career, SAP ABAP Guides, SAP ABAP Prep, SAP ABAP Tutorial and Materials, SAP ABAP Prep, SAP ABAP Preparation

Now double click on accounting document which is highlighted in the above image. The following screen appears as shown.

SAP ABAP Career, SAP ABAP Guides, SAP ABAP Prep, SAP ABAP Tutorial and Materials, SAP ABAP Prep, SAP ABAP Preparation

Now double click on item level which is highlighted in the above image. The following screen appears as shown.

SAP ABAP Career, SAP ABAP Guides, SAP ABAP Prep, SAP ABAP Tutorial and Materials, SAP ABAP Prep, SAP ABAP Preparation

In the above screen shot, there is an area which is highlighted for the text ( field ) to be maintained which is empty as of now. The text whichever is maintained in the item texts tab under item level of invoice need to appear in the highlighted area of the text( field ).

To achieve the above requirement, I have followed the below steps.

Steps:

1. Firstly, we need to find the function exit to enhance the functionality.

2. I have identified the function exit by placing the external break point in the exit and name of the function exit is EXIT_SAPLV60B_008. Please refer to the below screenshot.

SAP ABAP Career, SAP ABAP Guides, SAP ABAP Prep, SAP ABAP Tutorial and Materials, SAP ABAP Prep, SAP ABAP Preparation

3. Maintain the logic in the highlighted include zxvvfu08 from the above screenshot.

4. The logic for the traceability text is shown below.

SAP ABAP Career, SAP ABAP Guides, SAP ABAP Prep, SAP ABAP Tutorial and Materials, SAP ABAP Prep, SAP ABAP Preparation

SAP ABAP Career, SAP ABAP Guides, SAP ABAP Prep, SAP ABAP Tutorial and Materials, SAP ABAP Prep, SAP ABAP Preparation

5. Call the FM : READ_TEXT. Fill the required parameters, Refer to the below screenshot.

SAP ABAP Career, SAP ABAP Guides, SAP ABAP Prep, SAP ABAP Tutorial and Materials, SAP ABAP Prep, SAP ABAP Preparation

SAP ABAP Career, SAP ABAP Guides, SAP ABAP Prep, SAP ABAP Tutorial and Materials, SAP ABAP Prep, SAP ABAP Preparation

6. From the above FM the text is captured into internal table ( lines[] ). Finally, this internal table is looped accordingly and the text is captured in structure xaccit and the field name is sgtxt. This ( sgtxt ) field refers to text ( field ) in VF03 T-code.

Result:

◉ The text is captured which is maintained under item texts tab in item level of sales order billing doc into item level of accounting document which is shown in the below highlighted text ( field ) in screen shot.

SAP ABAP Career, SAP ABAP Guides, SAP ABAP Prep, SAP ABAP Tutorial and Materials, SAP ABAP Prep, SAP ABAP Preparation

◉ The same text is also enhanced into the reports of FBL5N & FBL3N with no additional code. Please check the below screen shot.

SAP ABAP Career, SAP ABAP Guides, SAP ABAP Prep, SAP ABAP Tutorial and Materials, SAP ABAP Prep, SAP ABAP Preparation

SAP ABAP Career, SAP ABAP Guides, SAP ABAP Prep, SAP ABAP Tutorial and Materials, SAP ABAP Prep, SAP ABAP Preparation

No comments:

Post a Comment