[go: up one dir, main page]

0% found this document useful (0 votes)
18 views9 pages

Solved - Parameterized Standard Text - SAP Community

The document discusses how to create parameterized standard text in ABAP by passing parameters to standard texts. It is possible to pass a parameter to a standard text by using the READ_TEXT function module to read the text into an internal table, then looping through the table to replace placeholders with parameter values before output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views9 pages

Solved - Parameterized Standard Text - SAP Community

The document discusses how to create parameterized standard text in ABAP by passing parameters to standard texts. It is possible to pass a parameter to a standard text by using the READ_TEXT function module to read the text into an internal table, then looping through the table to replace placeholders with parameter values before output.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

5/16/24, 5:37 PM Solved: Parameterized standard text - SAP Community

Community

SAP Community  Products and Technology  Technology  Technology Q&A  Parameterized standard text

All community  What are you looking for today?

Options

Parameterized standard text

 Go to solution

Former Member


on ‎11-21-2008

 0 Kudos

Hello,

Is possible pass a parameter to a standard text?

For example, I have a text Z_BANK_DATA id ST lang EN. Currently this is a normal text
with data about a bank account (eg. "Bank ABC, Account 123456, New York, NY, USA").
Is possible transform that into something like this: "Bank ABC, Account
&ACCOUNT_NUMBER&, New York, NY, USA", and then pass it the value of
ACCOUNT_NUMBER when the text is included in my form?

Thank you all in advance.

Regards,

Charles Oliveira

https://community.sap.com/t5/technology-q-a/parameterized-standard-text/qaq-p/4790176 1/9
5/16/24, 5:37 PM Solved: Parameterized standard text - SAP Community

SAP Managed Tags:

NW ABAP Print and Output Management

 Show replies

Answer

 Accepted Solutions (1)


Former Member


‎11-21-2008

 0 Kudos

Hi,

It is possible through include text also.

Try this eg:

In Script write like this.

/: PERFORM GETTOTVAL IN PROGRAM Z_TEST

/: CHANGING &FINAL&

/: ENDPERFORM

/: INCLUDE Z_TEST OBJECT TEXT ID ST LANGUAGE EN

https://community.sap.com/t5/technology-q-a/parameterized-standard-text/qaq-p/4790176 2/9
5/16/24, 5:37 PM Solved: Parameterized standard text - SAP Community

In Se38 Program :

FORM GETTOTVAL TABLES IN_TAB STRUCTURE ITCSY

OUT_TAB STRUCTURE ITCSY. "#EC CALLED

DATA : VAL(10) TYPE C.

SELECT SINGLE EBELN FROM EKKO INTO VAL .

READ TABLE OUT_TAB WITH KEY NAME = 'FINAL'.

IF SY-SUBRC IS INITIAL..

OUT_TAB-VALUE = VAL.

MODIFY OUT_TAB INDEX SY-TABIX.

ENDIF.

ENDFORM.

In SO10(Standard Text)

This is standard text &FINAL& only

O/P : This is standard text 4100000078 only

 Show replies

https://community.sap.com/t5/technology-q-a/parameterized-standard-text/qaq-p/4790176 3/9
5/16/24, 5:37 PM Solved: Parameterized standard text - SAP Community

 Answers (2)

Sougata
Active Contributor

‎11-21-2008

 0 Kudos

Hello Charles,

I think its worth a try but I suggest you avoid INCLUDE TEXT if you want to replace the
values at runtime.

In SO10 enter your text name and click on change button to go to the editor to change
the text. At the correct position click menubar Insert->Symbols->Program Symbols. In the
following pop-up "Print Programs for Form" choose your print program - if its not there on
the list, you can add it by clicking Append Print Program. Now select your print program
and hit Global Data button which will then show you all global data currently available in
your print program. Here you should have already declared the variable
ACCOUNT_NUMBER - now double click to choose it and the system automatically
inserts it as &ACCOUNT_NUMBER&.

In your print program now you can pass the value of field ACCOUNT_NUMBER in a loop
and within the same loop I think if you can call FM READ_TEXT then replace the
&ACCOUNT_NUMBER& with the required value....something along the lines of...

