cancel
Showing results for 
Search instead for 
Did you mean: 

Smartforms:- First Line of the header Text to be bold

Former Member
0 Kudos

Hi Friends!

In my smart forms that I created I have been asked to Make the first line of my header text to always show up in bold and the rest of the lines in it to be regular. Can anyone please explani as to how and where do I go and make the change so that the header text s first lien always apper bolded .

eg:

header window

-


sub-header window

-


Header text( The first line of this should be bolded), like

Well#1,well#2,well#3

Msa #12345

contract 3448-36737-233

Product/Services QTy Unit Price Total

ect ect ect......

So basically in the above example the Well#1, well#2.... shld be bold and the 2 lines below it will be a normal font.

Here the text is extracted from VBBK and the text name is &G_HEADER_N_KEY& and the text taken from G_HEADER_N_KEY = is_vbdka-vbeln.

So kindly suggest as how to make the first line of the header text to show bolded.

Thanks

Aarav

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Aarav,

To solve this issue u need to perform following steps:

1) First u need to store the lines of ur text in an internal table say i_lines of type tline , for this use function module READ_TEXT as:

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = 'ZHIS' "which ever ID of text u want

language = is_nast-spras

name = G_HEADER_N_KEY

object = 'VBBK'

TABLES

lines = i_lines

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

2) Now all the lines of text will get stored in i_lines.

As u want to display first line in bold so read first line from this internal table as:

READ table I_LINES into W_LINES index 1.

if sy-subrc = 0.

gv_first_line = w_lines-tdline.

endif.

3) Now use this global variable &gv_first_line& in text element of ur smartform, here give the paragraph of style which u will define as bold say P1.

Thus ur first line will get printed in bold.

4) To print rest of the lines use LOOP in ur smartform where u give internal table name I_LINES and work area W_LINES

Inside this loop create a text element where write &i_lines-tdlime& , and assign paragraph say P2 of ur style which is not in bold.

Thus u will get first line of ur header as bold and rest of the lines in different format.

I think this will help u.

Regards

Shweta.

Former Member
0 Kudos

Awesome .It worked out shweta, thanks for it.

Thanks

Answers (2)

Answers (2)

Former Member
0 Kudos

What I understand from this post is,

Well#1,well#2,well#3

Msa #12345

contract 3448-36737-233

is a standard text created in so10.

If this is the case, then you can not have different text format for individual lines.

However, if this is not the case, then SMARTSTYLES is the solution.

G@urav.

Former Member
0 Kudos

Hi!

So it possible to create a smartsyle with first line as bolded and the rest of the lines not bold? If so can someone please tell me how top go about doing it . Shall be highly appreciated .

Thanks

Former Member
0 Kudos

smartstyle will provide you with paragraph formats and character formats.. You need to use that in your smartform.

GoTo transaction SMARTSTYLES.

Create a new smartstyle.

Create Paragraph format and character formats in that smartstyle.

Character Format will give you option to specify Bold Font.

Now goto SMARTFORMS.

Provide that smartstyle name in the output option tab of that text.

Now you can use those paragraph format and character format in your text lines to adjust its font as per the character format u have in that SmartStyle.

G@urav.

Former Member
0 Kudos

HI!

But when I create a smartstyle and enter that in the output option and execute my order , the header texts comes as bold which is what I want but not all the lines only the first line , but with this it gives me all teh lines a s bold.

something like this:

Header Text Include

Well#1,well#2, well #3

MSA#12345

Contract #483-2656788

but I want something like this:

Header Text Include

Well#1,well#2, well #3

MSA#12345

Contract #483-2656788

Is it possible to create a smartstyle which will have the first line as bold and other lines under it as normal.

If yes please let me know how so that I can get the job done .

Points will definitely awarded which I have been doing always .

Thansk

Aarav

Former Member
0 Kudos

Check my first post in this thread..

If,

Header Text Include

Well#1,well#2,well#3

Msa #12345

contract 3448-36737-233

is a standard text created in so10,

then you can not have different text format for individual lines.

G@urav.

Former Member
0 Kudos

Thanks alot Gaurav , certainly I got what you want to explain me and will do it accordingly.

Thanks

Former Member
0 Kudos

Hi,

Hope u r using the include text for displaying Header Text.

In that node u can find seperate 'Paragraph Formats' box below all the attributes fields. In that u can give two paragraph formats one for the first paragraph of the text and the other for the remaining paragraph.

Create one style according to ur need in smartstyles as bold and assign it in the first paragraph format field.

But u cannot give it to the first line alone.

Hope this ll help u.

Regards,

Prabhu.

Former Member
0 Kudos

Hi Aarav,

If you use an include node in smartforms

you have 2 options

First paragraph, and standard paragraph

Once you create your bold style

Put that in first paragraph

and use a normal one for standard paragraph

Another way of doing this

If it is not a custom include text

You will have to read the text using FM READ_TEXT

You will get the result in an itab.

You can set the first with ur own style there

Sm1tje
Active Contributor
0 Kudos

when starting transaction SMARTFORMS, there is also another radiobutton for creating styles which can be chosen in the smartform.

Create a new style with font to be used and mark this particular one as bold. Easy transaction, shouldn't give you too much trouble.