cancel
Showing results for 
Search instead for 
Did you mean: 

how to protect elements from line break in smartforms ??

former_member186143
Active Contributor
0 Kudos

in a smartform we pass variables that contain spaces which we don't want to break in a line

for instance

hello my birthday is 27 april 2010

27 april 2010 we absolutely don't want to break like

hello my birthday is 27 
april 2010

when I just add it in a text element I can use <31> to prevent breaking only when I pass the value

27<31>april<31>2010 to a variable smartforms doesn't interpretet this correctly

in sapscript you can define elements which can be set to protect so it keeps it together only in smartforms that is also not possible.

is there a neat solution for this in smartforms ??

kind regards

arthur

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member186143
Active Contributor
0 Kudos

I have found a sollution myself with the coding below. perhaps the coding can be much easier but that I don't know.

data c1 type c length 1.
data: lv_temp type text18.

c1 = cl_abap_conv_in_ce=>uccp( '00A0' ).


lv_temp = '27_april_2011'.
replace all OCCURRENCES OF '_' in lv_temp with c1.

Edited by: A. de Smidt on May 9, 2011 2:50 PM

former_member186143
Active Contributor
0 Kudos

on the printout however if you get # signs instead of the unbreakable space you have to use a different printerdriver like a unicode compatible SWINCF

kind regards

arthur

Former Member
0 Kudos

hi,

there is a option called page protection ,which can restrict the text break.

While creating a new text,go to its output-options tab,you can find the page protection checkbox.

Mark the checkbox and check it out.

Jshree

Former Member
0 Kudos

Hi AD Smith,

Just try to increase you window width, where the text element is residing.

Hope this will help you to resolve the issue & close the thread.

BR,

Vinit

former_member186143
Active Contributor
0 Kudos

no that is not a sollution otherwise we would already have done that and not spend hours investigating on the no break, there are also other variables involved which can force the date to break up.

kind regards

arthur

Former Member
0 Kudos

Hi,

If you are using multiple variable on the same line. You can use formatting options like ZC.

for eg &VAR1(ZC)&&VAR2(ZC).

when you put your cursor on VAR1. There are option in the attributes, whether u want to append it to new line or Continue on the similar line

Please check the same for both variables.

Regards.

former_member186143
Active Contributor
0 Kudos

I have also looked at the parameters that can be passed but there is no parameter which keeps the variable together

http://help.sap.com//saphelp_erp2005/helpdata/EN/1c/f40c64ddf311d3b574006094192fe3/frameset.htm

with ZC it wil also break down half way the variable.

If I click on the variable in the smartform I can't see where I can see the attributes ??

and page protection is for an entire block and not for an individual variable in a sentence.

like a text we have

	The Examination Board of the &GS_STUDY_EN-PROGTYPE& in
 	&GS_STUDY_EN-NAME&, which is accredited on &GV_CONFER_ACCRED_DATE_EN&
 	declares that

so if the name off the study is to long the date has to be printed entirely on the next line but if the study name is short it has to be printed right after accredited on.

kind regards

Arthur

Edited by: A. de Smidt on May 4, 2011 3:55 PM

Former Member
0 Kudos

Hi ,

I am not sure whether it work or not. One more dirty solution:). Create a varaible with type character . Concatenate the fields you want to print in to the variable you have created. and then try to print.

Regards,

Vikram Singh.

former_member186143
Active Contributor
0 Kudos

Hi ,

>

> I am not sure whether it work or not. One more dirty solution:). Create a varaible with type character . Concatenate the fields you want to print in to the variable you have created. and then try to print.

>

> Regards,

> Vikram Singh.

that doesn't work either

but how can you can transfer special characters in an variable ??

why can't I code ?

wa_temp = '27<31>april<31>2011'.

or is the syntax of the special character wrong ?

kind regards

arthur

former_member186143
Active Contributor
0 Kudos

I have searched further on but the only sollution I can find is way to dirty

when I find the spaces I can spilt the variable in its parts

&wa_temp(2)&&<31>&&wa_temp+3(5)&

but I can't believe that this is the only sollution to make a non breakable element in smartforms ??

kind regards

arthur