Application Development 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: 

Problem with Loading Long text in IA12 Transaction

Former Member
0 Kudos
301

Hi Friends,

I have to Upload the long text in the Operations of Functional Location Task lists.

I tried using the FM SAVE_TEXT, It returns sy-subrc as 0, but no text is being saved.

I found similar problems in the forum, but nothing was useful.

Appricitiate your help. Thanks in advance

Thanks,

Satish

14 REPLIES 14

naimesh_patel
Active Contributor
0 Kudos
154

Have you tried using the parameter SAVEMODE_DIRECT = 'X'.?

Regards,

Naimesh Patel

0 Kudos
154

Hi Naimesh,

Thanks for the reply.

Yes, I tried it is not working.

Regards,

Satish

0 Kudos
154

In the forum i found below answer and it has been answered, But i couldn't understand what he says

<i>I prefer to do a recording to register the LT in LSMW.

I would navigate in the transaction to get the LT editor (Line editor) and enter a * in the tag of second line & save the transaction where the LT gets registered and later update the LT by SAVE_TEXT FM.</i>

Regards,

Satish

0 Kudos
154

Check are you passing proper Header information.

Set break point at SAVE_TEXT FM .

Now go to IA12 and try to insert text in your text id and save it.

When system stops at the breakpoint, check all the import parameter.

You need to pass in the same fashion what you get in the debugging.

Regards,

Naimesh Patel

Former Member
0 Kudos
154

How do you fill the header?

Rob

0 Kudos
154

Rob,

This is my code, i am filling the header

  SORT git_tapl.
  SORT git_plpo.
  LOOP AT git_data INTO wa_data.


    IF wa_data-text1 IS NOT INITIAL.

      CALL FUNCTION 'TR_SPLIT_TEXT'
        EXPORTING
          iv_text  = wa_data-text1
          iv_len   = 40
        IMPORTING
          et_lines = git_et_lines.

      READ TABLE git_tapl INTO wa_tapl
       WITH KEY tplnr = wa_data-tplnr
                plnal = wa_data-plnal BINARY SEARCH.
      IF sy-subrc = 0.
        READ TABLE git_plpo INTO wa_plpo
         WITH KEY plnty = wa_tapl-plnty
                  plnnr = wa_tapl-plnnr
                  vornr = wa_data-vornr
                  BINARY SEARCH.
        IF sy-subrc = 0.
          CONCATENATE wa_plpo-mandt
                      wa_plpo-plnty
                      wa_plpo-plnnr
                      wa_plpo-plnkn
                      wa_plpo-zaehl
                 INTO gv_name.
        ENDIF.
      ENDIF.

      CALL FUNCTION 'INIT_TEXT'
        EXPORTING
          id       = 'PLPO'
          language = 'E'
          name     = gv_name
          object   = 'ROUTING'
        IMPORTING
          header   = gv_header
        TABLES
          lines    = git_lines.
      IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

      CLEAR : wa_et_lines.

*** Structure mapping
      LOOP AT git_et_lines INTO wa_et_lines.
        wa_lines-tdformat = '*'.
        wa_lines-tdline = wa_et_lines.
        APPEND wa_lines TO git_lines.
        CLEAR wa_lines.
      ENDLOOP.

      CALL FUNCTION 'SAVE_TEXT'
        EXPORTING
          client          = sy-mandt
          header          = gv_header
          insert          = ' '
          savemode_direct = 'X'
        TABLES
          lines           = git_lines.
      IF sy-subrc = 0.

      CALL FUNCTION 'COMMIT_TEXT'
       EXPORTING
         OBJECT                = 'ROUTING'
         NAME                  = gv_name
         ID                    = 'PLPO'
         LANGUAGE              = 'E'
         SAVEMODE_DIRECT       = 'X'
         KEEP                  = 'X'
*         LOCAL_CAT             = ' '
*       IMPORTING
*         COMMIT_COUNT          =
*       TABLES
*         T_OBJECT              =
*         T_NAME                =
*         T_ID                  =
*         T_LANGUAGE            =
                .
      ENDIF.
ENDIF.

It is populating the header with correct details. GIT_LINES is also having text, SAVE_TEXT is also returning sy-subrc = 0. But text is not there....

Regards,

Satish

0 Kudos
154

Try to create the GV_NAME like this:

gv_name+0(3) = sy-mandt.
gv_name+3(1) = wa_plpo-plnty.
gv_name+4(8) = wa_plpo-plnnr.
gv_name+12(8) = wa_plpo-plnkn.
gv_name+20(8) = wa_plpo-zaehl.

If you have any space in the PLNNR, concatenate will remove those space and key will no loger effective.

Regards,

Naimesh Patel

0 Kudos
154

Hi Naimesh,

That is not the problem. GV_NAME is getting properly.

Regards,

Satish

0 Kudos
154

Any ideas guys....

-Satish

0 Kudos
154

Guys,

It is working if i do like this before using SAVE_TEXT function module. Is it safe to use?

      UPDATE plpo SET txtsp = 'E' 
       WHERE plnty = wa_plpo-plnty
         AND plnnr = wa_plpo-plnnr
         AND vornr = wa_plpo-vornr.

Regards,

Satish

0 Kudos
154

I would try to get the FM working correctly.

Rob

0 Kudos
154

Sorry guys, it is not working even after adding UPDATE Statement. It worked for the first time, Again giving problem.

Anybody can help....

I am stuckup with this guys, Nobody has answer for this? Nobody faced this problem?

Thanks,

Satish

Message was edited by:

Satish Panakala

0 Kudos
154

Satish,

There are some long texts like this one (BOM item texts are one more example), where you have to set the table language field to 'E' before you can see them in the screen. The reason for this is that in the SAP code, it does READ_TEXT to read the long text only if this field is not initial. You have to update it, there is no other way other than may be trying to find a BAPI that also does the texts.

See why your update is failing. Also go directly to STXH and STXL tables to see if there are any entries. If they are there and if you are following the logic for forming the object key correctly and if your direct update is successful, it will work.

former_member214131
Active Contributor
0 Kudos
154

Hi

Best Regards, Murugesh