从flex传递参数到SAP query_view_data

时间:2011-06-02 10:45:43

标签: flex sap

我是flex和SAP的新手。我正在设计flex的仪表板。我从SAP query_view_data检索了数据,我可以在图表中显示它。但是现在我想将参数传递给SAP Web服务以检索两个日期之间的数据。我正在尝试使用以下代码:

protected function adg1_creationCompleteHandler(event:FlexEvent):void
{           
  var IInfoprovider:String="0FIGL_O02";

  var w:Object= new Object();
  var Parameter:Array = new Array();

  w.Name = "VAR_NAME_1";
  w.Value = "OCOMP_CODE";
  Parameter.push(w);

  w = null ;
  w = new Object(); 
  w.Name = "VAR_VALUE_EXT_1";
  w.Value = "1028";
  Parameter.push(w);
  w=null;

  w = new Object(); 
  w.Name = "VAR_NAME_2";
  w.Value = "OCALMONTH";
  Parameter.push(w);
  w=null;

  w = new Object(); 
  w.Name = "VAR_VALUE_LOW_EXT_2";
  w.Value = "01032008";
  Parameter.push(w);
  w=null;

  w = new Object(); 
  w.Name = "VAR_VALUE_HIGH_EXT_2";
  w.Value = "01092008";
  Parameter.push(w);
  w=null;

  var ITParameter:ArrayCollection= new ArrayCollection(Parameter);

  var IQuery:String="ZFIGL_0FIGL_O02_QD008";
  var IViewId:String="";
  Rrw3GetQueryViewDataResult.token = rRW3_GET_QUERY_VIEW_DATA.Rrw3GetQueryViewData(IInfoprovider, IQuery, ITParameter, IViewId);        
}

但是,整个数据显示在数据网格中,而不是过滤后的数据。

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:0)

我解决了这个问题。以上代码的所有内容都是正确的,除了我在w.value中使用列名。但是,它应该是该列的SAP变量名称。这是更正后的代码:

var w:W3Query = new W3Query();                 w.Name =“VAR_NAME_2”;                 w.Value =“ZCOAUTH2”;                 Parameter.push(W);                 w = null;

            w = new W3Query(); 
            w.Name = "VAR_VALUE_EXT_2";
            w.Value = "1007";
            Parameter.push(w);
            w=null;

            w = new W3Query(); 
            w.Name = "VAR_NAME_3";
            w.Value = "ZCOAUTH2";
            Parameter.push(w);
            w = null ;

            w = new W3Query(); 
            w.Name = "VAR_VALUE_EXT_3";
            w.Value = "1037";
            Parameter.push(w);
            w=null;

            w = new W3Query(); 
            w.Name = "VAR_NAME_4";
            w.Value = "ZCOAUTH2";
            Parameter.push(w);


            w = null ;
            w = new W3Query(); 
            w.Name = "VAR_VALUE_EXT_4";
            w.Value = "1123";
            Parameter.push(w);



            w=null;
            w = new W3Query(); 


            w.Name = "VAR_NAME_1";
            w.Value = "0I_DAYIN";
            Parameter.push(w);
            w = null ;

            w = new W3Query(); 
            w.Name = "VAR_VALUE_LOW_EXT_1";
            w.Value = df.format( from_date.text);
            Parameter.push(w);
            w=null;

            w = new W3Query(); 
            w.Name = "VAR_VALUE_HIGH_EXT_1";
            w.Value = df.format(to_date.text);
            Parameter.push(w);
            w=null;

var ITParameter:ArrayCollection = new ArrayCollection(Parameter);

            var IQuery:String="ZFIGL_0FIGL_O02_QDP008";
            var IViewId:String="";

            Rrw3GetQueryViewDataResult.token = rRW3_GET_QUERY_VIEW_DATA.Rrw3GetQueryViewData(IInfoprovider, IQuery, ITParameter, IViewId);