0% found this document useful (0 votes)
2K views9 pages

How To Use Dynamic SO10 Text in BRF+ Adobe Form Output SAP

How to Use Dynamic SO10 Text in BRF+ Adobe Form Output SAP

Uploaded by

koizak3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views9 pages

How To Use Dynamic SO10 Text in BRF+ Adobe Form Output SAP

How to Use Dynamic SO10 Text in BRF+ Adobe Form Output SAP

Uploaded by

koizak3
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Community Topics Groups Answers Blogs Events Programs Resources

Ask a Question Write a Blog Post Login / Sign

Technical Articles

Beyhan MEYRALI
September 30, 2022 | 4 minute read

How to Use Dynamic SO10 Text in BRF+


Adobe Form Output
 1  5  1,168
Follow

Hi,
 Like
In this post ,I would like to share with you, how to use dynamic SO10 text elements on standard
Adobe form that you maintain with SFP tcode and also show you, how to achieve same thing with
 RSS Feed BRF+ Adobe form outputs those need to be maintained in Adobe Live Cycle application.

S F P PA R T

For non BRF+ cases, If you want to use SO10 text elements with their styles in Adobe form, you
can  go to SFP transaction, create a form and add TEXT element to context, bind that text
element to a text object on layout. That is it, it will work nicely.

You can drag and drop from context to layout. It will create necessary element on layout with
bindings.

First lets see, how we can do it with SFP tcode.


To Add Text to Context

Non BRF+ Form


Layout Object properties for TEXT element

And sample code to read to text for the case above


METHOD fill_doc_ship_type_txt.
DATA: exref TYPE REF TO cx_root.
TRY.
CLEAR docstc-ship_type_text_name.
IF docstc-vstel IS NOT INITIAL AND docstc-vsart IS NOT INITIAL.

"Some logic to determine name


docstc-ship_type_text_name = 'ZDLVY_XYZ' && docstc-vstel && '_' && doc
CONDENSE docstc-ship_type_text_name NO-GAPS.

IF langu IS INITIAL.
langu = 'E'.
ENDIF.

docstc-ship_type_text_langu = langu.

CALL FUNCTION 'READ_TEXT'


EXPORTING
id = 'ST'
language = docstc-ship_type_text_langu
name = docstc-ship_type_text_name
object = 'TEXT'
TABLES
lines = docstc-ship_type_text "Contains text lin
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.

IF langu NE 'E'.
result = fill_doc_ship_type_txt( langu = 'E' ).
ELSE.
result-status = c_stat_warning.
IF NOT sy-msgid IS INITIAL.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
INTO result-status_text.
ENDIF.
ENDIF.

ELSE.
result-status = c_stat_success.
ENDIF.
ELSE.
result-status = c_stat_error.
ENDIF.

CATCH cx_root INTO exref.


result-status = c_stat_error.
result-status_text = exref->get_text( ).
ENDTRY.
ENDMETHOD.

That is it for SFP form. With those steps above, you can use TEXT element with dynamic text
objects in non BRF+ forms.

B R F + PA R T

But, i f yo u w a n t t o h a v e s a m e f u n c t i o n a l i t y w i t h B R F + , you need to download your form


from �ori app “Maintain Form Templates” and then edit form in Adobe Live Cycle Designer. Once
you complete editing you need to upload them back. The problem is, Adobe Live Cycle Designer
d o e s n o t h a v e context to add TEXT object. It does not know about SAP SO10.

There is a solution! You can pass string that contains html tags such as <b></b> and run
Javascript code events to interpret the string as html.

Now lets see how to do that.

First we need to add tags to our SO10 text.

in Word Editor

In XYZ_get_entityset method we will read our text and concatenate it according SO10.

method xyz_get_entitsey.
............
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ST'
language = 'E'
name = name
object = 'TEXT'
TABLES
lines = texts-tdlines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.

IF sy-subrc IS INITIAL.

CALL FUNCTION 'CONVERT_ITF_TO_STREAM_TEXT'


