cancel
Showing results for 
Search instead for 
Did you mean: 

Available elements in NC_DATA object (Routing Scripting)

0 Kudos

Hello Community,

I am desperately trying to implement a customer requirement for link scripting in non-conformance routings. (SAP ME 15.5)

The following concrete problem exists:

I need to make a different "next step" decision due to a property of an open NC.

This property is the REF_DES.

However, since this NC is not recorded at the completing operation, I have to read all open NCs with the method getOpenNCs().

According to the documentation and How-To documents, this method returns an NC_DATA object.

And now the problem begins: I can access the elements "NC_CODE_BO" and "HANDLE" with <object>.getHandle, for example, but with FAILURE_ID or REF_DES I get back null, although there is verifiably a value in the database row.

Does anyone know from documentation or simply from experience which elements are really available in the data object NC_DATA or can possibly help me with the RefDes? I would not like to perform another select with the HANDLE value. Especially because it says everywhere that further information is available in the Javadoc under NCDataBOBean.getOpenNCs(). However, even here I can't find anything on the net.

I thank you already for any help I can get.

Many thanks

Christoph

steve_stubbs
Participant
0 Kudos

HI Christoph,

According to the help, NC_DATA is a DATA object.

See it this works:

var ncData = NC_DATA.get("NC_DATA_REF_DES");//returns a DATA object

var refDes= ncData.get("REF_DES");// returns the REF_DES string for the object, or null if none was recorded

or this:

var refDes=NC_DATA_REF_DES.get("REF_DES");

Your only other option is to write a custom SQL Query in the Router Script to retrieve the specific data from the NC_DATA table in WIP.

Regards, Steve

Accepted Solutions (1)

Accepted Solutions (1)

sergiy_katerinich
Active Contributor
0 Kudos

getOpenNCs() just returns HANDLE, OPERATION_BO, USER_BO, DATE_TIME, NC_CODE_BO from NC_DATA table.

Formally, having obtained HANDLE, you can execute getNCData() with this value. But anyway you will need this one more call. So maybe a direct query to the table will be faster.

Answers (1)

Answers (1)

0 Kudos

Hi Steve,

Thanks for this quick reply and the two suggested solutions.

For me, unfortunately, only the SQL query on the NC_DATA table solved the problem, as NC_DATA and NC_DATA_REF_DES only contain information if the NC was recorded on the currently completed operation. (according to the documentation)

In my case, unfortunately, the NC was captured in the process before that and so I have to use the getOpenNCs() method.

This method also returns an NC_DATA object, but unfortunately I could not read the NC_DATA_REF_DES object from this object.

Therefore, I had to use the query on the NC_DATA table here.

Best regards to the United States

Christoph