cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with mandatory import parameters of BAPI

Former Member
0 Kudos

Hello,

I am using a model based on a BAPI which has two mandatory parameters. One of the parameters is a single field, the other parameter is a structure which contains several subfields:

e.g

import parameters:

- Field A type C(10).

- Structure B contains

- Field B1 type C.

- Field B2 type C.

- Field B3 type C.

Inside the component controler i create and bind a contextmodel for the main model and also create and bind context for structure B.

When the BAPI is called it complains the structure B is not passed.

I was able to fill the fields by using the wdContext.currentStructureB.setB... methods

What am i doing wrong or is it just not possible to use structures as an import parameter

Thanks

Bertil Rebergen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Bertil,

You have to fill the data in the structure by using the following code.

//Initialize the RFC/BAPI input

Bapi_ABC_Input input = new Bapi_ABC_Input();

wdContext.nodeBapi_ABC_Input().bind(input);

//Set the value for the FieldA

input.setA("<<some value>>");

//Create object of the structure

StructureB objStructureB = new StructureB();

objStructureB.setB1("<some value>");

objStructureB.setB2("<some value>");

objStructureB.setB3("<some value>");

//bind the created structure to the context

input.setI_Shlp(objStructureB);

//execute the RFC/BAPI

wdContext.currentBapi_ABC_InputElement().modelObject().execute();

Try the above steps your problem should be solved. If you require any further do let me know.

Regards,

Santhosh.C

Former Member
0 Kudos

Hi Santhosh

great help!

It solved my problem

Bertil

Answers (0)