cancel
Showing results for 
Search instead for 
Did you mean: 

SAP ISA, custom Action.do request fails

Former Member
0 Kudos

Hello,

I programmed a own Actionclass for the SAP Webshop.

In this class an ABAP Function is called by a JavaConnection. This AbapFunction throws a Exception after 45 seconds. The Java class handles this exception and calls a error.jsp, which is displayed in the webbrowser?

The problem is: After the first call of this customaction.do, every new request will never be answered. The Action is not working a second time.

I proved this with a

system.out.println

in the first line.

Anybody knows this problem. I really don't know what cause this error. Is this because the action has to wait so long for an answer of the ababfunction?

Can anybody help me.

Are more details needed?

Thank you Nils Kloth

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Nils,

ISA is a complex applcation. How you call the action. It is a link or forwarded by another action? Can you debug ISA application?

Is successful first call of the action ?

Is it possible paste the action code and error stack ?

Best regards,

Altug Bayram

Former Member
0 Kudos

Hi Altug,

I post this to complement my first post.

> It is a link or forwarded by another action? Can you

> debug ISA application?

The Action is called as a link as onClick result of a button.

> Is successful first call of the action ?

The first call of the action is successfull, because i know, that the abap functions throws an exception and the error.jsp is shown. I post the forward of my action here.


                <action path="/b2b/customAction" type="com.hauni.isa.action.customAction">
                        <forward name="success" path="/b2b/order/frameset_order_confirmation.jsp"/>
                        <forward name="fail" path="/b2b/error.jsp"/>
                        <forward name="notInCRM" path="/b2b/error.jsp"/>
		</action>

As you can see, the jsp is shown, if the result is not success.

> Is it possible paste the action code and error stack

> ?

At the first call of the action i can see the system.out.println in the console and the errorpage is shown.

After the first every call is not be answered (there is no response) and the debug line doesn't appear in the console.

Is this a timeout problem? Can an action class crash like this? I think the reason of this problem is the behavoir of the jco.

I can't debug the ISA Application.

Which error stack do you mean? There is no response at the second call, beaucse of this there is no error shown in the logs.

Has someone an idea or a solution?

Do you need more information?

Best regards,

Nils Kloth

Former Member
0 Kudos

Hi Nils,

Why abap function throws exception and are you handle this? Maybe your action cause an runtime exception and session has expire. Maybe you must analyze standart isa error pages.

Error stack is jvm exception dump. For to explain which java classes causes this error.

If possible you post to me isa log files and action source code. Maybe i can help you. my e-mail address is altugbayram2 at yahoo dot com .

I think java debug environment will help you. Otherwise your development process will difficult.

Best regards,

Altug Bayram

Former Member
0 Kudos

Hi Altug,

here is the code of the function call method


	public Z_CopyInR3CRM(){
	}
	
	/**
	* Method to copy an offer in the R3 with a CRM Function
	* 
	* @param hData HeaderData of an offer
	* @param processType ProcessType of the order
	* @param bstkd String Bestellnummer des Kunden
	* @param edatu String Wunschlieferdatum des Kunden
	* 
	* @return Vector contains Ordernumber and TechKey
	*/	
	public Vector copySalesDocumentR3(HeaderData hData,
											String processType,
											String bstkd, 
											String edatu){
		
		Vector retVector = new Vector();
		// new: get JcoConnection
		JCoConnection cn = getDefaultJCoConnection();
		
		try {
			// get JCO.Function for
	        JCO.Function function = cn.getJCoFunction("Z_SALESDOCUMENT_COPY_R3");
	        
	        // getting import parameter
	        JCO.ParameterList importParams =
	                function.getImportParameterList();
	
	        // get export parameter
	        JCO.ParameterList exportParams =
	                function.getExportParameterList();
	        
	        String qNumber = hData.getSalesDocNumber().trim();
	        if (qNumber.length() == 8)
	        	qNumber = "00"+qNumber;
	        
	        // setting the qoutationnumber
	        JCoHelper.setValue(importParams, qNumber , "I_QUOTATIONNUMBER");
	        
	        // setting processType (Verkaufsbelegart)
	        JCoHelper.setValue(importParams, processType , "I_PROCESSTYPE");
	        
	        // setting bstkd und edatu
	        if (bstkd!=null)
	        	JCoHelper.setValue(importParams, bstkd, "I_BSTKD");
	        
	        if (edatu!=null){
	        	edatu = Z_ParameterConverter.convertStringtoDate(edatu);
	        	JCoHelper.setValue(importParams, edatu, "I_EDATU");
	        }	
        
	        cn.execute(function);
	        
	        String orderNumber = JCoHelper.getString(exportParams, "E_ORDERNUMBER");
	        String orderGUID = JCoHelper.getString(exportParams, "E_HEADER_GUID");
	        cn.close();
	        cn.destroy();
	        
	        retVector.add(orderNumber);
	        retVector.add(orderGUID);
	        
	        return retVector;
	        
		} catch (AbapException e) {
			System.out.println("copySalesDocumentR3 ist fehlgeschlagen");
			System.out.println(e.toString());
			cn.destroy();
			return null;
		} catch (BackendException e) {
			System.out.println("copySalesDocumentR3 ist fehlgeschlagen");
			System.out.println(e.toString());
			cn.destroy();
			return null;
		}
	}

