Purpose 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. |
Example 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.
Pushbutton (1,39) "Read equipment" _process="read_equipment.txt" size=(1,21) // Equipment Items 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 // create structures and tables for BAPI calls CreateTable V[equipmentlist] equipment // planner group selection 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" _ import.EQUIPMENT_LIST="equipmentlist" // read details for each item label next_equipmentif 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" _ import.DATA_GENERAL_EXP="equipmentinfo" goto next_equipment endif // now we execute all requests // read results of the bundled calls label next_requestSet V[k] &V[k] + 1 Call importFromBundle=&V[k] if Q[ok]UpdateRow V[equipmentinfo] table="V[equipments]" index=&V[k] goto next_request endif // delete all results // done |
Components |