Skip to Content

Workflow not working when BO is created through webservice

I have a custom BO with 1 level approval workflow and everything was working great.

then requirements changed and the BO instances now are created from android application using SOAP webservices generated from the ByD.

the problem is the field "ApprovalStatus" is emtpy and cannot be edited through code because it is read only field so the approval workflow is not working now.

is there a solution for that ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jan 31 at 12:47 PM

    Hi Haitham,

    typically status fields are not entered, but show the result of an BO action. Using the web service wizard in the SAP Cloud Applications Studio you can create interface operations to trigger BO actions as well. Therefore I think the solution would be to trigger the approval by invoking the corresponding BO action via web service.

    Regards,
    Knut

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Knut,

      Thank you for replying but i dont think i can understand what do u really mean.

      there is no BO action for initializing the ApprovalStatus field. there are actions for CRUD operations, submit for approval, approve and reject but they dont work because field approval status is empty and i cant give it value in the create operation.

      Can you please give me a clear example what i should do to create BO instance from webservice with approvalstatus field = 1 ?

  • Jan 31 at 07:12 AM

    Hello,

    Do you know why the ApprovalStatus field is empty? How are you filling that field? Is it from the web service or through some code?

    Thanks & Regards,

    Meghna

    Add comment
    10|10000 characters needed characters exceeded

    • ApprovalStatus is a standard read only field automatically added when i create approval process on my business object.

      usually when i create a new instance from my BO using New button in OWL it takes initial value "1" then when i press "Submit for Approval" the workflow starts and status changes after approval or rejection.

      But when i create instance of that BO using absl code or from webservice the ApprovalStatus field is emtpy and "Submit for Apporval" button is disabled. the field is read only so i cant change it with my absl logic

  • Feb 20 at 06:09 AM

    Hello Haitham,

    Status fields are generally not enabled for editing directly but you can obviously change that by using the appropriate actions. You need to trigger the same action from absl code which gets triggered when you press "Submit for Approval" button for that BO instance, that will change the approval status. Hope it helps.

    Thanks & Regards,

    Meghna

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 20 at 10:11 AM

    HI all

    This is a known problem with custom approval processes and custom BO. I have raised it with SAP about 12 months ago

    https://influence.sap.com/sap/ino/#/idea/141009/?section=sectionVotes

    Add comment
    10|10000 characters needed characters exceeded