将参数从flex传递到SAP query_view_data

iq3niunx  于 2023-06-28  发布在  Apache
关注(0)|答案(1)|浏览(146)

我是Flex和SAP的新手。我正在用Flex设计一个 Jmeter 板。我已经从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);        
}

但是,数据网格中显示的是整个数据,而不是过滤后的数据。
有人能帮忙吗?

wpx232ag

wpx232ag1#

我解决了问题。上面的代码都是正确的,除了我在w. value中使用了列名。但是,它应该是该列的SAP变量名。下面是正确的代码:
var w:W3Query= new W3Query(); w.Name =“VAR_NAME_2”; w.Value =“ZCOAUTH2”; String.push(String); return 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);

相关问题