SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SAP ABAP Programming and HANA Database Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.




Install SAP Free




SAP Smartforms Table for Sales Order and Invoice Outputs


Smartforms table is used to display a list of data table rows on SAP Smartforms output documents.
These data rows are generally Sales Order items for a Sales Order Confirmation output. Or item lines for a SAP Sales Invoice document.

In this Smart Forms tutorial we'll display invoice data from SAP Sales Invoice table VBRK and VBRP, and sales order data from SAP Sales Order table VBAK and VBAP

Just as seen in below SAP Smartform structure, a Smartform table has Header section, Main Area section and Footer section.
In general, header section is used to display table column headers.
Main area is used for listing table item lines.
The footer is generally used for subtotals.

SAP Smartforms table for sales order output





SAP Sales Order Confirmation Order Items Table

In a Sales Order Confirmation Smartform output, there is a table parameter named ZTVBDPA which imports Sales Order items. The ZTVBDPA view has the structure VBDPA - Document Item View for Inquiries,Quotation,Order
In the Smartform, in Main window section, Smartform developers can add a Table and display order items using this Smartforms table.

Create the following field symbol definition in Global Definitions > Field Symbols tab.

<FS> TYPE VBDPA

SAP Smartforms field symbols

Then goto Main window where you want to display sales order details as a table.
Right click on the window node, select Create > Table menu options.

create table in SAP Smartforms window

Goto Data tab.
In the first line, write the internal table ZTVBDPA which stores table data.
Then choose A ASSIGNING from dropdown list since we will be using a field symbol variable <FS> for this SAP Smartforms tutorial.

SAP Smartforms table data definition

This definition is equal to following ABAP report example in function.

DATA ZTVBDPA TYPE TABLE OF VBDPA.
FIELD-SYMBOLS <FS> TYPE VBDPA.

LOOP AT ZTVBDPA ASSIGNING <FS>.
* ABAP Code
ENDLOOP.

Then using Table Painter and Details buton on Table tab, row types can be defined which will be used within Smartforms table.

Then to display POSNR position number of a sales order item, <FS>-POSNR can be used.
In oder to show the order item material number, <FS>-MATNR can be used.


SAP Sales Invoice Items Table

For a Sales Invoice SAP Smartform output, all invoice data is transferred from Smartform print program to the SAP Smartforms using import variable named IS_BIL_INVOICE
IS_BIL_INVOICE is defined using the LBBIL_INVOICE (Billing Data: Transfer Structure to Smart Forms) structure type.
IT_GEN component of the LBBIL_INVOICE stores Billing Item: General Data details which is used as base table to display invoice items on a SAP Smartforms document.

Here is how invoice items table Data tab can be configured to list Sales invoice items.

SAP Smartforms invoice items table data from VBRP

Smartform developers can create GS_IT_GEN structure in Global Definitions > Global Data tab as follows.

GS_IT_GEN TYPE LBBIL_IT_GEN

lbbil_it_gen structure in SAP Smartforms global data

The table data definition creates ABAP code similar to shown below.

DATA :
 GS_IT_GEN TYPE LBBIL_IT_GEN,
 IS_BIL_INVOICE TYPE LBBIL_INVOICE.

LOOP AT IS_BIL_INVOICE-IT_GEN INTO GS_IT_GEN.
* ABAP Code
ENDLOOP.

SAP Smartforms Table Tips

ABAP developers can use Smartform Folder control to keep together a group of lines.
For example, for a sales order item or for an invoice item you want to display 3 lines of data.
But it is important to keep together these three lines on the same page.
This is not easy if Smartforms Folder control is not used.
Insert a Folder structure into the Table Main Area, move the item lines into the Folder control.

folder control in Smartforms table

Then the trick is to mark the checkbox Page Protection as seen in the below screenshot.

SAP Smartforms folder page protection







SAP Resources

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table






Related Articles and Tutorials(http://www.kodyaz.com/articles/sap-smartforms-table-for-sales-order-and-invoice-outputs.aspx)
Complete List of SAP Modules
SAPScript Transaction Codes
Change Output Condition Records
Email Spool Request using SAPOffice - Spool to PDF
Sales Tables among ABAP Tables (SAP Sales and Distribution SD Tables)
How to Debug SmartForms - Debugging SAP SmartForm in ABAP ?
SAP Invoice Output Determination Analysis for Not Created Output Message
SAP Payment Terms Table and ZTERM Texts Table for ABAP Developers
SAP Smartforms - How to Call Smartform within ABAP Program
SAP Smartforms Table for Sales Order and Invoice Outputs
SAP Smartforms Tutorial - How to Create Smartform
SAP Smartforms Tutorial - Create Smartforms Example
SAP Smartforms Tutorial - Table Calculations using Count
SAP Smartforms Tutorial - Table Calculations using Sum Total
Adobe Forms Table Header is Missing After Second Page
Free Adobe LiveCycle Designer Download
Assign SAP Item Category to Sales Document Type using SPRO
Message no XS826: Cannot process message; no node determined for 76550052
Complex Conditions in SAP Smartform with AND/OR
How to Spell Numbers using ABAP Spell_Amount Function Module
Convert Smartform to PDF in Print Preview Mode
Create Sales Order, Delivery and Billing Document in SAP
Delete Entries in NAST Table using RSCLNAST ABAP Program
How to Export IDOC as Excel and Save as Local File from WE02 Transaction
Export SAP Spool Requests as PDF using SP01 Transaction
How to Find Output Determination Procedure for a Billing Document
Export SAP Data to Fixed Length Text File
How to Disable Word Editor in SAP Smartform Text
Import and Export SO10 Standard Text using RSTXSCRP ABAP Program
Invoice Split due to Manual Invoice Maintenance Check on Sales Order
Invoice Output fail because of missing Billing Type text in TVFKT table
Move Minus Sign from Right to Left of Negative Number in SAP Smartform
Print SAP Outputs From Two Printers at the Same Time
Get Proforma Invoice from Commercial Invoice in ABAP
SAP VKM3 to Release Sales Order from Credit Block
Get SAP Document Flow using SD_DOCUMENT_FLOW_GET ABAP Function Module
SAP Invoice Output ZZZZ is not Defined
SAP Output Management - Create New SAP Output Type
SAP Purchase Order Tables, Transaction Codes and Output
Graphics White Background Displayed Grey on SAP Smartform Output
SE63 Smartform Translation and Export using SLXT Program
SAP Smartform Runtime Error CX_SY_CONVERSION_NO_NUMBER
Window MAIN does not fit onto page PAGE (height)
SAP Smartforms Table Parameter in Form Routine
Trigger Output Re-Determination for Billing Documents
VF31 SAP Transaction to Reprocess Billing Output Messages
Web DynPro Tutorial - Display Spool Requests using Web DynPro Table


Copyright © 2004 - 2018 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems