来自ABSL的MDR:如何添加查询参数

2020-09-18 13:30发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)嗨, 基于本文( http...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


嗨,

基于本文( https://archive.sap.com/ Discussions/thread/3925665 )我试图从ABSL创建自己的MDR。 除了查询参数外,这在大多数情况下都可以正常工作。 它们不会应用到创建的MDR中。

有人知道该怎么做吗? 请在下面查看我的代码,并告诉我哪里出了问题。

 var QueryParam:QueryParameter;
 var MDRO_ID:XPEString;
 var MessageList:MessageList;

 " MDRO_ID =" PRS_" + this.ID.content.RemoveLeadingZeros()+" _" + Context.GetCurrentSystemDate()。GetDay()+"。"  + Context.GetCurrentSystemDate()。GetMonth()+"。"  + Context.GetCurrentSystemDate()。GetYear()+" _" + Context.GetCurrentSystemTime()。GetHour()+":" + Context.GetCurrentSystemTime()。GetMinute();

 MDRO.CreateInstance(" MDR_MD_Create","",MDRO_ID);

 QueryParam.ParameterName =" RequirementSpecificationID";
 QueryParam.Sign =" I";
 QueryParam.Option =" EQ";
 QueryParam.Low = this.ID.content.RemoveLeadingZeros();
 MessageList = MDRO.AddSelectionParameter(" MDR_MD_Create",""," QueryByReleaseStatus",MDRO_ID,QueryParam);

 MDRO.Activate(" MDR_MD_Create","",MDRO_ID);

 var currentTime = Context.GetCurrentGlobalDateTime();
 var StartDuration = Library :: Duration.Create(0,0,0,0,0,30);
 var startTime = currentTime.AddDuration(StartDuration);

 MDRO.ExecuteDateTime(" MDR_MD_Create","",startTime,MDRO_ID);
 
2条回答
空代码
2020-09-18 13:47

嗨Michiel,

请查看下面的示例代码,我相信您将能够解决它的问题。


导入

导入ABSL;
 导入AP.PlatinumEngineering; 


MDR配置

 var MDRName =" MDR_StackProcessor";
 var RunDescription ="为" + obj.ObjectType.GetDescription()+"运行,会话
 (" + obj.SessionUUID.content.ToString()+")";
 var NumberRangeName =" MDR_Stack_ID";
 var SelectionParam1 =" SelectByObjectTypeContent";
 var SelectionParam2 =" SelectBySessionUUIDContent";
 var SelectionParam1content = obj.ObjectType.content;
 var SelectionParam2content = obj.SessionUUID.content; 


选择参数

 var queryParameter:QueryParameter;
 var parameterName = SelectionParam1;
 queryParameter.Option =" EQ"; queryParameter.ParameterName = parameterName;
 queryParameter.Low = SelectionParam1content;
 var queryParameter2:QueryParameter; var parameterName2 = SelectionParam2;
 queryParameter2.Option =" EQ"; queryParameter2.ParameterName = parameterName2;
 queryParameter2.Low = SelectionParam2content; 


实例

 var MDRO_ID:XPEString;
 MDRO_ID = NumberRange.DrawNumber(NumberRangeName);
 MDRO.CreateInstance(MDRName,"",MDRO_ID,RunDescription);

//每个实例只执行一次AddSelectionParameter(否则,您将有多个具有相同选择参数的条目)
 MDRO.AddSelectionParameter(MDRName,"",parameterName,MDRO_ID,queryParameter);
 MDRO.AddSelectionParameter(MDRName,"",parameterName2,MDRO_ID,queryParameter2);

//如果您使用之间的选择标准,则不需要以下行
 MDRO.SetSelectionLowParameter(MDRName,"",parameterName," LowerBoundaryID"," 2",MDRO_ID); 


计划与执行

 var currentTime = Context.GetCurrentGlobalDateTime();
 var StartDuration = Library :: Duration.Create(0,0,0,0,0,10); //年,月,日,小时,分钟,秒

 var startTime = currentTime.AddDuration(StartDuration);
 MDRO.ExecuteDateTime(MDRName,"",startTime,MDRO_ID); 

根据测试,我们可以确认10秒间隔最有效。 其他持续时间似乎无法无缝运行。


示例实现

导入ABSL;
 导入AP.PlatinumEngineering;
 var mdrName =" MDR_Schedule";
 var mdrDescription:MDRO.CreateInstance.Description ="针对对象XY的计划运行";
 var mdrID =" [MDR_ID]";
 MDRO.CreateInstance(mdrName,"",mdrID,mdrDescription);
 var queryParameter:QueryParameter;
 queryParameter.Option =" EQ";
 queryParameter.ParameterName =" SelectByID";
 queryParameter.Low =" 4711";
 MDRO.AddSelectionParameter(mdrName,"",queryParameter.ParameterName,mdrID,queryParameter);
 var now = Context.GetCurrentGlobalDateTime();
 var startDuration = ABSL:Duration.Create(0,0,0,0,0,10);
 var startTime = now.AddDuration(startDuration);
 MDRO.ExecuteDateTime(mdrName,"",startTime,mdrID); 

一周热门 更多>