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.
4

2 回答 2

0

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

于 2010-07-06T20:35:31.243 回答
0

如果我没记错的话,您将表 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 处循环以显示您刚刚发送到初始函数的数据。

问候
纪尧姆

于 2010-08-04T17:12:06.953 回答