cancel
Showing results for 
Search instead for 
Did you mean: 

Performance Issue using SAP WAPI

Former Member
0 Kudos

Dear Experts ,

I am facing the below perfomance problem by using SAP WAPI Function modules in my requirement .

Requirement :---I am working on DMS Workflows .The BO is DRAW .

I need to find the WORKFLOW Workitem Id respective to the Document . I am using the WAPI - SAP_WAPI_WORKITEMS_TO_OBJECT for this .

In the import parameter of this BAPI i am passing the DMS document no , version, document type and document part which are the key fields for the business object DRAW . I am geeting the respective workflow workitem ID for that perticular document through this bapi .

My problem is :---

When i want to get the workflow workitem id of more than 1000 documents at a time through programme , i am calling this WAPI - SAP_WAPI_WORKITEMS_TO_OBJECT inside Loop of an internal table like below ,

The ITAB intranal table contains the document nos appx 1000 .

LoOp at ITAB .

CALL FUCNTION SAP_WAPI_WORKITEMS_TO_OBJECT

IMPORT

EXPORT

TABLES

END LOOP .

This takes nearly 5 minutes to get executed . In real when i will execute the programme there may be more than 5000 documents to be executed so the programme may take more than 10minutes .

I am quite surprised that the standard WAPI are taking so much of time .

Am i missing any thing so that the WAPI is taking so much of time. Or if any body is having any suggestion related to are most welcome .

Is it possible to get the data directly from Tables instead of using WAPIs .

Regards

Prabhudutta

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I think reading table SWW_WI2OBJ will be a good approach.

Thanks

Arghadip

Former Member
0 Kudos

Thanks every body for your guidance . really the table helps a lot to over come the perfomrmance issue of SAP WAPI .

Regards

Prabhudutta

Answers (2)

Answers (2)

surjith_kumar
Active Contributor
0 Kudos

Hi,

For you Scenario, Directly fetch from the Tables, You having the list of Object Keys, get the workitem id using the above mention tables. Use For All Entries to pick the all workitem ids at one time.

Regards,

Surjith

former_member185167
Active Contributor
0 Kudos

Hello,

I don't know if SAP_WAPI_WORKITEMS_TO_OBJECT can really be faulted over this.

1000 iterations in 5 minutes = 0.3 seconds per object, or 10 objects every 3 seconds.

Unless there's a special WAPI for multiple objects, I think you will have to access the tables directly.

Looking inside that fm it seems it's tables SWWWIHEAD and SWIWOBJCT. You should debug a run of the fm to see exactly how it's done.

Note that table names may change from release to release.

regards

Rick Bakker

Hanabi Technology

Former Member
0 Kudos

Table - SWW_WI2OBJ has the workitem - object relationship.You should be able to query directly for work items for each object instance ( in your case, for each document )