从透明表中获取数据

发布于 2024-08-08 15:29:53 字数 249 浏览 5 评论 0原文

我们的 sap 环境中开发了一个新的 bapi,它从台球表和透明表中获取数据。

当从非 sap 环境调用此 bapi 时,只有池表返回数据。透明表返回空白值。

案例

当我们在透明表(如A931表)的“Where子句”中传递硬编码值时,透明表也在非sap环境中从bapi返回数据。

但是,当我们通过 bapi 中声明的变量传递透明表的“Where 子句”中的值时,透明表在非 SAP 环境中不会返回任何值(而是返回空白)。

There is a new bapi developed in our sap environment which is fetching data from pool tables and transparent tables.

When this bapi is called from non sap environment then only pool tables are returning data .Transparent tables are returning blank values.

Case

When we are passing hard coded values in "Where Clause" of transparent tables like A931 table ,then transparent tables are also returning data from bapi in non sap environment.

But when we pass values in "Where Clause " of transparent tables through Variables declared in bapi then transparent tables are not returning any value (instead returns Blank) in non SAP environment.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

卖梦商人 2024-08-15 15:29:53

我的变量的长度不是 SAP 所需的长度,因此我附加了零。

它起作用了。

The length of my variable was not of SAP Length required, so I appended zeros.

It worked.

旧人 2024-08-15 15:29:53

你能发布一些ABAP代码吗?
如果您在模块函数中声明表,则它们的内容应该是可访问的,并且可以作为表参数返回。

例如,在以下由 RFC 调用的代码中,即使您注释了“select”语句,表 STATES 也永远不会为空,因为两个插入语句会填充它。

FUNCTION z_prt_dns_status_get.
*"----------------------------------------------------------------------
*"*"Interface locale :
*"  IMPORTING
*"     VALUE(LANGU) TYPE  LANGU DEFAULT 'F'
*"  EXPORTING
*"     VALUE(RETURN) TYPE  BAPIRETURN1
*"  TABLES
*"      STATES STRUCTURE  ZPRT_ATN_STATEST
*"----------------------------------------------------------------------


  SELECT t~atn t~state t~langu t~text s~seqnr
   INTO CORRESPONDING FIELDS OF TABLE states
     FROM zprt_atn_statest AS t
     INNER JOIN zprt_atn_states AS s
        ON s~atn = t~atn AND s~state = t~state
        WHERE t~atn = 'DNS'
        ORDER BY s~seqnr.

  states-text = 'A traiter'.
  states-state = 'OPEN'.
  INSERT states INDEX 1.

  states-text = 'Tous'.
  states-state = '****'.
  INSERT states INDEX 1.

ENDFUNCTION.

问候

Could you post some ABAP code ?
if you declare the tables in your module function, their content should be accessible, and can be returned as table params.

For example in the following code, called by RFC, the table STATES will never be empty, even if you comment the 'select' statement, as two insert statement fill it.

FUNCTION z_prt_dns_status_get.
*"----------------------------------------------------------------------
*"*"Interface locale :
*"  IMPORTING
*"     VALUE(LANGU) TYPE  LANGU DEFAULT 'F'
*"  EXPORTING
*"     VALUE(RETURN) TYPE  BAPIRETURN1
*"  TABLES
*"      STATES STRUCTURE  ZPRT_ATN_STATEST
*"----------------------------------------------------------------------


  SELECT t~atn t~state t~langu t~text s~seqnr
   INTO CORRESPONDING FIELDS OF TABLE states
     FROM zprt_atn_statest AS t
     INNER JOIN zprt_atn_states AS s
        ON s~atn = t~atn AND s~state = t~state
        WHERE t~atn = 'DNS'
        ORDER BY s~seqnr.

  states-text = 'A traiter'.
  states-state = 'OPEN'.
  INSERT states INDEX 1.

  states-text = 'Tous'.
  states-state = '****'.
  INSERT states INDEX 1.

ENDFUNCTION.

regards

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文