Professional Documents
Culture Documents
Requirement :
Design Ui5 app to display Sales order
Form :
Created by
Document Date
Net value.
Table :
Sales Doc Created on Net value Currency Doc date Sales org Distribution
chanel
Table :
VBAK
VBELN
AUDAT
ERDAT
NETWR
WAERK
VKORG
VTWEG
Step 1 we need to create o data service.
T code SGEW:
SALES_ORDERSET_GET_ENTITYSET
Activate
Save and now we will test the service in sap Gateway Server.
Next and finish . you will have 3 files : index file, view file and controller file .
apo.placeAt("content");
2.Lets create 1 Panel to keep user input Together inside this Panel we were using Form .
panel.placeAt("content");
Just to see App one we execute application as WEB app Preview and then copy this link and open in
Chrome URl
Now we will add Form the form contain 3 filed : created by , Delivery Date and Currency
var simpleform = new sap.ui.layout.form.SimpleForm({
content: [
new sap.ui.commons.Label({text: "Created By"}),
new sap.ui.commons.AutoComplete({ value : "" ,width: "15em"
}),
new sap.ui.commons.Label({text: "Delivery Date "}),
new sap.ui.commons.DatePicker(),
new sap.ui.commons.Label({text: "Amount"}),
new sap.ui.commons.TextField({ value : " " , width:
"15em"}),
// button
new sap.ui.commons.Label({text:" "}),
new sap.ui.commons.Button({ text : "Search" , width: "15em"
}),
]
});
simpleform.placeAt("content");
//table
Inside that event handler we apply filter function for filtering the value .
//
sap.ui.commons.MessageBox.alert(cratedBy +" " +amount );
var filter1 = new sap.ui.model.Filter("Ernam",
sap.ui.model.FilterOperator.EQ ,cratedBy);
var filter2 = new sap.ui.model.Filter("Netwr" ,
sap.ui.model.FilterOperator.GT ,amount);
var d = odateicker.getYyyymmdd();
var year = d.substring(0,4);
var month = d.substring(4,6);
var day = d.substring(6,8);
var result = year + "-"+ month + "-"+ day + "T00:00:00";
Event handler Code of Method .
var filter1 = new sap.ui.model.Filter("Ernam",
sap.ui.model.FilterOperator.EQ ,cratedBy);
var filter2 = new sap.ui.model.Filter("Netwr" ,
sap.ui.model.FilterOperator.GT ,amount);
var filter3 = new sap.ui.model.Filter("Audat" ,
sap.ui.model.FilterOperator.GT ,datepicer);
We will Put second table inside one of container and this will display only if record is Present
Note :