Bundle multiple requests into one (BAPI_EQUI_GETDETAIL)

The Open Call Interface supports the bundling of multiple requests into one. This makes sense if you need to execute numerous independent requests each of which does not take much time compared to the RFC communication time.
For example, if the RFC overhead is 5ms and the actual call time is 3ms, 1000 calls will need 8 seconds in the non-bundled case and 3 seconds when you bundle the calls. If a user is connected via internet, a single RFC communication may very well be 30 ms, resulting in 30 seconds for non-bundled calls and 3 seconds with bundling.

The user enters a planner group (plant maintenance). We display all equipment items assigned to the given planner group, showing detailed information for each item.

The BAPI we want to use is "BAPI_EQUI_GETDETAIL". It is called up for a single equipment item but cannot handle a list of equipment items; we need one call for each equipment item in the list and want to bundle them into a single remote call.


GuiXT Script

InputField (1,2) "Planner group" (1,22) size=3 name="ingrp" _
searchHelp="H_T024I" shName="INGRP"

Pushbutton (1,39) "Read equipment" _
process="read_equipment.txt" size=(1,21)

// Equipment Items
Table (3,1) (27,103) name="equipments" _
title="&V[equipments.rowcount] Equipment items"
fixedColumns=6 -singlerowselection
Column "Equipment" size=12 name="equnr" -readOnly
Column "Text" size=40 name="descript" -readOnly
Column "Value" size=12 name="acquisval" -readOnly -alignRight
Column "Currency" size=8 name="currency " -readOnly
Column "Cost center" size=10 name="costcenter" -readOnly
Column "Inst.Date" size=10 name="start_from" -readOnly

InputScript "read_equipment.txt"

// create structure and table for display
CreateStructure V[equipmentinfo] _
  descript acquisval currency start_from costcenter
CreateTable V[equipments] equnr include=V[equipmentinfo]

// create structures and tables for BAPI calls
CreateTable V[plannergroupselection] sign option low
CreateTable V[equipmentlist] equipment

// planner group selection
Set V[plannergroupselection.sign.1] "I" // include value
Set V[plannergroupselection.option.1] "EQ" // equal
Set V[plannergroupselection.low.1] "&V[ingrp]" // planner group

// read all equipment items for given planner group
  export.PLANGROUP_RA="plannergroupselection" _

// read details for each item
Set V[k] 0

label next_equipment
if V[k<&V[equipmentlist.rowcount]]
  Set V[k] &V[k] + 1

// fill table for display
  Set V[equipments.equnr.&V[k]] "&V[equipmentlist.equipment.&V[k]]"
Set V[equnr] "&V[equipments.equnr.&V[k]]"

// bundle all detail request calls
    Call "BAPI_EQUI_GETDETAIL" -bundle _
export.EQUIPMENT="equnr" _

  goto next_equipment


// now we execute all requests
Call bundledRequests

// read results of the bundled calls
Set V[k] 0

label next_request
Set V[k] &V[k] + 1
Call importFromBundle=&V[k]

if Q[ok]
  UpdateRow V[equipmentinfo] table="V[equipments]" index=&V[k]
goto next_request

// delete all results
Call deleteBundledRequests

// done