‎2013 Oct 21 4:36 AM
Hi,
I am new to EAM/PM. I am trying to create function location via JCO/BAPI: BAPI_FUNCLOC_CREATE
Here is part of my code:
- JCoFunction function = destination.getRepository().getFunction("BAPI_FUNCLOC_CREATE");
- function.getImportParameterList().setValue("EXTERNAL_NUMBER","1018-1043-292020222222222222222222222223");
- function.getImportParameterList().setValue("LABELING_SYSTEM", "A");
- JCoStructure structure = function.getImportParameterList().getStructure("DATA_GENERAL");
- structure.setValue("PLANPLANT", "3000");
- JCoStructure structure2 = function.getImportParameterList().getStructure("DATA_SPECIFIC");
- structure2.setValue("SUPFLOC", "1018-1043");
- structure2.setValue("STRIND", "ZLINE");
- structure2.setValue("CATEGORY", "M");
- function.execute(destination);
-
- JCoStructure returnStructure = function.getExportParameterList().getStructure("RETURN");
- System.out.println(returnStructure.getString("MESSAGE"));
I got the error output:
Functional location 1018-1043 does not exist Anything wrong with the parameter settings.
Please help.
Kevin
‎2013 Oct 25 12:44 AM
I got it solved.
structure2.setValue("SUPFLOC", "1018-1043");
SUPFLOC should be set by an internal number which is like "?0100000000000005581".
‎2013 Oct 21 5:10 AM
Can you check below Sample Code ...
Example Program JCo Client - Components of SAP Communication Technology - SAP Library
Regard's
Smruti
‎2013 Oct 21 5:16 AM
Hi, Functional location have superior FL to 4 levels. Say XXXX, XXXX-ABCD, XXXX,-ABCD-1234
like this. Each time it will see the superior FL exist or not. That may cause error.
‎2013 Oct 21 6:02 AM
Hi
As Nivedita suggested what i believe is you have to first create superior function location as an hierarchy. For example first create 1018 this then 1018--1043 then 1018-1043-292020222222222222222222222223
thanks
Nabheet
‎2013 Oct 25 12:44 AM
I got it solved.
structure2.setValue("SUPFLOC", "1018-1043");
SUPFLOC should be set by an internal number which is like "?0100000000000005581".