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: 

How to generate the URL, which links to SAP GUI application?

Former Member
4,238

Hi all,

We use email for notification of the our transaction.

In the email notification, we want to add some links to the transaction, by clicking it, the SAP GUI will open (with SSO) automatically with transaction.

In other words, user shall can navigate to the SAP GUI application with the URL Link in email notification.

In the CSS system, when we got an internal message, the system will generate both the WebDynpro link and SAP GUI link.

It implements like following procedure for SAP GUI link:

1. Download the ***.sap file with the URL link, the parameters are set in the ***.sap file

2. Open the ***.sap file automatically, which starts the transaction.

Do you have any ideas to generate such URL links for SAP GUI?

Thanks,

Miao

8 REPLIES 8

Former Member

0 Kudos
503

Thanks. But I am writing ABAP code.

I prefer if there is any function module or classes to generate the SAP URL links.

0 Kudos
503

Hi Miao,

Please go through the below link, look for my response where i have mentioned on how to build your attachment for opening a Tcode.

Regards,

Chen

0 Kudos
503

Thanks Chen.

The solution attach the ***.sap as attachment within the email notification can be a workaround.

It is not the solution I am looking for, because it is not simple for the notification.

I prefer there is only a link in the email, e.g. https://host_address/sap/bc/bsp/sap/itsm_gui/cssguimessage.htm?pointer=012006153200022237672011.

The link may direct to the download of ***.sap file, it also OK. Because for the email itself, it's simple.

BTW, the example has the same behavior as you mentioned.

[Creating a SAP shortcut for any transaction and sending it by mail|http://wiki.sdn.sap.com/wiki/display/Snippets/CreatingaSAPshortcutforanytransactionandsendingitby+mail]

0 Kudos
503

Hi Miao,

thanks for that wiki example, i could use the FM SWN_CREATE_SHORTCUT instead of hard coding the file content.

Coming back to your question,

I prefer there is only a link in the email, e.g. https://host_address/sap/bc/bsp/sap/itsm_gui/cssguimessage.htm?pointer=012006153200022237672011.

The link may direct to the download of ***.sap file, it also OK. Because for the email itself, it's simple.

So, if i understand you correctly, you want to send a link to the actual file(shortcut) and not the actual file.

In this case, you need to identify a file server or a folder on you app server and drop the content you get from the FM SWN_CREATE_SHORTCUT into a .SAP file using OPEN, TRANSFER and CLOSE data set. Once this is done you can send an email with the link. Although the security aspects of read/write authority on this file server/folder on the app sever needs to be identified and defined properly.

Also, you need to keep in your mind to be generic in your coding that the file server/folder on app server will be different in Dev/QA/Prod.

Regards,

Chen

0 Kudos
503

Hi Chen,

The process, OPEN DATA SET, TRANSFER, CLOSE shall make sense for the .SAP file.

One more question, how can I get the URL of the file, after the above operations?

Thanks,

Miao

0 Kudos
503

Hi Miao,

There are several ways to do this, in one of the projects i worked for, they had a folder on one of the APP Servers within which they would create a folder for each of the RICEFs that were developed, and each of these folder would have a defined folder structure within it like "IN, OUT, WORK, ERROR" etc. And they had an common Z FM created which would fetch the URL for a specifc RICEF and Folder(obviously they ahd a strict naming convention for App Server and folders within).

If you have a single App server, you could use SY-HOST\FOLDER\Filename.SAP etc.

So, in case if you have a similar set up you could explore this.

Else, a simple approach would be to maintain entry in TVARVC table, this table entry would contain the URL of the File Server/Folder on APP server, in your program you can select this entry and append it with the "\filename.sap" and create the file using OPEN/TRANSFER/CLOSE DATASET and use the same filepath as the URL in the email.

Once you transport your program from Dev to QA to PROD you can maintain the entry accordingly for the respective File Server/Folder on the App Server.

Note: you could also try with Tcode: FILE(links logical file path to Physical filepath), it has been a long time since i have used it and mostly forgotten it, but definitely a possibility to check out.

Regards,

Chen

Edited by: Chen K V on Jun 29, 2011 2:03 PM

0 Kudos
503

Hi Chen,

Thanks for your ideas.

I think it's the best solution I can find.

Best regards,

Miao