cancel
Showing results for 
Search instead for 
Did you mean: 

How to read period close date from T009B table in SAP BI 7.X

Former Member
0 Kudos

Hi All,

I have requirement to display a period close day of the month in my report. I have added 0NUMDAY into Cube KFs list.

I need to read T009B table in transformation while loading data into Cube.

I have delacred my table as below in START ROUTINE

DATA:

       IT_T009B TYPE STANDARD TABLE OF T009B,

        WA_T009B TYPE IT_T009B.

I am getting the below error when I check the code

E:Type "IT_T009B" is unknown

I need to extract my t009b table into an internal table in start routine. and then need to read that in field level routine to capture period close day

read table into internal table i wrote the code as below

SELECT * FROM T009B INTO CORRESPONDING FIELDS OF TABLE IT_T009B

FOR ALL ENTRIES IN SOURCE_PACKAGE[]

  WHERE

  PERIV = SOURCE_PACKAGE-FISCVARNT AND

  BDATJ = SOURCE_PACKAGE-FISCPER(4).

field level routine i wrote:

READ TABLE IT_T009B INTO WA_T009B WITH TABLE KEY

PERIV = SOURCE_PACKAGE-FISCVARNT

BDATJ = SOURCE_PACKAGE-FISCPER(4)

POPER = SOURCE_PACKAGE-FISCPER+5(2).

     IF SY-SUBRC = 0.

        RESULT = WA_T009B-BUTAG.

     ENDIF.

Please help me where i need to correct my code to achieve my requirement.

thanks

Murali

Accepted Solutions (1)

Accepted Solutions (1)

sander_vanwilligen
Active Contributor
0 Kudos

Hi Murali,

Your data declaration should look like this:

DATA:

  IT_T009B TYPE STANDARD TABLE OF T009B,

  WA_T009B TYPE T009B.   "<<<<<<<<

An alternative solution could be using Function Module LAST_DAY_IN_PERIOD_GET in the Field Routine. You don't need the Start Routine anymore. Table T009B is fully buffered, so it should not cause any performance problems.

Best regards,

Sander

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Please define as :  IT_TOO9B is no defined as type (it has started with data statement). So you have to use the like clause or refer the table directly using type statement.

DATA:

       IT_T009B TYPE STANDARD TABLE OF T009B,

        WA_T009B TYPE T009B.

Or

DATA:

       IT_T009B TYPE STANDARD TABLE OF T009B.

DATA:

        WA_T009B  LIKE  T009B.


Please define the internal table in the global declaration and clear the work area before the read statement.


Regards