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

save_text Function module is not update the data in the notification, Help!

Former Member
0 Likes
1,500

Here is the code snippet, does anybody know why? Thanks!

form update_root_causes

tables p_it_root_causes type zqmtxt_t

using notif_no.

data:

ls_header type thead,

lit_lines type standard table of tline,

lwa_line like line of lit_lines,

lv_index type i value 0.

field-symbols:

<fs> like line of p_it_root_causes.

  • fill the header

ls_header-tdobject = 'QMEL'.

ls_header-tdname = notif_no.

ls_header-tdid = 'LTXT'.

ls_header-tdspras = sy-langu.

  • fill the lines table

  • fill from line #2 ...

lv_index = 0.

loop at p_it_root_causes assigning <fs>.

if lv_index gt 0.

lwa_line-tdformat = '*'.

lwa_line-tdline = <fs>-qmtxt.

append lwa_line to lit_lines.

endif.

lv_index = lv_index + 1.

endloop.

  • update the save_text

call function 'SAVE_TEXT'

exporting

header = ls_header

insert = 'x'

tables

lines = lit_lines.

call function 'COMMIT_TEXT'

exporting

object = ls_header-tdobject

name = ls_header-tdname

id = ls_header-tdid

language = ls_header-tdspras.

endform. " UPDATE_ROOT_CAUSES

3 REPLIES 3
Read only

Former Member
0 Likes
836

Hi Anthony,

Two things you can check:

1. Ensure the notification number you are passing is valid, i.e. it has the requisite number of leading 0s (apply CONVERSION_EXIT_ALPHA_INPUT to ensure to the field notif_no before passing it to ls_header)

2. In the function module to SAVE_TEXT - INSERT should be 'X' not 'x'

Please check.

Adi

Read only

former_member156446
Active Contributor
0 Likes
836

[Save text help >>>|http://help.sap.com/saphelp_40b/helpdata/en/d6/0db8ef494511d182b70000e829fbfe/content.htm]

if you had maintained the exception , you would have solved it your self..

Read only

Former Member
0 Likes
836

I found that, call bapi_transaction_commit at the end.