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.




CRM Companies List
Web Based CRM Software


Complex Conditions in SAP Smartform with AND/OR

Every element in SAP Smartforms has a Conditions tab where Smartform developers can define conditions to run the Smartform element. Output Conditions is one of the most used conditions. This screen is just like the Node Conditions screen of Smartform Alternative element.

Smartform developer can define a condition which will print a text on SAP invoice. Or define a condition in Conditions tab for a Window element which will be printed on the last page. Some conditions require controlling of a variable against more than one value. Some require validation of more than one variable and these conditions are combined with each other using AND (default) or OR.

Smartform Alternative element can provide a decision tree for the developer. If Node conditions are met then TRUE path will be executed. Otherwise, if node conditions return FALSE then the FALSE path will be executed by Smartform function module.

Sometimes in SAP Smartform output documents, I was required to use AND, OR together. This is a little bit tricky since it is difficult to build a safe WHERE condition for that element.

The trick is using "(" and ")" within the Conditions lines.
Below developers can see a live example of complex conditions for a Smartform element.

building complex conditions in SAP Smartform
Complex Conditions records for Smartform element

Below code is showing how you can create complex conditions. Please note that conditions that are not combined using OR keyword are combined with AND keyword.

( ZVBDKA-AUART = 'ZWCN'
OR
ZVBDKA-AUART = 'ZWDN'
OR
ZVBDKA-AUART = 'ZWRE' )
GV_WAERS = 'EUR'
ZNAST-PARNR = GS_SKINV-PARTNER





SAP Tutorials

SAP Tutorial

SAP Forums

SAP Tools

SAP Transaction Codes Table






Related Articles and Tutorials(http://www.kodyaz.com/sap-abap/complex-conditions-in-sap-smartform.aspx)
Convert Smartform to PDF in Print Preview Mode
SAPScript Transaction Codes
Free Adobe LiveCycle Designer Download
Change Output Condition Records
Complex Conditions in SAP Smartform with AND/OR
Email Spool Request using SAPOffice - Spool to PDF
How to Debug SmartForms - Debugging SAP SmartForm in ABAP ?
SAP Invoice Output Determination Analysis for Not Created Output Message
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
Export SAP Data to Fixed Length Text File
SAP Invoice Output ZZZZ is not Defined
SAP Smartforms Tutorial - Table Calculations using Sum Total
Adobe Forms Table Header is Missing After Second Page
Message no XS826: Cannot process message; no node determined for 76550052
How to Spell Numbers using ABAP Spell_Amount Function Module
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
How to Disable Word Editor in SAP Smartform Text
Import and Export SO10 Standard Text using RSTXSCRP ABAP Program
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 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 - 2017 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems