Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Spaces in SO_NEW_DOCUMENT_SEND_API1 throwing off column alignment

Former Member
0 Likes
1,966

I've been searching the net for over an hour on this, and I must be using lousy keywords as I'm not finding the solution, so I thought I'd post.  Here's my situation:

I have a table of "free flowing" text that is built as an interface program runs.  It displays information about the input file, run date/time information, successful transactions, warnings, and transactions in error (so there's no common layout from line to line).

There is embedded spacing to add indentation and white space between columns to aid readability.  This works great when written to the spool.  It is also written out as an email via FM SO_NEW_DOCUMENT_SEND_API1.  Before, I was sending it out as type 'RAW'.  This utilizes a non-proportional font (or maybe it doesn't and it just depends on the user's default email font in Outlook?) so the spaces are there, but things don't line up quite right.  In an effort to make this look prettier, I changed the type to 'HTM' so I could change the font to a proportional font like Courier New.

The font changes, and after adding in some '<br />' values after each line to preserve my line breaks, it looks really good.  The problem is that somehow the HTML is ignoring my embedded spaces (both at the beginning of the lines where I'm indenting or extra spaces between literals and values).  Between the latter, it will keep one space, but that's it.  All other spaces are removed, so I'm pretty much back to where I started when I was using the non-proportional font in the 'RAW' format.

Suggestions?  I'd like to keep the 'HTM' format if possible because I'd like to change the color or bold some key informational lines that might appear in my output.

Thanks!

Dave

I've been searching the net for over an hour on this, and I must be using lousy keywords as I'm not finding the solution, so I thought I'd post.  Here's my situation:

I have a table of "free flowing" text that is built as an interface program runs.  It displays information about the input file, run date/time information, successful transactions, warnings, and transactions in error (so there's no common layout from line to line).

There is embedded spacing to add indentation and white space between columns to aid readability.  This works great when written to the spool.  It is also written out as an email via FM SO_NEW_DOCUMENT_SEND_API1.  Before, I was sending it out as type 'RAW'.  This utilizes a non-proportional font (or maybe it doesn't and it just depends on the user's default email font in Outlook?) so the spaces are there, but things don't line up quite right.  In an effort to make this look prettier, I changed the type to 'HTM' so I could change the font to a proportional font like Courier New.

The font changes, and after adding in some '<br />' values after each line to preserve my line breaks, it looks really good.  The problem is that somehow the HTML is ignoring my embedded spaces (both at the beginning of the lines where I'm indenting or extra spaces between literals and values).  Between the latter, it will keep one space, but that's it.  All other spaces are removed, so I'm pretty much back to where I started when I was using the non-proportional font in the 'RAW' format.

Suggestions?  I'd like to keep the 'HTM' format if possible because I'd like to change the color or bold some key informational lines that might appear in my output.

Thanks!

Dave

7 REPLIES 7
Read only

Former Member
0 Likes
1,396

Hi Dave,

Have you tried instead with TAB as delimiter?

Regards,
Karthik D

Read only

Former Member
0 Likes
1,396

Are you using a HTML table or text table to send the data via SO_NEW_DOCUMENT_SEND_API1?

Can you try to use ' ' for adding space in the table?

Thanks,

Shambu


Read only

0 Likes
1,396

Ha ha it converted the text I had kept to space, use '&nb@sp;'.

Remove the @ in the center and use that for adding spaces.

Read only

Clemenss
Active Contributor
0 Likes
1,396

SO_NEW_DOCUMENT_SEND_API1

is not supported any longer. Try CL_BCS and help will come

Regards

Clemens

Read only

Former Member
0 Likes
1,396

"lousy keyword" ...is that a professional assessment?  or ??

Getting serious here.... you can do whatever you like with spaces...the user's settings or the settings in whatever they use to view will dictate how it looks.  If you want to preserve the spaces, forget spaces and use tabs, probably into a tab-delimited file, attach it to an email and send it by BCS, as Clemens has already noted. 

And, as Clemens notes, IMHO, nobody should be writing new ABAP objects that call those old APIs.

Read only

Former Member
0 Likes
1,396

Thanks for your replies.  What I really find valuable is learning that the FM I'm using is no longer supported and that this CL_BCS is the new way to go.

At this point, given where I'm at in my particular project, it's best if I keep the FM in place; however, I'm going to learn how to use CL_BCS and will use it not only in the future but also as an eventual replacement for the FM in my program.  We've typically used the FM here so this was a copy-and-paste-from-an-existing-program scenario.  And, it's not absolutely critical that things line up nice and neat; I just thought I was probably missing something like a parameter somewhere that would keep the spaces intact (kind of like a RESPECTING BLANKS thing).

What makes this a little more challenging is the free-flow nature of the output.  I don't have a table of separate fields; rather, it's a large character field allowing the program to store varying information and messages as the program executes.  Spaces can be embedded at varying positions throughout the text, depending on the messages being generated and the "section" in which they fall.

So, CL_BCS...duly noted.  And if anyone still has any ideas (I'm going to try the  '&nb@sp;' thing -- thank you, Shambu) please let me know.

Thanks, and have a great day.

Dave

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,396

Yes the non-breaking space is the best solution, it is also often  called non-collapsing white-space for this reason

(Just one remark,

so I could change the font to a proportional font like Courier New

Courrier are non-proportional fonts (ie. fixed width, monospaced) the proportional fonts contain glyphs of varying widths. - technically a "monospaced slab serif typeface")

Regards,

Raymond