06-07-2005 12:04 AM
We are looking for a BAPI that will allow us to retrieve a user's inbox items for purchase req approval process.
Any suggestions?
06-07-2005 4:24 AM
I don't think there is any BAPI for this but a Function Module RH_WI_SWWUSERWI_SELECT can be used.
If you are calling from outside SAP then try to RFC enable it by copying it into a new FM.
Cheers,
Ram
06-09-2005 2:38 PM
Thanks for information.
I found that you can retrieve inbox items for a user using RH_INBOX_VIEW_CREATE. I have also found that in the application you can take the object id from the inbox return balue and enter the id in transaction SWK1. The transaction launches the related Purchase Req transaction.
I need to make the same query via a bapi and display the related purchase req for approval. I am trying to build a web dynpro application that displays the user's inbox and allows for purchase req approval. I don't want to use ITS. What is the best way to do this?
06-09-2005 4:52 PM
You need to check if there is any BAPI/RFC for approval or at least a nondialog method on business object for Purchase Requisition.
If it is available then in that case you can call it from your BSP application / webdynpro.
You need to design the web-screen and then call the BAPI.
Or else you might think of developing a BAPI having same logic of the approval/rejection Xn.
Thanks,
Ram
09-15-2005 5:28 PM
Hi,
I also need to retrieve inbox items. However, I don't get any results using RH_INBOX_VIEW_CREATE trying transaction se37, even though the inbox shows items.
I'm not a SAP Programmer though, so I'm not sure whether I passed all required parameters.
What am I missing?
thanks,
Thibault
09-15-2005 6:49 PM
Here is what you can do provided the Approval work item is based on a decision task. The WAPI function modules may not be available depending on your SAP release.
Use FM SAP_WAPI_CREATE_WORKLIST to retrieve the users work items.
Use FM SAP_WAPI_DECISION_READ to read the Decision Options. These are returned as a 4 digit number and the text on each decision button as displayed in the Business Workplace. These can then be presented on your web form.
Once the decision is made, Use SAP_WAPI_RESERVE_WORKITEM to reserve the workitem and then use FM SAP_WAPI_DECISION_COMPLETE supplying the corresponding 4 digit number for the user decision.
To display the PR detail, you can get the PR number from the WI container using SAP_WAPI_READ_CONTAINER and the get the PR details using BAPI_REQUISITION_GETDETAIL.
All of this is not necessary if you implement UWL (Universal Work List) available with Enterprise Portals.
Cheers,
Ramki Maley.
09-16-2005 10:22 AM
Actually, I found out today that it did not work because I used a session of a different user. Quite silly.
Thanks for that info, anyway. I need to provide most of the Inbox within a J2EE Portlet, so I will probably need more BAPI's in the days to come. Your explanation will certainly help a lot.
09-16-2005 11:58 AM
Hi Ramki,
Calloing SAP_WAPI_DECISION_READ returns Error, "Work item .... is not a user decision. I entered the WI_ID I got from RH_INBOX_VIEW_CREATE for a Workitem that shows with Approve and reject Buttons in Worplace.
Any ideas on this?
thx,
Thibault
09-16-2005 12:09 PM
Hi Thibault,
Though I have not used the WAPIs with a remote call, they certainly worked for me. Can you tell me if the standard task behind the Workitem uses object method Decision.Process?
Thanks,
Ramki Maley.
09-16-2005 2:28 PM
Hi Ramki,
> Can you tell me if the standard task behind the Workitem
> uses object method Decision.Process?
Wish I could, but I am not an SAP expert. And the SAP experts I'm working with on the team don't seem to know very much about SAP workflow. I was told the standart task is TS20000193. Don't know whether that helps.
You tell me how to find out and I'll tell you.
Cheers,
Thibault
09-16-2005 7:55 PM
Display the task using Txn PFTS or PFTC. On the very first tab you should see the info. This looks to be a standard SAP task and therefore uses Decision.Process. It is possible that you are not supplying the correct WI id.
Cheers,
Ramki Maley.
09-19-2005 11:16 AM
Hi Ramki,
I displayed the task, first tab info is (Not sure whether that's relevant):
Abbr: CHECKABSENCE
Name: Check leave (with HTML)
Release status: not defined
Object Category: BOR Object Type
Object Type: FORM
Method: HTMLPROCESS
As I said, I supply the WI_ID I get from RH_INBOX_VIEW_CREATE.
And if I use Txn SWK1 (whatever that is) like Stephen King, using the same WI_ID, the SAP client opens the inbox window for Process Leave Request where I can approve, or reject.
Also, if I enter some fake id in SAP_WAPI_DECISION_READ, I get "Work item ... cannot be read", rather than "Work item ... is not a user decision".
So I'm rather confident that the WI_ID is right. Repeated this a few time now to exclude a typing error.
Cheers,
Thibault
BTW: I'm new to SDN, should I start a new Thread to be able to give you Reward Points?
09-19-2005 1:28 PM
Thibault,
A decision task is identified by Object Type Decision, Method Process. As you had verified, the WI you are referring is not a Decision Task and hence the error. The task you are referring to is an HTML form and used in conjunction with ITS.
I have not used this method and cannot help you but here are some links to HTMLPROCESS method:
http://help.sap.com/saphelp_470/helpdata/en/d3/bde438b572b407e10000000a114084/frameset.htm
http://help.sap.com/saphelp_470/helpdata/en/cb/a56af36d5311d194ac0000e82dec10/frameset.htm
http://help.sap.com/saphelp_470/helpdata/en/5f/175d31706f11d194ad0000e82dec10/frameset.htm
You can start a new link if you need more info. You may have to contact either Mark Finnern or Craig Cmehil (SDN Moderators) on SDN Suggestions forum if you want to award points to this post.
Cheers,
Ramki Maley.
09-21-2005 1:34 PM
Hi all,
I'm trying to find a BAPI to access the documents in the inbox/outbox. Testing a lot of different BAPI calls I was not able to get a list or details of inbox documents. Can anybody give me a suggestion how to go forward? Or does anybody know a BAPI call for that?
10-06-2005 2:35 PM
Hi Andre,
Welcome to SDN.
Please start a new thread with your question.
Thanks,
Ramki Maley.