SQL Server administration and T-SQL development, Web Programming with ASP.NET and Javascript, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software Kodyaz SAP and ABAP Programming Resources
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



Display Sales Invoice Due Date on SAP Smartform Output using NET_DUE_DATE_GET Function Module


On a SAP Smarform document for SAP Sales output, I had to display due date information. When I checked sample Smartform documents I see that using ABAP function module FI_FIND_PAYMENT_CONDITIONS and NET_DUE_DATE_GET, ABAP developers can get due date information on to the SAP Smartform invoice output easily.

FI_FIND_PAYMENT_CONDITIONS is used to determine cash discount using ZTERM and document, posting, CPU, base date
The required input parameters are terms of payment key, document date, posting date.
Optional parameters are system date, base date, function class from transaction control, etc.

Export parameters of the ABAP function module fi_find_payment_conditions is payment terms work area, calculated base date and cash discount.

data :
 lt_sklin type SKLIN ,
 lv_zfbdt type BSEG-ZFBDT,
 lv_FAEDT type RFPOS-FAEDT,
 lv_zbd1t type BSID-ZBD1T,
 lv_ZBD2T type BSID-ZBD2T,
 lv_ZBD3T type BSID-ZBD3T.

call function 'FI_FIND_PAYMENT_CONDITIONS'
EXPORTING
 i_zterm = IS_BIL_INVOICE-HD_GEN-TERMS_PAYM
 i_bldat = IS_BIL_INVOICE-HD_GEN-BIL_DATE
 i_budat = IS_BIL_INVOICE-HD_GEN-BIL_EDATE
 I_CPUDT = SY-DATLO
IMPORTING
* E_T052 =
 E_ZFBDT = lv_zfbdt " Calculated base date, for example 20080717
 E_SKLIN = lt_sklin
* E_XSPLT =
EXCEPTIONS
 TERMS_INCORRECT = 1
 TERMS_NOT_FOUND = 2
 NO_DATE_ENTERED = 3
 NO_DAY_LIMIT_FOUND = 4
 OTHERS = 5

As seen in below ABAP debug screenshot during Smartform execution, the ZTAG1 cash discount days returns 15 days.

abap-internal-table-lt_sklin-for-payment-conditions





NET_DUE_DATE_GET ABAP function module calculates the due date based on the relevant sales invoice information.

lv_zbd1t = lt_sklin-ZTAG1.
lv_ZBD2T = lt_sklin-ZTAG2.
lv_ZBD3T = lt_sklin-ZTAG3.

call function 'NET_DUE_DATE_GET'
EXPORTING
 i_zfbdt = lv_zfbdt " 20080717
 i_zbd1t = lv_zbd1t " Cash discount days 1, for example 015
 i_zbd2t = lv_ZBD2T " Cash discount days 2, for example 000
 i_zbd3t = lv_ZBD3T " Net Payment Terms Period, ie. 000
 i_shkzg = 'S' " Debit/Credit Indicator: H Credit and S Debit
 i_rebzg = 'X' " Number of the Invoice the Transaction Belongs to
 I_KOART = 'D' " Account type
IMPORTING
 E_FAEDT = lv_FAEDT " Net Due Date

Possible account types used in SAP are listed below under KOART data type:

KOART Account type
A Assets
D Customers
K Vendors
M Material
S G/L accounts

And the sample NET_DUE_DATE_GET ABAP function module call resulted with the due date variable lv_FAEDT as follows :

lv_FAEDT = 20080801







SAP Resources

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table






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

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
SAP Smartforms Tutorial - Create Smartforms Example
SAP Smartforms - How to Call Smartform within ABAP Program
Complete List of SAP Modules






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