cancel
Showing results for 
Search instead for 
Did you mean: 

Agentry - Keep SAP long texts format

Marçal_Oliveras
Active Contributor
0 Kudos

Hi,

In SAP when you have a long texts, for instance in the Work Order header, you can apply certain formats like "Bold".

When you do so, SAP stores this long text with tags indicating the format and Agentry displays it with no format: <H>long text</>

Would it be possible to display this long text according to the format in SAP? I guess not in a standard way, but maybe there is some work around to do so?

Thank you in advance.

Marçal

Accepted Solutions (1)

Accepted Solutions (1)

Marçal_Oliveras
Active Contributor
0 Kudos

Hi,

With Jason tip of using the HTML field + the following code to convert to HTML before sending the text to Agentry I found the solution.

In this code I'm reading the work order text, and then writting it to show the HTML result in SE38 execution test. In Agentry only the call to CONVERT_ITF_TO_HTML in a BADI should be necessary.

* Convert work order header text to HTML (pictures are ignored)
DATA: lt_tline    TYPE STANDARD TABLE OF tline,
      ls_header   TYPE                   thead,
      ls_htmlline TYPE                   htmlline,
      lt_htmlline TYPE STANDARD TABLE OF htmlline.

CALL FUNCTION 'READ_TEXT'
  EXPORTING
    id       = 'KOPF'
    language = 'E'
    name     = '250000020421705'
    object   = 'AUFK'
  IMPORTING
    header   = ls_header
  TABLES
    lines    = lt_tline.

CALL FUNCTION 'CONVERT_ITF_TO_HTML'
  EXPORTING
    i_header      = ls_header
    i_html_header = space
  TABLES
    t_itf_text    = lt_tline
    t_html_text   = lt_htmlline.

LOOP AT lt_htmlline INTO ls_htmlline.
  WRITE ls_htmlline.
ENDLOOP.

Answers (1)

Answers (1)

jason_latko
Active Contributor
0 Kudos

Marcal,

If the tags were HTML, you could display the fetched text in an HTML control on the client.  Not sure if that is the case, or if the tags are in some other SAP format.

Jason Latko - Senior Product Developer at SAP

Marçal_Oliveras
Active Contributor
0 Kudos

Hi Jason,

Good point, thank you.

The tags are not html but maybe SAP has some function to transform this and then I should change the field type in Agentry.

I will update the post once I try it.