Old one (BUS2081/cross fiscal years)

Keohan, Susan - 1140 - MITLL keohan at ll.mit.edu
Wed May 9 13:24:36 EDT 2018


Hi Wuggers,

 

I have two custom workflows that send invoices out for approvals.  When
these workflows are started, they update a text field on the invoice using
BAPI_INCOMINGINVOICE_GETDETAIL and BAPI_INCOMINGINVOICE_CHANGE.   The same
calls are done to update the invoice again after approval (updating only the
text field).

 

These two workflows, BTW, have been running for 14 years.  The method to
update the invoice was updated in 2008 when the above BAPIs were released
for customer use.

 

At some point, we recognized that we needed to handle invoices that are in
process by workflow when the FY changed.  No problem!  The
BAPI_INCOMINGINVOICE_CHANGE nicely returns invoicedocnumber_new and
fiscalyear_new if the old invoice was deleted and a new one created in the
background.  I capture those new values and pass them back into the object
method, where I check for a new invoice/fiscal year and execute some macros
(remember them???)

 

IF NOT new_invoice IS INITIAL.  "We have a new invoice doc

  CONCATENATE new_invoice new_year INTO new_key.

  swc_free_object self.

  swc_set_objectkey new_key.

* new object reference

  swc_create_object self 'BUS2081' new_key.

  swc_refresh_object self.

 

 

This methodology worked ~most~ of the time.  Once in a while, one of the
workflows would fail on subsequent steps because the new invoice doc number
and fiscal year somehow were not returned in the container.

Since it didn't cause anyone except the lowly WF Admin any pain, nobody saw
the need to change it!  (I can hear Jocelyn talking to me about this.)

 

Now we've completed an upgrade to HEC, and noticed some quirks.
BAPI_INCOMINGINVOICE_GETDETAIL doesn't always return the accountingdata
sorted by serial number, which makes the BAPI_INCOMINGINVOICE_CHANGE throw
up (error M8 367).  I've added a sort on accountingdata between them, and
that problem goes away.

 

But now the WFs are all erroring out on Fiscal Year changes - in QA, and
only because I made people test 'pre-HANA' invoices (smiley face).   When I
debug the method in the BOR, the BAPI still returns the invoicedocnumber_new
and fiscalyear_new, but my trusty macros are not updating the main object of
the WF.

 

 

Sure would appreciate any insights you can share.  And bear in mind, this
stuff is O-L-D.

Thanks,
Sue

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20180509/eb94513c/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5465 bytes
Desc: not available
Url : http://mailman.mit.edu/pipermail/sap-wug/attachments/20180509/eb94513c/attachment.bin


More information about the SAP-WUG mailing list