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: 

FM READ_TEXT is not showing the data but the SAP standard transaction ME33L does show all the data

jimmy_guzman
Explorer
0 Kudos
764

hello,

I am using FM READ_TEXT to read some texts (  EKPO, L03 ) but the FM is not showing any data. When I check the database table STXH also the DB table is not showing any data, but however, when I go to the SAP standard transaction ME33L ,  SAP  uses the same FM READ_TEXT  and the FM does show all the data !

If I debug the FM READ_TEXT  this is exactly the problem

1)  In my program when I use the FM  READ_TEXT

jimmy_guzman_0-1725662665426.png     syst-subrc = 4   (  not found )

2) In SAP program ,  when SAP uses the FM READ_TEXT

jimmy_guzman_1-1725662707241.png     syst-subrc = 0   (  everything ok !  )

 

any suggestions guys ?

thanks in advance,

Jimmy

 

 

8 REPLIES 8

Sandra_Rossi
Active Contributor
0 Kudos
624

Debug READ_TEXT when it's called from ME33L, copy ALL of the EXACT values of the parameters into your custom report with CTRL+C and CTRL+V, and it should work. Make sure to run your report from the same client than the one where you run ME33L.

anandmuthu
Participant
0 Kudos
578

Hello,

FM READ_TEXT is the correct way to retrieve using ABAP. Since you couldn't find the data in STXH/STXL, I suspect that the object id and name could be incorrect. You can verify this by going into ME33L and double click on the long text you want to see.  This usually opens a word document but you can cancel and navigate to the classic editor. At the menu, there is a header item which you can navigate too.

This will give you the text Header with all the appropriate fields. This is the information you would need to pass to the FM and verify in STXH.

anandmuthu_0-1725710969966.png

IMPORT from memory ID is a runtime function. If the long text is saved it should be in STXH/STXL.

Hope that helps.

Anand

 

jimmy_guzman
Explorer
0 Kudos
427

thank you very much for the answers,  I'm going to try to explain the whole problem sequence

step 1. Create Scheduling Agreement in Tx. ME31L

jimmy_guzman_0-1725890011417.png 

      1.1  I don't know why the system doesn't create the text in the DB table  STXH / STXHL  the very first time

      1.2  My poor Z  SAPscript doesn't find the text info.  whit FM READ_TEXT

      1.3  Standard SAP  ME33L  of course can read the text info.

step 2.   someone modify the text  in Tx. ME32L 

       2.1  this time the system  create the text in the DB  table  STXH,  STXL    the second time

       2.2  My poor Z  SAPscript  now  can read  the text info.  with  FM  READ_TEXT

       2.3  Standard SAP  ME33L  of course can read the text info.

 

step 3.   Create another Scheduling Agreement in Tx. ME31L

      3.1   Again, I don't know why the system doesn't create the text in the DB table  STXH / STXHL  this very   

              first time

      3.2  Again, My poor Z  SAPscript doesn't find the text info.  whit FM READ_TEXT

       3.3    Standard SAP  ME33L  of course can read the text info.

 

Step 4.    Again, someone modify the text  in Tx. ME32L 

     4.1    this time the system  create the text in the DB  table  STXH,  STXL     ( the second **bleep** time )

     4.2   My poor Z  SAPscript  now  can read  the text info.  with  FM  READ_TEXT

      4.3  Standard SAP  ME33L  of course always can read the text info.

 

I did think this was a system bug,   but the system,  simply can read the text info.  from memory or  from the DB table  or boths at the same time,  buy my poor Z SAPscript can't read the text info.  from buffer memory,  only from the  DB  table  ?

 

again,  any advice guys  ?

 

 

0 Kudos
409

Seems to be matching the behavior as highlighted by raymond_giuseppi. You can try to enter a separate text during creation to see STXH/STXL is created. 

Sandra_Rossi
Active Contributor
0 Kudos
419

When is the Z SAPScript called? Automatically during the execution of ME31L/ME32L?

raymond_giuseppi
Active Contributor
408
  • If youd didn't change the default text during creation, the displayed text will be the text of the material master data.
  • When an user change the text, this text will become adopted by the purchase document and copied with the expected keys.

In Customizing you can force adoption (e.g. Define text types for item texts)

Also browse tables T165K (header) and T165P (item) to get the copy rules (from which text to which text) so if a text is not adopted at current level, read it from previous level (material, inforecord, etc.)

VORGATDOBJECTTDIDFOLGEBSTYPKOOBJECTKOIDFIXIE
LEKPOL030 EKPOL03 
LEKPOL031 MATERIALGRUNN

Note the FIXIE = N, so text from material master data is by default not adopted by document item.

0 Kudos
357

thank you very much,

this is the solution !

Sandra_Rossi
Active Contributor
0 Kudos
289

After Raymond has posted the right solution, it makes me think that a universal solution is to use the SQL trace (ST05) to understand quickly (in minutes) what's going on.

In your case, you would see right after steps 1 or 2 (ME31L or ME32L) that the access to STXH/STXL concerns the material master data, and you would also see the values to access STXH/STXL.