cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a non-site-specific 'reference' in an IDAT file?

Former Member
0 Kudos

I want to create a Reason Code using an IDAT file.  If I look at the javadocs and the database (after actually creating the code manually) I can sort of piece together some of the bits and pieces for the request.  I attached my attempt to this note, and here is an image:

So ... there are multiple questions in the image, but the main one is:   Where the API requires a 'reference' string to be passed, how can I create a reference string that does not refer to one specific site?

Are IDATs documented somewhere that I'm missing?  I see examples in the some of the SDK training, but they don't really address my questions.

Thanks for any help you can provide.

--Barry

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Well, I solved my own issue (the first one), but found more...  I apologize in advance if this is 'old news' to most ME developers ...

Loading the above IDAT resulted in this error, which is actually quite helpful:

So I made this change to the IDAT, redeployed, and tried again.  (In my environment, each cycle takes about 10 minutes)

That fixed my status problem, and exposed my next error:

My first attempt to fix this also failed:

... with this error:

The underlying details are:

To make the above easier to find here:


com.sap.me.plant.SiteApplicationBean.reloadInitialData(com.sap.me.system.base.ApplicationVO) throws com.sap.me.frame.BasicBOBeanException method on bean instance com.sap.me.plant.SiteApplicationBean@25bc678a for bean sap.com/me~ear*xml|me.plant.ejb-6.1.4.16.jar*xml|SiteApplication in application sap.com/me~ear.; nested exception is: com.visiprise.frame.service.ext.ExtensionExecutionException: java.lang.NullPointerException: while trying to invoke the method java.lang.Object.toString() of a null object loaded from local variable 'propValue'

Next attempt:

That produced exactly the same exception.

Next attempt:

The result was a different, unrelated issue:

So I think that I found the right combination of entries.

Former Member
0 Kudos

As it turned out, that also did not work.  Is there a way to create a Reason Code without a Message Type? I can do it easily in the UI, but I have found no way to leave the message type reference with a NULL value in the IDAT.

I've tried these four formulations:

(1)

      <reasoncode:messageTypeRef>
        <reference type="MESSAGE_TYPE">
          <messageType></messageType>
        </reference>
      </reasoncode:messageTypeRef>

(2)

      <reasoncode:messageTypeRef>
        <reference type="MESSAGE_TYPE" />
      </reasoncode:messageTypeRef>

(3)

      <reasoncode:messageTypeRef />

(4)... and nothing at all.

All lead to an error when the IDAT is processed.

sergiy_katerinich
Active Contributor
0 Kudos

Hi,

It might be the case when javadoc definition contradicts GUI's behavior. Then it is a bug and needs a support ticket for investigation.

Regards,

Sergiy

Former Member
0 Kudos

I created ticket 691248 yesterday, after a lot of trial-and-error investigation, with no success.  I think this one should be fairly easy to reproduce, or SAP can create the simplest IDAT that will create a reason code, verify that it runs, and send that to me so I can try it.

Former Member
0 Kudos

An update from the ticket:  I am told that the MESSAGE_TYPE is required (although the GUI and the API javadocs contradict this).  So I placed a valid MESSAGE_TYPE value into the IDAT.  It still fails with the 'internal error' listed earlier.  The key bit of that stack trace seems to be this part:

com.visiprise.frame.service.ext.ExtensionExecutionException: java.lang.NullPointerException: while trying to invoke the method java.lang.Object.toString() of a null object loaded from local variable 'propValue'


I still have no resolution on the ticket.   All that I need at this point is a working example of an IDAT file that creates a reason code ...  ANY reason code.

It would actually be great if anyone could create one from scratch (not even using mine), make sure it runs, and post it here.  I asked for that from the support group, and I was told that that would be "consulting", not support.

former_member329581
Participant
0 Kudos

Hi Barry,

Its not only the Javadocs that says that the MESSAGE_TYPE is not needed, also If you create it trough API oder GUI without a MESSAGE_TYPE its work. This should not be the problem. I try to create a IDAT for the reason code and if I have success I will post it her.

EDIT: Sorry im also not able to get it working. It seems there is a reason why the SAP still uses the old way

EDIT2: It seems that it is not a generally problem, I tried a IDAT for Operations and it worked very well. So I hope you get an helpfull answer for you Ticket

Former Member
0 Kudos

Thanks for trying, Kay.

Just to have a detailed example that works (using the API), here is an image from SoapUI.  Obviously, the SOAP request format is very different from the IDAT format, which (thankfully) removes the need to specify exact reference strings.  Also, the IDAT format uses the enum 'name' "I", rather than the value "INVENTORY" for the category.  Also, here I can comment-out whole elements, but IDAT doesn't seem to like that.  (These are the sorts of specifics that an IDAT Specification would provide.  I've asked for that, but no luck so far.)

This will be hard to read.  Double-click to open it in a larger view.

The request above did work, and I verified in the ME GUI that the indicated reason code was created.

former_member185234
Active Participant
0 Kudos

Hello Barry ,

I have processed your ticket and fixed problem , I believe fix will be released soon for ME 6.1.4.You will be able to use API to create reason code at reload initial data. By the way , you will need to specify category as INVENTORY , HOLD , etc. , instead of using I or H.

Example :

<?xml version="1.0" encoding="UTF-8"?>

<common:serviceInvocationRequests xmlns:common="http://www.sap.com/me/common" xmlns:reasoncode="http://www.sap.com/me/reasoncode">

  <common:serviceInvocationRequest>

    <moduleId>com.sap.me.reasoncode</moduleId>

    <serviceName>ReasonCodeConfigurationService</serviceName>

    <methodName>createReasonCode</methodName>

    <requests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="reasoncode:ReasonCodeConfiguration">

      <reasoncode:reasonCode>TEST_INV</reasoncode:reasonCode>

      <reasoncode:description>Log entry for scan pass</reasoncode:description>

      <reasoncode:category>INVENTORY</reasoncode:category>

      <reasoncode:messageTypeRef>

       <reference type="MESSAGE_TYPE">

         <messageType></messageType>

       </reference>

      </reasoncode:messageTypeRef>

      <reasoncode:statusRef>

        <reference type="STATUS">

          <status>101</status>

        </reference>

      </reasoncode:statusRef>

    </requests>

  </common:serviceInvocationRequest>

</common:serviceInvocationRequests>

Thanks,

Oksana

Former Member
0 Kudos

Thanks Oksana.  We've been told that the fix for 691248 will be in Patch 21. (It's odd that this is not visible on the ticket yet.)  I'm not sure when we will install that, but we can make some progress, knowing that we will have the fix.

Thanks,

Barry

Answers (0)