Any prerequisites for using javascripts (JS) in SAP BPC 7.5NW (SP5)

Hi,
I keep getting evalution and parsing errors, every time I use a JS in my conversion files. It simple standard JS, like:
js:parseInt(%external%)
js:%external%.substring(2,5)
etc
Are there any prerequisites for using javascripts ??
Is there anywhere I can debug these JS withing SAP BW ?
Thank you,
Joergen

Gersh,
It works now. I have implemented the below code (ENTITY needed to contain the variable as well). The relationship profitcenter and entity is very important as it derives the relevant profitcenters from the profit center hierarchy (e.g. all profitcenters under the legalentity node).
//ALLOCATION PROCEDURE CONVERSION RATE
//=====================================
*FOR %ENT% = %ENTITY_SET%
*RUNALLOCATION
*FACTOR=1
*DIM SEBACCOUNT WHAT=CONV_RATE; WHERE=<<<; USING=<<< ; TOTAL=<<<
*DIM PROFCENT WHAT=DUMPC; WHERE=BAS(BPC_%ENT%);USING=<<<; TOTAL=<<<
*DIM CATEGORY WHAT=FCSTCUR; WHERE=<<<; USING=<<< ; TOTAL=<<<
*DIM ENTITY WHAT=%ENT%; WHERE=<<<; USING=<<<; TOTAL=<<<
*ENDALLOCATION
*NEXT
Thanks
Nico

