cancel
Showing results for 
Search instead for 
Did you mean: 

Question About RSDRI_INFOPROV_READ

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

matt
Active Contributor
0 Kudos

You're using the function module incorrectly, and the logic of your start routine doesn't really make much sense. You set up the function module to read 2 characteristics and one key figure. But nowhere do you restrict what values to return. You then start a while loop that will read data from the infoprovider until there's none left. THEN for each package returned by the function module, you loop through your source data, hoping that G_S_SFK will contain the value you need.

There's so many things that aren't right about your usage of the FM. You need to talk to an ABAPper. Having a none-abapper do complicated coding will cause immense support pain further down the project path, and getting in someone to fix the issues is far more expensive than getting someone suitably experienced in the first place.

I just googled on RSDRI_INFOPROV_READ and in the first hits there are examples on how to use this FM. The FM documentation itself points to a sample program. If you insist on doing this yourself, then read all of those and figure out what they're doing. And what's wrong with what you're doing. If you can't do that - get someone who knows what they're doing in.

Finally, "However, the load to the DSO has been failing consistently" doesn't really tell us anything. Is it dumping, not providing the expected data, causing an earthquake?

dielom
Active Contributor
0 Kudos

Hi Vamshi,

Do you have an error or somethng that you need to fix? If so, post that, not the code. The forums are not for you to post codes and people to fix it for you. Please read the guidelines, otherwise you'll get banned from posting.

Cheers,

Diego