Skip to Content

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:

  1. Get familiar with the business object that you want to call in ECC. A business object can be an invoice, order, customer, project … etc.
  2. Go to SAP ECC and launch the transaction code that you would like the user to call. For example, if you are jumping to transaction code CJ03 and want to display Project Definition as opposed to WBS Element Overview, you need the return code for that button.

/wp-content/uploads/2012/04/image1_91016.png

  1. The easy way to find out this code is to click on the button and keep clicking while you press one time on F1, then release the click. You will get the following window with the required function:

/wp-content/uploads/2012/04/image2_91014.png

  1. The following is the URL that will take you directly to Project Definition transaction: http://<server>:<port>/sap/bc/gui/sap/its/webgui?~transaction=*CJ03%20*PROJ-PSPID=12348;DYNP_OKCODE=MDTB

/wp-content/uploads/2012/04/image3_91015.png

  1. You can also find these functions in SE41:

/wp-content/uploads/2012/04/image4_91017.png

/wp-content/uploads/2012/04/image5_91018.png

  1. If you want to generically pass an enter code, use /00. This is equivalent to LETB in this particular case of CJ03.
  2. Although the parameter ~OKCODE is obsolete and it is recommended that you use parameter DYNP_OKCODE, the ~OKCODE parameters is still the only way to bypass the selection screen in some transactions. For example, the following HTML tag calls transaction code VF03, which only work with ~OKCODE:

=”<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>”


  1. To find the screen field name, go to the transaction and press F1 in the field you choose to populate with the value coming from your report. Select the “Technical Information” icon to access the screen field name.

/wp-content/uploads/2012/04/image6_91019.png

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


  • http://<server>:<port>/sap/bc/gui/sap/its/webgui/!? is the SAP ITS web GUI.
  • ~transaction=(=[L01 Sales Document Number])& is the transaction we want to send to ECC. L01 Sales Document Number is the Business Objects field (object) which will be passed to ECC.
  • Finally, ~OKCODE=ENT2 executes the search in ECC.
  • Selecting the Parse command button will cause the various portions of the URL to populate.  As per report to report linking, we can specify a Target Window and a Tooltip. Select the OK button.

/wp-content/uploads/2012/04/image7_91020.png

  1. For the final step, we need to add the transaction code and screen field information to the URL. Turn on your formula bar (see image) by right clicking in the tool bar area of Web Intelligence.

/wp-content/uploads/2012/04/image8_91021.png

  1. Copy the contents of the formula bar and paste into Notepad or MS Word.

=”<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>”


  1. Add the transaction code and screen field syntax, =VA03%20VBAK-VBELN, to the URL string.  This information should be placed before the transaction key word (marked in bold red).

=”<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>”


  1. Copy the new URL into the formula bar.  Select the Enter from the keyboard. As a best practice, name the URL as a local report object.  Turning the formula into an object will reduce report clutter and report maintenance.

/wp-content/uploads/2012/04/image9_91022.png

  1. Finally, test the link.

/wp-content/uploads/2012/04/image10_91023.png

Advanced Topics

Passing Parameters to Web GUI Transaction to Release Requisition and Purchase Orders

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/!&~transaction=*ZMM_PR_RELEASE 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

Terminating a user session with integrated ITS when the transaction ends

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:

  • Kernelpatch: 136
  • ABAP Support-Package: SAPKB64018

SAP NetWeaver 2004s, aka 700:

  • Kernelpatch: 66
  • ABAP Support-Package: SAPKB70009

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

Passing Two Parameters from Web Intelligence Report to ECC Transaction

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>”

/wp-content/uploads/2012/04/image11_91024.png

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>”

/wp-content/uploads/2012/04/image12_91025.png

/wp-content/uploads/2012/04/image13_91026.png

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:

/wp-content/uploads/2012/04/image14_91027.png

=”<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>”

/wp-content/uploads/2012/04/image15_91028.png

Basically, you need to define the maximum and minimum values as variables in the Web Intelligence report.

/wp-content/uploads/2012/04/image16_91029.png

/wp-content/uploads/2012/04/image17_91030.png

A Hyperlink on Measures

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.

To report this post you need to login first.

11 Comments

You must be Logged on to comment or reply to a post.

  1. Steffen Schloenvoigt

    Very nice information!

    As a hint: If you need to acquire the host/port of your system dynamically (e.g. for use in mails or external reports), the class CL_URL (and its HOST() and URL() methods…)  might be very useful!

    (0) 
  2. Amer Syed

    i tried to follow this but at line 2 i got stuck i dont understand what you mean click on the item? which item as i kept on clicking to get to technical name but i dont get the same screen as u do and keep on getting step 8 screen.. any ideas?

    (0) 
    1. Mohamed Judi Post author

      Hi Amer,

      the idea is to get the focus on the required button that does the function we need to trigger from the URL. There different ways to do this. One is to keep pressing tab until you see that button highlighted, and then you press F1 to get the Function code. You can also click on the button and slide away your mouse pointer from the button. That will highlight the button as well. This is similar to the F1 pop-up screen you get when you press F1 on a field. You just get more info with that pop-up for a screen field.

      Thanks,

      MJ

      (0) 

Leave a Reply