Application Development 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: 

CONVERT_OTF converting url to 'Click here'

faisal_pc
Active Contributor
0 Kudos

Hi all,

I searched something relevant to my issue but couldn't find any. Kindly let me know if anybody of you had come across this issue.

I have a smartform where I have a link like www.google.com. If I execute the smartform individually, it comes as www.google.com only. But when I use the FM CONVERT_OTF and attach the smartform to a service request, it comes as 'Click here'. Though it takes to the right url, user doesn't want this 'click here' to come. Instead they want the actual url. My code is as below,

"render form
     CALL FUNCTION lv_fm_name
       EXPORTING
         control_parameters = ls_control_parameters
         output_options     = ls_output_options
         header             = is_header
       IMPORTING
         job_output_info    = ls_job_output_info
         job_output_options = ls_job_output_options
       EXCEPTIONS
         formatting_error   = 1
         internal_error     = 2
         send_error         = 3
         user_canceled      = 4
         OTHERS             = 5.
     IF sy-subrc NE 0.
" Exception
     ENDIF.

     "Convert OTF to PDF
     CALL FUNCTION 'CONVERT_OTF'
       EXPORTING
         format                = 'PDF' ##no_text
       IMPORTING
         bin_filesize          = ev_pdf_stream_len
         bin_file              = ev_pdf_stream
       TABLES
         otf                   = ls_job_output_info-otfdata
         lines                 = lt_dummy_lines
       EXCEPTIONS
         err_max_linewidth     = 1
         err_format            = 2
         err_conv_not_possible = 3.
     IF sy-subrc NE 0. "PDF conversion failed
"Exception
     ENDIF.


Thanks,

Faisal

8 REPLIES 8

former_member182915
Active Contributor
0 Kudos

Hi,

Dummy code

DATA ls_output_options_sf TYPE ssfcompop.
DATA lv_function_module_name TYPE rs38l_fnam.


TYPES: BEGIN OF ty_url,
           name(80),
           url TYPE string,
         END   OF ty_url.

DATA: lt_url TYPE TABLE OF ty_url,
          ls_url TYPE          ty_url.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
  EXPORTING
    formname           = 'ZHCM_EXP_HYPERLINK'
  IMPORTING
    fm_name            = lv_function_module_name
  EXCEPTIONS
    no_form            = 1
    no_function_module = 2
    others             = 3.

ls_url-name = 'TEST'.
ls_url-url  = 'https://www.google.co.in/'.
APPEND ls_url TO lt_url.


* clear buffer for callback functionality

CALL FUNCTION 'HR_RCF_SF_URL_REFRESH_GT'.

CALL FUNCTION 'HR_RCF_SF_URL_PREPARE_CALLBACK'
  TABLES
    pt_url = lt_url.

ls_output_options_sf-urlcall    = 'HR_RCF_SF_URL_CALLBACK'.

CALL FUNCTION lv_function_module_name
EXPORTING
   OUTPUT_OPTIONS                  = ls_output_options_sf
*   USER_SETTINGS                   = 'X'
* IMPORTING
*   DOCUMENT_OUTPUT_INFO     =
*   JOB_OUTPUT_INFO                 =
*   JOB_OUTPUT_OPTIONS          =
* EXCEPTIONS
*   FORMATTING_ERROR           = 1
*   INTERNAL_ERROR                = 2
*   SEND_ERROR                       = 3
*   USER_CANCELED                 = 4
*   OTHERS                                = 5
          .
IF SY-SUBRC <> 0.
* Implement suitable error handling here
ENDIF.

have a look

http://scn.sap.com/community/abap/blog/2014/01/28/hyperlink-alias-in-smartform

http://adamus.home.pl/sap/index.php/2014/03/09/change-urls-text-in-smartform-or- pdf-generated-from-smartform/

0 Kudos

Hi Swadhin,

Kindly check the question once again. I want the link to be as a link only. Not as a normal text. However, I don't want it to get converted as 'Click here'.

Thanks,

Faisal

0 Kudos

Check the image .

Instead of text put Url.

0 Kudos

Hi,

If you thing I am in wrong direction, I let me known .

0 Kudos

Hi Swadhin,

Thanks for the reply. However, my smartform doesn't have any issue if I execute that individually. The issue is when I convert that OTF to PDF by using the FM CONVERT_OTF. I get the proper result if I  execute it individually.


Thanks,

Faisal

0 Kudos

Then you want to say if you run for single smartform it is working fine if u run for more data their is some error.

and if I am not wrong u definitely use on_open and on_close parameter in setting which is working good for single record for multiple record as for as example for second record it does not get OTF data so in that case I suggest we do changes in calling of sf to get OTF data for every time.

0 Kudos

Hi Swadhin,

Kindly read my question in the first post. I am not saying when I execute a single smartform there is an issue. I meant when I execute smartform individually- means, I go to tcode smarforms and press on execute button, and then pass the importing parameters->Go to print preview. It works fine there.

When I use the FM convert_otf only there is the issue.

Thanks,

Faisal

0 Kudos

Hi,

 If I execute the smartform individually, it comes as www.google.com only. But when I use the FM CONVERT_OTF and attach the smartform to a service request, it comes as 'Click here'. Though it takes to the right url, user doesn't want this 'click here' to come.

So share screen with and with out 'Click here' text.