Similar Messages

  • Prerequisites for Using Windows NTLM Authentication

    Hi,
    One of the prerequisites for using Windows NTLM Authentication, mentioned on help.sap.com documentation, is:
    - The user’s Web browser must be a Microsoft Internet Explorer
    This means that users not using Internet Explorer can’t authenticate using other web browser (Firefox and Netscape).
    In PAM, SAP says that web browser based on mozzila 1.7.x is also supported, and from this version on, Firefox and Netscape, both, support NTLM.
    NTLM Authentication in portal, still be supported with IE web browser?
    Thanks and Regards,
    Paul

    Hi Paul,
    I suspect that although it may not be officially supported, it will work.  The main thing is that a frontend web server perform the NTLM authentication and pass the header variable back to the J2EE engine.  By the time the header gets back to the J2EE engine, I dont think the portal has any idea how the header REMOTE_USER was generated, just that it was.
    Not positive though, as I havent tested the scenario you describe below..just thought I'd throw in my two cents.
    Marty

  • I can use my appleID without any problems for using to download new apps in the app-store or Itunes - Problem: I can´t use my ID at facetime and Imessage - I´d like to add an EMail account on top to my mobile number. My password will not be accepted!!!???

    I can use my appleID without any problems for using to download new apps in the app-store or Itunes - Problem: I can´t use my ID at facetime and Imessage -
    I´d like to add an EMail account on top to my mobile number to use more this services. My password will not be accepted!!!??? I try it and i try it and i try ist, throughout the same problem. Whats on? The user help desk said, i´ve to reset and use the WLAN key new as well as possible - no way!

    Contact the App store for Apple ID help. Their support link is on the right of the App store window
    LN

  • Any Prerequisite for adding MRP Area?

    Hi Gurus,
    I need to add MRP area data to a large number of materials. I tried testing for some material . For some materials I am able to add the data. For other I am not able to add.
    Is there any prerequisite for adding MRP area to a material?
    Can some suggest any BAPI to add/ update MRP area for a material?
    I am basically a ABAPer and don't have much Idea about MRP area. Please suggest any link where I can learn overview about MRP area.
    Thanks in Advance,
    KG

    hi,
    the prerequisities for MRP area are
    1> ACTIVATE MRP AREA
    2> DEFINE MRP AREAS.u will find the settings under the menu path:
    SPRO > IMG > MATERIAL MANAGEMENT > CONSUMPTION BASED PLANNING > MASTER DATA > MRP AREAS
    or u can find it under the menu path:
    SPRO > IMG > PRODUCTION > MATERIAL REQUIREMENT PLANNING > MASTER DATA > MRP AREAS.
    regards
    jash
    Edited by: diptasya jash on Apr 30, 2009 11:35 AM

  • Is there any tutorial for using ARM cortex-A processors of Zynq for digital signal processing ?

    Hello, everyone.
    Is there any tutorial for using ARM cortex-A processors(such as A9 and A53) of Zynq to deal with digital signal processing  problems?
    Please tell me , thanks.

    Hi
    Check below links
    http://www.xilinx.com/training/zynq/software-acceleration-for-dsp-functions-with-zynq.htm
    https://www.youtube.com/watch?v=ErEG7ZREcJQ
    http://www.xilinx.com/support/documentation/application_notes/xapp1170-zynq-hls.pdf
    http://www.xilinx.com/support/documentation/application_notes/xapp890-zynq-sobel-vivado-hls.pdf
    http://www.xilinx.com/support/documentation/application_notes/xapp1167.pdf

  • Apple iMac 24" 2008 , will this imac be any good for using xcode ? Thanks

    Apple iMac 24" 2008 , will this imac be any good for using xcode ? Thanks

    Hmmmm.
    http://www.nvidiadefect.com/apple-2008-imac-24-with-nvidia-geforce-8800-gs-t2243 .html

  • Can any one explain me consolidation topic in sap bpc ?

    hi
    please explain me consolidation
    can any one explain me consolidation topic in sap bpc
    thank you .......
    suresh

    Hi Sures,
    It's like can you explain BPC ?
    Do search on scn.
    Refer below links, may be helpful,
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/7070134c-1b04-2d10-f29d-bbb35abfa119?QuickLink=index&…
    BPC Step by Step Scenario Document
    SAP BPC 10 DOCUMENTS
    Shrikant

  • Prerequisites for using ALV reports

    Hi,
    We have some of our standard transaction for instance LT23, which seems to have been programmed to be used and viewed with ALV layout. However, this is not the case, it just print using the old list layout.
    Are the prerequisites for running ALV report; if so I would like to know them. SAP GUI is 7.20 and the theme is SAP Signature.
    Any input is appreciated.
    Thanks.

    Hi
    If you want to use the GRID instead of LIST, yes I don't know if it's a good idea but you can do only that
    That means you need to change the function module  L_TO_LIST_DISPLAY, but the ALV is called in form CALL_ALV, so you can create an enhancement in order to call the GRID instead of LIST.
    The call should be the same, because the 2 functions (GRID and LIST) have the same interface, so instead of
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
         EXPORTING
              I_CALLBACK_PROGRAM       = SAV_SY_REPID
              I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
    *         I_CALLBACK_USER_COMMAND  = ' '
    *         I_STRUCTURE_NAME         =
              IS_LAYOUT                = LAYOUT
              IT_FIELDCAT              = XFIELD
    *         IT_EXCLUDING             =
              IT_SPECIAL_GROUPS        = XSP_GROUP[]
    *         IT_SORT                  =
    *         IT_FILTER                =
    *         IS_SEL_HIDE              =
              I_DEFAULT                = 'X'
              I_SAVE                   = 'A'
              IS_VARIANT               = VARIANT
              IT_EVENTS                = XEVENT
    * >>>>>>>>>> begin of insertion HP_318150 >>>>>>>>>>
              i_buffer_active          = 'X'
    * <<<<<<<<<< end   of insertion HP_318150 <<<<<<<<<<
    *         IT_EVENT_EXIT            =
    *         IS_PRINT                 =
              I_SCREEN_START_COLUMN    = I_SCREEN_START_COLUMN
              I_SCREEN_START_LINE      = I_SCREEN_START_LINE
              I_SCREEN_END_COLUMN      = I_SCREEN_END_COLUMN
              I_SCREEN_END_LINE        = I_SCREEN_END_LINE
    *    IMPORTING
    *         E_EXIT_CAUSED_BY_CALLER  =
           TABLES
                T_OUTTAB                 = T_TO_LIST_PLUS
           EXCEPTIONS
                PROGRAM_ERROR            = 1
                OTHERS                   = 2.
      IF SY-SUBRC NE 0.
        MESSAGE E706(L1) WITH 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'.
    *   Interner Fehler ist aufgetreten (FB &)
      ENDIF.
    ....you can insert:
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
              I_CALLBACK_PROGRAM       = SAV_SY_REPID
              I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
    *         I_CALLBACK_USER_COMMAND  = ' '
    *         I_STRUCTURE_NAME         =
              IS_LAYOUT                = LAYOUT
              IT_FIELDCAT              = XFIELD
    *         IT_EXCLUDING             =
              IT_SPECIAL_GROUPS        = XSP_GROUP[]
    *         IT_SORT                  =
    *         IT_FILTER                =
    *         IS_SEL_HIDE              =
              I_DEFAULT                = 'X'
              I_SAVE                   = 'A'
              IS_VARIANT               = VARIANT
              IT_EVENTS                = XEVENT
    * >>>>>>>>>> begin of insertion HP_318150 >>>>>>>>>>
              i_buffer_active          = 'X'
    * <<<<<<<<<< end   of insertion HP_318150 <<<<<<<<<<
    *         IT_EVENT_EXIT            =
    *         IS_PRINT                 =
              I_SCREEN_START_COLUMN    = I_SCREEN_START_COLUMN
              I_SCREEN_START_LINE      = I_SCREEN_START_LINE
              I_SCREEN_END_COLUMN      = I_SCREEN_END_COLUMN
              I_SCREEN_END_LINE        = I_SCREEN_END_LINE
    *    IMPORTING
    *         E_EXIT_CAUSED_BY_CALLER  =
           TABLES
                T_OUTTAB                 = T_TO_LIST_PLUS
           EXCEPTIONS
                PROGRAM_ERROR            = 1
                OTHERS                   = 2.
      IF SY-SUBRC NE 0.
        MESSAGE E706(L1) WITH 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'.
    *   Interner Fehler ist aufgetreten (FB &)
      ENDIF.
    Max

  • Any tips for using the battery ? T500

    Are there any tips to use the battery for a long time ?
    I've seen the posts somewhere that "conditioning" is not needed for this battery, Li-on based ?
    Is recharging when the battery is half-charged a bad habit ?
    Thanks

    Hello shong9,
    First you should load your battery 36h, then unload it normally, till it will go to sleep or hibernate
    (depends on setting in power manager).
    Second load it 24, then unload it normally till it went to sleep or hibernate.
    Third and last, load it 12h, then unload it normally till it went to sleep or hibernate.
    Then you battery has got it´s full capacity and the powermanger will do all for you, to keep it healthy.
    You should leave the battery in your machine, if using AC.
    When you are working mobile, then charge it, when it´s necessary. 
    That´s it.
    Follow @LenovoForums on Twitter! Try the forum search, before first posting: Forum Search Option
    Please insert your type, model (not S/N) number and used OS in your posts.
    I´m a volunteer here using New X1 Carbon, ThinkPad Yoga, Yoga 11s, Yoga 13, T430s,T510, X220t, IdeaCentre B540.
    TIP: If your computer runs satisfactorily now, it may not be necessary to update the system.
     English Community       Deutsche Community       Comunidad en Español

  • Any sample for using Captcha with Oracle ADF ?

    Hi
    Thank you for reading my post
    is there any sample available for using captcha with adf faces ?
    thanks

    Hi,
    nott hat I am aware of. However, I started a project to build a custom JSF component using
    http://jcaptcha.sourceforge.net/
    Not sure when I have this finished, but the goal is to have this working with ADF Faces (not sure if it makes sense to bind the component to ADF though)
    Frank

  • HT204380 Do I incur any charges for using face time (Apple ipad 4) when calling someone else?

    Do I (or the person I am calling) incur any charges for calling someone on face time (using Apple ipad 4)?

    There are no extra charges associated with Facetime in and of itself.   The only applicable charges are whatever you already pay for your internet connection, or your Cellular connection if you are connecting through that.
    Same applies for the person on the other end.

  • Is Solaris Cluster 4.0 Free?. whether we need any license for using it?

    I am able to Download the Solaris Cluster from the Oracle Site. But need to know whether we need any license to use it?

    Hello 1577859,
    and if you like to get the support updates you need a contract to get access to the Solaris Cluster support publisher.
    Hth,
      Juergen

  • Using a variable in an allocation routine in SAP BPC 7.5NW

    Below is a very simple BPC allocation routine I wrote.  The data originally sits on a dummy profit center and needs to be allocated to all itu2019s relevant profit centers. These relevant profit centers can be derived from the profit center hierarchy (BPC_ + ID of entity).
    When I hardcode the Profitcenter and the entity, the routine works (as below). But what I really want is that it works variable as in the line that I commented out. Any idea whether this could work (BPC 7.5NW)  ? If not, I am afraid I need to go to ABAP, which is really a pitty
    //ALLOCATION PROCEDURE CONVERSION RATE
    //=====================================
    *RUNALLOCATION
    *FACTOR=1
    *DIM SEBACCOUNT WHAT=CONV_RATE; WHERE=<<<; USING=<<< ; TOTAL=<<<
    //*DIM PROFCENT WHAT=DUMPC; WHERE=BAS(BPC_"%ENTITY_SET%");USING=<<<; TOTAL=<<<
    *DIM PROFCENT WHAT=DUMPC; WHERE=BAS(BPC_OKB);USING=<<<; TOTAL=<<<
    *DIM ENTITY WHAT=OKB; WHERE=<<<; USING=<<< ; TOTAL=<<<
    *ENDALLOCATION
    Thanks
    Nico

    Gersh,
    It works now. I have implemented the below code (ENTITY needed to contain the variable as well). The relationship profitcenter and entity is very important as it derives the relevant profitcenters from the profit center hierarchy (e.g. all profitcenters under the legalentity node).
    //ALLOCATION PROCEDURE CONVERSION RATE
    //=====================================
    *FOR %ENT% = %ENTITY_SET%
    *RUNALLOCATION
    *FACTOR=1
    *DIM SEBACCOUNT WHAT=CONV_RATE; WHERE=<<<; USING=<<< ; TOTAL=<<<
    *DIM PROFCENT WHAT=DUMPC; WHERE=BAS(BPC_%ENT%);USING=<<<; TOTAL=<<<
    *DIM CATEGORY WHAT=FCSTCUR; WHERE=<<<; USING=<<< ; TOTAL=<<<
    *DIM ENTITY WHAT=%ENT%; WHERE=<<<; USING=<<<; TOTAL=<<<
    *ENDALLOCATION
    *NEXT
    Thanks
    Nico

  • Email notification for instance activation not working - SAP BPC 7.5

    Hello Everybody,
    I have a problem with email notification in SAP BPC 7.5.
    I want to configure an email notification to whenever an instance is activated.
    I have followed one How-To guide and basically I have created and activated a template in SAP GUI with transaction se38 and a program called UJB_MAINTAIN_EMAIL_TMPL.
    Also, the web server was configured by systems admin.
    But still is not working.
    I am completely new with SAP BPC so I donu2019t know what more can I do to solve the problem.
    Hope you can help me.
    Regards,
    Nadine

    You can greatly improve your chance of receiving a helpful answer to your question if you state the version (MS or NW) of BPC which you are using.
    Also notice the sticky [note|Please do not post BPC, SSM or FI/CO questions here!; at the top of this forum whereby we announced new dedicated forums for BPC which are the proper place to post your questions regarding BPC in the future to be able to reach the right audience for your question.
    Thanks and best regards,
    [Jeffrey Holdeman|http://wiki.sdn.sap.com/wiki/display/profile/Jeffrey+Holdeman]
    SAP Labs, LLC
    BusinessObjects Division
    Americas Customer Solutions Adoption (CSA) team

  • How to download jco, for using in a test sap system?

    Hello,
    at the moment i am trying to program with java a connection to a sap test system (from the book abap objects).
    Normally the conenction is built up by jco. My question is, because i haven´t got a login to the service marketplace,
    is there any possibility to download and use jco for my test connection? I only try it for education.
    Thank you very much
    Bye

    Hi GLM,
    i just used the example from the jco package,
    which i downloaded from sap service marketplace.
    (I have changed the sap poperties).
    With the jco 2 it works perfect. Only with new one
    i got problems.
    import java.io.File;
    import java.io.FileOutputStream;
    import java.util.Properties;
    import java.util.concurrent.CountDownLatch;
    import com.sap.conn.jco.AbapException;
    import com.sap.conn.jco.JCoContext;
    import com.sap.conn.jco.JCoDestination;
    import com.sap.conn.jco.JCoDestinationManager;
    import com.sap.conn.jco.JCoException;
    import com.sap.conn.jco.JCoField;
    import com.sap.conn.jco.JCoFunction;
    import com.sap.conn.jco.JCoFunctionTemplate;
    import com.sap.conn.jco.JCoStructure;
    import com.sap.conn.jco.JCoTable;
    import com.sap.conn.jco.ext.DestinationDataProvider;
    public class StepByStepClient
        static String ABAP_AS = "ABAP_AS_WITHOUT_POOL";
        static String ABAP_AS_POOLED = "ABAP_AS_WITH_POOL";
        static String ABAP_MS = "ABAP_MS_WITHOUT_POOL";
        static
            Properties connectProperties = new Properties();
            connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "binmain");
            connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR,  "53");
            connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "000");
            connectProperties.setProperty(DestinationDataProvider.JCO_USER,   "JCOTEST");
            connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "JCOTEST");
            connectProperties.setProperty(DestinationDataProvider.JCO_LANG,   "en");
            createDataFile(ABAP_AS, "jcoDestination", connectProperties);
            connectProperties.setProperty(DestinationDataProvider.JCO_POOL_CAPACITY, "3");
            connectProperties.setProperty(DestinationDataProvider.JCO_PEAK_LIMIT,    "10");
            createDataFile(ABAP_AS_POOLED, "jcoDestination", connectProperties);
            connectProperties.clear();
            connectProperties.setProperty(DestinationDataProvider.JCO_MSHOST, "binmain");
            connectProperties.setProperty(DestinationDataProvider.JCO_R3NAME,  "BIN");
            connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "000");
            connectProperties.setProperty(DestinationDataProvider.JCO_USER,   "JCOTEST");
            connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "JCOTEST");
            connectProperties.setProperty(DestinationDataProvider.JCO_GROUP, "PUBLIC");
            connectProperties.setProperty(DestinationDataProvider.JCO_LANG,   "en");
            createDataFile(ABAP_MS, "jcoDestination", connectProperties);
        static void createDataFile(String name, String suffix, Properties properties)
            File cfg = new File(name+"."+suffix);
            if(!cfg.exists())
                try
                    FileOutputStream fos = new FileOutputStream(cfg, false);
                    properties.store(fos, "for tests only !");
                    fos.close();
                catch (Exception e)
                    throw new RuntimeException("Unable to create the destination file " + cfg.getName(), e);
        public static void step1Connect() throws JCoException
            JCoDestination destination = JCoDestinationManager.getDestination(ABAP_AS);
            System.out.println("Attributes:");
            System.out.println(destination.getAttributes());
            System.out.println();
            destination = JCoDestinationManager.getDestination(ABAP_MS);
            System.out.println("Attributes:");
            System.out.println(destination.getAttributes());
            System.out.println();
        public static void step2ConnectUsingPool() throws JCoException
            JCoDestination destination = JCoDestinationManager.getDestination(ABAP_AS_POOLED);
            destination.ping();
            System.out.println("Attributes:");
            System.out.println(destination.getAttributes());
            System.out.println();
        public static void step3SimpleCall() throws JCoException
            JCoDestination destination = JCoDestinationManager.getDestination(ABAP_AS_POOLED);
            JCoFunction function = destination.getRepository().getFunction("STFC_CONNECTION");
            if(function == null)
                throw new RuntimeException("BAPI_COMPANYCODE_GETLIST not found in SAP.");
            function.getImportParameterList().setValue("REQUTEXT", "Hello SAP");
            try
                function.execute(destination);
            catch(AbapException e)
                System.out.println(e.toString());
                return;
            System.out.println("STFC_CONNECTION finished:");
            System.out.println(" Echo: " + function.getExportParameterList().getString("ECHOTEXT"));
            System.out.println(" Response: " + function.getExportParameterList().getString("RESPTEXT"));
            System.out.println();
        public static void step3WorkWithStructure() throws JCoException
            JCoDestination destination = JCoDestinationManager.getDestination(ABAP_AS_POOLED);
            JCoFunction function = destination.getRepository().getFunction("RFC_SYSTEM_INFO");
            if(function == null)
                throw new RuntimeException("BAPI_COMPANYCODE_GETLIST not found in SAP.");
            try
                function.execute(destination);
            catch(AbapException e)
                System.out.println(e.toString());
                return;
            JCoStructure exportStructure = function.getExportParameterList().getStructure("RFCSI_EXPORT");
            System.out.println("System info for " + destination.getAttributes().getSystemID() + ":\n");
            for(int i = 0; i < exportStructure.getMetaData().getFieldCount(); i++)
                System.out.println(exportStructure.getMetaData().getName(i) + ":\t" + exportStructure.getString(i));
            System.out.println();
            //JCo still supports the JCoFields, but direct access via getXX is more efficient as field iterator
            System.out.println("The same using field iterator: \nSystem info for " + destination.getAttributes().getSystemID() + ":\n");
            for(JCoField field : exportStructure)
                System.out.println(field.getName() + ":\t" + field.getString());
            System.out.println();
        public static void step4WorkWithTable() throws JCoException
            JCoDestination destination = JCoDestinationManager.getDestination(ABAP_AS_POOLED);
            JCoFunction function = destination.getRepository().getFunction("BAPI_COMPANYCODE_GETLIST");
            if(function == null)
                throw new RuntimeException("BAPI_COMPANYCODE_GETLIST not found in SAP.");
            try
                function.execute(destination);
            catch(AbapException e)
                System.out.println(e.toString());
                return;
            JCoStructure returnStructure = function.getExportParameterList().getStructure("RETURN");
            if (! (returnStructure.getString("TYPE").equals("")||returnStructure.getString("TYPE").equals("S"))  )  
               throw new RuntimeException(returnStructure.getString("MESSAGE"));
            JCoTable codes = function.getTableParameterList().getTable("COMPANYCODE_LIST");
            for (int i = 0; i < codes.getNumRows(); i++)
                codes.setRow(i);
                System.out.println(codes.getString("COMP_CODE") + '\t' + codes.getString("COMP_NAME"));
            codes.firstRow();
            for (int i = 0; i < codes.getNumRows(); i++, codes.nextRow())
                function = destination.getRepository().getFunction("BAPI_COMPANYCODE_GETDETAIL");
                if (function == null)
                    throw new RuntimeException("BAPI_COMPANYCODE_GETDETAIL not found in SAP.");
                function.getImportParameterList().setValue("COMPANYCODEID", codes.getString("COMP_CODE"));
                function.getExportParameterList().setActive("COMPANYCODE_ADDRESS",false);
                try
                    function.execute(destination);
                catch (AbapException e)
                    System.out.println(e.toString());
                    return;
                returnStructure = function.getExportParameterList().getStructure("RETURN");
                if (! (returnStructure.getString("TYPE").equals("") ||
                       returnStructure.getString("TYPE").equals("S") ||
                       returnStructure.getString("TYPE").equals("W")) )
                    throw new RuntimeException(returnStructure.getString("MESSAGE"));
                JCoStructure detail = function.getExportParameterList().getStructure("COMPANYCODE_DETAIL");
                System.out.println(detail.getString("COMP_CODE") + '\t' +
                                   detail.getString("COUNTRY") + '\t' +
                                   detail.getString("CITY"));
            }//for
         * this example shows the "simple" stateful call sequence. Since all calls belonging to one
         * session are executed within the same thread, the application does not need
         * to take care about the SessionReferenceProvider. MultithreadedExample.java
         * illustrates the more complex scenario, where the calls belonging to one session are
         * executed from different threads.
         * Note: this example uses Z_GET_COUNTER and Z_INCREMENT_COUNTER. The most ABAP systems
         * contain function modules GET_COUNTER and INCREMENT_COUNTER, that are not remote enabled.
         * Copy these functions to Z_GET_COUNTER and Z_INCREMENT_COUNTER (or implement as wrapper)
         * and mark they remote enabled
         * @throws JCoException
        public static void step4SimpleStatefulCalls() throws JCoException
            final JCoFunctionTemplate incrementCounterTemplate, getCounterTemplate;
            JCoDestination destination = JCoDestinationManager.getDestination(ABAP_MS);
            incrementCounterTemplate = destination.getRepository().getFunctionTemplate("Z_INCREMENT_COUNTER");
            getCounterTemplate = destination.getRepository().getFunctionTemplate("Z_GET_COUNTER");
            if(incrementCounterTemplate == null || getCounterTemplate == null)
                throw new RuntimeException("This example cannot run without Z_INCREMENT_COUNTER and Z_GET_COUNTER functions");
            final int threadCount = 5;
            final int loops = 5;
            final CountDownLatch startSignal = new CountDownLatch(threadCount);
            final CountDownLatch doneSignal = new CountDownLatch(threadCount);
            Runnable worker = new Runnable()
                public void run()
                    startSignal.countDown();
                    try
                        //wait for other threads
                        startSignal.await();
                        JCoDestination dest = JCoDestinationManager.getDestination(ABAP_MS);
                        JCoContext.begin(dest);
                        try
                            for(int i=0; i < loops; i++)
                                JCoFunction incrementCounter = incrementCounterTemplate.getFunction();
                                incrementCounter.execute(dest);
                            JCoFunction getCounter = getCounterTemplate.getFunction();
                            getCounter.execute(dest);
                            int remoteCounter = getCounter.getExportParameterList().getInt("GET_VALUE");
                            System.out.println("Thread-" + Thread.currentThread().getId() +
                                    " finished. Remote counter has " + (loops==remoteCounter?"correct":"wrong") +
                                    " value [" + remoteCounter + "]");
                        finally
                            JCoContext.end(dest);                   
                    catch(Exception e)
                        System.out.println("Thread-" + Thread.currentThread().getId() + " ends with exception " + e.toString());
                    doneSignal.countDown();
            for(int i = 0; i < threadCount; i++)
                new Thread(worker).start();
            try
                doneSignal.await();
            catch(Exception e)
        public static void main(String[] args) throws JCoException
            step1Connect();
            step2ConnectUsingPool();
            step3SimpleCall();
            step4WorkWithTable();
            step4SimpleStatefulCalls();
    Edited by: Unicast on Sep 14, 2008 4:33 PM

Maybe you are looking for