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

Smartform Alignment

Former Member
0 Likes
1,877

Hello

I have a Z-table with one field 132 chars and 5 lines:

Wood          10.00          5.00

Hardware    20.00        10.00

Packing       30.00        15.00

                   -----------------------

Total            60.00         30.00

But when I print this data from my Z-table to Smarforms using table command alignment is off.  The font I'm using in Smartforms is Helivetica 8pts

Wood        10.00         5.00

Hardware     20.00         10.00

Packing     30.00        15.00

-----------------------------

Total         60.00         30.00

Is there a way to get the 5 rcds from my Z-table to align when display in smartforms?

Thanks Gary

1 ACCEPTED SOLUTION
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,746

The users can put whatever they want in the text, so I doubt it's possible to parse it intelligently? A lot of assumptions would have to be made and we all know how that goes.

I agree that this should not be entered in the text to begin with. Since this is coming from the order, I'm confused - what business scenario is this for? Why aren't these things entered as the order line items or included in BOM or VC? How would company capture the cost and revenue figures for these items? And if they are not important then why are they on the form?

The proper solution would be to get the data entered in a proper format instead of "anything goes" text field. This really seems like one of those questions where we should be asking "why" instead of "how"...

5 REPLIES 5
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,746

You can only achieve such alignment with a monospaced font, like Courier. It's not the Smartform issue - try the same in Word and it won't "align" either unless you use tabulation.

But why do you have all columns in one string? Just build a table properly and then you can align each column as you please...

Read only

0 Likes
1,746

This data is being enter via trans VA02 "item text".  The user is setting up the columns in the text box but pressing space bar to line up the columns and then I use FM READ_TEXT to insert data to smartform. Only the data doesn't line up like it was entered in VA02.

Thanks for your help there probably is not a solution???

Read only

0 Likes
1,746

Hi,

What you describe is IMO a "silly" and error prone way of data entry... but then you probably already knew that . It's not a good idea to try to fix or to work around application design, process flow or data entry flaws somewhere in the output (printing) - once you compromise and give what looks like "a little finger" here, the people will try to take your hand and then some... You'll regret it eventually

But if that silly way of data entry can not be replaced with something "humane", you could try to parse each text line to internal table with character/string columns. CONDENSE the text line and then SPLIT at SPACE, for example. Then do output of internal table using a table node in the Smartform.

For the love of programming gods, please don't program parsing the text to table suitable for output directly in the Smartform itself - do it at least in "driver" program...

The second option would be to try to use SAP's "ancient" and limited "What you see is what you often don't get" text formatting capabilities. If it's "standard text", define appropriate paragraph formats with tabs and make user format the text using them. One would need to know the text and application to suggest something more (I'm not familiar with VA02). Or use for output the same font the editor uses (probably Courrier?)

cheers

Jānis

Message was edited by: Jānis B

Read only

0 Likes
1,746

May be RKD_WORD_WRAP FM can help. Have a look.

R

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,747

The users can put whatever they want in the text, so I doubt it's possible to parse it intelligently? A lot of assumptions would have to be made and we all know how that goes.

I agree that this should not be entered in the text to begin with. Since this is coming from the order, I'm confused - what business scenario is this for? Why aren't these things entered as the order line items or included in BOM or VC? How would company capture the cost and revenue figures for these items? And if they are not important then why are they on the form?

The proper solution would be to get the data entered in a proper format instead of "anything goes" text field. This really seems like one of those questions where we should be asking "why" instead of "how"...