cancel
Showing results for 
Search instead for 
Did you mean: 

How to set values to a BAPI Model

Former Member
0 Kudos

Hi All,

I have a BAPI available in my NWDSthrough a WebService Model (WSDL).

The structure is as follows :

<i>-Request_Equip........................(BAPI) -


0..1

-


LOCID......................(MN) -


0..n

-


LOCValue ..........(MA inside LOCID)

-


Response..................(MN) -


0..1

-


Result.................(MN inside Response) -


0..n

-


EquipId.........(MA inside Result)

-


Customer..................(MA directly inside Request_Equip)</i>

Our objective is to execute the BAPI (Request_Equip) by passing the parameters -

-


Customer

-


LOCValue(s) in LOCID node,

so that the Result node will get populated with EquipId(s) as output.

We have followed the following code, in which we were able to correctly

pass the value for "Customer", but somehow the "LocIds" are not getting passed.

Request_LspmResponseEquipIdsOSMI_lspmResponseEquipIdsOSMI requestBAPI = new Request_LspmResponseEquipIdsOSMI_lspmResponseEquipIdsOSMI();

wdContext.nodeRequest_Equip().bind(requestBAPI);

ArrayList arrayL = new ArrayList(1);

arrayL.add("0000000099");

requestBAPI.setCustomer("0000300006");

requestBAPI.setLOCID(arrayL);

<b>//The method - setLOCID accepts parameters in the form of List or Item[] only</b>.

try

{

requestBAPI.execute();

}

catch(Exception ex)

{

manager.reportSuccess("ERROR stack : "+ex.getStackTrace());

}

wdComponentAPI.getMessageManager().reportSuccess("Result Size1 : "+wdContext.nodeResult().size());

wdContext.nodeResponse().invalidate();

wdContext.nodeResult().invalidate();

No matter what, we always get the size of the Result-node as "0", but from the R3, we get to see 2 records for the same inputs.

Please provide the code steps to achieve this functionality.

Regards,

Ashwin.

Message was edited by:

Ashwin Upadhyay

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You forgot to add

wdContext.nodeResult().invalidate()

to refersh the context values. If you don't execute that command after doning execute the context values won't be updated.

see the web dynpro tutorial on how to use model :

https://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/f0b0e990-0201-0010-cc96-d7ecd2e51715

Regards

Omer