Skip to main content

Custom report from workflow log

I received this request in many forms from various users including auditors. Though it came in differant flavours, the basic requirement is to identify, the different approvars and the final approvar who caused the release of the document. In our company we are using workflow mainly for PR and PO approvals. All the previous instances I avoided looking into that saying that it is difficult to get our hands into the workflow system and it is complicated. Finally this time I thought, let me see how this can be done. After spending half a day, I realised that it is not that difficult at all. There are two function modules, which satisfies my requirement. But this can be improved based on individual requirement. The first function module is SAP_WAPI_WORKITEMS_TO_OBJECT. This one gives the list of work items for a specific object. This even allows to select based on a time frame. The output table contains the workitem ID of the workflow apart from many other details. Again in our company we have developed PR and PO workflow as main and subworkflows. It is possible to get the sub workflows also in this FM by passing the relevent parameters. Next another FM needs to be executed to get the detailed log like, the status, approval agent, date etc. The FM for this is SWP_WORKFLOW_LOG_READ. Only the Workitem ID of the main workflow needs to be passed as a parameter. The output is returned as SWP_LOGTAB.

Comments

Popular posts from this blog

Vendor Consignment Business Process

Wikipedia offers a very simple definition for consignment . It is a process of placing a thing in the hand of another, but retaining the ownership until the goods are sold or used. In SAP consignment business process can be implemented very easily using the following steps. Activate Consignment inforecords using tcode OMEV. This activates the consignment prices to be picked up using the consignment info records. configure a special procurement type using IMG->Production->MRP->Master Data->Define special procurement type. In OBYC configure the consignment payables account (transaction KON). Assign the special procurement type created in step 2 to all the materials that are to use the consignment process. This is done in the MRP2 view of the material master maintenance transaction Create Consignment info record using tcode ME11. Select info category as consignment. Create general data, Purchase Org data and conditions. Conditions allow you to create time dependent prices. Cre...

Rounding off of Amount fields in SAP

I remember, when I learnt COBOL, our instructor used to give us problems to solve. One of the problems often repeated in all programming classes was to write the code for rounding off numbers, without using built in functions. In SAP it is a bit tricky, as SAP stores amout fields as currency types. These fields are stored internally with 2 decimals, irrespective of the currency used. It can be easily done using write statement if you want to round the amount field in the report. How to do it if you want to round it store it as a currency amount field itself. This is a problem in SAP query reports. In my case the user wanted to amount fields to appear rounded to nearest integer. SAP has some built-in-functions like ceil, floor but they can not be used as it is, due to the fact that the amount is stored internally with 2 decimals. Most of the currencies are with 2 decimals and it is still not a problem. This can be easily achieved by the following operation. A constant need to be defin...

Stock Differences in HU (Handling Unit)

This blog post might help you to solve the problem with these messages. HUGENERAL 017 Handling unit &1 has the status "goods issue posted", cannot be changed HUFUNCTIONS 251 No posting-relevant material items could be found Many times it happens that the standard functionality provided by SAP is not sufficient. IN HU if customisations have been done, it is possible that, you end up with some data inconsistancy. The worst part about this is that not much is available in SAP or even internet. I learnt these hard way. The solution might look very simple, but it has consumed quite a lot of tense days. This could be due to some MDE customisations also. The above messages might appear if you are trying to transfer HU from blocked to unrestricted or vice versa using VLMOVE. Or if you are trying to pick a HU from stock. What happened in my case is that the inventory stock was transferred to Blocked stock, but the HU was not updated. So, the following standard transactions gives...