EXPORTING
language = 'E'
lf = abap_true
IMPORTING
stream_lines = texts-strlines
TABLES
itf_text = texts-tdlines.

"Add Lines to entityset table


DATA: newline TYPE LINE OF zcl_zfdp_ef_purchase_o_mpc=>tt_pofixtext.
LOOP AT texts-strlines ASSIGNING FIELD-SYMBOL(<wa>).
CLEAR newline.
newline-seqno = sy-tabix.
newline-tdline = <wa>.

"Some sort of logic to open close tags for each line, in case if user fo
"Javascript event will work for each line,therefore tags needs to exists
IF newline-tdline CP '*<b>*' AND NOT newline-tdline CP '*</b>*'.
newline-tdline = newline-tdline && '</b>'.
ELSEIF newline-tdline CP '*</b>*' AND NOT newline-tdline CP '*<b>*'.
newline-tdline = '<b>' && newline-tdline.
ENDIF.

IF newline-tdline CP '*<u>*' AND NOT newline-tdline CP '*</u>*'.


newline-tdline = newline-tdline && '</b>'.
ELSEIF newline-tdline CP '*</u>*' AND NOT newline-tdline CP '*<u>*'.
newline-tdline = '<u>' && newline-tdline.
ENDIF.
IF newline-tdline CP '*<i>*' AND NOT newline-tdline CP '*</i>*'.
newline-tdline = newline-tdline && '</b>'.
ELSEIF newline-tdline CP '*</i>*' AND NOT newline-tdline CP '*<i>*'.
newline-tdline = '<i>' && newline-tdline.
ENDIF.

APPEND newline TO et_entityset.


ENDLOOP.
ENDIF.
..........
endmethod.

Add a table to list rows, as you would do for any table view.

shows Tdline element of table

And just add a javascript initialize event with following code.

// Form.FixText.xyz.Tdline::initialize - (JavaScript, client)


if(this.rawValue != null)
{
var envelope = "<?xml version='1.0' encoding='UTF-8'?>" +
"<exData contentType='text/html' xmlns='http://www.xfa.org/schema/xfa-temp
"><body xmlns='http://www.w3.org/1999/xhtml' xmlns:xfa='http://www.xfa.org
"xfa:APIVersion='Acroform:2.7.0.0' xfa:spec='2.1'>" +
"<p>"+ this.rawValue +"</p></body></exData>";

this.value.exData.loadXML(envelope,1,1);
}

And if you print, you will see;


PDF Output

There were blog posts and answers to give clues on solving BRF+ and SO10 case. But there was
not a complete answer. Therefore I decided to write a post. Hope that helps you.

If you know an alternative solution, please add it to comments.

Thanks for reading.

Links:

A blog post on dynamically placing image on form from se78.

And this class is quite useful : c l _ s s f _ x s f _ u t i l i t i e s , check the methods.

Alert Moderator

Assigned Tags

ABAP Development | NW ABAP Business Rule Framework (BRFplus) | SAP Interactive Forms by Adobe

Similar Blog Posts 


Use of PDF Fragments in Outputs - Part 1 Practical use of BRF+ Application to design the Rules in
By Mandar Shete Jan 20, 2019 SAP
By Prabhjot Bhatia Jun 27, 2020

Understanding Fragments based Adobe form building


using LiveCycle version 10+ with OData as back-end.
By Sijin Chandran Apr 28, 2020
Related Questions 
Printing Standard text in OData based adobe form with Email content text dynamic number of text lines
suitable smartstyle By Siong Chao Ng Jun 16, 2021
By Rajat Sharma May 22, 2018

SO10 : Logo and Text in same line


By Praveer Sen Feb 03, 2020

1 Comment

You must be Logged on to comment or reply to a post.

Vishal B
November 17, 2022 at 10:49 am

Informative blog Beyhan MEYRALI


For my requirement I simply read the text into a string and used text �eld to display the same

Like 1 | Share

Find us on

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Cookie Preferences

Newsletter Support

You might also like