cancel
Showing results for 
Search instead for 
Did you mean: 

Variant function/pfunction devlopment need clarification!

Former Member
0 Kudos

Hi guys,

i'm developing a variant function for extend the product configuration with IPC.

In our environment we have the last relase of IPC 5.0 and CRM EHP2, so we are facing with the last version running on VMC.

I follow this link

http://help.sap.com/saphelp_crm700_ehp02/helpdata/en/1a/2d9a3ecd744135ad27078554403974/content.htm

and referenced note to implement a very simple Variant Function.

I first create a new function in product model with two parameters (one input and one output) and referenced this function as Function Formula dependency.

After that, following the note 870201 and this other link Variant Functions - Configuration Engine - SAP Library i develop my class

This is my code where ZZ_TEST_CONF is the name of the function created in the product configuration

package com.sap.sce.user;

import com.sap.sce.engine.*;

public class ZZ_TEST_CONF  implements sce_user_fn {

        ZZ_TEST_CONF MyClass;

     public boolean execute(fn_args args, Object obj) {

        

         String TipoRic = args.get_value("ZZTIPORICHIESTA");

         sce_user_fn_logging MyLog = new sce_user_fn_logging();

         MyLog.writeLogError(MyClass, "SONO IO");

        

         return true;

          }

}

As you can see it is a very simple code just only to make all work. I uploaded the JAR without error and check the presence of my class with SM53.

I simulate the configuration of new product guessing that the my Variant Function should be triggered selecting the value of my input parameters.

But i can't figure out how to check the log, to see if my program execute correctly. In the pdf attached to the note 870201 there is this stament

"For tracing the following API can be used to make trace-entries. You will find your traces under the location com.sap.sce.user.sce_user_fn_logging." but there is no way for me to find this location. Neither in SM53 or AL11 or file system on the server.

Have you any suggestion or some tips about all the procedure to develop this Variant Function. I noticied that there are very few documentation about this topic and since the last revision of IPC introduce big chenges, many documentaion and topic are out of date.

Thanks in advice for any suggestion!

Accepted Solutions (1)

Accepted Solutions (1)

former_member182421
Active Contributor
0 Kudos

Hi Marco,

I never did varian configuration using java, but I dealt with the pricing exits, and tracing logs is a pain...did you try to go SM53/log administrator/log configuration and copy paste "com.sap.sce.user.sce_user_fn_logging" and press the transfer button? make sure the value ALL or DEBUG is selected in the dropdown before pressing transfer.

Then you should be able to see the logs on the log display

Cheers!

Luis

Former Member
0 Kudos

Hi Luis,

thanks for your suggestion, i correctly add the new location. And now i can select it from Log Display Tree.

Now the problem is that seem that my function didn't execute, since there are no log entry.

Could anyone confirm or not that my assumption about the triggering of the function is correct or not?

Thanks

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Pisačić,

at the end i was able to run a personal pfunction but without logging functionalities. The customer wanted to call an RFC inside PFunction, but after raised an incident to sap to help us, SAP answer that is not supported doing this thing.

At the moment i also change project and i working in other environment at all.

Regards

Krunoslav
Discoverer
0 Kudos

Hi Marco,

Thnx for reply. I also opened incident and got same answer - that in PME pfunction is not supported.

br,k.

Former Member
0 Kudos

Little update.

I still not able to see logs or traces, but using a statemnt like this in the code

     args.set_value("ZZCONSUMO", 60);

i'm able to check that my function is correctly triggered, since this value is correctly set.

But now, since i want also read prameters, when i use the statment

  ddb_inst inst = args.get_instance();

during the simulation i get this error when the function is triggered

"You have tried to set the following values for non-existent instance 1: 20"

Where "20" is the numeber i manually insert in my input parameters during the simulation.

Krunoslav
Discoverer
0 Kudos

Hi Marco,

Where you able to resolve this problem, and managed to call this implementation as "pfunction"? I have same issue - so would appriciate a hint.

thnx.

br,k.