Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

BAPIs and JAVA , method setValue() is giving error ???

Former Member
0 Likes
438

Hello all

I havea bapi ,which i m calling from my java application using JCO ,

The function module : 'ZBAPINEW1'

Import parameter : IN1 type ZBAPI_NEW1 ( ZBAPI_NEW1 is a structure having 'CARRID' as the only field inside )

now the code inside the java pgm is as follows

IFunctionTemplate ft = repository.getFunctionTemplate("ZBAPINEW1");

.

.

JCO.Function func = ft.getFunction();

JCO.ParameterList input = func.getImportParameterList();

<u><i> <b>input.setValue("AA","IN1");</b></i></u>

it is here that it is giving me error that the value string"AA" cant be assigned to a structure "IN1" , which is understandable ..but now my qn is how to assign import values to the fields of the BAPI function module whic are of type structure.

PLz help !!

Thank in advance

Nilesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
404

Hi Nilesh,

Check my thread

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/07/05/sapApplicationHierarchyusingJAVA&

Reward if useful!

2 REPLIES 2
Read only

Former Member
0 Likes
405

Hi Nilesh,

Check my thread

https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/07/05/sapApplicationHierarchyusingJAVA&

Reward if useful!

Read only

0 Likes
404

hi

i went through ur link

but i didn understand 1 thing

input.setValue("INFO_TABLT", "QUERY_TABLE");

here the QUERY_table is an import parameter in ur function module , so is it of type DDIC structure which contaisn some fileds or directly some DDIC field .IF this is aDDIC structure (as in my case) how can we assign the value to the structure , rather iw ant ot assign that value to one field in that structure ( IN1-carrid in my case) .

thank

nilesh