cancel
Showing results for 
Search instead for 
Did you mean: 

Hyperlink in Smartform

Former Member
0 Kudos

Hello,

I am able to create hyperlink in smartform and also able to open the link when I output the in pdf format. My question is how to I hide hyper link and display test ex: If i click on SAP it should go to WWW.SAP.COM

I tried to serach SDN forum but did'nt get the answer.

Thanks,

AP

Accepted Solutions (1)

Accepted Solutions (1)

aidan_black
Active Contributor
0 Kudos

Hi,

You ca try using the callback method described in the following Notes:

622718 - SF Web Forms: Callback for the URL format

707931 - Web Forms: Incorrect URL address with the HTML output

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 must create your own function module with the following interface:

*"

*" CHANGING

*" REFERENCE(DATA) TYPE TTXCTOKEN

*"

Data: i_data type STXCTOKEN,

(see 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.

Regards,

Aidan

brad_bohn
Active Contributor
0 Kudos

Nice post Aidan. I've seen that note before but discarded it thinking it was for XSF to HTML output only. I just tried it in the OTF to PDF interface and it works! You simply need to modify the ST line of the DATA table to identify the correct description and link in the callback function. It's not pretty, but it works. Sweet!

Abhijeet-K
Active Participant
0 Kudos

Wonderful solution. It delivered the very thing I needed: an alias for the hyperlink text. I am sharing the [final output|http://picasaweb.google.com/abhijeetavinashkulkarni/SDN?feat=directlink] for the benefit of fellow visitors.

Former Member
0 Kudos

Abhijeet,

What do you write in the function module. I have 3 URL in the form. Big URLs with about 65 character.

Thanks,

AP

Abhijeet-K
Active Participant
0 Kudos

See following function modules-

HR_RCF_SF_URL_CALLBACK

and

SF_XSF_DEMO_URL

Prefer the first one. The maximum length of a link can be 42 characters, even though the permissible length in the STXCTOKEN line type is 255.

Former Member
0 Kudos

Hi Abhijeet,

Iam not able to access your complete solution link.

Kindly let me know the steps to mask the link in a word.

suppose iam having link = 'https://google.com' and the type of link is string.

which i have to display in smartform output as Click.

Iam not finding the driver program of the smartform also.

Kindly send me the complete steps in order to achieve the same .

Thanks in advance.

Regards

Sharief

Abhijeet-K
Active Participant
0 Kudos

Dear Sharief,

Refer to my earlier post in the same thread. It has the function module that can be used to adjust the URL. The HR_RCF_SF_URL_CALLBACK is perfect. Now, assuming you are calling the smartform from a custom program, written by you (or your team), do the following-


DATA: v_fmnam   TYPE rs38l_fnam,
      ls_ctropt TYPE ssfctrlop,
      ls_output TYPE ssfcompop.
.
.
.

ls_output-urlcall = 'HR_RCF_SF_URL_CALLBACK'.
.
.
.

CALL FUNCTION v_fmnam
  EXPORTING
    user_settings      = space
    control_parameters = ls_ctropt
    output_options     = ls_output
  EXCEPTIONS
    formatting_error   = 1
    internal_error     = 2
    send_error         = 3
    user_canceled      = 4
    incorrect_document = 5.
.
.
.

In case, you are using something like print workbench or any SAP program that calls the smartform in it, try finding an exit that gets called prior to the generated function module of the smartform, and put these setting there.

Former Member
0 Kudos

Dear Abhijeet,

Many Thanks for your kind reply.

Iam developing the link to Word functionality for SRM 5.0 in the workflow using smartform , when the SC goes to Purchaser for the PO creation where the purchaser will reject the SC for some reason.

Then a notification will be sent to purchaser saying the SC is rejected.

The notification will be having the details of the SC's he created. In which the Inbox link to open the SC will be there.

Iam concatinating the link with other data and putting it into one string variable.

and it will be like http://psrmhsd.app.8082/sap/bc/gui/sap/its/bbpsc12 , instead of displaying the complete link i want it to a word say "LOGIN" when they click to this word will actually have the above link embedded.

Also in SRM the FM 'HR_RCF_SF_URL_CALLBACK' is not available, should i have to create this FM and then proceed or is there any other way to continue.

Kindly let me know the steps if you are having for this functionality .

Many thanks in advance.

Regards

Sharief

Abhijeet-K
Active Participant
0 Kudos

Dear Sharief,

This thread fulfils your requirement. Nevertheless, follow these steps.

You can simply create a text element in the smartforms with text 'Login' in it. Use the 'Insert URL' button (in the extreme right of the list of buttons) to assign hyperlink to it. The word should now appear with an underline and in blue colour.

Also, call function module HR_RCF_SF_URL_PREPARE_CALLBACK, anywhere in your smartform, to set the hyperlink to be assigned under the text 'Login'.

As mentioned in my penultimate post, put the function module HR_RCF_SF_URL_CALLBACK in the URLCALL field, so that the requisite hyperlink can be actually assigned under the 'Login' text.

Now, if you don't have these function modules in your landscape, make a custom copy of same, referring to the corresponding R/3 code. In case you don't have a R/3 installation, get the copy from some colleague/friend who has. Of course, it goes without saying, that if you create custom copies of the aforesaid function modules, remember to assign the corresponding custom names in the right places, as described above.

You should get the hyperlink under the 'Login', beautifully.

Former Member
0 Kudos

Dear Abhijeet,

Thanks again for the reply.

I created the FM's HR_RCF_SF_URL_PREPARE_CALLBACK and HR_RCF_SF_URL_CALLBACK but iam not sure where to use these FM's.

In the smartforms i have done the changes as enclosed below.

If the link is

http://pminhsrmhsd.app.pmi:8082/sap/bc/gui/sap/its/bbpsc12/!?sap-language=EN&sap-client=320&SC_H_GUI...

and iam trying to mask this link into word LOGIN,

But when i try to click this link iam getting the below window, which is not the above link which iam required.

The actual link is not getting masked.

For this i did the development something like this.

In the smartform inside the program lines i have coded

CONCATENATE lv_url

'bbpsc12/!?sap-language=EN'

'&sap-client='

sy-mandt

'&SC_H_GUID='

lv_hguid

'&ITMGUID='

lv_iguid

INTO lv_link.

CALL FUNCTION 'READ_TEXT'

EXPORTING

client = sy-mandt

id = 'ST'

language = sy-langu

name = 'ZH_SC_REJECTION_NOTIFICATION'

object = 'TEXT'

TABLES

lines = lt_text.

CONCATENATE LINES OF lt_text INTO l_str.

REPLACE ALL OCCURRENCES OF '<URL>' IN l_str WITH lv_link RESPECTING CASE.

Here the lv_link is of type string.

Kindly suggest what code iam missing here to do in order to mask the lv_link (actual link) into the word "LOGIN"

-


I have created standard text 'ZH_SC_REJECTION_NOTIFICATION'

<html><body bgColor=#cbdbea>

<p> The shopping cart can be accessed by the following link:

<br/><a href="<URL>" target="_blank">LOGIN</a>

</body></html>

In smartform i have included the created text as below

In web properties i have not included anything, is anything needs to be defined here

-


In the smartform , In the text i have included the text "LOGIN" as below

Also I have created one standard text 'ZH_SC_REJECTION_NOTIFICATION'

in order to display the link in the "LOGIN" word .

Kindly suggest the necessary changes to be done at the appropriate place, your help is highly appretiated.

Many thanks in advance.

Regards

Sharief

Abhijeet-K
Active Participant
0 Kudos

Dear Sharief,

My last post was clear enough. Please understand, that you will need to piece in the information from various sources for your need and club them together to try out the right settings suitable to your requirements. Me or anyone can't spoon feed solutions.

As for the placement of call for the HR_RCF_SF_URL_PREPARE_CALLBACK, since your requirement is of a dynamic URL, call it after you have decided upon the final link value. Let me remind, yet again, as you happen to have comfortably overlooked the fact mentioned earlier in the same thread, that the link length can't be more than 42 characters. Furthermore, you also have paid little heed to the simple and clear steps to create a text in the smartform with hyperlink under it. Making and calling a standard text, to put a hyperlink in the smartforms, is the most ingeniously zany way one could ever see in their lifetime.

My final advice is this: Please go through the posts carefully. If you can reduce the length of the URL upto 42 characters, you can get the desired result.

Sincere apologies for the inconsiderate tone.

Former Member
0 Kudos

Dear Abhijeet,

Thank you very much for your help.

I have achieved my requirement with the standard text.

Thanks for your time .

Regards

Sharief

Former Member
0 Kudos

I have a related issue. I have a created a user version of a supplied SAP for E-Recruiting. I cannot ammend the interface as this is SAP standard. (The user version of the for can be called by configuration).

I have implemented the changes suggested by Abhijeet but the only place where can set output_options-urlcall is in the initialization section of the form and this seems to late.

I have simulated the same issue on a test form that I have developed and it seems that if output_options-urlcall is set before the interface the form is called the form works correctly but if I do it in the initialization section of the form it doesn't work.

Any advice?

Thanks

aidan_black
Active Contributor
0 Kudos

Hi,

You need to fill the parameter OUTPUT_OPTIONS-URLCALL when you call the function module of the Smartform from your application program. If this is a standard SAP application program, you will need to copy it to a Zxxxxx program and make the needed change.

Regards,

Aidan

Former Member
0 Kudos

Hi Abhijeet,

Need your help here, I have the similar requiremnt and implemented both the FM HR_RCF_SF_URL_PREPARE_CALLBACK and HR_RCF_SF_URL_CALLBACK as sugged in the thread, but not wroking for PDF.

Please suggest Is there anything else I need to do ?

Thanks in Advance

Manohar

Sandra_Rossi
Active Contributor
0 Kudos

Hi Abhijeet,

sorry to restart an old thread, but there was a new one (here: ) about the same topic and a confusion because of a supposed 42 characters length limitation. So I'd like to correct that. In 7.0 SP 13, there's no limitation, the LK line has to be repeated several times to enter long URLs. I agree that we can't use the whole STRING length, but it's cut off at 70 characters. First 4 characters must be left blank, and LEN value must be STRING length minus 4 (so it can be 66 maximum). LINE must go from 1 up to the number of LK lines.

Sandra

brad_bohn
Active Contributor
0 Kudos

I'm not sure that the case though - maybe it's version dependent. I don't touch the 'LK' line, only the 'ST' line and I can enter long URL's with it in 7.0 SP16. Though I haven't tried to go over the 255 limit, I've used about 200 characters max and the hyperlink portion extends up until the width of the window.

A simple example:


  DATA: ls_data TYPE LINE OF ttxctoken.

  LOOP AT data INTO ls_data.

    IF ls_data-string CS 'www'.

      IF ls_data-code EQ 'ST'.

        ls_data-string = text-h01.
        ls_data-len    = STRLEN( ls_data-string ).

      ELSEIF ls_data-code EQ 'LK'.

      ENDIF.

    ELSEIF ls_data-string CS 'mailto'.

      IF ls_data-code EQ 'ST'.

        ls_data-string = text-m01.
        ls_data-len    = STRLEN( ls_data-string ).

      ELSEIF ls_data-code EQ 'LK'.

      ENDIF.

    ENDIF.

    MODIFY data FROM ls_data.

  ENDLOOP.

Former Member
0 Kudos

How did you do it by Standard Text?

Sandra_Rossi
Active Contributor
0 Kudos

Please, stop posting here, it's an old answered thread, continue on that new one -> (and sorry it was my fault)

Former Member
0 Kudos

Hi Sharief,

How you have achived by using Standard text ?. Please share your knowledge, it will be veymuch helpful for me.

Thanks & Regards,

Hema

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi All,

We have a requirement wherein we need to provide a dynamic hyperlink in the smart form.

We have tried to create a function module passing changing parameter as TTXCTOKEN and used the function module in output_options-URLCALL. This is not working.

The output of the smartform is in the form of .pdf.

Thanks in advance

nikhil

krishna_k17
Participant
0 Kudos

Hi Nikhil,

I am also facing the same issue, could you please specify the procedure you followed to fix the long URL issue in the smartforms.

Thanks in advance.

Regards,

krishna

Former Member
0 Kudos

We have a requirement wherein we need to provide a dynamic hyperlink in the smart form.

We have tried to create a function module passing changing parameter as TTXCTOKEN and used the function module in output_options-URLCALL. This is not working.

The output of the smartform is in the form of .pdf.

brad_bohn
Active Contributor
0 Kudos

You didn't search very well then - I've answered this several times before...