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

Slow READ_TEXT function

h_senden2
Active Contributor
0 Likes
1,601

Hi,

in an badi of an extractor for BW, for every line in the data internal table function module READ_TEXT is used to get some standard text related to the line. When found, only the first 7 characters of the first line will be used, and move one of the fields of the records.

But the use of the function results in runtime errors when the internal table with data is to big.

Is there are better / faster way to do it job without runtime errors ?

regards,

Hans

9 REPLIES 9
Read only

Former Member
0 Likes
1,279

What kind of run time errors?

Rob

Read only

Former Member
0 Likes
1,279

Not sure, but you might execute FM COMMIT_TEXT after each READ_TEXT. This may slow it down (then again it may not). But I think it will also clear some memory and avoid run time errors.

Rob

Read only

Former Member
0 Likes
1,279

first you need to determine why you are getting runtime errors... is it really because you have too many texts linked to your items or you just have inefficient code which selects/processes these texts.

then you can actually use select from STXH & STXL tables to select just first line if it's the only line which is required.

Would be really good to see the code to be able to help 🐵

Read only

0 Likes
1,279

The runtime error is a time out !

Read only

0 Likes
1,279

So, did you try FM COMMIT_TEXT ?

Rob

Read only

0 Likes
1,279

No, i didnt. I dont think it increases the performance. The time out can be avoided by resetting the counter by using function module TH_REDISPATCH.

Hans

Read only

0 Likes
1,279

I suggested it because some SAP FMs don't clear out memory after each call. If you call the same FM many times in a program, it may try to read whatever is in memory before going to the database. Then when it does go to the database, the data is added to memory and also returned to you.

I'm not saying this is the case, or that it will definitely help, but I doubt if it could hurt at all.

Rob

Read only

0 Likes
1,279

@Rob : oke,

i can try it, maybe it helps.

Read only

0 Likes
1,279

If it doesn't, would you please post your code?

Rob