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

problem in writing and saving text elements

Former Member
0 Likes
444

Hi All!

I am giving below the

<b>code</b>

which is being used to update text elements but I am not able to save the data onto the text elemnts in texts tab on VLO2N transaction.

Any advise please..

data : lines type standard table of tline,

w_lines type tline,

header type standard table of thead,

w_header type thead.

break-point.

if likp-zzdnstatus is not initial.

likp-zzdnstatdate = sy-datum.

likp-zzdnstattime = sy-uzeit.

endif.

CALL FUNCTION 'READ_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

id = 'ZHIS'

language = sy-langu

name = '0080006463'

object = 'VBBK'

  • ARCHIVE_HANDLE = 0

  • LOCAL_CAT = ' '

  • IMPORTING

  • HEADER =

tables

lines = lines

  • 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.

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

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

ENDIF.

break-point.

do 1 times.

w_lines-tdline = 'This is test No. 3.'.

append w_lines to lines.

enddo.

w_header-tdobject = 'VBBK'.

w_header-tdname = '0080006463'.

w_header-tdid = 'ZHIS'.

w_header-tdlinesize = '100'.

w_header-tdspras = sy-langu.

BREAK-POINT.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

CLIENT = SY-MANDT

header = W_header

  • INSERT = ' '

  • SAVEMODE_DIRECT = ' '

  • OWNER_SPECIFIED = ' '

  • LOCAL_CAT = ' '

  • IMPORTING

  • FUNCTION =

  • NEWHEADER =

tables

lines = lines

  • 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.

break-point.

CALL FUNCTION 'COMMIT_TEXT'

EXPORTING

OBJECT = 'VBBK'

NAME = '0080006463'

ID = 'ZHIS'

LANGUAGE = sy-langu

  • SAVEMODE_DIRECT = ' '

  • KEEP = ' '

  • LOCAL_CAT = ' '

  • IMPORTING

  • COMMIT_COUNT =

  • TABLES

  • T_OBJECT =

  • T_NAME =

  • T_ID =

  • T_LANGUAGE =

Message was edited by: kumar pavan

Message was edited by: kumar pavan

3 REPLIES 3
Read only

Former Member
0 Likes
410

Hi All!

I solved it .i forgot to give the value to save_modedirect in the FM save_text.

One more query is there any way that we can get the new line appended in the next line insteading of appending to the existing line.

Regards

Pavan

Read only

0 Likes
410

check manually the length of the line by typing in something. pass the length variable as space.

append.

now pass your stuff. indirect but should work.

thanks.

Read only

0 Likes
410

never mind.