cancel
Showing results for 
Search instead for 
Did you mean: 

Pass tdline and tdformat to Sapscript

Former Member
0 Kudos

Hi all,

Can we pass tdline and tdformat at the same time to Sapscript?

My requirement needs the tdformat to be dynamically, is this possible ?

How should I pass a dynamic format to sapscript?

If yes, could someone provide some sample code?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI myahsam,

Create a subroutine and and create a std text using trx SO10.Fill an internal table of the type tline using tdformat and tdline.

Use FM save_text to pass the values of tdformat and tdline dynamically.In the header parameter of the FM pass the name of the std text.

wa_header-tdobject = 'TEXT'.

wa_header-tdname = c_tname . (name of the std text)

wa_header-tdid = 'ST' .

wa_header-tdspras = spras.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

header = wa_header

insert = 'X'

savemode_direct = c_x

TABLES

lines = it_line

EXCEPTIONS

id = 1

language = 2

name = 3

object = 4

OTHERS = 5

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Then in the sapscript layout use include text statement to read this std text in the script.

Hope this helps

Neerja

Former Member
0 Kudos

Hi neerja thakur,

Thanks for your input.

One more question, if my standard text in SO10 is using paragraph format center and char format highlighted, will these two formats be shown in the form ?

Thanks again.

Former Member
0 Kudos

Hi Myahsam,

Whatever format you pass to the tdformat of the internal table that will be shown in the sapscript output.

Neerja

Former Member
0 Kudos

Hi,

My include looks like this,


INCLUDE &LT_LINE-TDLINE& LANGUAGE &SY-LANGU& PARAGRAPH &LT_LINE-TDLINE& &LT_LINE-TDFORMAT&

However, nothing is shown in the form. I have tried to debug in sapscript, correct value and format are passing into LT_LINE.

Any idea? Thanks.

Former Member
0 Kudos

Hi Myahsam,

Don't pass it_line-tdline into the include statement.

pass the text name which you have passed in wa_header.

wa_header-tdname = c_tname . (name of the std text)

eg suppose c_tname = 'ZTEXT'.

and use it as follows

INCLUDE ZTEXT OBJECT TEXT ID ST LANGUAGE 'EN'

Neerja

Answers (1)

Answers (1)

Former Member
0 Kudos
Former Member
0 Kudos

Hi swati,

Thanks for the link, however I do not understand the statement "You can use SAPscript to administer texts that have other formats that ITF. The information on the text format is stored in the text header. To pass texts with other formats to SAPscript via function modules, you must also use the structure TLINE. SAPscript, however, does not interpret the contents of the text lines but passes them on to the function modules, which call the interface to the external word processing program."

Do you have sample code for this?

Thanks.