Skip to Content
0
Former Member
Oct 20, 2009 at 06:00 AM

JCO function parameters lost during qRFC call

139 Views

Hello guys,

We have a very strange situation. We are trying to call a qRFC from JCo and the problem is that on the ABAP side, the call comes without parameters set (even if in the Java side they are correctly set). If we are switching to simple RFC calls, everything goes smoothly. All the parameters of the function are defined as changing parameters. We are verifying this by deregister the queue from ABAP side and we see the call in pending waiting for execution. By inspecting this call we can see that no parameters are set on it.

Here is how we make the qRFC call and set the function parameters:

                JCoFunction function = jcoDestination.getRepository().getFunction(PSNV_WEB_CONN_FUNC);
		
		
		if ( function == null )
			throw new RuntimeException(PSNV_WEB_CONN_FUNC + " function not found in SAP.");
		
		function.getChangingParameterList().setValue(OBJECT_TYPE, initialRequestHeader.getObjectType());
		function.getChangingParameterList().setValue(OBJECT_NAME, initialRequestHeader.getObjectName());
		function.getChangingParameterList().setValue(OBJECT_KEY, initialRequestHeader.getObjectKey());
		function.getChangingParameterList().setValue(OBJECT_VERSION, initialRequestHeader.getObjectVersion());
		
		JCoTable contentTable = function.getChangingParameterList().getTable(CONTENT);
		
		ByteArrayInputStream bais = new ByteArrayInputStream( (byte[]) jcoContent );
		byte[] buffer = new byte[BA_SIZE];
		int readBytes;
		while ((readBytes = bais.read(buffer)) != -1) {
			contentTable.appendRow();
			contentTable.lastRow();
			contentTable.setValue(0, new String(buffer, 0, readBytes));
		}
		
		function.getChangingParameterList().setValue(CONTENT_LENGTH, ((byte[]) jcoContent).length);
		
		try {
			String tid = jcoDestination.createTID();
			
			if ( logger.isDebugEnabled() )
				logger.debug("Calling the RFC with transaction ID: " + tid);
			
                       function.execute(jcoDestination, tid, initialRequestHeader.getResponseQueue());
                       jcoDestination.confirmTID(tid);
			//	function.execute(jcoDestination);
            
            if ( logger.isDebugEnabled() )
            	logger.debug(function.toString());
		} catch (AbapException e) {
        	logger.error("Abap exception rised while trying to execute the abap function " + function.getName(), e);
        	throw new Exception("Abap exception rised while trying to execute the abap function " + function.getName(), e);
        }

We have also activate the trace at level 9 on the Jco client side and it looks like this (non relevant content was removed to fit the message length limitation):

The full trace can be found here:

Full_JCO_trace_231107682.zip

