Purpose Start a transaction in a different SAP system If a special function is available in an SAP system other than the one where the users normally are working, it makes sense to provide a quick link to a transaction of the other SAP system (called "remote" system in the following). A similar situation occurs if some business objects (e.g. older service orders) are no longer available in the current but in a remote SAP system. In this situation a possible solution is to read the data via a Remote Function Call and display the data with GuiXT. Or you directly call up the corresponding display transaction in the remote system, providing the object key. This is the approach that we are going to describe here. |
Solution We use the SAP function module "RFC_CALL_TRANSACTION_USING" to call up a transaction in the remote system. The object keys are passed via a "batch Input" file. We can use "RFC_CALL_TRANSACTION_USING" in the same SAP
session. In this case, the underlying screen, i.e. the transaction where
we start, remains locked until the user closes the transacion of the
remote SAP system ("modal dialog").
We assume that some customer orders are available in a remote SAP system. For this example we let the user enter the order number in VA03; a button created with GuiXT then allows him to open up VA03 in the remote SAP system, using the given order number.
GuiXT script: // display customer
order in our remote SAP ERP system Clicking the "remote display" button the user immediately opens up VA03 in the remote SAP system:
In this example we started in client 100 of the S/4HANA system S4H
and then display the order in client 800 of the SAP ERP system ABA. The
S4H screen remains locked until the user closes the ABA screen. The InputScript prepares "batch input" data for passing the order number and skipping the first VA03 screen: // Define SAP structure BCDDATA Set V[partdynpro] "(41-44)" Set V[partdynpbegin] "(45-45)" Set V[partfnam] "(46-177)" Set V[partfval] "(178-209)" // Batch Input data // fill BatchInput data Set V[bdcline]&V[partprogram] "SAPMV45A" Set V[bdcline]&V[partdynpro] "0102" Set V[bdcline]&V[partdynpbegin] "X" CopyText fromString="bdcline" toText="bdcdata" -appendLine Clear V[bdcline]Set V[bdcline]&V[partfnam] "VBAK-VBELN" Set V[bdcline]&V[partfval] "&F[Order]" CopyText fromString="bdcline" toText="bdcdata" -appendLine Clear V[bdcline]Set V[bdcline]&V[partfnam] "BDC_OKCODE" Set V[bdcline]&V[partfval] "/0" CopyText fromString="bdcline" toText="bdcdata" -appendLineCall "RFC_CALL_TRANSACTION_USING" -dialog _connection="ASHOST=/H/synactives10.com/H/XXX CLIENT=800 SYSNR=00" _ in.TCODE="VA03" _ in.MODE="E" _ table.BT_DATA="bdcdata" Return
The alternative, a non-blocking call, does not differ much in the implementation: GuiXT script: // display customer order in our remote SAP ERP system "@QE@Display in remote SAP ERP" "/o0" size=(1,30) _ process="va03_rfc.txt" using OrderNumber = "[Order]"
Parameter OrderNumberScreen SAPLSMTR_NAVIGATION.0100// SAP structure BCDDATA Set V[partprogram] "(1-40) Set V[partdynpro] "(41-44)" Set V[partdynpbegin] "(45-45)" Set V[partfnam] "(46-177)" Set V[partfval] "(178-209)" // Batch Input data // fill BatchInput data Set V[bdcline]&V[partprogram] "SAPMV45A" Set V[bdcline]&V[partdynpro] "0102" Set V[bdcline]&V[partdynpbegin] "X" CopyText fromString="bdcline" toText="bdcdata" -appendLine Clear V[bdcline]Set V[bdcline]&V[partfnam] "VBAK-VBELN" Set V[bdcline]&V[partfval] "&U[OrderNumber]" CopyText fromString="bdcline" toText="bdcdata" -appendLine Clear V[bdcline] Set V[bdcline]&V[partfnam] "BDC_OKCODE"Set V[bdcline]&V[partfval] "/0" CopyText fromString="bdcline" toText="bdcdata" -appendLine Call "RFC_CALL_TRANSACTION_USING" -dialog _connection="ASHOST=/H/synactives10.com/H/XXX CLIENT=800 SYSNR=00" _ in.TCODE="VA03" _ in.MODE="E" _ table.BT_DATA="bdcdata" // end this mode after the call |
Components |