简体   繁体   English

SAP JCo 3 RFC RSAQ_REMOTE_QUERY_CALL - 意外结果

[英]SAP JCo 3 RFC RSAQ_REMOTE_QUERY_CALL - unexpected results

We're using JCo 3.0 to connect to RFCs and read data from SAP R/3.我们使用 JCo 3.0 连接到 RFC 并从 SAP R/3 读取数据。 We use one RFC RFC_READ_TABLE often and use a second custom RFC to read employee information.我们经常使用一个 RFC RFC_READ_TABLE 并使用第二个自定义 RFC 来读取员工信息。 My questions revolve around a third RFC RSAQ_REMOTE_QUERY_CALL.我的问题围绕着第三个 RFC RSAQ_REMOTE_QUERY_CALL。 I'm calling an ad-hoc query I built in SAP using this RFC but I'm not getting the expected results.我正在使用这个 RFC 调用我在 SAP 中构建的临时查询,但我没有得到预期的结果。 The main problem is that it appears that SAP is ignoring one of my selection criteria and using what was saved in SAP when I originally built it.主要问题是,SAP 似乎忽略了我的一个选择标准,并使用了我最初构建它时保存在 SAP 中的内容。 The date criterion stored in my ad-hoc is 6/23/2013.存储在我的 ad-hoc 中的日期标准是 6/23/2013。 If I pass in 6/28/2013 from JCo, I get the same results as if I had passed 6/23/2013 from JCo.如果我在 2013 年 6 月 28 日从 JCo 中通过,我得到的结果与从 JCo 中通过 2013 年 6 月 23 日的结果相同。

We have built several ad-hoc queries whose only criteria is a personnel number and call them successfully using RFC RSAQ_REMOTE_QUERY_CALL.我们已经构建了几个临时查询,其唯一标准是人员编号,并使用 RFC RSAQ_REMOTE_QUERY_CALL 成功调用它们。

Background on my ad-hoc query: reporting period of today, joining together four aspects of an employee's information: their latest action (hire, rehire, etc.), organization (eg company), pay (eg pay scale level) and communication (eg email).我的临时查询的背景:今天的报告期,将员工信息的四个方面结合在一起:他们的最新行动(雇用,重新雇用等),组织(例如公司),薪酬(例如工资等级)和沟通(例如电子邮件)。 The query will run every workday.查询将在每个工作日运行。

Here are my questions:以下是我的问题:

  1. My ad-hoc has three selection criteria.我的临时有三个选择标准。 The first two are simple strings.前两个是简单的字符串。 The third is a date.三是约会。 The date will vary each time the query runs.每次查询运行时,日期都会有所不同。 We are referencing the first criteria using SP$00001, the second with SP$00002 and the third with SP$00003.我们使用 SP$00001 引用第一个条件,使用 SP$00002 引用第二个条件,使用 SP$00003 引用第三个条件。 The order of the criteria changes from the ad-hoc to SQ01 (what was SP$00001 in the ad-hoc is now SP$00003).条件的顺序从 ad-hoc 更改为 SQ01(ad-hoc 中的 SP$00001 现在是 SP$00003)。 Shouldn't we reference them in the order defined in the ad-hoc (eg SP$00001)?我们不应该按照 ad-hoc 中定义的顺序(例如 SP$00001)来引用它们吗?

  2. The two simple string selections are using OPTION “EQ”.两个简单的字符串选择使用 OPTION “EQ”。 The date criteria is using OPTION GT (greater than).日期标准使用 OPTION GT(大于)。 Is “GT” correct? “GT”正确吗?

  3. We have some limited accessibility to SAP.我们对 SAP 的访问能力有限。 Is there a way to see which SP$ parameters are mapped to which criteria?有没有办法查看哪些 SP$ 参数映射到哪些条件?

  4. If my ad-hoc was saved with five criteria but four of them never change when I call the ad-hoc from JCo, do I just need to set the value of the one or do I need to set the other four as well?如果我的 ad-hoc 保存有五个标准,但当我从 JCo 调用 ad-hoc 时,其中四个永远不会改变,我是否只需要设置一个的值,还是需要设置其他四个?

  5. Do I have to call this ad-hoc using a variant (function.getImportParameterList().setValue(“VARIANT”, “VARIANT_NAME”))?我是否必须使用变体 (function.getImportParameterList().setValue(“VARIANT”, “VARIANT_NAME”)) 来调用此临时方法?

  6. Does the Reporting Period have an impact on the date criteria?报告期对日期标准有影响吗? I have tried changing the Reporting Period to be PNPBEGDA = today and PNPENDDA = today and noticed no change.我曾尝试将报告期更改为 PNPBEGDA = 今天和 PNPENDDA = 今天,但没有发现任何变化。

  7. Is there a way in SAP to get a “declaration” of your ad-hoc (name, inputs, outputs, criteria)? SAP 中有没有办法获得您的临时(名称、输入、输出、标准)的“声明”? I have looked at JCoFunction.toXml() and JCoFunctionTemplate.我看过 JCoFunction.toXml() 和 JCoFunctionTemplate。 These are good if you want to see something at runtime before it goes to SAP, but I'm looking for something I can use on the JCo end to help me write Java code that matches the ad-hoc.如果您想在进入 SAP 之前在运行时看到一些东西,这些是很好的,但我正在寻找可以在 JCo 端使用的东西来帮助我编写与临时匹配的 Java 代码。