http-8080-Processor23 [23:12:00:494]: [JCoAPI] Pool.getClient() on pool PSNV_DEV10_AS&800|AIO|EN|E3C1EE2F687D5152851197C615F7CAF9                 [enter]
http-8080-Processor23 [23:12:00:495]: [JCoAPI] Pool.getClient() returns [5]     [leave]
http-8080-Processor23 [23:12:00:495]: [JCoRFC] CreateTID before RfcCreateTransId(5)
http-8080-Processor23 [23:12:00:563]: [JCoRFC] CreateTID after RfcCreateTransId(5)=C0A80A0F03F84ADCC8107059
http-8080-Processor23 [23:12:00:564]: [JCoAPI] Context.releaseConnection on destination PSNV_DEV10_AS [5|83742355]
http-8080-Processor23 [23:12:00:564]: [JCoAPI] Pool.releaseClient([5]) in pool PSNV_DEV10_AS&800|AIO|EN|E3C1EE2F687D5152851197C615F7CAF9 [pool size 1, max connections 10, waiting threads 0, currently used 1]
http-8080-Processor23 [23:12:00:565]: [JCoRFC] Reset before RfcCleanupContext(5)
http-8080-Processor23 [23:12:00:641]: [JCoRFC] Reset after RfcCleanupContext(5)
http-8080-Processor23 [23:12:12:362]: [JCoAPI] destination PSNV_DEV10_AS destinationID=PSNV_DEV10_AS&800|AIO|EN|E3C1EE2F687D5152851197C615F7CAF9 executes /PSI/WEB_CONNECT sessionID=Thr-48-1, threadID=0x30
http-8080-Processor23 [23:12:12:363]: [JCoAPI] Context.getConnection on destination PSNV_DEV10_AS (state: destination = null, general = null, default = STATELESS)
http-8080-Processor23 [23:12:12:363]: [JCoAPI] Pool.getClient() on pool PSNV_DEV10_AS&800|AIO|EN|E3C1EE2F687D5152851197C615F7CAF9                 [enter]
http-8080-Processor23 [23:12:12:364]: [JCoAPI] Pool.getClient() returns [5]     [leave]
http-8080-Processor23 [23:12:12:419]: [JCoAPI] JCoClient before execute (/PSI/WEB_CONNECT) on handle [5]
Function /PSI/WEB_CONNECT (does not support BASXML)
CHANGING
   APPLICATION                     /PSI/WEB_APPLICATION            CHAR      0       20      20      40      CA
   CODEPAGE_SAP                    RFCCHARTYP                      CHAR      20      4       4       8       CAu
   CODEPAGE_WEB                    RFCCHARTYP                      CHAR      24      4       4       8       CA
   CONTENT                         /PSI/WEB_CONTENT                TABLE     28      0       1024    1024    CA
   CONTENT_LENGTH                  SYTABIX                         INT       28      2       4       4       CA
   GUID                            SYSUUID_C                       CHAR      30      32      32      64      CA
   LOGSYS                          LOGSYS                          CHAR      62      10      10      20      CAu
   OBJECT_KEY                      /PSI/WEB_OBJECT_KEY             CHAR      72      256     256     512     CA
   OBJECT_NAME                     OBJ__NAME                       CHAR      328     30      30      60      CA
   OBJECT_TYPE                     OBJTYPE                         CHAR      358     2       2       4       CA
   OBJECT_VERSION                  /PSI/WEB_VERSION                NUM       360     6       6       12      CA
   REQUEST_QUEUE                   TRFCQNAM                        CHAR      366     24      24      48      CA
   RESPONSE_QUEUE                  TRFCQNAM                        CHAR      390     24      24      48      CA
   SYNC                            FLAG                            CHAR      414     1       1       2       CAu
   TRANSACTION_ID                  ARFCTID                         STRUCTURE 415     0       24      48      CAu
/PSI/WEB_CONTENT
   LINE                            TABL1024                        BYTE      0       512     0       1024    0       1024    
ARFCTID
   ARFCIPID                        ARFCIPID                        CHAR      0       8       0       8       0       16      
   ARFCPID                         ARFCPID                         CHAR      8       4       8       4       16      8       
   ARFCTIME                        ARFCTIME                        CHAR      12      8       12      8       24      16      
   ARFCTIDCNT                      ARFCTIDCNT                      CHAR      20      4       20      4       40      8       

