Old one (BUS2081/cross fiscal years)

Dart, Jocelyn jocelyn.dart at sap.com
Wed May 9 20:00:22 EDT 2018


Hi Sue,
Moving to HEC shouldn’t change anything… unless there were transports involved and some macro definitions were lost?

Did you also change NetWeaver releases at the same time? I recall some mention of HANA.. ?

Rgds
Jocelyn

From: <sap-wug-bounces at mit.edu> on behalf of Susan Keohan <keohan at ll.mit.edu>
Reply-To: SAP Group <sap-wug at mit.edu>
Date: Thursday, 10 May 2018 at 3:38 am
To: SAP Group <sap-wug at mit.edu>
Subject: Old one (BUS2081/cross fiscal years)

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/5956f0f1/attachment-0001.html


More information about the SAP-WUG mailing list