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

Replace text Symbol

Former Member
0 Likes
4,467

Hi,

I had a requirement of replacing the text symbol of standard text with dynamic values.

Text maintained is - PO &PO_NUM& has been approved

CALL FUNCTION 'READ_TEXT'

EXPORTING

id = 'ST'

language = sy-langu

name = 'ZTEST'

object = 'TEXT'

IMPORTING

header = header

TABLES

lines = it_text.

DATA: PO_NUM TYPE char30 VALUE 'TEST1234'.

CALL FUNCTION 'TEXT_SYMBOL_REPLACE'

EXPORTING

header = header

TABLES

lines = it_text.

When i am executing the above code in a report , it is working fine ,

but when i had copy the above code inside a function module,

Text symbol is getting replaced with blank value.

So,is there are some limitations of using TEXT_SYMBOL_REPLACE or please suggest if there is some other issue.

Thanks

10 REPLIES 10
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
2,156

Do you mean a exit function module ?

Read only

0 Likes
2,156

Its a normal Z Function Module. Even i tried declaring the variables in Global Data also, still its not working

Read only

0 Likes
2,156

Add to the function call:

PROGRAM = sy-repid

Read only

0 Likes
2,156

Thanks for the quick reply Sujay and Maen. I tried using below code ,still not working inside function module

CALL FUNCTION 'TEXT_SYMBOL_REPLACE'

EXPORTING

header = header

program = sy-repid

ENDLINE = cnt

replace_text = 'X'

TABLES

lines = it_text.

Read only

Former Member
0 Likes
2,156

Possibly declare DATA: PO_NUM TYPE char30 VALUE 'TEST1234' in your TOP-include of your functionpool.

Read only

Former Member
0 Likes
2,156

Hi,

I checked the FM, it is having the TDLines andetc. When you run this code using the report the system will have the values., but when use it in standard code, then u need to generate some internal tables which will be used by the FM. In general you need to find pre required function modules.

Check this function pool SAPLSTXV.

Regards

Shiva

Read only

Former Member
0 Likes
2,156

Hi,

Pass replace_text = 'X' and try. You can provide the start line and end line.

Check the exporting parameter changed

Hope it helps.

Sujay

Read only

0 Likes
2,156

Its default paragraph '*'

Read only

Former Member
0 Likes
2,156

Hi,

What is the tline-tdformat for the line you are trying to change?

Sujay

Read only

Former Member
0 Likes
2,156

Hi,

I see that you marked this as answered, could you please provide the solution, I have the same problem.

Thanks.

Cumps,

Diogo Silva-