Skip to Content
0
Former Member
Oct 18, 2004 at 06:34 AM

BAPI Return

31 Views

<b>Hi All

When trying to execute the function

we should get either the BAPI results (RECORD) if there is a record or it shall return the BAPI return with the error message

The problem I have in the below code is:

In the try-catch block, if the record is null, it does not execuute the rest of block which has the BAPI return of the error message.

I need to get the error message returned by the BAPI to display it to the user in his selection screen.

Any help in that?

please it is an urgent matter

Thank you in advance

</b>

===================================

	
try {
	client.execute(function);
	JCO.ParameterList table = function.getExportParameterList();
	tableCr = table.getStructure("RECORD");	

	JCO.ParameterList tableE = function.getTableParameterList();
	tableErr = tableE.getTable("RETURN");
		
	str_err_type = tableErr.getString("TYPE");
	str_err_mess = tableErr.getString("MESSAGE"); 
		
	myBean.setErrMsgType(str_err_type);
			
	if (str_err_type.equalsIgnoreCase("S") )
	{	
	          myBean.setErrMsg(str_err_mess);
				
	}
			


	try{
	     if (tableErr.getString("TYPE").equals("E") )
	     {
															myBean3.setErrMsg(str_err_mess);
		ipcSession.putValue("sesBenefitsStatInfoBeanErr",myBean3);
	     }
	}
	catch(Exception errEx){
			
	}
			
			
			
	}
	catch (Exception ex3){
					
		}
		
	try 
	{
	if ((emp_pernr.equals("")) || (emp_pernr.equals("00000000")) ||
		(term_date.equals("")) || (gosi_date.equals("")) )
		{
						
	}
	else
	{
	processBAPI();			
	}
		} 
	catch (Exception e1)
	{
			

	}