I have looked at length on the web for answers to my questions and have not found anything that is useful.我在网上仔细查看了我的问题的答案,但没有找到任何有用的东西。 If there is anything which would help me, please let me know.如果有什么可以帮助我,请告诉我。

Thanks,谢谢,

LM LM

Since I don't know much about SQnn , I won't be able to answer all of your questions...由于我对SQnn了解不多,因此无法回答您的所有问题...

  1. I don't know, sorry.我不知道,抱歉。
  2. It should be, at least it's the usual operator for greater than.它应该是,至少它是大于的常用运算符。
  3. Yes - set an external breakpoint right inside the function module and trace its execution while performing the RFC call.是 - 在功能模块内部设置一个外部断点,并在执行 RFC 调用时跟踪其执行情况。 Warning: At least basic ABAP knowledge required.警告:至少需要基本的 ABAP 知识。
  4. I don't know, sorry.我不知道,抱歉。
  5. I don't know either, sorry.我也不知道,抱歉。
  6. That would depend on the query, I suspect...这将取决于查询,我怀疑......
  7. JCo won't be able to help you out there - it doesn't know about queries, it only knows function modules. JCo 将无法帮助您——它不知道查询,它只知道功能模块。 There might be other RSAQ_* function modules to get that information though.不过,可能还有其他RSAQ_*功能模块可以获取该信息。

I played with setting up a variant in SQ01 for my query.我在 SQ01 中为我的查询设置了一个变体。 I added some settings in the variant that solved my problem and answered several of my questions in my post.我在解决我的问题的变体中添加了一些设置,并在我的帖子中回答了我的几个问题。 The main thing I did was add a dynamically calculated date as part of my criteria.我所做的主要事情是添加一个动态计算的日期作为我的标准的一部分。 Here's how:就是这样:
1. In SQ01, access menu "Go To" -> "Maintain Variants". 1. 在 SQ01 中,访问菜单“转到”->“维护变体”。 2. Choose your variant and in subobjects, choose "Attributes" and click "Change". 2. 选择您的变体并在子对象中选择“属性”并单击“更改”。
3. In the displayed list, find your date criterion. 3. 在显示的列表中,找到您的日期标准。
4. Choose "D" in Selection Variable, choose a comparison option (mine was GT for greater than), and a "Name of a Variable" (really, this is the type of dynamic date calculation you need). 4. 在选择变量中选择“D”,选择一个比较选项(我的 GT 表示大于)和“变量名称”(实际上,这是您需要的动态日期计算类型)。
5. Go back to the Subobjects panel, choose "Values" and click "Change". 5. 返回子对象面板,选择“值”并单击“更改”。
6. Enter any other criteria you need in the "Program selections" section. 6. 在“程序选择”部分输入您需要的任何其他标准。
7. Save the variant. 7. 保存变体。
By doing this, I don't need to pass anything into the query from JCo.通过这样做,我不需要将任何内容传递到 JCo 的查询中。 Also, SAP will automatically update the date criteria you entered in step #4 above.此外,SAP 将自动更新您在上述第 4 步中输入的日期条件。
So to to answer my questions from my original post:所以要从我的原始帖子中回答我的问题:
1 and 4. It doesn't matter because I'm no longer passing anything in from JCo. 1 和 4。没关系,因为我不再从 JCo 传递任何东西。
2. "GT" is Greater Than. 2.“GT”大于。
3 and 7. If anyone knows, I'd really like to find out. 3 和 7。如果有人知道,我真的很想知道。
5. Use the name you as it is in SAP (step #2 above). 5. 使用您在 SAP 中的名称(上面的第 2 步)。
6. I still don't know, but it's not holding me up. 6.我仍然不知道,但这并没有阻止我。
I'm posting this in case anyone out there needs this type of information.我张贴这个以防有人需要这种类型的信息。 Thanks to Esti and vwegert for helping me out.感谢 Esti 和 vwegert 帮助我。

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

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