|
If a user works in more than one SAP system, it is often desirable to establish an easy link from a transaction in one system to a transaction in a second system, passing key data from one to the other.
For our example, let us assume that the customer data is distributed over two SAP systems. In one system the customer numbers are always 4 digits long and in the other system they consist of 10 digits. The user want to work with an interface where he can simply enter a customer number, press a button, and then continue with the customer transaction in the chosen system. There are different ways to achieve such an interface. We use a simple approach, combining GuiXT and SAP shortcuts. The implementation uses InputAssistant and Viewer.
|
This is the interface built with GuiXT. The user enters the customer number and presses the “Go” button. GuiXT then starts transaction VD03 (Display customer data) in the right system, relaying the customer number. We can add this interface to any SAP screen. In our example it is placed on the main menu screen. It makes sense to have the interface in both systems, so that the user can start in either system. The InputScript “DisplayCustomer.txt” therefore has to be slightly different in the two systems, or it can make use of an “if Q[database=...]“ statement for its decision on where to call up transaction VD03. The GuiXT script is as follows: SAPLSMTR_NAVIGATION.E0100.txt: // Display customer information interface // Shift SAP standard menu downwards The InptScript DisplayCustomer.txt first decides in which system the customer data can be found, based on the length of the customer number. If it is the same system, it starts transaction VD03 directly. If not, it calls up an SAP shortcut that starts VD03 in the other system. Since it is not possible to relay parameters via the shortcut, a temporary parameter file is used to transport the customer number to the second system. Instead of looking at the length of the customer number, one can use an RFC that does the looking up of the customer in the R/3 database. If more than 2 systems are involved, you have to work with the Destination=… option in the GuiXT call statement in order to find the right system. For our example we assume there are only 2 systems, and that we can determine the right system merely by looking at the length of the customer number. // GuiXT InputScript DisplayCustomer.txt if V[CustomerNumberRightPart]
// Write customer number to parameter file (&%[TEMP] is the environment variable TEMP) // Start VD03 in system (S4C) via shortcut // Start VD03 in same system // First screen of VD03 Leave
The GuiXT script for VD03, initial screen, always reads the temporary parameter file and sets the customer number, if found: // GuiXT Script SAPMF02D.E7108.txt // Read customer number from parameter file if V[CustomerNumberFromFile]
// delete parameter file Set F[Customer] “&V[CustomerNumberFromFile]“ Finally, the SAP shortcut vd03.sap can be generated automatically in sapgui. Just go to the transaction and choose the pushbutton in the toolbar:
It looks like this:
|