cancel
Showing results for 
Search instead for 
Did you mean: 

Making Address Line2 optional when printing - avoid printing blank line

Former Member
0 Kudos

Alright I am printing an address on my form as so...

&Name

&Street Address1&

&Street Address2&

&City&, &State& &Zip&

Street Address2 is seldom used and populated. So if it is left blank or initial, I don't want it to print a blank line there.

This is what I get when Street Address2 is empty:

John Doe

9322 Circle Street

New York, NY 99911

Thanks,

Brett

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

If you need to elimate the space when the field is empty u can do it in the following ways.

Smartforms :

In case of smartforms use a where condition and make the branches like this &Street Address2& = Initial.


&Name
&Street Address1&
&City&, &State& &Zip&

and the another branch shoule be &Street Address2& not Initial.


&Name
&Street Address1&
&Street Address2&
&City&, &State& &Zip&

If its case of script u can make it like this.

using the text editor make and if conditiion

if &Street Address2& is initial.

&Name

&Street Address1&

&City&, &State& &Zip&

else.

&Name

&Street Address1&

&Street Address2&

&City&, &State& &Zip&

endif.

This will surely works for u.

Cheers,

Joe.

Former Member
0 Kudos

Hi Brett,

one easy way and a standard way to display address is use

😕 ADDRESS

😕 ENDADDRESS

or please refer to the wiki

[https://wiki.sdn.sap.com/wiki/display/Snippets/Mass%20Address%20or%20Label%20Printing%20in%20SMARTFORMS]

or

[]

in the line editor of the samrtform and just pass the address number from your internal table to the form.

i hope u got the idea !!!

Best Of Luck !!!

Regards

Ravi

Former Member
0 Kudos

Try this :

if not street_address2 is initial.

print street address2.

else.

print city.

Former Member
0 Kudos

In Paragraph Format of SAP Script (inside standard tab) there is an check-box "No Blank Lines". Use the same to ensure no blank lines is printed.

Another option:

In case of smart forms/SAP Scripts you may use the following logic to ensure that the address line 2 row does not come up as a blank row,



IF &Street Address2& EQ ' '.
&Name
&Street Address1&
&City&, &State& &Zip&
ELSE.
&Name
&Street Address1&
&Street Address2&
&City&, &State& &Zip&
ENDIF.

Rgds,

Karthik

Edited by: Karthik Bhaskar on Jul 20, 2009 10:02 AM

Former Member
0 Kudos

Hi,

I assume you are getting the address from ADNR table in SAP if it is so then its is better to use a address window which has been provided in the SMARTFORMS, You can check how to display the dynamic address in smartforms in this wiki

[Dynamic Address|http://wiki.sdn.sap.com/wiki/x/3QBVBQ]

[Inserting Addresses|http://help.sap.com/saphelp_nw70/helpdata/EN/d2/69a151cd8b11d3b563006094192fe3/content.htm]

or

If you are displaying the variables separately, by getting the data from the your report program, then you need to give a condition in text window,

street address2 is space.

Print that text window

else

print other text window

Regards

Sarves