cancel
Showing results for 
Search instead for 
Did you mean: 

How to suppress a blank line within an address block

Former Member
0 Kudos

We have this ongoing situation that has bubbled its way to the top and I need to find a way to solve it.  Any suggestions would be appreciated.

Some of our customer's addresses require a 2nd street address line, but most require only 1 line for the street address. We have set up our USA address format so that we use the "block" field as the 2nd address line.  The problem is that when the "block" field is blank, it leaves a blank line in the Address Block.  Is there a way to collaspe the address when one of the fields is blank?

I am using SBO 8.81 PL 10.  Most of my printed documents were built using Crystal Reports.

Randy Davis

Denver, CO

Accepted Solutions (0)

Answers (2)

Answers (2)

greg_stone
Explorer
0 Kudos

Hi Randy,

We had the same issue with our recently implemented 8.82. We also use ‘Block’ as the second address line.

Our consultant just added the following formula to the address boxes in the Crystal reports:

REPLACE({OINV.Address}, ChrW(13)+ChrW(13), ChrW(13))

It’ll still display a blank line if there is no Block field within SAP however will not print as long as you replace the two line breaks with just the
one as per above code.

Kind regards,

Greg

BattleshipCobra
Contributor
0 Kudos

I hope you don't mind Greg I found your code very useful and I expanded it into a how-to article.

http://www.tellme747.com/?p=903

greg_stone
Explorer
0 Kudos

I don't mind at all. However I can't take all the credit, it was given to me by my implementation consultants at Evolution Future Solutions

BattleshipCobra
Contributor
0 Kudos

The updates link is located here.  I still use this trick and it works great:

http://www.battleshipcobra.com/2013/sap-business-one-crystal-reports-address-fix/

Former Member
0 Kudos

Hi

You can create a formula like :

stringvar Address :="";

if (Not(ISNULL({tablename.field1})) AND {tablename.field1} <>"")

THEN Address : = {tablename.field1} + " " + CHRW(13);

if (Not(ISNULL({tablename.field2})) AND {tablename.field2} <>"")

THEN Address : = Address + {tablename.field2} + " " + CHRW(13);

if (Not(ISNULL({tablename.field3})) AND {tablename.field3} <>"")

THEN Address : = Address + {tablename.field3} + " " + CHRW(13);

if (Not(ISNULL({tablename.field4})) AND {tablename.field4} <>"")

THEN Address : = Address + {tablename.field4}

Address;

Regards

Former Member

Pari, thank you for your reply.

I thought about writing a similar formula.  However, we have several country formats and the resulting formula would be unmanageable.

I was hoping that SAP would have figured this out by now.  Anyone else know of any other solution?