The

return null

is handled in the action class


        //BusinessObject lesen
		Z_CopyInR3BusinessObjectManager zBom =
			(Z_CopyInR3BusinessObjectManager) 
				userSessionData.getBOM(Z_CopyInR3BusinessObjectManager.CUSTOM_BOM);

		Z_CopyInR3 z_CopyInR3 = zBom.getZ_CopyInR3();
		//Funktion aufrufen
		Vector result = z_CopyInR3.copySalesDocumentR3(headerQuot,processType, bstkd, edatu);
		//Z_BOM leeren
		zBom.releaseZ_CopyInR3();
		
		if (result== null) 
			return mapping.findForward("fail");

and calls the error.jsp!

Both method don't throws a exception. The exception is only thrown in the SAP CRM Abap Enviroment.

After the the first call of this action,but sometimes its never work again.

I can't find the related isa logs, because i don't know which log entries are related to the actual java actionclass and the problem.

there are entries like this:

[actionxecution]='begin' [actionclass]='com.hauni.isa.action.Z_CopyQuotInR3Action' [path]='/b2b/z_CopyQuotInR3'

[actionclass]='com.hauni.isa.action.Z_CopyQuotInR3Action' [path]='/b2b/z_CopyQuotInR3' [forward]='/b2b/runtimeexception.jsp' [exectime]='24047'

but also:

[actionclass]='com.hauni.isa.action.Z_CopyQuotInR3Action' [path]='/b2b/z_CopyQuotInR3' [forward]='/b2b/z_copyError.jsp' [exectime]='3266'

and:

[jcofuncionexecution]='begin' [funcname]='Z_SALESDOCUMENT_COPY_R3' [ashost]='khz009' [sysid]='KCR'

[jcofunctionexecution]='end' [funcname]='Z_SALESDOCUMENT_COPY_R3' [ashost]='khz009' [sysid]='KCR' [exectime]='20703'

I think sometimes the exectime is too long sometimes, are there limits for lonkworking jcofunction calls?

I can't reproduce the error, because now my company is in an upgrade project from crm3.1 to crm 4.0

Thanks for your help

Best regards,

Nils Kloth

Former Member
0 Kudos

Hi Nils,

[actionclass]='com.hauni.isa.action.Z_CopyQuotInR3Action' [path]='/b2b/z_CopyQuotInR3' [forward]='/b2b/runtimeexception.jsp' [exectime]='24047'

Line says runtimeecception occured. Thir exception causes session expire.

But i see some lines in backend object

cn.close();

cn.destroy();

You closes jco connection of session . You must not do this.

I will paste example FM call method below:

public String getShopDesc(String shop) {

String ret = "";

try {

JCO.Function func = getDefaultJCoConnection().getJCoFunction("ZCRM_ISA_SHOP_READ");

func.getImportParameterList().setValue(shop, "IV_SHOP_ID");

getDefaultJCoConnection().execute(func);

ret = func.getExportParameterList().getStructure("ES_SHOP_H").getValue("DESCRIPTION").toString();

} catch (Exception ex) {

System.out.println(ex);

}

return ret;

}

I think you msut read ISA Dev and Ext Guide again.

Best regards,

Altug Bayram

kyo_choi2
Participant
0 Kudos

Your code is missing the session object. Try following.

UserSessionData userSessionData = UserSessionData.getUserSessionData(request.getSession());

// get Internet Sales core functionality BOM

BusinessObjectManager zBOM =

(BusinessObjectManager)userSessionData.getBOM(BusinessObjectManager.ISACORE_BOM);