Input: null
Changing: 
content:
|00000000|00490043003400530020 00200020002000200020 00200020002000200020 00200020002000200020|IC4S                |
|00000020|00200020002000200020 0020002000200000140E 00380033004500380037 00380036004100380035|        .u140E83E8786A85|
|00000040|00340038004500410034 00360041004200330036 00430041003800460042 00360042003700370042|48EA46AB36CA8FB6B77B|
|00000060|00330045002000200020 00200020002000200020 00200020003000300030 00300030003000300030|3E          00000000|
|00000080|00300030003000300030 00300031003200390035 00200020002000200020 00200020002000200020|0000001295          |
|00000100|00200020002000200020 00200020002000200020 00200020002000200020 00200020002000200020|                    |
|00000120|00200020002000200020 00200020002000200020 00200020002000200020 00200020002000200020|                    |
|00000140|00200020002000200020 00200020002000200020 00200020002000200020 00200020002000200020|                    |
|00000160|00200020002000200020 00200020002000200020 00200020002000200020 00200020002000200020|                    |
|00000180|00200020002000200020 00200020002000200020 00200020002000200020 00200020002000200020|                    |
|00000200|00200020002000200020 00200020002000200020 00200020002000200020 00200020002000200020|                    |
|00000220|00200020002000200020 00200020002000200020 00200020002000200020 00200020002000200020|                    |
|00000240|00200020002000200020 00200020002000200020 00200020002000200020 00200020002000200020|                    |
|00000260|00200020002000200020 00200020002000200020 00200020002000200020 00200020002000200020|                    |
|00000280|00200020002000200020 00200020002000200020 00200020002000200020 00200020002000200020|                    |
|00000300|00200020002000200020 00200020002000200020 00200020002000200020 00200020002000200020|                    |
|00000320|00200020002000200020 002000200020002F0050 0053004900490043002F 0043004C005F00490043|        /PSIIC/CL_IC|
|00000340|00340053005F0044004F 00430055004D0045004E 00540020002000200020 0020002000200043004C|4S_DOCUMENT       CL|
|00000360|00300030003000300030 00330049004300340053 005F0052004500510055 00450053005400200020|000003IC4S_REQUEST  |
|00000380|00200020002000200020 00200020002000200020 0049004300340053005F 0052004500530050004F|          IC4S_RESPO|
|00000400|004E0053004500200020 00200020002000200020 00200020002000200020                     |NSE                 |
CONTENT: 6 row(s)
row 0
|00000000|FFFFFFFEFFFFFFF1F0FF FFFFFFFFFFFFFFFFFFFA FDFFFFFFFFFFFFFFFCFF FEFFFFFFFCFFFFFFFEFF|....uF0FF....uFFFA....uFCFFuFEFF.uFCFF.uFEFF|
|00000020|FFFFFEADFFFFFFFAFDFF 80FFFFFFFFFFFFFFFFFF 000000000000001295FF FFFFFFFFFBFFFFF0FFFB|.uFEAD.uFFFA.u80FF........u95FF..uFBFF.uFFFB|
|00000040|FFFFFFFFFFFFFFFEFFFF FFFFFFFBFDFFF200FF08 F0FFFBFDFFFFFFFFDAFF 2009F0FF04FFFFDAFFFF|......uFFFB.uF200uFF08uF0FFuFBFD...u2009uF0FF.uFFDA.|
|00000060|FFFDFFF200FF08F0FFFF FDFFFFFFFFFFFFFF0000 FFFFFFFFFFFFFFFFFF10 00FFFFFFFFFFFEFFFCFD|uFFFD.ÿ...........uFF10ÿ..uFEFFuFCFD|
|00000080|FFFEFFFCFFFFFFFFFF00 00001000FFFFFFFFFFFA FFF1FCFEFBFFBEFFFFFF ABFFFFFFFAFFFFFFFFFF|.uFFFC....u1000..uFFFA.uFCFEuFBFFuBEFF......|
|00000100|FFFFFFFF15FFABFFFFFF FAFFFCFDFFFAFFFCFFFF ABFFFF1200FFFAFFFCFF FFABFCFFBEFFFFFFABFC|..u15FF...uFCFDuFFFAuFFFC..uFF12ÿ.uFCFFuFFABuFCFFuBEFF..|
|00000120|FFFFFFFFFDFDE3221566 87FFFFFFFFFFFFAEFFFE FFFFFAFFFFFFFFFFFFF1 49F1FFFFFFFFFFFFBEFF|..uFDFDuE322u1566u87FF..uFFAE......u49F1...uBEFF|
|00000140|FFFF00FFBEFFFFFFFFFF FFF1FF35FFFAFFFFFFFF FFFFF7F6FFFFFFFFFFFF FFFFFF16FF50FFFFFFFF|.ÿuBEFF...uFF35uFFFA...uF7F6....uFF16uFF50..|
|00000160|FFFFFFFFF0F0FFFFFFFF FFFFFFFFFFFB01FFFFFF FFFFFFFBFFF200FF08F0 FFFFFBFFFFFFFBD1FF14|..uF0F0....uFFFBu01FF..uFFFB.ÿ..uFBFF..uFF14|
|00000180|FFFBD1FFFFFFBDFFF3FF FFBDFFFFFFFBD3FF45FF FBD3FFFFFFBDFFF3F000 FFFBD1FFFFFFBDFFF2F0|uFFFBuD1FF.uBDFFuF3FFuFFBD.uFFFBuD3FFu45FFuFBD3.uFFBD.uF000uFFFBuD1FF.uBDFFuF2F0|
|00000200|00FFFBD2FFFFFFFFFFF0 00000000000000FFFFFF FFFFFFFFDAFF2009F0FF 04FFFFDAFFFFFEFFFFF0|ÿ.......ÿ....u2009uF0FF.uFFDA.uFEFF.|
|00000220|FF13F0FFFEFFFFFFFFFF FAFFFFFFFEFFFFFFFFAE DAFF2009F0FF04FFAEDA FFFFFAFFFFF0FF22F2FF|uFF13uF0FFuFEFF....uFEFF.uFFAE.u2009uF0FF.uAEDA...uFF22uF2FF|
|00000240|FAFFFFFFFFAEFAFFFFFF FAFFFFFFFFFFFAFFFFFF FEFFFFFFFFFFFFFFFAFF FFFB0000000000000000|..uFFAE.......uFEFF....uFFFB....|
row 1
|00000000|FFFFFFFFFEFFFF0000FF FEFFFFFFFBFFFFFCFFF0 0000000000000000FFFB FFFFFCFFFFFFFEFFFFFF|..uFEFF.ÿuFEFF.uFBFFuFFFC.....uFFFB.uFCFF.uFEFF.|
|00000020|FF96F2FFFFFFFFFFFFFF FFFFFFFFFF00FFFFFFFF FFFFFFFFF200FF09F1FF FFFFFFFFFFFFFFFFFFFF|uFF96uF2FF..........uF200uFF09uF1FF.....|
|00000040|FFF0F0FFFFFFFDFAFFFF FFFFFFBDFFFFFFF0FFFB D1FFFFFFFFFFBDFFFFFF F0FFFBD2FFFFFFFFFFBD|.uF0FF.uFDFA..uFFBD..uFFFBuD1FF..uBDFF.uF0FF...uFFBD|
|00000060|FFFFFFF0FFFBD3FFFFFF FFFFBDFFFFFFF0F000FF FBD1FFFFFFFFFFBDFFFF FFF0F000FFFBD2FFFFFF|..uFFFBuD3FF..uBDFF.uF0F0ÿ...uFFBD..uF000uFFFBuD2FF.|
|00000080|FFFDFFF1F0FFFDFFF1FF FFFFFFFF00FFFFFFFFFF FDFFF3F0FFFDFFF3FFFF FFFFFF00FFFFFFFFFFFF|uFFFD.uF0FF.uF1FF..ÿ...uF3F0uFFFD.......|
|00000100|FBFFFAFFFBFFF000FF00 F0FFFFFBFFFAFFFBFFFF FFFFBAFFFFFFDAFEF000 FF00F0FFFFFBFFFAFFFD|uFBFF.uFBFFuF000.uF0FFuFFFBuFFFAuFFFB..uBAFF..uF000.uF0FFuFFFBuFFFAuFFFD|
|00000120|FFFFFFFFFBFFFAFFBDFF F0F000FFFFBAFFFFFBD1 FFFFFFFBFFFAFFBDFFF0 FFFFBAFFFFFBD1FFFFFF|..uFBFF.uBDFFuF0F0ÿuFFBA...uFFFBuFFFAuFFBD..uBAFFuFFFBuD1FF.|
|00000140|FBFFFAFFFFFFF000FF00 F0FFFFFBFFFAFFFFFFFF FFFFEADEFFFFFFFEFFFF FFFFFFFFFFFAFDFF80FF|uFBFF..uF000.uF0FFuFFFBuFFFA...uEADE.....uFFFA.u80FF|
|00000160|FFFFFFFFFFFFFFFF0000 00000000001295FFFFFF FFFFFBFFFFF00000FFFB FFFFFFFFFFFFFFFFFFFF|........u95FF..uFBFF..uFFFB.....|
|00000180|FEFFFFFBFFFF000000FF FBFFFFFFFEBEFFF00000 FFEBFFFFFFFFFFFFF000 FFFFFFFFFFFFFFFFFF00|uFEFFuFFFB..ÿuFBFF.uFEBE..uFFEB...uF000.....|
|00000200|00FFFFFFFFFFFFFFFFF0 00FFFFFFFFFFFFFAFFFF 0000400000FFFAFFFFFF FFFFFEF0F000FFFEFFFF|ÿ....ÿ..uFFFA..u4000ÿ...uFEF0uF000..|
|00000220|FFFFFEFFF0F0FFFFFEFF FFFFFEFFFFFF00FFFEFF FFFFFFFAFFF0F0FFFFFA FFFFFFFFFFFFFF00FFFF|.uFEFFuF0F0.uFEFF.uFEFF.ÿuFEFF.uFFFA.uF0FFuFFFA.....|
|00000240|FFFFFFFFFFFFF0FFFFFF FFFFFFFFFFFFFF00FFFF FFFFFFFFEBFFF000FFFF EBFF0000000000000000|...uF0FF........uEBFFuF000.uEBFF....|
|00000260|00000000000000000000 00000000000000000000 00000000000000000000 00000000000000000000|....................|
row 2
|00000000|FFFFFEFFFF00FFFFEBFF FFFFFAFFFF0000F0FF00 FFFAFFFFFFFFFFFFF100 FFFFFFFFFFFFFBFFFF00|.uFEFF..uEBFF...ð.uFFFA...uF100...uFBFF.|
|00000020|0000FFFBFFFFFFFFFFFF F0000000FFFFFFFFFFFF FEFFFFFFFFF0F000FFFE FFFFFFFFFFFFFEFFFFFF|.uFFFB...uF000....uFEFF..uF000....uFEFF.|
|00000040|FFF0F0FFFFFFFFFFFFFF FFFFAEFFF0FFFFAEFFFF FFDAFFFF0000F0FF00FF DAFFFFFFFBFFFFF0F000|.uF0FF....uAEFFuF0FFuFFAE.uFFDA..uF0FFÿ..uFBFF.uF000|
|00000060|FFFFFEFFFFFFFFFFF000 FFFFFFFFFFFFFBFFFFF0 00FFFBFFFFFFFFFFFFFF 1000FFFFFFFFFFFFFFFF|.uFEFF..uF000...uFBFF.ÿuFBFF...u1000....|
|00000080|F0000000FFFFFFFFFFFF FFFFFFFF00FFFBFFFFFF FFFFFFFFF0F0FFFBFEFF FFFFFFFFFFFFF0000000|uF000......ÿuFBFF...uF0F0uFFFBuFEFF...uF000.|
|00000100|00FFFFFFFFFFFFFFFAFF FFFF0000FFFAFFFFFFFF FBFFFFF0F000FFFFFFFF FFFFFFFFF0F0FFFFFFFF|ÿ......uFFFA..uFBFF.uF000....uF0F0..|
|00000120|FFFFFEFFFFFFFFFFFFFF FFFFFFFFFFFBFFFFFFFF FFFFFFFFFBFFFFFFFFFE FFFF0000F0FF00FFFEFF|.uFEFF.....uFFFB....uFBFF....uF0FFÿuFEFF|
|00000140|FFFFFFFFFFF111FFFFFF FFFFFFFFFFFFFF00FFFF FFFFFFFFFFFFFFFFFF00 00FFFFFFFFFEFDFFFFFF|...............ÿ....|
|00000160|FFFFFFD1F00003FFFFFF FFFFD1FFFFFFFFFFFFD2 F00000FFFFFFFFFFD2FF FFFEFFFFFFFFFF00FFFF|..uF000...uD1FF..uFFD2uF000ÿ..uD2FF.....|
|00000180|FFFEFFFFFFFFFEFFFFFF FFF0F0FFFFFFFFFDFFFF FFFFFFFFF00000FFFFFF FFFFFFFFFEFFFFFFFEFF|...uFEFF..uF0FF.uFFFD...uF000ÿ...uFEFF.uFEFF|
|00000200|FFFFFFFFF800FFFAFDFF FFFBFFFFF00000000000 000129FFFBFFFFFFFFFF FFFF000002FFFFFFFFFF|..uF800uFFFA.uFFFB.uF000...u29FFuFBFF....u02FF..|
|00000220|FFFFFEFFFFFFFFFFFFFF FFFFF00000FFFFFFFFFF FFEBFFFF0000FFFEBEFF FFFFFFFFFF0000FFFFFF|.uFEFF....uF000ÿ..uFFEB...uBEFF...ÿ.|
|00000240|FFFFFFFAFFF000FFFFFA FFFFFFFBFFFF0000FFFB FFFFFFFFFFFFF0000400 00FF0000000000000000|.uFFFA.ÿuFFFA.uFFFB..uFFFB...uF000u0400ÿ....|
|00000260|00000000000000000000 00000000000000000000 00000000000000000000 00000000000000000000|....................|
|00000280|00000000000000000000 00000000000000000000 00000000000000000000 00000000000000000000|....................|