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

DOI: How to create hyperlinks in Excel cells?

former_member195402
Active Contributor
0 Kudos
2,924


Hi Abapers,

I have the request to extract some master data and related documents from SAP to a Windows network drive. The master data catalogue should be an Excel file, which may be enhanced by additional rows.

For each master data entry there should be a hyperlink to a specific folder, where related documents will be available after download from SAP to this folder.

In a first development step I tried to create this excel catalogue using the interfaces I_OI_DOCUMENT_PROXY and I_OI_SPREADSHEET. As a simple sample I've tried with two fields MARA-MATNR and MAKT-MAKTX.

Already working are the functions:

  • Creating new excel file(s)
  • Adding new rows into the excel sheet complying with the correct sort order
  • Formatting header and data rows.

This is the excel sheet created by my report (Material description is replaced ).

But now I can't find a method to insert a hyperlink to the material number cells. It should link to folder "../000000000000000289' for material number 000000000000000289 in cell A3 (row 3 column 1).

How can I achieve this using the interfaces  I_OI_DOCUMENT_PROXY and I_OI_SPREADSHEET ?

Thanks for your help!

Klaus

1 ACCEPTED SOLUTION

rosenberg_eitan
Active Contributor
0 Kudos
1,797

Hi,

Here is my quick and dirty attempt.

regards.

See program y_r_eitan_test_25_07 .

9 REPLIES 9

rosenberg_eitan
Active Contributor
0 Kudos
1,797

Hi,

Just thinking...... can you generate HTML instead of Excel ?

regards .

0 Kudos
1,797

Hi Eitan,

thanks for your interest. I choose excel and DOI, because I can read the excel sheet data with DOI into an internal table, and I have the option to insert rows in a specific sort order. Do you know a tool like DOI to read html table contents into an internal ABAP table like DOI for excel?

The problem is, that I need an existing catalogue to be extended in the correct sort order.

Regards,

Klaus

rosenberg_eitan
Active Contributor
0 Kudos
1,797

Hi,

See if this is useful:


Found it using google "excel with url"

rosenberg_eitan
Active Contributor
0 Kudos
1,797

Hi,

I just noticed that if you use UNC naming it is working....

So maybe just create an extra column with the required path.

Regards.

0 Kudos
1,797

Hi Eitan,

I've added a new column and checked this.

These hyperlinks in Excel are working automatically, if I directly insert them in Excel. But If I fill them with DOI, they don't  work as hyperlinks, but show as normal text only. This looks like a format issue, but I can't find a hyperlink format option for cells in DOI.

In the last line I simply overwrote the leading F of file with F and it became a hyperlink automatically. But I need to do this with DOI.

I've tried with method UPDATE_DOCUMENT_LINKS of interface I_OI_DOCUMENT_PROXY. But there was no effect.

I've attached my sample report now.

Regards,

Klaus

0 Kudos
1,797

Hi,

I need to play with this I have never used package SOFFICEINTEGRATION .

Regards

rosenberg_eitan
Active Contributor
0 Kudos
1,798

Hi,

Here is my quick and dirty attempt.

regards.

See program y_r_eitan_test_25_07 .

0 Kudos
1,797

Hi Eitan,

thank you for your input. Your solution told me the way.

After changing field values to '=HYPERLINK("...")' there was still no hyperlink there:

So it didn't work for me, but in your sample it was working. My thought was, that this might be caused by method I_OI_SPREADSHEET->CELL_FORMAT. So in the next try I formatted the header part only and I got the following result:

Now the material number was no longer a text and the hyperlink was working. After searching for some documentation of structure SOI_SELL_ITEM I found some new fields I've never seen in DOI samples until now. So I didn't use them. One of them is field NUMBER. After splitting the format of the data cells into two parts for normal data and hyperlink data it was working as desired and the link opens the folder:

Thank you for your help. Great idea to let excel do the hyperlink job instead of DOI. My Excel knowledge is very poor.

If somebody else has an issue like that, I've attached the report and the DDIC structure ZTBC_EXCEL_SAMPLE below.

Regards,

Klaus

0 Kudos
1,797

Hi,

Great !! 

I want to thank you on behalf of some grateful people here that were not aware of SOFFICEINTEGRATION .

Regards