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 Not working

Former Member
0 Likes
6,800

Hi ,

am using SAVE_TEXT function module and it is not updating the long text in VA22.

In the below function module am getting the text in gt_lines but that text is not updating in VA22

can some one suggest me to overcome

x_header-tdobject      =  'VBBK'.
  x_header-tdname        = VBAK-VBELN.
  x_header-tdid          = '0001'.
  x_header-tdspras       = sy-langu.

  LOOP AT text2 INTO text3.
    gt_lines-tdformat = '*'.
    gt_lines-tdline   = text3.
    APPEND gt_lines.
  ENDLOOP.

  CALL FUNCTION 'SAVE_TEXT'
    EXPORTING
*   CLIENT                = SY-MANDT
      header              = x_header
*   insert                = 'X'
   savemode_direct        = 'X'
*   OWNER_SPECIFIED       = ' '
   local_cat              = ' '
* IMPORTING
*   FUNCTION              =
*   NEWHEADER             =
    TABLES
      lines               = gt_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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,157

Doesn't seems to be a problem in code mentioned. Check the value passed to variable "x_header-tdname" (should be after applying conversion exit). Also check value of sy-subrc after executing SAVE_TEXT.

5 REPLIES 5
Read only

Former Member
3,157

Hello

Try to add this after call 'SAVE_TEXT':


CALL FUNCTION 'COMMIT_TEXT'
       EXPORTING
            OBJECT   = x_header-tdobject
            NAME     = x_header-tdname.

Read only

0 Likes
3,157

I was tried to save the text in MM03 for Material Memo applying the SAVE_TEXT function, but without the COMMIT_TEXT the text was not recorded indeed.

Thank you very much for the answer !

Read only

former_member386202
Active Contributor
0 Likes
3,157

Hi,

Use BAPI_TRANSACTION_COMMIT after SAVE_TEXT.

Regards,

Prashant

Read only

Former Member
0 Likes
3,158

Doesn't seems to be a problem in code mentioned. Check the value passed to variable "x_header-tdname" (should be after applying conversion exit). Also check value of sy-subrc after executing SAVE_TEXT.

Read only

Former Member
0 Likes
3,157

Hi All,

Thanks for your replies.

I have solved

solution is

gt_lines-tdline   = text3.

i have changed the format of text3 to string now it is working

Thanks

Surendra