cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in workflow

Former Member
0 Kudos

I have a scenario in workflow where

Blocked invoice comes to workflow and i need to release it.

for this in workflow i an getting "IncomingInvoice " which is of type BO BUS2081.

I have created a method in ZBUS2081 for releasing this invoice. The binding is as follows.

From workflow i am passing the "IncomingInvoice" object to &_WI_OBJECT_ID& which is of type BUS2081.

This is working fine when i execute the workflow.

In the BO method the code is as follows.

data: gt_bapireturn type table of BAPIRET2 with HEADER LINE.

data: IncomingInvoice type ref to OBJECT.

CALL FUNCTION 'BAPI_INCOMINGINVOICE_RELEASE'

EXPORTING

invoicedocnumber = object-key-INVOICEDOCNUMBER

fiscalyear = object-key-FiscalYear

  • DISCOUNT_SHIFT = ' '

tables

return = gt_bapireturn

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  • EXPORTING

  • WAIT =

  • IMPORTING

  • RETURN =

.

When i execute this method, it is releasing the document successfullt.

But when i execute the workflow, it showing the step completed, but the document is not released.

Please tell me if i am missing anything in the binding.

I think that data is passing fromworkflow to task but problem is when passing from task to method .

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I think you should use COMMIT Work after the Release FM.

I hope the binding is done properly.

Thanks

Arghadip

Answers (3)

Answers (3)

Former Member
0 Kudos

Check system log to see if update is failing.

Former Member
0 Kudos

Change the attribute of the task from background to foreground(temporary) and put a break point in the custom method.

execute the scenario and cehck if GT_RETURN table from the BAPI.

As you are running in background, check if any authorization error.

Former Member
0 Kudos

BAPI could be calling some function module internally which runs in update mode. Once released event RELEASED of BUS2081 will be triggered.

Use this event for your workflow to continue. Also check for your failed cases whether block is removed after a while.

Regards,

Krishnakumar PM

Former Member
0 Kudos

Try it without the CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

If it works, I'll explain why.

Regards,

Tom Carruth

Former Member
0 Kudos

Hi,

Its not working with out "BAPI_TRANSACTION_COMMIT.

I have even tried using COMMIT work and wait up to 3 seconds.

still its not working.

i have verified there is no problem with data binding.

data is passing properly.

when i execute the BO , it is releasing the Invoice.

But when i use it in workflow, its not updating.. but the task status is Completed.

0 Kudos

Hi Tom,

Can you explain me the reason why you asked not to call the FM 'BAPI_TRANSACTION_COMMIT'.

Thanks,

Srinivas G.