Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

IF Else If Statement

HOw do you string two if statements together. Here is what I am looking at and getting a road block

whileprintingrecords;

if {TPHASE.DF_DATE}= #1/31/2006 12:00AM# or

{TPHASE.DF_DATE}= #2/28/2007 12:00AM# or

{TPHASE.DF_DATE}= #3/31/2007 12:00AM# or

{TPHASE.DF_DATE}= #4/30/2007 12:00AM# or

{TPHASE.DF_DATE}= #5/31/2007 12:00AM# or

{TPHASE.DF_DATE}= #6/30/2007 12:00AM# or

{TPHASE.DF_DATE}= #7/31/2007 12:00AM# or

{TPHASE.DF_DATE}= #8/31/2007 12:00AM# or

{TPHASE.DF_DATE}= #9/30/2007 12:00AM# or

{TPHASE.DF_DATE}= #10/31/2007 12:00AM# or

{TPHASE.DF_DATE}= #11/30/2007 12:00AM# or

{TPHASE.DF_DATE}= #12/31/2007 12:00AM# then

numbervar escalation;

escalation:= escalation+({#ActiveProjDet}/1.035);

else

If {TPHASE.DF_DATE}= #1/31/2008 12:00AM# or

{TPHASE.DF_DATE}= #2/28/2008 12:00AM# or

{TPHASE.DF_DATE}= #3/31/2008 12:00AM# or

{TPHASE.DF_DATE}= #4/30/2008 12:00AM# or

{TPHASE.DF_DATE}= #5/31/2008 12:00AM# or

{TPHASE.DF_DATE}= #6/30/2008 12:00AM# or

{TPHASE.DF_DATE}= #7/31/2008 12:00AM# or

{TPHASE.DF_DATE}= #8/31/2008 12:00AM# or

{TPHASE.DF_DATE}= #9/30/2008 12:00AM# or

{TPHASE.DF_DATE}= #10/31/2008 12:00AM# or

{TPHASE.DF_DATE}= #11/30/2008 12:00AM# or

{TPHASE.DF_DATE}= #12/31/2008 12:00AM# then

numbervar escalation;

escalation:= escalation+({#ActiveProjDet}/1.071);

How do I properly string together if statements

replied

Try it this way:

numbervar escalation;
if {TPHASE.DF_DATE}= #1/31/2006 12:00AM# or
{TPHASE.DF_DATE}= #2/28/2007 12:00AM# or
{TPHASE.DF_DATE}= #3/31/2007 12:00AM# or
{TPHASE.DF_DATE}= #4/30/2007 12:00AM# or
{TPHASE.DF_DATE}= #5/31/2007 12:00AM# or
{TPHASE.DF_DATE}= #6/30/2007 12:00AM# or
{TPHASE.DF_DATE}= #7/31/2007 12:00AM# or
{TPHASE.DF_DATE}= #8/31/2007 12:00AM# or
{TPHASE.DF_DATE}= #9/30/2007 12:00AM# or
{TPHASE.DF_DATE}= #10/31/2007 12:00AM# or
{TPHASE.DF_DATE}= #11/30/2007 12:00AM# or
{TPHASE.DF_DATE}= #12/31/2007 12:00AM# then
escalation:= escalation+({#ActiveProjDet}/1.035)
else
If {TPHASE.DF_DATE}= #1/31/2008 12:00AM# or
{TPHASE.DF_DATE}= #2/28/2008 12:00AM# or
{TPHASE.DF_DATE}= #3/31/2008 12:00AM# or
{TPHASE.DF_DATE}= #4/30/2008 12:00AM# or
{TPHASE.DF_DATE}= #5/31/2008 12:00AM# or
{TPHASE.DF_DATE}= #6/30/2008 12:00AM# or
{TPHASE.DF_DATE}= #7/31/2008 12:00AM# or
{TPHASE.DF_DATE}= #8/31/2008 12:00AM# or
{TPHASE.DF_DATE}= #9/30/2008 12:00AM# or
{TPHASE.DF_DATE}= #10/31/2008 12:00AM# or
{TPHASE.DF_DATE}= #11/30/2008 12:00AM# or
{TPHASE.DF_DATE}= #12/31/2008 12:00AM# then
escalation:= escalation+({#ActiveProjDet}/1.071);

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question