Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Question About RSDRI_INFOPROV_READ

Hello Everyone,

I am trying to use the function Module RSDRI_INFOPROV_READ, while loading a DSO. The Start routine to the DSO does a lookup on the a Planning infocube to get the Amount Field. However, the load to the DSO has been failing consistently and i just cant seem to figure out why. Iam not so much of a ABAP'er and i need your help. I am pasting the Code below, can someone share your inputs why this is happening?

*******************************************************************
*******************************************************************
    CONSTANTS :
    RS_C_FALSE TYPE RS_BOOL VALUE ' ',
    RS_C_TRUE    TYPE RS_BOOL VALUE 'X',
    RS_C_UNKNOWN TYPE RS_BOOL VALUE 'U'.

    TYPES :
        BEGIN OF GT_S_DATA,
         ZPLANITEM TYPE /BI0/OISEM_POSIT,
          ZPROITEM TYPE /BIC/OIZ_PROITEM,
          ZAMOUNT1 TYPE /BI0/OIAMOUNT,
        END OF GT_S_DATA.

    DATA:
      G_S_SFC TYPE RSDRI_S_SFC,
      G_TH_SFC TYPE RSDRI_TH_SFC,
      G_S_DATA TYPE GT_S_DATA,
      G_T_DATA TYPE STANDARD TABLE OF GT_S_DATA
      WITH DEFAULT KEY INITIAL SIZE 10,
      G_S_SFK TYPE RSDRI_S_SFK,
      G_TH_SFK  TYPE RSDRI_TH_SFK,
      G_S_RANGE   TYPE RSDRI_S_RANGE,
      G_T_RANGE TYPE RSDRI_T_RANGE,
      G_END_OF_DATA  TYPE RS_BOOL,
      G_FIRST_CALL   TYPE RS_BOOL.

*******************************************************************
*******************************************************************
* Planning Item
    CLEAR G_S_SFC.
* --- name of characteristic
    G_S_SFC-CHANM    = '0SEM_POSIT'.
* --- name of corresponding column in G_T_DATA
    G_S_SFC-CHAALIAS = '0SEM_POSIT'.
* --- no ORDER-BY
    G_S_SFC-ORDERBY  = 0.
* --- include into list of characteristics
*    INSERT G_S_SFC INTO TABLE G_TH_SFC.

* --- name of characteristic
    G_S_SFC-CHANM    = '/BIC/SZ_PROITEM'.
* --- name of corresponding column in G_T_DATA
    G_S_SFC-CHAALIAS = '/BIC/SZ_PROITEM'.
* --- no ORDER-BY
    G_S_SFC-ORDERBY  = 0.
* --- include into list of characteristics
    INSERT G_S_SFC INTO TABLE G_TH_SFC.

* For the following key figures should be returned:
*  0Amount
    CLEAR G_TH_SFK.
* 0Amount
    CLEAR G_S_SFK.
* --- name of key figure
    G_S_SFK-KYFNM    = '0AMOUNT'.
* --- name of corresponding column in G_T_DATA
    G_S_SFK-KYFALIAS = '0AMOUNT'.
* --- aggregation
    G_S_SFK-AGGR     = 'SUM'.
* --- include into list of key figures
    INSERT G_S_SFK INTO TABLE G_TH_SFK.

* --- this variable will be set to TRUE when the last data
*     package is read
    G_END_OF_DATA = RS_C_FALSE.
* --- this variable indicates whether this is an initial
*     call to the reading module or a follow-up call (which
*     simply retrieves already selected data)
    G_FIRST_CALL  = RS_C_TRUE.
    WHILE G_END_OF_DATA = RS_C_FALSE.

*******************************************************************
*******************************************************************

      DATA:WA_SOURCE_PACKAGE TYPE _TY_S_SC_1.
      DATA:ZAMOUNT TYPE /BI0/OIAMOUNT.
      LOOP AT SOURCE_PACKAGE INTO WA_SOURCE_PACKAGE.
        BREAK-POINT.
        CALL FUNCTION 'RSDRI_INFOPROV_READ'
          EXPORTING
            I_INFOPROV             = 'ZAIGTXPC'
            I_TH_SFC               = G_TH_SFC
            I_TH_SFK               = G_S_SFK
            I_SAVE_IN_TABLE        = RS_C_FALSE
            I_SAVE_IN_FILE         = RS_C_FALSE
            I_REFERENCE_DATE       = SY-DATUM
            I_PACKAGESIZE          = 10
            I_AUTHORITY_CHECK      = 'R'
          IMPORTING
            E_T_DATA               = G_T_DATA
            E_END_OF_DATA          = G_END_OF_DATA
          CHANGING
            C_FIRST_CALL           = G_FIRST_CALL
          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.

        IF SY-SUBRC = 0.
          MOVE G_S_SFK TO ZAMOUNT.
        ENDIF.
        IF WA_SOURCE_PACKAGE-ZAMTFLD = 'A'.
          MOVE ZAMOUNT TO WA_SOURCE_PACKAGE-Z_DUM_ACT.
        ELSEIF
          WA_SOURCE_PACKAGE-ZAMTFLD = 'B'.
          MOVE ZAMOUNT TO WA_SOURCE_PACKAGE-Z_DUM_BAL.
        ELSEIF
        WA_SOURCE_PACKAGE-ZAMTFLD = 'D'.
          MOVE ZAMOUNT TO WA_SOURCE_PACKAGE-Z_DUM_ADJ.
          APPEND WA_SOURCE_PACKAGE TO SOURCE_PACKAGE.
        ENDIF.
      ENDLOOP.
    ENDWHILE.

Edited by: Vamshi_g_1 on Jun 7, 2011 1:50 AM

Edited by: Matt on Jun 7, 2011 6:55 AM - added tags

Former Member
Not what you were looking for? View more on this topic or Ask a question