cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to bind data to Context Node

Former Member
0 Kudos

I have created a Model Node (Material Details) in the view (AssetMgmtView) from the BAPI Mm_Materials_For_Group_Input. For binding the input elements of this BAPI I use this code

Mm_Materials_For_Group_Input modelInput =

new Mm_Materials_For_Group_Input();

IPrivateAssetMgmtView.IMaterialDetailsElement element =

wdContext.nodeMaterialDetails().createMaterialDetailsElement(

modelInput);

wdContext.nodeMaterialDetails().bind(element);

element.setI_Material_Group(materialGroup);

element.setI_Plant(plant);

Now I have another Model Node in Context of view as follows

PR_CREATION (Main Node)

-


PR_HEADER (Sub Node 1)

-


Attribute 1

-


Attribute 2

-


PR_HEADERTEXT (Sub Node 2)

-


Attribute 1

-


PR_ITEM (Sub Node 3)

-


Attribute 1

-


Attribute 2

-


Attribute 3

-


PR_ITEMTEXT (Sub Node 4)

-


Attribute 1

-


Attribute 2

-


Attribute 3

I am unable to bind the input values for the above Context through Node.

Please provide some inputs.

Regards

Nikhil Bansal

Accepted Solutions (0)

Answers (3)

Answers (3)

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

Mm_Materials_For_Group_Input modelInput =

new Mm_Materials_For_Group_Input();

IPrivateAssetMgmtView.IMaterialDetailsElement element =

wdContext.nodeMaterialDetails().createMaterialDetailsElement(

modelInput);

wdContext.nodeMaterialDetails().bind(element);

<b>modify this code as</b>

Mm_Materials_For_Group_Input modelInput =

new Mm_Materials_For_Group_Input();

IPrivateAssetMgmtView.IMm_Materials_For_Group_InputElement element =

wdContext.createMm_Materials_For_Group_InputElement(

modelInput);

wdContext.nodeMm_Materials_For_Group_Input.bind(element);

hope it helps

regards

abhijeet_mukkawar
Active Contributor
0 Kudos

hi,

not sure where are you confused,

bt lets consider context,

PR_CREATION (Main Node)

-


PR_HEADER (Sub Node 1)

-


Attribute 1

-


Attribute 2

lets say you want to bind attribute1 to PR_CREATIO,, proceed as,

<main name of model node> model = new <main name of model node>;

wdcontext.node<main name of model node>.bind(model);

now for PR_HEADER

PR_HEADER prObj = new PR_HEADER();<provided this is the proper structure name and not parameter name ie it is the structure referred by parameter lets say import param in bapi> then,

prObj.setAttribute1(<value which it accepts>);

model.set<Parameter name as appearing in bapi parameter>(prObj);

model.execute();

hope it helps

let me know if you have different doubts

regards

Former Member
0 Kudos

Foll is my code in the method executeBapiPRCreate()

Bapi_Pr_Create_Input prCreateInput = new Bapi_Pr_Create_Input();

wdContext.nodePR_Creation().bind(prCreateInput);

Bapimereqitem itemInput = new Bapimereqitem();

Bapimereqitemx itemInputX = new Bapimereqitemx();

Bapimereqitemtext itemtextInput = new Bapimereqitemtext();

Bapimereqheader headerInput = new Bapimereqheader();

Bapimereqheaderx headerInputX = new Bapimereqheaderx();

Bapimereqheadtext headtextInput = new Bapimereqheadtext();

itemInput.setAcctasscat("U");

itemInput.setPreq_Name("NikhilBansal");

itemInput.setMaterial("000000000000034621");

itemInput.setPlant("0002");

itemInput.setPur_Group("RD3");

itemInput.setMatl_Group("COMPDT");

itemInput.setPurch_Org("STPO");

itemInput.setStore_Loc("SB01");

itemInput.setTrackingno("LOUB0101");

itemInput.setQuantity(new BigDecimal("01"));

itemInputX.setAcctasscat(true);

itemInputX.setPreq_Name(true);

itemInputX.setMaterial(true);

itemInputX.setPlant(true);

itemInputX.setPur_Group(true);

itemInputX.setMatl_Group(true);

itemInputX.setPurch_Org(true);

itemInputX.setStore_Loc(true);

itemInputX.setTrackingno(true);

itemInputX.setQuantity(true);

itemtextInput.setText_Line("Text Line 1");

headerInput.setPr_Type("NB");

headerInputX.setPr_Type(true);

headtextInput.setText_Line("Text Line 2 ");

wdContext.nodePrheader().bind(headerInput);

wdContext.nodePrheadertext().bind(headtextInput);

prCreateInput.setPrheader(headerInput);

prCreateInput.setPrheaderx(headerInputX);

However, when I try this line

prCreateInput.setPritem(itemInput);

then I get compilation error : AbstractList argument expected.

Can you throw some light on this.

Plz help.

Regards

Nikhil Bansal

SRudra
Contributor
0 Kudos

Hi,

1. Do the data binding in this way as shwon below in your doInit method:

Z_Bapi_Put_Bank_Signatories_Input generalInput = new Z_Bapi_Put_Bank_Signatories_Input();

wdContext.nodeZ_Bapi_Put_Bank_Signatories_Input().bind(generalInput);

2. Do the proper Context Mapping.

Cheers!!!

Sukanta