2018 May 16 11:54 AM
We have a requirement to display 100 char long urls under alias text as hyperlink, such that on clicking on the alias it is redirected to the url. We have gone through related links
https://archive.sap.com/discussions/thread/1819587 and
https://blogs.sap.com/2014/01/28/hyperlink-alias-in-smartform/ but not getting the hyperlink displayed from smartforms.
We have followed below steps :
1)We have created text element "LOGIN" in smartforms and clicked on URL button to activate hyperlink
2)In the Calling program we have declared url with name "LOGIN" and passed to FM HR_RCF_SF_URL_PREPARE_CALLBACK
3)In the Calling program we have declared the output_options-urlcall = 'HR_RCF_SF_URL_CALLBACK'.
The smartform conversion data format is ASCII. Kindly assist <removed by moderator>.
2018 May 16 2:58 PM
Hi Sayani,
You can get a different title of the link by using a kind of user exit for the URL processing, which is described in Note 622718.
You may create your own function module with the following interface: *" *" CHANGING *" REFERENCE(DATA) TYPE TTXCTOKEN *" Data: i_data type STXCTOKEN, (see the note 622718; TTXCTOKEN is an internal table of type STXCTOKEN)
Now when you call the function module of the Smartform, you should fill the parameter OUTPUT_OPTIONS-URLCALL with the name of the new function module. As a result your function module is called, when the URL is processed by the Smartforms composer.
Let's look at an example: Let's say you use the URL www.web.uk in your Smartform.
Then the internal table 'data' is filled with the following contents, when the function module is called:
CODE LINE LEN STRING
1 ST 1 16 http://www.web.uk
2 LK 0 20 http://www.web.uk
ST Line with alias
LK Line with link
LINE index of line in the table
LEN length on data in the row
You can change the content of this structure in your function module. Long links must be split to different rows with maximum length 70.
Each row must start with 4 spaces. E.g. if you change the table according to the PNG file
For this example the following HTML tag is generated: <a href="http://www.1234567890.12345.uk">Link</a>
Best regards,
Hedvig
2018 May 17 8:35 AM
Hello Hedwig,
Thank you for the answer.
1)We have created the smartforms text element as below :
LOGIN
2)We have created custom FM and function group by copying standard HRRCF00_CALLBACK and have inserted the below code in smartforms calling program. (here url is 42 chars long and in custom FM
ZHR_RCF_SF_URL_CALLBACK we have kept max length as 70 chars) :
ls_url-name = 'LOGIN'.
ls_url-url = sf_tam_url.
APPEND ls_url TO lt_url.
CALL FUNCTION 'ZHR_RCF_SF_URL_REFRESH_GT'.
CALL FUNCTION 'ZHRRCF_SF_URL_PREPARE_CALLBACK'
TABLES
PT_URL = lt_url.
s_output_options-urlcall = 'ZHR_RCF_SF_URL_CALLBACK'.
URL data :
Row Code Line Len string
1 ST 11 5 LOGIN
2 LK 0 42 https://p2pdev.pok.
The output still does not show the hyperlink under alias "LOGIN"
Can u please suggest if any other change is needed apart from above steps.
2022 Mar 02 3:00 PM
2023 Jul 20 10:06 PM
Esto les puede servir.
Hyperlink alias in Smartform | SAP Blogs