简体   繁体   English

C# 中 ABAP SELECT-OPTIONS 的等效性

[英]Equivalence of ABAP SELECT-OPTIONS in C#

I am writing a report in C# that will generate an SQL statement to call data in SAP.我正在用 C# 编写一份报告,它将生成一个 SQL 语句来调用 SAP 中的数据。 In SAP ABAP, there is a command "SELECT-OPTIONS" which will automatically place on a screen a field which automatically has a number of different options to input data.在 SAP ABAP 中,有一个命令“SELECT-OPTIONS”,它会自动在屏幕上放置一个字段,该字段自动具有许多不同的选项来输入数据。 For example, if you wanted to query a customer master database, you could enter a single customer number, multiple customer numbers, multiple ranges of customer numbers.例如,如果要查询客户主数据库,则可以输入单个客户编号、多个客户编号、多个客户编号范围。 Set criteria to include the customer numbers, exclude them, etc.设置条件以包含客户编号、排除它们等。

It is really nice functionality that users are asking me to duplicate but with a C# front end.这是一个非常好的功能,用户要求我复制但使用 C# 前端。

I am trying to replicate this a portion of this functionality by using lookup buttons, datagridviews, internal lists, etc.我试图通过使用查找按钮、数据网格视图、内部列表等来复制此功能的一部分。

I was wondering if anyone has done anything similar or if there is a customer class that already exists that does the equivalent.我想知道是否有人做过类似的事情,或者是否有一个已经存在的客户类可以做同样的事情。

You probably need to understand SAP ABAP and C# to fully understand the question as it is hard to explain without having to show a lot pictures and using a lot of words.您可能需要了解 SAP ABAP 和 C# 才能完全理解这个问题,因为如果不显示大量图片和使用大量文字,很难解释清楚。

Thanks谢谢

Stephen斯蒂芬

Most likely there is no generic finished product that will do it.很可能没有通用的成品可以做到这一点。 In ABAP, this relies on the fact that select-options is bound to a variable, data element and domain, which, in turn, has either a valid-values-list (fix or via table) and/or various search helps.在 ABAP 中,这依赖于这样一个事实,即select-options绑定到一个变量、数据元素和域,而后者又具有一个有效值列表(修复或通过表)和/或各种搜索帮助。 So if you need to enter an employee number, you will be able to select the number by name or by email or by department or other criteria.因此,如果您需要输入员工编号,您可以按姓名、电子邮件、部门或其他条件选择编号。 So basically, for each “type of object” that you want to enter there is some sort of input help that has intrinsic knowledge of entered data.所以基本上,对于您想要输入的每种“对象类型”,都有某种输入帮助,其中包含输入数据的内在知识。

If you are only interested in an “input field” that is able to select an arbitrary number of following inputs at the same time (without value help dialogs)如果你只关心“输入字段”,也就是能够选择在同一时间以下输入任意号码(不含值帮助对话框)

  • include/exclude single values包含/排除单个值
  • include/exclude range (for sortable values) (42-50 or Bob-Mike)包含/排除范围(用于可排序值)(42-50 或 Bob-Mike)
  • include/exclude open ranges (>= 42)包括/排除开放范围 (>= 42)
  • include/exclude values by pattern (ash*)按模式包含/排除值 (ash*)

Then: I never saw anything like that in any UI other than SAPs DynPro or WebDynpro.然后:我从未在 SAP DynPro 或 WebDynpro 之外的任何 UI 中看到过类似的东西。

In the end, you end up with a so-called range table, which has four values per line:最后,您会得到一个所谓的范围表,每行有四个值:

  • include/exclude包括/排除
  • operation (equals, not equals, less than, between, etc)操作(等于、不等于、小于、介于等)
  • value1值1
  • value2 (only relevant for operations like “between”) value2(仅与“之间”之类的操作相关)

So if you build a UI for that, the user will need to enter something which will end up in this construct.因此,如果您为此构建 UI,则用户将需要输入将在此构造中结束的内容。

Try ERPConnect from Theobald Software:试试 Theobald Software 的 ERPConnect:

https://theobald-software.com/en/erpconnect/ https://theobald-software.com/en/erpconnect/

I didn't find a mention of SELECT-OPTION control in the brochures but they claim they have .Net API for core SAP/ABAP tools and interfaces, so you can give a try.我没有找到在SELECT-OPTION控制的一提的小册子,但他们声称,他们有核心SAP / ABAP工具和接口.NET API,所以你可以给一个尝试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM