cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI Return

Former Member
0 Kudos

<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)
	{
			

	}

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

It is not a standard BAPI

Z_BAPI_ZHFSS

but the same procedure will be applied to all BAPIs.

gregorw
Active Contributor
0 Kudos

Hello,

can you tell us the Name of the BAPI your calling?

Please Post code with [code ] [/code ] tags, so it becomes more readable.

Regards

Gregor