cancel
Showing results for 
Search instead for 
Did you mean: 

Pass table like import parameter

Former Member
0 Kudos

Hi.

I've developing a application for the portal (.par archive) in Java. I want to call a function and I've to pass a table like parameter import. I call the function and I pass a import parameter that way:

funcion.getImportParameterList().setValue(this.getusuario),"USUARIO_SAP");

How I can pass a table ( for example, the table TABLE1 with a field who call NAME) like import parameter?

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Guillermo,

it depends on you Function Module architecture. The parameter you are trying to send to BAPI is defined as IMPORT or TABLES parameter? If it is defined in IMPORTING statement, then it's a parameter of type STRUCTURE and you should fill it in as follows:


...
ParameterList importParams = function.getImportParameterList();
Structure myStruct = importParams.getStructure("Your_Structure_Parameter_Name");
myStructure.setValue("Your_Value","Structure_field_name");
... and so on
client.execute(function);
...

In case it is a parameter defined it TABLES part of Function Module. Then do it as follows:


...
ParameterList tabParams = function.getTableParameterList();
Table table = tableParameterList.getTable("Your_Table_Param_Name");
	for (...) {
		table.appendRow();
		table.setValue(<Object>,"Table_Field_Name");
		... here you set all table fields for a new row
	}
... and so on
client.execute(function);
...

regards,

mz