cancel
Showing results for 
Search instead for 
Did you mean: 

Error creating vendor w/ JCo FM VENDOR_INSERT- Missing parameter w/ PERFORM

Former Member
0 Kudos

Dear all,

I have followed the following thread and found it very useful as we need to create vendors from an external system in R/3 using the JCo as well. We are doing all the steps specified in previous posts and calling FM VENDOR_INSERT but when I execute the function it returns an exception:


JCoException: (104) RFC_ERROR_SYSTEM_FAILURE: Missing parameter with PERFORM.

We have checked and all the needed BAPIs are enabled but we are stuck at this first step. I have tried a variety of things but nothing seems to work. Not sure how I can specify the PERFORM parameter using JCo. Did anyone else fase this issue?

Here is what some of the relevant Java code looks like:


        JCoFunctionTemplate tmplt1 = repository.getFunctionTemplate("VENDOR_INSERT");
        JCoFunction vfunc = tmplt1.getFunction();        
        JCoParameterList vparams =  vfunc.getImportParameterList();

        JCoStructure jcs= vparams.getStructure("I_LFA1");
        try
        {

        	LocalSupplier s = getSupplier1();
        	jcs.setValue("MANDT", "010");
        	jcs.setValue("NAME1", s.getSupName());
        	jcs.setValue("NAME2", s.getSupName2());
        	jcs.setValue("PSTLZ", s.getSupPostalCode());
        	jcs.setValue("ORT01", s.getSupCity());
        	jcs.setValue("LAND1", s.getIdCountry().getIsocode());
        	jcs.setValue("STRAS", s.getAddress1() +", " + s.getAddress2());
        	jcs.setValue("MCOD1", "test");
        	jcs.setValue("KTOKK", "ZKRE");
        	jcs.setValue("SPRAS", s.getIdmasterSupplier().getIdlanguage().getLocale());
        	jcs.setValue("STCD1", s.getIdmasterSupplier().getTaxId());
        	jcs.setValue("TELF1", s.getTelephone());
        	jcs.setValue("TELFX", s.getFax());
        	        	
        	execute(vfunc, destination);        	

        }
        catch(Exception e)
        {
            System.out.println(e.toString());
            e.printStackTrace();
            return;
        }


	/**
	 * Method execute will call a function. The Caller of this function has
	 * already set all required parameters of the function
	 * 
	 */
	public static void execute(JCoFunction function, JCoDestination dest) {
		try {
			JCoContext.begin(dest);
			function.execute(dest);
			JCoContext.end(dest);
		} catch (JCoException e) {
			e.printStackTrace();
		}
	}   

Any help from some of view that have succesfully implemented vendor creation using the JCo would be highly appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

as I just wrote in the previous thread,

don't use function module VENDOR_INSERT.

As written before it is an update task FM. And also it do not check any field validity.

This is the best way to face inconsistencies in the future.

As you have also noticed, troubles and difficulties will come very soon related to the address management.

In standard there is NO FM or BAPI to do so.

The only supported option is via batch-input or idocs. Eventually, LSMW could help

See [note 384462|https://service.sap.com/sap/support/notes/384462]

With ECC 2005, a synchronisation class can help a lot. See class VMD_EI_API.

With ECC 2005 ehp3, you have an eSOA service to create vendor asynchronously. Not all fields are supported.

In other words, just create a BAPI to transfert your own parameters then either make a batchinput which will call XK01/XK02 in batch, either trigger class VMD_EI_API

BR

Alain

Answers (0)