Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 8338

Jco 3.0 to SAP RFC connection and holding SAP session global data

$
0
0

Hi Guru's,

 

I am trying to connect SAP R/3 System from Jco and i am successfull. But i am loosing the global data of SAP session on next RFC call.

As a first step, i called BAPI_XMI_LOGON and which updated External Company and Agent details in INTERFACES_USED global table.

In next step i called BAPI_XBP_JOB_OPN, but by this time INTERFACES_USED global internal table is becoming empty, so i am getting

Interface not logged on Issue.

 

Below is the Piece coding format i followed.

 

void executeCalls(String destName)

    {

        JCoDestination dest;

        try

        {

            dest = JCoDestinationManager.getDestination(destName);

            dest.ping();

            System.out.println("Ping Destination " + destName + " working fine");

 

            JCoFunction function1 = dest.getRepository().getFunction("BAPI_XMI_LOGON");

 

                        function1.getImportParameterList().setValue("EXTCOMPANY","TBP" );

                        function1.getImportParameterList().setValue("EXTPRODUCT","TBP" );

                        function1.getImportParameterList().setValue("INTERFACE","XBP" );

                        function1.getImportParameterList().setValue("VERSION","3.0" );

 

                        function1.execute(dest);

                        System.out.println("RFC - XMI Logon Successfull");

 

                        JCoFunction function = dest.getRepository().getFunction("BAPI_XBP_JOB_OPEN");

 

 

            try

                    {   function.getImportParameterList().setValue("JOBNAME","ZTEST_TBP" );

                        function.getImportParameterList().setValue("EXTERNAL_USER_NAME","SAPX" );

                        function.getImportParameterList().setValue("JOBCLASS","C" );

 

                        function.execute(dest);

 

                        System.out.println("RFC - FM Job Open successful " );

 

                        JCoFunction function5 = dest.getRepository().getFunction("BAPI_XBP_JOB_ADD_ABAP_STEP");


Viewing all articles
Browse latest Browse all 8338

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>