on 11-21-2008 2:50 AM
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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...
DATA: t_lines LIKE tline OCCURS 0 WITH HEADER LINE.
WHILE v_account_number NE 3.
ADD 1 TO v_account_number.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'ST'
language = sy-langu
name = 'ZSCTEST'
object = 'TEXT'
TABLES
lines = t_lines
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT t_lines.
REPLACE '&V_ACCOUNT_NUMBER&' IN t_lines-tdline
WITH v_account_number.
WRITE:/ t_lines-tdline.
ENDLOOP.
ENDWHILE.
Hope this helps a bit.
Cheers,
Sougata.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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&
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.