cancel
Showing results for 
Search instead for 
Did you mean: 

routing script documentation

Former Member
0 Kudos


Hi,

In the SAP ME Application help for "Methods Available for Routing Scripts" the last line says

"The methods are documented in more detail in the javadocs, in ScriptHelper.java (core.sys.server). Check the javadocs for the current definition"

I have downloaded the Javadocs zip file for both ME 15 and ME 6.0, but when looking through it I cannot find Scripthelper.java.

Can anyone help me in the right direction?

Best regards,

Johan

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi Johan!

That file does not have any javadoc comments. I guess this is why the statement was removed in 15.0 help.

If you have a question about any specific method, please let me know.

Regards,

Sergiy

Former Member
0 Kudos


Hi Sergiy,

I am looking for a routing script that can read all NC's for a SFC and search for all occurrences of a specific NC.

I saw the method GetOpenNCs() and wondered if there was a method to get all NCs and not just the Open ones.

Best regards,

Johan

0 Kudos

Johan,

There is such method defined available in ScriptHelper. So, you should use either callEJB() or executeQuery() - see some examples in SAP Notes 1270403 and 1270322.

Regards,

Sergiy

stuarta1
Active Participant
0 Kudos

Johan

The simplest way would be to do an executeQuery(). You can place all your custom logic inside one single query to return a true/false for whether a specific NC code exists for the SFC.

Are you simply routing the SFC to an alternative path, based on the evaluation?

Former Member
0 Kudos

Hi Stuart,

Yes, the plan is to route the SFC to an alternative path if we find a specific NC_CODE
has been logged > 3 times.

Br,

Johan

stuarta1
Active Participant
0 Kudos

Johan

You can do something like this:

sfcHandle=COMPLETE_DATA.getHandle("SFC_BO");

stmt="select count(*) as COUNT from nc_data inner join nc_code on nc_code_bo=nc_code.handle and nc_code='NC1'  where nc_context_gbo='" + sfcHandle + "'";

qry_result=executeQuery(stmt);

res=qry_result.get("COUNT");

if (res>3) exit(900);  else exit(0);

Remember to replace NC1 with your NC code and have the other path with just

exit(500);

Stuart

Former Member
0 Kudos

Thank you Stuart.

I only added the check so that it does not count if the NC has been cancelled.

The final script looks like this:

sfcHandle=COMPLETE_DATA.getHandle("SFC_BO");
stmt="select count(*) as COUNT from nc_data inner join nc_code on nc_code_bo=nc_code.handle and nc_code='NC1'  where nc_context_gbo='" + sfcHandle + "' and nc_state <> 'D'";
qry_result=executeQuery(stmt);

res=qry_result.get("COUNT");

if (res>3) exit(900);  else exit(0);

/Johan

Answers (1)

Answers (1)

0 Kudos

Hi Johan,

Some basic information still can be found in 5.1 guides:

https://websmp208.sap-ag.de/~sapidb/011000358700001374762008E/productionlinesetup.pdf

see pages since 61.

Br, Alex.