Skip to Content
avatar image
Former Member

Call transaction from jco

Hi,

I'm trying to call a transaction from jco. It is successful till a point - transaction actually start but there is not way to read the resulting screen. Is it possible to achieve this at all?

Here is a little snippet:

                JCoFunction function = destination.getRepository().getFunction("ABAP4_CALL_TRANSACTION");
		JCoRecordMetaData usingTabMeta = function.getFunctionTemplate().getFunctionInterface().getRecordMetaData("USING_TAB");
		JCoTable usingTab = JCo.createTable(usingTabMeta);
		
		JCoRecordMetaData spagpaTabMeta = function.getFunctionTemplate().getFunctionInterface().getRecordMetaData("SPAGPA_TAB");
		JCoTable spagpaTab = JCo.createTable(spagpaTabMeta);

		JCoRecordMetaData messTabMeta = function.getFunctionTemplate().getFunctionInterface().getRecordMetaData("MESS_TAB");
		JCoTable messTab = JCo.createTable(messTabMeta);
		
		function.getImportParameterList().setValue("SKIP_SCREEN", 'X');
		function.getImportParameterList().setValue("MODE_VAL", 'E');
		function.getImportParameterList().setValue("UPDATE_VAL", 'A');
		function.getImportParameterList().setValue("TCODE", name);
		
		function.getTableParameterList().setValue("USING_TAB", usingTab);
		function.getTableParameterList().setValue("SPAGPA_TAB", spagpaTab);
		function.getTableParameterList().setValue("MESS_TAB", messTab);

		try {
			function.execute(destination);
		} catch (AbapException e) {
			System.out.println(e.toString());
			return;
		}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Sep 19, 2008 at 03:36 PM

    Hi,

    as far as I know, the problem is that the JCo cannot handle UI elements which are sent back as a response. Only responses of type RFCs are handled and any UI elements (which are to be rendered by the SAP GUI, which interestingly acts as a server) are not processed by the Java Connector. This is why you don't see the screen.

    I would have actually expected that you get an error from JCo, I find it strange that you say that the transaction is actually started. Are you sure? How do you know?

    T00th

    Add comment
    10|10000 characters needed characters exceeded