https://community.sap.com/t5/technology-q-a/parameterized-standard-text/qaq-p/4790176 4/9
5/16/24, 5:37 PM Solved: Parameterized standard text - SAP Community

1
2 DATA: t_lines LIKE tline OCCURS 0 WITH HEADER LINE.
3
4 WHILE v_account_number NE 3.
5 ADD 1 TO v_account_number.
6 CALL FUNCTION 'READ_TEXT'
7 EXPORTING
8 id = 'ST'
9 language = sy-langu
10 name = 'ZSCTEST'
11 object = 'TEXT'
12 TABLES
13 lines = t_lines
14 EXCEPTIONS
15 id = 1
16 language = 2
17 name = 3
18 not_found = 4
19 object = 5
20 reference_check = 6
21 wrong_access_to_archive = 7
22 OTHERS = 8.
23
24 IF sy-subrc <> 0.
25 MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
26 WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
27 ENDIF.
28 LOOP AT t_lines.
29 REPLACE '&V_ACCOUNT_NUMBER&' IN t_lines-tdline
30 WITH v_account_number.
31 WRITE:/ t_lines-tdline.
32 ENDLOOP.
33 ENDWHILE.

Hope this helps a bit.

Cheers,

Sougata.

 Show replies

https://community.sap.com/t5/technology-q-a/parameterized-standard-text/qaq-p/4790176 5/9
5/16/24, 5:37 PM Solved: Parameterized standard text - SAP Community

Former Member


‎11-21-2008

 0 Kudos

Hi,

If u r using Include Text it is not possible to get the &ACCOUNT_NUMBER& in middle.

By using READ_TEXT FM u can do it .

If u use FM,u can get all the data in one internal table.Then loop that table and fetch

" Bank ABC, Account " in one variable(V1) and "New York, NY, USA" in another
variable(V2).

Then in u r form Print

&V1& &ACCOUNT_NUMBER& &V2&

 Show replies

Ask A Question

https://community.sap.com/t5/technology-q-a/parameterized-standard-text/qaq-p/4790176 6/9
5/16/24, 5:37 PM Solved: Parameterized standard text - SAP Community

Type your question here...

Continue

Recommendations

 Standard text changes not getting reflected immedi... 
‎10-04-2023


 How to use parameterized external service programa... 
‎02-04-2023


 SAC - Multiactions: Use Unique parameteres 
‎02-14-2022


 Standard Text 
‎11-02-2006


 Removing Translate Manually for Standard recording... 
‎03-06-2024

Related Content
Simple way to renew NW ABAP SSL certificate with STRUST Replacement Wizard 
in Technology Blogs by Members 3 hours ago

First steps to work with SAP Cloud ALM Deployment scenario for SAP ABAP systems
(7.40 or higher) 
in Technology Blogs by SAP Sunday

S_ALR_87013611 Report Painter report to Internal Table 


in Technology Q&A Saturday

SAP Cloud ALM: Requirements Management on Steroids 


https://community.sap.com/t5/technology-q-a/parameterized-standard-text/qaq-p/4790176 7/9
5/16/24, 5:37 PM Solved: Parameterized standard text - SAP Community
in Technology Blogs by SAP a week ago

Embedding Business Context with the SAP HANA Cloud, Vector Engine 
in Technology Blogs by SAP a week ago

Top Q&A Solution Author

SAPSupport  74

N1kh1l  9

MioYasutake  8

TuncayKaraca  6

DonWilliams  6

Dinu  5

kaidehmann  5

Edrilan_Berisha  4

Ryan-Crosby  4

William_Yu  4

View all

https://community.sap.com/t5/technology-q-a/parameterized-standard-text/qaq-p/4790176 8/9
5/16/24, 5:37 PM Solved: Parameterized standard text - SAP Community

Latest Posts
How to enable SAC story script editing for other u...

Re: How to upload data to date "Unassigned" 0000-0...

Hiding Workflow Step Names in Business Process Aut...

Re: ABAP Native SQL not working

Re: ABAP Native SQL not working

View all

Follow

Privacy Terms of Use

Copyright Legal Disclosure

https://community.sap.com/t5/technology-q-a/parameterized-standard-text/qaq-p/4790176 9/9

You might also like