
Almost every project I go to, this feature becomes the most attractive feature of the Web Intelligence reports we create for our customers. Clicking on a sales order or invoice to launch an ECC transaction and view or change that order or invoice while viewing the report is an added value feature that you can impress your customers with relatively little effort.
The secret of this feature resides in the structure of the URL. I will explain how to construct the URL by giving the following example:
http://<server>:<port>/sap/bc/gui/sap/its/webgui?~transaction=*CJ03%20*PROJ-PSPID=300002903;DYNP_OKCODE=/00
It is important that the integrated ITS service default_host->sap->bc->gui->sap->its->WEBGUI within your ECC’s NetWeaver instance is active before you can call a WebGUI transaction. The server is your ECC one that you can find in the SAP Logon. You can also find the right port in transaction SICF. The transaction itself must also be enabled for WebGUI access in SE93.
The above example URL is calling transaction code CJ03 and filling the screen field PROJ-PSPID with the WBS number 300002903 and bypassing the selection screen by clicking on the Execute button. This is a static example but in real life, the number should be replaced by the column name in the Web Intelligence report.
As we will see later, these URLs can be constructed to pass on multiple values and click on a specific button on the selection screen in ECC and not necessarily always the Execute button.
The following is a step by step how to add a hyperlink to ECC in a Web Intelligence report:
="<a href=\"http://<server>:<port>/sap/bc/gui/sap/its/webgui?~transaction=VF03+VBRK-VBELN="+URLEncode([Billing Document])+"&~OKCODE=UEBP\" title=\"Display Invoice Document in ECC\" target=\"_new\" nav=\"web\">"+[Billing Document]+"</a>"
The combination of the SAP ITS web GUI URL, the t-code and the screen field will allow specifying the exact location we need to pass the object value we need.Select the column of interest. Right click, select Hyperlink and then New. Please note that you do not need to select the column whose value you wish to pass to ECC.Select the Link to web page option. Enter the following syntax in the URL:
http://<server>:<port>/sap/bc/gui/sap/its/webgui/!?~transaction=(=[L01 Sales Document Number])&~OKCODE=ENT2
="<a href=\"http://<server>:<port>/sap/bc/gui/sap/its/webgui/!?~transaction="+URLEncode(""+[L01 Sales Document Number])+"&~OKCODE=ENT2\" title=\""+("select to go to ECC")+"\" target=\"_blank\" nav=\"web\">"+[L01 Sales Document Number]+"</a>"
="<a href=\"http://<server>:<port>/sap/bc/gui/sap/its/webgui/!?~transaction=VA03%20VBAK-VBELN="+URLEncode(""+[L01 Sales Document Number])+"&~OKCODE=ENT2\" title=\""+("select to go to ECC")+"\" target=\"_blank\" nav=\"web\">"+[L01 Sales Document Number]+"</a>"
You can do this by creating a custom Z transaction code that simply calls a custom ABAP program, which in turn, calls Function Module 'ME_RELEASE_REQUISITION'. The ABAP program takes in the PR Number. Here's an example ABAP program:
REPORT ZMM_CALL_RELEASE_PR_TRANS.
parameters p_pr_no type EBAN-BANFN.
CALL FUNCTION 'ME_RELEASE_REQUISITION'
EXPORTING
IM_BANFN = p_pr_no.
And here's the link you can use to call the Z transaction code ZMM_PR_RELEASE, which you can create in SE93 based on the above Function Module.
http://sapdvap02.lab.corp:8001/sap/bc/gui/sap/its/webgui/?sap-client=602&sap-language=EN/webgui/!&~t... P_PR_NO=0010000143
Of course you can replace the Purchase Requisition number 10000143 with the name of that object in the Web Intelligence report, or any other SAP BI front tool like Xcelsius.This solution can also be used to release Purchase Orders, except you'll have to call Function Module ME_RELEASE_PURCHASE_DOCUMENT in the custom ABAP program, and pass the PO Number you'd like to release. Here's the code:
REPORT ZMM_CALL_RELEASE_PO_TRANS.
parameters p_po_no type EKKO-EBELN.
CALL FUNCTION 'ME_RELEASE_PURCHASE_DOCUMENT'
EXPORTING
I_EBELN = p_po_no.
Source: https://forums.sdn.sap.com/thread.jspa?messageID=6318377
You might want to delete the user session with the parameter ~singletransaction when the transaction started with ~transaction ends. This will ensure that the user has terminated the transaction in ECC when done.
When calling a transaction with ITS 6.20 using the parameter ~transaction, ITS takes care to delete the session when the transaction ends. With SAP NetWeaver and integrated ITS, it doesn’t work the same way because session handling is no longer done by ITS but by the SAP kernel itself. When a transaction ends the system shows the transaction selection screen with the "Start Easy Access Menu" button.
In a portal environment this is often not desired. SAP therefore enhanced the kernel to provide a similar functionality as with ITS 6.20. To activate this functionality you have to set the parameter ~singletransaction=1 in the ICF service. This parameter tells ITS to ask the SAP kernel to logoff a user session at the end of transaction. SAP note 959417 describes the kernel and support package requirements. For those who do not currently have access to the SAP Service Marketplace, the requirements are as follows:
SAP NetWeaver 2004, aka 640:
SAP NetWeaver 2004s, aka 700:
The parameter has the limitation that it doesn't work if the transaction is terminated with LEAVE TO TRANSACTION. You should therefore not use this parameter with the standard WebGUI service but create your own z-service in SICF with ~transaction set to the transaction code you want to provide your users.
Source: https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=25427
Sometimes, you would like to pass on two objects in order to start a transaction in ECC. For example, in the case you need to a Project Number and an Order/Network Number to start transaction code CN41N; Project Structure Overview, the following is a URL that can be used:
="<a href=\"http://<server>:<port>/sap/bc/gui/sap/its/webgui?%7Etransaction=*CN41N+CN_PROJN-LOW="+URLEncode([Project Key])+";CN_NETNR-LOW="+URLEncode([Order/Network Key])+";DYNP_OKCODE%3DONLI\" title=\"\" target=\"_self\" nav=\"web\">"+[Project Key]+"</a>"
Another example of passing two parameters, one is Project Number and the other is a date:
="<a href=\"http://<server>:<port>/sap/bc/gui/sap/its/webgui?%7Etransaction=*CJ74+CN_PROJN-LOW="+URLEncode([Project Key])+";R_BUDAT-LOW="+URLEncode([WBS Last Activity Date])+";DYNP_OKCODE%3DONLI\" title=\"\" target=\"_new\" nav=\"web\">"+[Project Key]+"</a>"
Note: Make sure when you pass on a date, the format of this date is matching the format you have defined for your users in their User Profile.
The following example is to pass on Project Number from a Prompt response and a Range of WBS Elements in the dataset to transaction code CN43N:
="<a href=\"http://<server>:<port>/sap/bc/gui/sap/its/webgui?%7Etransaction=*CN43N+CN_PROJN-LOW="+URLEncode([Project])+";CN_PSPNR-LOW="+URLEncode([Min])+";CN_PSPNR-HIGH="+URLEncode([Max])+";DYNP_OKCODE%3DONLI\" title=\"\" target=\"_new\" nav=\"web\">"+Nameof([WBS Element (Flat) Key])+"</a>"
Basically, you need to define the maximum and minimum values as variables in the Web Intelligence report.
The biggest issue I encountered when creating a hyperlink on measures is losing the format of that measure in the Web Intelligence report as soon as you configure the link. The FormatNumber() function offers a fix for number formatting being lost when links are put on measures.
Here’s an example of how this function can be used:
="<a href=\"../../opendoc/openDocument.jsp?iDocID=M0n1zzkAAj.ZAAcQzAAATFkAAo4KDD8AAAA&sIDType=CUID&sType=wid&sRefresh=N&lsSWork%20Order="+URLEncode(""+[Order/Network Key])+"&lsSFiscal%20Year="+URLEncode(""+[Prompt Fiscal Year Key])+"&lsSPosting%20Period="+URLEncode(""+[Prompt Posting Period])+"&sWindow=New\" title=\"\" target=\"_new\" nav=\"doc\">"+[Actual Labour Hours YTD CY]+"</a>"
Becomes;
="<a href=\"../../opendoc/openDocument.jsp?iDocID=M0n1zzkAAj.ZAAcQzAAATFkAAo4KDD8AAAA&sIDType=CUID&sType=wid&sRefresh=N&lsSWork%20Order="+URLEncode(""+[Order/Network Key])+"&lsSFiscal%20Year="+URLEncode(""+[Prompt Fiscal Year Key])+"&lsSPosting%20Period="+URLEncode(""+[Prompt Posting Period])+"&sWindow=New\" title=\"\" target=\"_new\" nav=\"doc\">"+FormatNumber([Actual Labour Hours YTD CY]; "#,##0;[red](#,##0);-;-")+"</a>"
In this case, I’m jumping to an opendoc target; however this is not different from when you create a link on a measure to jump to SAP ECC.