Skip to Content
0
Former Member
Feb 17, 2016 at 11:33 PM

Odata binding problems...

22 Views

hi experts please help me

I can't bind items

controller.js

onInit: function() {

var BUKRS = sessionStorage.getItem("BUKRS");

var GJAHR = sessionStorage.getItem("GJAHR");

var BNUMB = sessionStorage.getItem("BNUMB");

var sServiceUrl = "proxy/http/malerptest.gmobis.com/sap/opu/odata/SAP/YPLAS_TEST_SRV";

var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl,true);

var oJsonModel3 = new sap.ui.model.json.JSONModel();

oModel.read("/DOC_DET_HEADSet(BUKRS='"+BUKRS+"',BNUMB='"+BNUMB+"',GJAHR='"+GJAHR+"')/

$expand=DOC_DET_ITEM1Set",null,null,true,function(oData,repsonse){

oJsonModel3.setData(oData);

});

sap.ui.getCore().setModel(oJsonModel3);

console.log(oJsonModel3);

}

xml.view

<l:Grid defaultSpan="L12 M12 S12" id = "layout1" visible = "false">

<l:HorizontalLayout>

<Label text = "Document Number" />

<c:TextField id = "VINET" value ="{BELNR}" />

<Label text = "Request Number" />

<c:TextField id = "reqnum" value = "{BNUMB}" />

</l:HorizontalLayout>

<l:HorizontalLayout>

<Label text = "Request Department" />

<c:TextView text = "{REQDP_NM}" />

</l:HorizontalLayout>

<l:HorizontalLayout>

<Label text = "Address" />

<c:TextField id = "address" value = "{NAME1}"/>

</l:HorizontalLayout>

</l:Grid>

odata

Attachments

Odata.png (136.2 kB)