Skip to Content
avatar image
Former Member

Using RSDRI_INFOPROV_READ in Start Routine

Please provide sample code along with characteristic, KF, Internal table declarations if any, on how to use RSDRI_INFOPROV_READ in start routine.

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Oct 10, 2007 at 06:31 PM

    Hi,

    there s an example report how to use it. Goto FM in SE37 and look in which reports it is used. I think the report is called something like infoprovread.

    Regards,

    Juergen

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Please take a look at this code and let me know if this is the way to use the function module RSDRI_INFOPROV_READ. I am trying to read 4 characteristics from the cube and then using those values to populate a different field in start routine based on document number.

      TYPES: BEGIN OF st_data,

      DOC_NUMBER TYPE /BI0/OIDOC_NUMBER,

      ZAREACHG TYPE /BIC/OIZAREACHG,

      ZVALUEOLD TYPE /BIC/OIZVALUEOLD,

      ZITEMCHG TYPE /BIC/OIZITEMCHG,

      END OF st_data.

      DATA: gt_characteristics TYPE rsdri_th_sfc,

      gs_characteristic LIKE LINE OF gt_characteristics,

      gt_keyfigures TYPE rsdri_th_sfk,

      gs_keyfigure LIKE LINE OF gt_keyfigures,

      gs_range TYPE rsdri_s_range,

      gt_range TYPE rsdri_t_range,

      gt_data TYPE st_data OCCURS 0,

      gs_data LIKE LINE OF gt_data,

      gv_flg_firstcall TYPE rs_bool value 'X'.

      *INITIALIZATION.

      MOVE: 'DOC_NUMBER' to gs_characteristic-chanm,

      'DOC_NUMBER' to gs_characteristic-chaalias,

      0 to gs_characteristic-orderby.

      INSERT gs_characteristic INTO TABLE gt_characteristics.

      CLEAR gs_characteristic.

      MOVE: 'ZAREACHG' to gs_characteristic-chanm,

      'ZAREACHG' to gs_characteristic-chaalias,

      0 to gs_characteristic-orderby.

      INSERT gs_characteristic INTO TABLE gt_characteristics.

      CLEAR gs_characteristic.

      MOVE: 'ZVALUEOLD' to gs_characteristic-chanm,

      'ZVALUEOLD' to gs_characteristic-chaalias,

      0 to gs_characteristic-orderby.

      INSERT gs_characteristic INTO TABLE gt_characteristics.

      CLEAR gs_characteristic.

      MOVE: 'ZITEMCHG' to gs_characteristic-chanm,

      'ZITEMCHG' to gs_characteristic-chaalias,

      0 to gs_characteristic-orderby.

      INSERT gs_characteristic INTO TABLE gt_characteristics.

      CLEAR gs_characteristic.

      • ZAREACHG = SCHEDULE LINES

      CLEAR gs_range.

      gs_range-chanm = 'ZAREACHG'.

      gs_range-sign = rs_c_range_sign-including.

      gs_range-compop = rs_c_range_opt-equal.

      gs_range-low = 'SCHEDULE LINES'.

      • --- include into list of restrictions

      APPEND gs_range TO gt_range.

      • ZITEMCHG = LOAD DATE

      CLEAR gs_range.

      gs_range-chanm = 'ZITEMCHG'.

      gs_range-sign = rs_c_range_sign-including.

      gs_range-compop = rs_c_range_opt-equal.

      gs_range-low = 'LOAD.DATE'.

      • --- include into list of restrictions

      APPEND gs_range TO gt_range.

      MOVE 'X' TO gv_flg_firstcall.

      CALL FUNCTION 'RSDRI_INFOPROV_READ'

      EXPORTING

      I_INFOPROV = 'Z_OC'

      I_TH_SFC = gt_characteristics

      I_TH_SFK = gt_keyfigures

      I_T_RANGE = gt_range

      i_reference_date = sy-datum

      i_save_in_table = rs_c_false

      i_save_in_file = rs_c_false

      i_packagesize = 1000

      i_authority_check = rsdrc_c_authchk-read

      IMPORTING

      E_T_DATA = gt_data

      CHANGING

      C_FIRST_CALL = gv_flg_firstcall

      EXCEPTIONS

      ILLEGAL_INPUT = 1

      ILLEGAL_INPUT_SFC = 2

      ILLEGAL_INPUT_SFK = 3

      ILLEGAL_INPUT_RANGE = 4

      ILLEGAL_INPUT_TABLESEL = 5

      NO_AUTHORIZATION = 6

      NCUM_NOT_SUPPORTED = 7

      ILLEGAL_DOWNLOAD = 8

      ILLEGAL_TABLENAME = 9

      TRANS_NO_WRITE_MODE = 10

      INHERITED_ERROR = 11

      X_MESSAGE = 12

      OTHERS = 13

      .

      DATA: BEGIN OF FINAL_TAB OCCURS 0,

      DOC_NUM TYPE /BI0/OIDOC_NUMBER,

      AREACHG TYPE /BIC/OIZAREACHG,

      VALUEOLD TYPE /BIC/OIZVALUEOLD,

      ITEMCHG TYPE /BIC/OIZITEMCHG,

      END OF FINAL_TAB.

      DATA: BEGIN OF zgt_data OCCURS 0,

      DOC_NUM TYPE /BI0/OIDOC_NUMBER,

      AREACHG TYPE /BIC/OIZAREACHG,

      VALUEOLD TYPE /BIC/OIZVALUEOLD,

      ITEMCHG TYPE /BIC/OIZITEMCHG,

      END OF zgt_data.

      DATA:BEGIN OF TEMP_DATA OCCURS 0,

      DOC_NUM TYPE /BI0/OIDOC_NUMBER,

      AREACHG TYPE /BIC/OIZAREACHG,

      VALUEOLD TYPE /BIC/OIZVALUEOLD,

      ITEMCHG TYPE /BIC/OIZITEMCHG,

      END OF TEMP_DATA.

      zgt_data[] = gt_data[]. .

      Sort zgt_data by DOC_NUM ascending

      ITEMCHG ascending.

      LOOP AT zgt_data.

      TEMP_DATA = zgt_data.

      AT NEW DOC_NUM.

      MOVE-CORRESPONDING TEMP_DATA TO FINAL_TAB.

      APPEND FINAL_TAB.

      CLEAR FINAL_TAB.

      ENDAT.

      ENDLOOP.

      Sort FINAL_TAB by DOC_NUM ascending.

      • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      LOOP AT DATA_PACKAGE.

      READ TABLE FINAL_TAB WITH KEY DOC_NUM = DATA_PACKAGE-DOC_NUMBER

      binary search.

      IF sy-subrc eq 0.

      MOVE FINAL_TAB-VALUEOLD TO DATA_PACKAGE-LOAD_DATE.

      MODIFY DATA_PACKAGE.

      ENDIF.

      ENDLOOP.

      CLEAR: zgt_data, FINAL_TAB.

      REFRESH: zgt_data, FINAL_TAB.

      Thanks in advance!