HRIQ_UPDATE_INFTY 不更新 hrp1001

发布于 2024-09-08 04:23:49 字数 997 浏览 5 评论 0原文

HRIQ_UPDATE_INFTY 返回 sy-subrc=0。但实际上并没有对其进行任何改变。部分源码:

DATA:
lt_single_1001   TYPE STANDARD TABLE OF p1001 WITH HEADER LINE, 
lt_1001          TYPE STANDARD TABLE OF hrp1001 WITH HEADER LINE.

SELECT * FROM hrp1001 INTO TABLE lt_1001 WHERE
       objid = <studies>-cs_objid AND sobid = lv_major_id.

move-corresponding lt_1001 to lt_single_1001.

CALL FUNCTION 'HRIQ_UPDATE_INFTY'
  EXPORTING
      vtask                   = 'D'
  TABLES
      innnn                   = lt_single_1001
  EXCEPTIONS
      error_during_update     = 1
      no_authorization        = 2
      relation_not_reversible = 3
      corr_exit               = 4
      OTHERS                  = 5.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.
ELSE.
  NEW-LINE NO-SCROLLING.
  WRITE: 'Update: '.
  WRITE: lt_1001-objid. "TODO: write proper information
  write: lt_single_1001-begda.
  write: lv_begda.
  write: lt_single_1001-endda.
  write: lv_endda.
ENDIF.

HRIQ_UPDATE_INFTY returns sy-subrc=0. But it actually doesn't make any changes to it. Part source code:

DATA:
lt_single_1001   TYPE STANDARD TABLE OF p1001 WITH HEADER LINE, 
lt_1001          TYPE STANDARD TABLE OF hrp1001 WITH HEADER LINE.

SELECT * FROM hrp1001 INTO TABLE lt_1001 WHERE
       objid = <studies>-cs_objid AND sobid = lv_major_id.

move-corresponding lt_1001 to lt_single_1001.

CALL FUNCTION 'HRIQ_UPDATE_INFTY'
  EXPORTING
      vtask                   = 'D'
  TABLES
      innnn                   = lt_single_1001
  EXCEPTIONS
      error_during_update     = 1
      no_authorization        = 2
      relation_not_reversible = 3
      corr_exit               = 4
      OTHERS                  = 5.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.
ELSE.
  NEW-LINE NO-SCROLLING.
  WRITE: 'Update: '.
  WRITE: lt_1001-objid. "TODO: write proper information
  write: lt_single_1001-begda.
  write: lv_begda.
  write: lt_single_1001-endda.
  write: lv_endda.
ENDIF.

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

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

发布评论

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

评论(2

音盲 2024-09-15 04:23:50

如果我没记错的话,您正在将表 lt_1001 的标头的值移动到表 lt_single_1001 的标头。您至少应该附加它,否则表是空的。另外,P1001 与 HRP1001 不同:有一个 INFTY 成员需要填写:
对于以下行:

   move-corresponding It_1001 to It_single_1001.

我会

   loop at It_1001.
      " move header of It_1001 to header of It_single_1001
      move-corresponding It_1001 to It_single_1001.
      " append the infotype information
      It_single_1001-infty = '1001'.
      " append the header to the table
      append lt_single_1001.
   endloop.
   " call to the function...

为显示执行类似的操作:您正在使用 It_1001 的标题。您还应该循环 it_single_1001 以显示刚刚发送到初始函数的数据。

问候
纪尧姆

If i'm not mistaken, you're moving the value of the header of table lt_1001 to the header of table lt_single_1001. You should at least append it, otherwise the table is empty. Also P1001 is not the same as HRP1001 : there is an INFTY member that should be filled :
For the following line :

   move-corresponding It_1001 to It_single_1001.

i would do something like

   loop at It_1001.
      " move header of It_1001 to header of It_single_1001
      move-corresponding It_1001 to It_single_1001.
      " append the infotype information
      It_single_1001-infty = '1001'.
      " append the header to the table
      append lt_single_1001.
   endloop.
   " call to the function...

Same thing for the display : you're using the header of It_1001. You should also loop at it_single_1001 to display the datas that you just sent to the initial function.

Regards
Guillaume

活雷疯 2024-09-15 04:23:50

我不确定,但是,尝试提供导出参数 commit_flg = 'X'。

Am not sure but, try providing the exporting parameter commit_flg = 'X'.

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