cancel
Showing results for 
Search instead for 
Did you mean: 

customize the next number maintenance in ME 6.0

former_member323997
Participant
0 Kudos

Hello,

We have the business requirements that for the SFC we need send some material custom data field into the next number rule definition therefore the SFC can generate the values which can be defined in the custom data field.

Do you know whether this is supported by the SAP ME 6.0 SDK?

I checked the API GenerateNextNumber  under NumberingServiceWS, but it seems this is not the right one to customize and get the desired SFC number. do you know what purpose for this API? I tried several times and it is confusing me.

Thanks & regards,

Leon

Accepted Solutions (1)

Accepted Solutions (1)

former_member185234
Active Participant
0 Kudos

Hi Leon,

you should add PRE service plugin to NumberingService --> generateNextNumber method.

Attached example for java class. Eclipse for SDK 6.0 had special wizard to configure service plugins to needed execution point.

Code example reads custom fields from shop order to support 'COLOR' and 'SALES_ORDER_NUMBER' replaceable parameters for Next Number functionality.

Regards,

Oksana

former_member323997
Participant
0 Kudos

Hello Oksana,

Thanks a lot for your quick answer.

from the example code, it seems we can create a java class PlugIn for this generation, my question is that where I can configure this PlugIn? or how the ME 6.0 SFC generation can call this PlugIn?

Would be good to attach a configurable screenshot?

Thanks & regards,

Leon

former_member185234
Active Participant
0 Kudos

Hi Leon ,

Service Extension wizard in Eclipse SDK makes special configuration in service-config.xml file in Service Plugin project. Service Plugin is available at runtime after custom code is deployed. Not needed to make any configurations at SAP ME to enable Service Plugin.

Regards,

Oksana

former_member323997
Participant
0 Kudos

Hello Oksana,


Thanks, I got to know how to create the service-config.xml. Just for the further understanding how this generateNextNumber method works.

In the next number maintenance activity, I defined a Material Group with SFC Release, and the prefix is like bellow:

%ITEM_BO.(PRODUCT_TYPE)%C9%DATE_TIME.[DDD]%%ONEDIGITYEAR%

I would like to replace the %ITEM_BO.(PRODUCT_TYPE)% as the value of the material custom field PRODUCT_TYPE.

Your attached source code example does the same replacement for the custom fields, or there should be another way to customize this??

Thanks again for your help.

Thanks & regards,

Leon

former_member185234
Active Participant
0 Kudos

Hello Leon, You should use my code example as a reference, it replace %SALES_ORDER_NUMBER% and %COLOR% replaceable parameters defined in Next Number maintenance with custom fields defined for Shop Order. You must implement your own business logic in service extension class. Regards, Oksana

former_member323997
Participant
0 Kudos

Hello Oksana,


I have copied your source code into my SDK dev environment, and as far as I see the service extension is created properly in my SDK. I did the build and generated the SCA file and developed onto another test NetWeaver. But the manufacturing page throws exception now:

com.visiprise.frame.utils.AppRuntimeException: com.visiprise.frame.service.ServiceActivationException: Exception activating service com.harman.services$NextNumberMaintenanceExtension

at com.sap.me.frame.AppStartupListener.contextInitialized(AppStartupListener.java:54)

at com.sap.engine.services.servlets_jsp.server.application.WebEvents.contextInitialized(WebEvents.java:120)

at com.sap.engine.services.servlets_jsp.server.deploy.ApplicationThreadInitializer.run(ApplicationThreadInitializer.java:266)

at com.sap.engine.services.deploy.server.utils.concurrent.impl.CleanRunnable.run(CleanRunnable.java:54)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:185)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:302)

Caused by: com.visiprise.frame.service.ServiceActivationException: Exception activating service com.harman.services$NextNumberMaintenanceExtension

at com.visiprise.frame.service.impl.ServiceRegistry.handleException(ServiceRegistry.java:248)

at com.visiprise.frame.service.impl.ServiceRegistry.activateServices(ServiceRegistry.java:210)

at com.visiprise.frame.service.impl.ServiceRegistry.activate(ServiceRegistry.java:150)

at com.visiprise.frame.service.GenericServiceConfigurationLoader.loadModules(GenericServiceConfigurationLoader.java:72)

at com.visiprise.frame.service.XmlConfigurationLoader.loadConfiguration(XmlConfigurationLoader.java:13)

at com.visiprise.frame.service.ServiceLocator.loadConfiguration(ServiceLocator.java:226)

