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 Kodyaz SAP and ABAP Programming Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Vista, etc.




Win FREE BOOK
from Kodyaz



CRM Companies List
Web Based CRM Software



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






SAP Tutorial and ABAP Tutorials (including Web Dynpro and Smartforms)

Unicode Character Problem in IFS File Interface
Read Pricing Condition Text using ABAP in SAP Sales Document Output
Export SAP Data to Fixed Length Text File
Export Table Contents into Text File and Download File
Business Document Service Error: Error when accessing graphic (BDS), RC = 5
Get Proforma Invoice from Commercial Invoice in ABAP
Convert Sales Unit into Text using Function Module in Target Language
Get Fullname of SAP user using Function Module in ABAP Program
ABAP Submit Report to Run Another ABAP Program within Code
Message no XS826: Cannot process message; no node determined for 76550052
SE63 Smartform Translation and Export using SLXT Program
VF31 SAP Transaction to Reprocess Billing Output Messages
Import and Export SO10 Standard Text using RSTXSCRP ABAP Program
CALL_FUNCTION_NOT_FOUND ABAP Run Time Error
SAP Output Management - Create New SAP Output Type
SAP Purchase Order Tables, Transaction Codes and Output
Assign SAP Item Category to Sales Document Type using SPRO
Window MAIN does not fit onto page PAGE (height)
SAP Invoice Output ZZZZ is not Defined
Invoice Output fail because of missing Billing Type text in TVFKT table
Read Integer and Decimals of a Numeric Value in ABAP Programming
SAP Smartforms Table Parameter in Form Routine
Complex Conditions in SAP Smartform with AND/OR
Free Adobe LiveCycle Designer Download
Create SAP Dynamic Variant using Date Calculation
Translate Web Dynpro Header Title displayed on Web Browser
ABAP RegEx for ABAP Regular Expression to fetch Date from String
Change Output Condition Records
Web Dynpro Text Translation using Assistance Class
Move Minus Sign from Right to Left of Negative Number in SAP Smartform
Read Address Data using FM ADDR_GET instead of Querying ADRC Table
Add Value Help to Web Dynpro Select Options
Add Web Dynpro Applications to SAP Favorites Menu
Component Usage ALV Does Not Have an Active Component
Web Dynpro Component Service Syntax Error in Program /1BCWDY/O3EC1AX6A3OVKK9L5FXO==CP
Web DynPro Tutorial - Display Spool Requests using Web DynPro Table
Web DynPro Tutorial - How to create Web Dynpro Application (Web Dynpro Component)
Display Data on Web DynPro Table Element
Test Web Dynpro ABAP Component by Creating Web Dynpro Application
Graphics White Background Displayed Grey on SAP Smartform Output
Get SAP Document Flow using SD_DOCUMENT_FLOW_GET ABAP Function Module
How to Spell Numbers using ABAP Spell_Amount Function Module
How to Transport SAP Graphics using SE78 Transaction
How to Delete Standard Text using SO10 SAP Transaction
Dynamic Programming using Field Symbols in ABAP Reports
How to Disable Word Editor in SAP Smartform Text
How to Debug Popup Screen in ABAP
TVAP Item Category and SAP Table TVAPT for Text Translations
ABAP Runtime Error ST22 Transaction using Short Dump Analysis
Create Transport Request for Text Translations using RS_LXE_RECORD_TORDER
SAP Invoice Output Determination Analysis for Not Created Output Message
Set Default Single Values List for SAP Selection Screen Parameter
SAP Payment Terms Table and ZTERM Texts Table for ABAP Developers
How to Create SAPScript Text using SO10 Transaction Code
SAP Smartforms Tutorial - Table Calculations using Sum Total
SAP Smartforms Tutorial - Table Calculations using Count
SAP Smartforms Tutorial - How to Create Smartform
SAP NetWeaver Installation Guide using installshield wizard
SAP Smartforms Table for Sales Order and Invoice Outputs
Email Spool Request using SAPOffice - Spool to PDF
How to Display SAP Graphics using SE78 Transaction Code
SAPScript Transaction Codes
ABAP Tutorial - ABAP String Split Example Code
Sales Tables among ABAP Tables (SAP Sales and Distribution SD Tables)
How to Upload Data to SAP from Excel File using alsm_excel_to_internal_table Function Module
ALV Grid Color - Table Row Background Color in ALV List
Multi Color ALV Grid Color Alternate using ALV Layout info_fname Property
How to Debug SmartForms - Debugging SAP SmartForm in ABAP ?
ABAP - Create Hierarchy Tree List using rs_tree_construct, rs_tree_list_display and snodetext
Create CL_GUI_ALV_GRID ALV Grid Column Header using ABAP Data Element
ABAP Tutorial - SAP Split and ABAP Split String Function
Upload Data from Excel File in ABAP using TEXT_CONVERT_XLS_TO_SAP
SAP Tutorial - Convert Spool Request to PDF File using RSTXPDFT4 ABAP Report
SAP ABAP Tutorial - ALV Grid Example with cl_gui_alv_grid and Screen Painter
Convert Smartform to PDF in Print Preview Mode
SAP Smartforms Tutorial - Create Smartforms Example
SAP Smartforms - How to Call Smartform within ABAP Program
Complete List of SAP Modules






Copyright © 2004 - 2013 Eralper Yilmaz. All rights reserved.
Community Server by Telligent Systems