Skip to Content

Issue in calling SAP IRPA bot via postman

Dear Experts,

I have created a simple SAP iRPA bot in which i am calling an RFC. I have created Input and output structure in context and mapped the input/output and input manager under properties as shown below .

I have mapped the input parameters to the RFC fields like this

and imported the package in Cloud and created the API Trigger. Now i am trying to test it via postman. It is getting triggered

but getting failed with below error "Step GLOBAL.CAIPostJE.PostJE: TypeError, 'IO.Entry' is null or not an object

I am not sure, what is that i am doing wrong here. I also not sure if i can debug the postman trigger of the bot.

Please help with this if you can.

Tagging the experts with hope :)

Stefan Schnell Peter Engel Chaitanya Priya Puvvada

Regards

Vijay

qamnb.png (19.0 kB)
jxznb.png (44.9 kB)
iikqw.png (5.6 kB)
Add comment
10|10000 characters needed characters exceeded

5 Answers

  • Posted on Jun 29 at 05:50 AM

    Vijay Sharma

    Can you let me know when you tested the Application in Desktop Studio(Debug mode) if you had received the output data.

    If you had faced any error ,let me know the error and attach the screen shot of the same.

    Thanks

    Priya

    Add comment
    10|10000 characters needed characters exceeded

    • Thanks Chaitanya Priya Puvvada for your response.

      First i tested my Bot in debug mode by setting the context variables with hardcoded values like below

      rootData.IO.Entry.v_cc = "1810";
      rootData.IO.Entry.Hdr_txt = "Test Header";
      rootData.IO.Entry.docDate = "20200622";
      rootData.IO.Entry.Fis_per = "06";
      rootData.IO.Entry.Doc_typ = "SA";
      rootData.IO.Entry.Xref_doc = "REF DOC1";

      and mapped them to the target fields.

      hdrdata("HEADER_TXT") = rootData_IO.Entry.Hdr_txt;
      hdrdata("COMP_CODE") = rootData_IO.Entry.v_cc;
      hdrdata("DOC_DATE") =  rootData_IO.Entry.docDate;
      hdrdata("PSTNG_DATE") = rootData_IO.Entry.docDate;
      hdrdata("FIS_PERIOD") = rootData_IO.Entry.Fis_per;
      hdrdata("DOC_TYPE") = rootData_IO.Entry.Doc_typ;
      hdrdata("REF_DOC_NO") = rootData_IO.Entry.Xref_doc;

      and it executed successfully without error.

      Now as the input is supposed to come from API trigger input, i have removed the hardcodded population of context variable.

      Bot gets triggered from postman, job gets created ,but fails with the error

      "Step GLOBAL.CAIPostJE.PostJE: TypeError, 'IO.Entry' is null or not an object"

      Regards

      Vijay

  • Posted on Jun 29 at 11:03 AM

    Vijay Sharma

    Hi Vijay,

    Can you please confirm you have exposed your parameters as Skills in Cloud Studio.

    Please confirm if you have done step 5 in my blog.

    https://blogs.sap.com/2020/02/18/challenge-submission-create-an-api-triggertest-in-postman-to-have-seamless-integration-in-cai./

    If you expose them correctly ,you can test it postman by sending the input parameters.

    Are you able to see your parameters in the Payload of API trigger.(Invocation context)?

    Step no 6 ,3rd screen shot in my blog.

    Please attach the screen shot of the payload of API trigger. We can check the input parameters mapping

    Add comment
    10|10000 characters needed characters exceeded

    • Yes, the parameters are exposed as skills in Cloud Studio as shown below (so step is done)

      In cloud Factory, the log looks like below

      And from postman , i am sending the same data as as shown below

      As you can see am sending username in invactionContext? could that be a problem as that is not mapped to anything

      Regards

      Vijay

  • Posted on Jun 29 at 03:57 PM

    Vijay Sharma :

    As requested, please send the screenshot of your invocation context.

    Attached is the screenshot for reference.

    Does your payload in the postman does not have an invocationcontext?

    Attaching the screenshot for the reference.


    postman.jpg (49.0 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 30 at 06:50 AM

    Vijay Sharma :

    Hi Vijay,

    Looks like the payload passed in post man and API trigger are same including the key word invocationcontext.

    Your screen shot of postman doesnot show the invocationcontext key word.Hope it is included.

    You had mentioned that the user name is not mapped .Can you elaborate on this?

    Hope you are using OAuth authentication in POSTMAN to execute the call.Refer this link more details.https://help.sap.com/viewer/c836fab4182e45548b6c6c6d0d0a9146/Cloud/en-US/347ba172a8e64f1c8544f46026446a86.html?q=postman

    If yes, What is the output when you are executing the POST call in POSTMAN ?

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 30 at 07:34 AM

    Vijay Sharma

    Hi Vijay,

    Are you mapping the user name from the your chat bot too ?

    Regards,

    Priya

    Add comment
    10|10000 characters needed characters exceeded