at com.sap.me.frame.AppStartupListener.contextInitialized(AppStartupListener.java:51)

... 7 more

Caused by: com.visiprise.frame.service.InvalidServiceConfigurationException: Exception validating service configuration: com.harman.services$NextNumberMaintenanceExtension

at com.visiprise.frame.service.impl.ServiceConfigurationResolver.validateServiceConfiguration(ServiceConfigurationResolver.java:323)

at com.visiprise.frame.service.impl.ServiceConfigurationResolver.validate(ServiceConfigurationResolver.java:99)

at com.visiprise.frame.service.impl.ServiceRegistry.activateServices(ServiceRegistry.java:205)

... 12 more

Caused by: com.sap.me.extension.ExtensionRegistrationException: Extension class com.harman.numbering.service.plugin.NextNumberMaintenanceExtensionExtensionActivity () is not trusted and will not be registered. Trusted extensions must be signed with a certificate issued by SAP ME Select

at com.sap.me.extension.ExtensionValidator.validateInternal(ExtensionValidator.java:55)

at com.sap.me.extension.ExtensionConfiguratorFactory.postValidate(ExtensionConfiguratorFactory.java:29)

at com.visiprise.frame.service.AbstractPrototypeFactory.validate(AbstractPrototypeFactory.java:73)

at com.visiprise.frame.service.AbstractPrototypeFactory.validate(AbstractPrototypeFactory.java:29)

at com.visiprise.frame.service.impl.ServiceConfigurationResolver.validateServiceConfiguration(ServiceConfigurationResolver.java:319)

... 14 more

Do you know what I am missing for this? I checked the maunfacturing-admin Extension Registration page, and I can find my extension service but it shows the Service Interface unspecified.

Thanks and regards,

Leon

former_member185234
Active Participant
0 Kudos

Hi Leon , You missed required steps from SDK Installation guide. It is section SAP ME License Configuration. A SAP ME license is required to allow extensions to be run within the SAP ME application.  Perform the following steps to install the development license: You must complete the following steps before performing the Java AS instance configuration: • Verify that all processes in the NetWeaver cluster are started.  Use SAP MMC to view the cluster status. • Start the Config Tool by running configtool.bat located in :\usr\sap\\\j2ee\configtool. 1. Select the instance node located in the navigation tree. 2. Go to the VM Environment tab. 3. Select the ClassPath property. 4. Add the following variable to the beginning of the classpath: ${INSTANCE_DIR}; Make sure to include the trailing semi-colon. 5. Click Set Custom Value. 6. Click Apply Change (Save) icon on the toolbar and close the Config Tool.  You will be prompted to restart the cluster. 7. Copy the SAPMELicense.properties file from the SDK installation folder to the SAP J2EE instance folder: :\usr\sap\\8. Save the configuration and close the Config Tool. 9. Restart NW instance. Regards, Oksana

former_member323997
Participant
0 Kudos

Hello Oksana,

Thank you very much for the answers.But I am now a little bit confused about the SAP ME license. In the SAP ME 6.0 installation guide for the normal production environment, the guide does not mention the SAP ME License is necessary, but the SDK installation guide needs it. Does that mean, we only need apply the SAP ME license for the SDK Dev NetWeaver? while the normal test and production SAP ME, the SAP ME License is not necessary?

Thanks & regards,

Leon

former_member185234
Active Participant
0 Kudos

Hello Leon,

I believe that you are using SDK Build Tool to build and package custom code for production system. SDK Build Tool uses special keystore certificate to sign your customization. This keystore certificate is unique for each customer or partner and delivered together with SDK training.

At development system you must perform steps explained for SAP ME License configuration , it is not needed to perform at production system.

regards,

Oksana

former_member323997
Participant
0 Kudos

Hello Oksana,

I have configured the configtool on my dev NetWeaver, but in the end I got the same result.

Here are what I have done:

In the SDK development Eclipse IDE, Ant area, I run the clean first, and then run the import, and afterwards I run the build.lib as mentioned in the SDK guide for Service PlugIn, and in the end, I run the run.production.build to generate the final SAPME.sca file.

And once the SAPME.sca file is generated, I still use the Eclipse IDE to deploy this sca to one of the test NetWeaver which is configured in the Windows->Preferences-> SAP AS Java

After the deployment is done successfully from the Eclipse IDE, and I restarted the me-ear in the test NetWeaver. All looks good, but the SAP ME manufacturing page shows that exception.

