Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Elements in sapscript not wrote

Former Member
0 Likes
361

Hi Folks!

I'm dealing with some strange problem with a sapscript. What is happening is that i'm reading a text already saved like the following:

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = 'TXT'

language = sy-langu

name = name

object = 'TRAM'

TABLES

lines = tlines

EXCEPTIONS

id = 1

language = 2

name = 3

not_found = 4

object = 5

reference_check = 6

wrong_access_to_archive = 7

OTHERS = 8.

After this i'm looping the table tlines to write every line like this:

IF sy-subrc = 0.

LOOP AT TLINES INTO wa_tlines.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'TEXT'

type = 'BODY' "normal output

window = 'MAIN' "to window MAIN

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

OTHERS = 8.

ENDLOOP.

For some reason I'm not getting the text to write on the sapscript. I have debugged it and the text is there, it does go in the loop. I have checked that the element name is correct,

I have also checked that the variable in the sapscript looks like: &WA_TLINES-TDLINE&.

The strange thing is that in this section 'TEXT' in the sapscript I have used another variable like &EKKO-INCO2& and it does print and it prints the number of times according to the number of lines that tlines have.

I don't really know what reasons am I missing so I can write this text.

Any help would be really appreciated.

Thanks.

Kind Regards,

Gilberto Li

2 REPLIES 2
Read only

Former Member
0 Likes
333

LOOP AT TLINES INTO wa_tlines.

move wa_tlines-tline to EKKO-INCO2.

CALL FUNCTION 'WRITE_FORM'

EXPORTING

element = 'TEXT'

type = 'BODY' "normal output

window = 'MAIN' "to window MAIN

EXCEPTIONS

element = 1

function = 2

type = 3

unopened = 4

unstarted = 5

window = 6

bad_pageformat_for_print = 7

OTHERS = 8.

endloop.

Read only

0 Likes
333

Hi Ramesh,

I need the line to be 132 char long like the field tline-tdline. Though you gave me the idea that I need to use the tables statement to transfer this to the sapscript and it worked.

For some reason, working with some sapscripts needs to use the tables statement to do this, at least the standard ones(copies).

Does anyone knows how to change this? Or where is this set?

Anyways for the moment my problem is solved.

Thanks.

Kind Regards,

Gilberto Li.