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

Standrad text problem

Former Member
0 Likes
587

Hi all,

I am using a SAPScript form. From the form a perform subroutine is called and over there I fetch data in the internal table and pass the internal table contents to a standard text. i am using SAVE_TEXT FM for this.

Now the form is called in a loop and the perform subroutine in the form is also called in a loop. So the previous contents of the standard text is displayed in the output.

When checked in debug, before the endform of the subroutine the standard text is updated with the new values; but in the sapscript the values remain from the previous loop.

I have used Commit statement and also tried out with DELETE_TEXT but the result is same.

Appreciate your inputs..

thanks,

stock

5 REPLIES 5
Read only

Former Member
0 Likes
564

Hi,

Use commit and wait.

There should be some delay in retriving the data after you are saving it.

Hope this will solve the problem.

Reward if helpful.

Read only

Former Member
0 Likes
564

Hi

In the PERFORM sub routine

Use the fun module READ_TEXT by passing the correct parameters like OBJECT,ID,NAME and LANGUAGE and fetch the text into Internal table with multiple text lines

then pass those Internal table lines into the script and write the text

generally for every item we fetch the text and display in the script

<b>Reward points for useful Answers</b>

Regards

Anji

Read only

Former Member
0 Likes
564

hi,

we have to use COMMIT_TEXT after save_text.

below is the sample code .

START-OF-SELECTION.

table_header-tdid = 'Z016'.

table_header-tdobject = 'KNA1'.

table_header-tdspras = 'EN'.

table_header-tdname = '0020000034'.

table_lines-tdline = 'save_text from SE38 PROGRAM'.

table_lines-tdformat = '*'.

APPEND table_lines TO t_lines.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

client = sy-mandt

header = table_header

savemode_direct = 'X'

insert = ' '

  • OWNER_SPECIFIED = ' '

  • LOCAL_CAT = ' '

  • IMPORTING

  • FUNCTION =

  • NEWHEADER =

TABLES

lines = t_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.

CALL FUNCTION 'COMMIT_TEXT'

EXPORTING

object = 'KNA1'

name = '0020000034'

id = 'Z016'

language = 'E'

savemode_direct = 'X'

keep = 'X'

local_cat = ' '

  • IMPORTING

  • COMMIT_COUNT =

  • TABLES

  • T_OBJECT =

  • T_NAME =

  • T_ID =

  • T_LANGUAGE =

.

IF sy-subrc = 0.

WRITE:/ 'SUCESS'.

ENDIF.

ENDIF.

regards

srinvas

Read only

0 Likes
564

Hi,

Thanks for your ideas!!

I tried Commit and wait and also COMMIT_TEXT; but it does not work.

Still i get the previous contents from the std. text.

Thanks,

stock

Read only

0 Likes
564

Hi,

Check whether your internal table is refreshed and the newly saved values are fetched after saving the texts in debugging mode.

I think the values are not fetched again.

Reward if helpful.