Can you please double check what I am wrong?

Thanks & regards,

Leon

former_member185234
Active Participant
0 Kudos

Hi Leon, SCA file created at development system should never be deployed to production or test system.You must use SDK Build Tool for this purpose. Configuration at Config Tool and license configuration (copy to NW drive:\usr\sap\sapsid\instance_name) folder should be performed only at development system. It allows service plugin to run without key store certificate.  Regards, Oksana

former_member323997
Participant
0 Kudos

Hello Oksana,


Thanks again:-) and back to my original question:-)


Now I deployed my source code to the SDK dev NetWeaver and I have no same exception anymore.


To test your source code which was deployed successfully:

1. In the next number maintenance, for one material I created the rule for Prefix %SALES_ORDER_NUMBER%%COLOR%ABCD

2. SALES_ORDER_NUMBER and COLOR are the Shop order custom data fields

3. I created the Shop Order for that material, and also maintained the data fields for SALES_ORDER_NUMBER and COLOR.

4. Then I go to Shop Order release, and release one SFC for this Shop Order, unfortunately, the generated SFC does not follow the PREFIX I have defined.


It seems this Service PlugIn not properly executed??


Thanks & regards,

Leon

former_member323997
Participant
0 Kudos

and, I use the soupUI to test the generateNextNumber, set the debug point in the Eclipse, and run the bellow request, the source codes from you run successfully.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mep="mepapi:com:sap:me:numbering" xmlns:num="http://www.sap.com/me/numbering">

   <soapenv:Header/>

   <soapenv:Body>

      <mep:generateNextNumber>

         <!--Optional:-->

         <mep:Site>RAINER</mep:Site>

         <!--Optional:-->

         <mep:Request>

            <num:nextNumberType>SFCRELEASE</num:nextNumberType>

            <num:numberOfValues>2</num:numberOfValues>

            <num:shopOrderRef>ShopOrderBO:RAINER,SO_00002534568_015_004</num:shopOrderRef>

         </mep:Request>

      </mep:generateNextNumber>

   </soapenv:Body>

</soapenv:Envelope>

the source codes from you run successfully. but the response I got from this request, the id seems nothing to do with the Next Number maintenance rule PREFIX setting.

former_member323997
Participant
0 Kudos

I figured out the problem that Shop Order release didn't work. I had the wrong order type, and after I changed the Shop Order type now I saw the SFC is released as desired.

Thank you very much for the help

former_member323997
Participant
0 Kudos

Hello Oksana,


I would like to have the last question about this topic, it is about the generateNextNumber API. I tried to run this API in the SoupUI tool, with bellow soap request message:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mep="mepapi:com:sap:me:numbering" xmlns:num="http://www.sap.com/me/numbering">

   <soapenv:Header/>

   <soapenv:Body>

      <mep:generateNextNumber>

         <!--Optional:-->

         <mep:Site>RAINER</mep:Site>

         <!--Optional:-->

         <mep:Request>

            <num:nextNumberType>SFCRELEASE</num:nextNumberType>

            <num:numberOfValues>1</num:numberOfValues>

            <num:shopOrderRef>ShopOrderBO:RAINER,SO_00002534568_015_004</num:shopOrderRef>

            <num:customFields>

               <name>SALES_ORDER_NUMBER</name>

               <value>LEON01</value>

            </num:customFields>

            <num:customFields>

               <name>COLOR</name>

               <value>RAINER01</value>

            </num:customFields>

         </mep:Request>

      </mep:generateNextNumber>

   </soapenv:Body>

</soapenv:Envelope>

<SOAP-ENV:Envelope xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

   <SOAP-ENV:Body>

      <ns3:generateNextNumberResponse xmlns:ns2="http://www.sap.com/me/numbering" xmlns:ns3="mepapi:com:sap:me:numbering">

         <ns3:Response>

            <ns2:id>RAINER546</ns2:id>

         </ns3:Response>

      </ns3:generateNextNumberResponse>

   </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

But the id I got from response is always not following the Next Number maintenance rule I defined for this shop order (the same shop order I used for testing your source code and it is working).

Could you please explain to me how to use this generateNextNumber API in the right way individually?

Thanks & regards,

Leon

former_member185234
Active Participant
0 Kudos

Hi Leon,

I always used release shop order maintenance or release shop order API to test service plugin.

regards,

Oksana

Answers (0)