Skip to Content

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

how to make use of a global internal table in SAP BW during transfer rules

HI friends,

I am ABAP consultant working on some APO info cubes. I have an issue during the upload of planning area data into APO info cube.

Please help.

I am using a transfer routine to find the TECHWEEK from a data base table ZGC_CALWEEK based on the on the calender month and calender week.

Code I am writing is like below.


*----------------------------------------------------------------------*
*       FORM COMPUTE_/BIC/ZCALWEEK
*----------------------------------------------------------------------*
* Compute value of InfoObject ZCALWEEK
* in communication structure /BIC/CSZT6DPPA
*
* Technical properties:
*     field name      = /BIC/ZCALWEEK
*     data element    = /BIC/OIZCALWEEK
*     data type       = NUMC
*     length          = 000006
*     decimals        = 000000
*     ABAP type       = N
*     ABAP length     = 000006
*     reference field =
*----------------------------------------------------------------------*
* Parameters:
*  -->  RECORD_NO       Record number
*  -->  TRAN_STRUCTURE  Transfer structure
*  <--  RESULT          Return value of InfoObject
*  <->  G_T_ERRORLOG    Error log
*  <--  RETURNCODE      Return code (to skip one record)
*  <--  ABORT           Abort code (to skip whole data package)
*----------------------------------------------------------------------*
FORM COMPUTE_/BIC/ZCALWEEK
  USING    RECORD_NO LIKE SY-TABIX
           TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE
           G_S_MINFO TYPE RSSM_S_MINFO
  CHANGING RESULT TYPE /BIC/OIZCALWEEK
           G_T_ERRORLOG TYPE rssm_t_errorlog_int
           RETURNCODE LIKE SY-SUBRC
           ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel datapackage
*$*$ begin of routine - insert your code only below this line        *-*
* DATA: l_s_errorlog TYPE rssm_s_errorlog_int.
DATA: LV_WEEK         TYPE ZGC_CALWEEK-APOWEEK,
        LV_MONTH        TYPE ZGC_CALWEEK-APOMONTH,
        LV_TECH_WEEK    TYPE ZGC_CALWEEK-TECHWEEK.

  LV_WEEK   = TRAN_STRUCTURE-CALWEEK.
  LV_MONTH  = TRAN_STRUCTURE-CALMONTH.

  SELECT SINGLE TECHWEEK INTO LV_TECH_WEEK
    FROM ZGC_CALWEEK CLIENT SPECIFIED
    WHERE  MANDT = SY-MANDT
    AND  APOWEEK  = LV_WEEK
    AND   APOMONTH = LV_MONTH.
  IF SY-SUBRC IS INITIAL.
    RESULT = LV_TECH_WEEK.
  ELSE.
    RETURNCODE = 1.
    ENDIF.
*$*$ end of routine - insert your code only before this line         *-*
ENDFORM.

There are more than 50-80 million records that wil be transferred from planning area to info cube. The select statment is giving pathetic performance as this has to run 50-80 million times.

After adding the select statment to find the TECHWEEK it is taking 4 times the time that used to take before writing the select statment.

Is there a way that I can first fetch the data from ZGC_CALWEEK to one internal table and that internal table can be used using read statment during the transfer routine instead of writing select statement here.

Please help in this case?

Former Member replied

Hi,

Yes , whatever data you are pulling in start routine, we can use that data in individual transfer rules . Even the declarations that we maintained in start routines will be accessible here in individual transfer rules .

Hope the above reply was helpful.

Kind Regards,

Ashutosh Singh

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question