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

Material Long Text Issue while reading

Former Member
0 Likes
734

Dear Experts,

Am looking to read Material Long text and push it to the legacy system with the material details.

Whenever i save the message am getting alll the details except Basic Data Text (Long Text). When i debug the code using the debugger(Classic/New) am getting the Long Text details. But am not able to find why the system is not fetching the Material Long Text in direct update(Without debugging).

Am using the FM READ_TEXT to read the Long Text and placing the code in the Enhancement Spot ES_SAPLMGMU in program SAPLMGMU.

6 REPLIES 6
Read only

vijaymanikandan
Contributor
0 Likes
687

HI

Have you tried to do a update debugging ? I am not sure what is the code that you are using but sometimes it might happen that when you are using debugging there might be enough time for the system to update and then you are able to retrieve the value from the table. Try to see if that is the issue else explain in detail what exactly you are trying to achieve in this enhancement spot.

Regards

Vijay V

Read only

Former Member
0 Likes
687

Hi,

Can you post some of your codes here for us to analyze if it code error or not.

Thanks,

iostreamax

Read only

Former Member
0 Likes
687

Hi all,

Below is the sample code used. My requirement is to fetch the Material details with Long text (Basic text) during material save and push it to legacy system.



L_NAME = MARA-MATNR.
      
      CALL FUNCTION 'COMMIT_TEXT'
       EXPORTING
         OBJECT                         = 'MATERIAL'
         NAME                             = L_NAME
         ID                                    = 'GRUN'
         LANGUAGE                    = SY-LANGU
         SAVEMODE_DIRECT       = 'X'
*         KEEP                  = ' '
*         LOCAL_CAT             = ' '
*       IMPORTING
*         COMMIT_COUNT          =
*       TABLES
*         T_OBJECT              =
*         T_NAME                =
*         T_ID                  =
*         T_LANGUAGE            =
                .
      

      CALL FUNCTION 'READ_TEXT'
        EXPORTING
          CLIENT                  = SY-MANDT
          ID                          = 'GRUN'
          LANGUAGE          = SY-LANGU
          NAME                    = L_NAME
          OBJECT                 = 'MATERIAL'
        TABLES
          LINES                     = IT_LINES
        EXCEPTIONS
          ID                      = 1
          LANGUAGE                = 2
          NAME                    = 3
          NOT_FOUND               = 4
          OBJECT                  = 5
          REFERENCE_CHECK         = 6
          WRONG_ACCESS_TO_ARCHIVE = 7
          OTHERS                  = 8.
      CASE SY-SUBRC.
        WHEN '4'.
*          MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
*        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        WHEN OTHERS.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDCASE.

Read only

0 Likes
687

Hi

Try to put a wait command and see after your commit.

Read only

0 Likes
687

Hi,

After calling the COMMIT_TEXT FM, try using the below statement before calling READ_TEXT FM.

 
WAIT UP TO 5 SECONDS. 

You may also try by changing the seconds value greater than 5 also. Please don't give any big value for seconds because it may cause the program to hang.

Read only

Former Member
0 Likes
687

Thanks guys, issue solved by giving wait command.

Points rewarded !!!!