SmarttableApp

by Fatih Demir

HTML

<mvc:View height="100%" xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns:variants="sap.ui.comp.smartvariants"
	xmlns:smartForm="sap.ui.comp.smartform" xmlns:smartField="sap.ui.comp.smartfield" xmlns:smartFilterBar="sap.ui.comp.smartfilterbar"
	xmlns:smartChart="sap.ui.comp.smartchart" xmlns:smartTable="sap.ui.comp.smarttable" xmlns:nav="sap.ui.comp.navpopover"
	xmlns:table="sap.ui.table" controllerName="com.hvl.im.yatirimbutcesi.ZHVL_IM_YATRBUT.controller.Main" xmlns:semantic="sap.m.semantic"
	xmlns:app="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1">
	<semantic:FullScreenPage showFooter="false" enableScrolling="false">
		<semantic:content>
			<VBox fitContainer="true" class="sapUiSizeCompact">
				<variants:SmartVariantManagement id="PageVariant" persistencyKey="PageVariant" showShare="true" showExecuteOnSelection="true"/>				
        <smartFilterBar:SmartFilterBar id="smartFilterBar" entityType="GetData" smartVariant="PageVariant" persistencyKey="PKeyFilterbar">
					<smartFilterBar:controlConfiguration>
						<smartFilterBar:ControlConfiguration key="Prnam" label="{/#GetData/Prnam/@sap:label}" preventInitialDataFetchInValueHelpDialog="false"
							visibleInAdvancedArea="true" index="1" filterType="single" mandatory="mandatory"/>
						<smartFilterBar:ControlConfiguration key="Gjahr" label="{/#GetData/Gjahr/@sap:label}" preventInitialDataFetchInValueHelpDialog="false"
							visibleInAdvancedArea="true" index="2" filterType="single" mandatory="mandatory"/>
						<smartFilterBar:ControlConfiguration key="Posid" label="{/#GetData/Posid/@sap:label}" preventInitialDataFetchInValueHelpDialog="false"
							visibleInAdvancedArea="true" index="3"/>
						<smartFilterBar:ControlConfiguration key="Durum" label="{/#GetData/Durum/@sap:label}" preventInitialDataFetchInValueHelpDialog="false"
							visibleInAdvancedArea="true" index="4"...

JavaScript

butceyeGonderPress: function(oEvent) {
			var x = 0,
      		oList = [],
      		oTable = this.byId("Table1"),
					oSelectedIndices = oTable.getSelectedIndices();
      for (x in oSelectedIndices) {
      	var oContext = oTable.getContextByIndex(oSelectedIndices[x]);
      	var oObject = oContext.getObject();
       	oList.push(oObject);
      }

			// var rowobject = this.byId("customUiTable").getSelectedItem().getBindingContext().getObject();
      /*
			var aRows = [],
				selectedRows = this.byId("customUiTable").getBinding("rows").getContexts();

			$.each(selectedRows, function(index, item) {
				var row = item.getObject();
				aRows.push(row);
			});
      */
},
  
  
  
  METHOD getdataset_get_entityset.

    TYPES : BEGIN OF ts_butce,
              objnr      TYPE bp_objekt,
              ippos      TYPE im_ippos,
              ilk_butce  TYPE bp_wjt,
              ek_butce   TYPE bp_wjt,
              iade_butce TYPE bp_wjt,
            END OF ts_butce.

    " ODATA FILTERS - SORTING PARAMETERS
    DATA : lt_filters           TYPE /iwbep/t_mgw_select_option,
           ls_filter            TYPE /iwbep/s_mgw_select_option,
           ls_order             LIKE LINE OF it_order,
           lt_order             LIKE TABLE OF ls_order,
           lo_message_container TYPE REF TO /iwbep/if_message_container,
           ls_so                TYPE /iwbep/s_cod_select_option,
           es_entityset         LIKE LINE OF et_entityset,
           ls_entityset         LIKE LINE OF et_entityset,
           err_return           TYPE bapiret2.

    DATA :rt_posid TYPE zhvl_so_rt_filter,
          rs_posid LIKE LINE OF rt_posid,
          rt_durum TYPE zhvl_so_rt_filter,
          rs_durum LIKE LINE OF rt_durum,
          lv_prnam TYPE bapi1057id-inv_prog,
          lv_gjahr TYPE bapi1057id-appr_year.

    " ***********************************************************************
    " FRONTENTD TARAFINDAN GELEN FİLTRELERİN ALINMASI
    "...