cancel
Showing results for 
Search instead for 
Did you mean: 

Start Routine needs to read a master data value

Former Member
0 Kudos

Hello,

BI gurus this might be an easy one for anyone who knows ABAP. I am loading transaction data into an Infocube in 7.0.

Cube has 0UCCONTRACT as one of the fields to be loaded.

My start routine needs to read master data of 0UCCONTRACT - attribute 0OUTLINE_ID (CHAR,1)

and DELETE RECORDS where 0OUTLINE_ID is NOT blank. (I want blanks)

Something like

DELETE SOURCE_PACKAGE where OUTLINE_ID NE '0'.

But since the attributre is not in the source /transformation the above does not work.

Please help- I am a beginner in ABAP.

Thanks

Naresh

Accepted Solutions (1)

Accepted Solutions (1)

dennis_scoville4
Active Contributor
0 Kudos

Global Definitions


TYPES : BEGIN OF tp_puccontract,
                 uccontract TYPE /bi0/oiuccontract,
                 outline_id TYPE /bi0/oioutline_id,
        END of tp_puccontract.

DATA : t_puccontract TYPE HASHED TABLE OF tp_puccontract
                  WITH UNIQUE KEY uccontract,
          wa_puccontract TYPE tp_puccontract,
       l_tabix TYPE sy_tabix.

Start Routine


SELECT
  uccontract
  outline_id
FROM
  /bic/puccontract
INTO CORRESPONDING FIELDS OF TABLE
  t_puccontract
FOR ALL ENTRIES IN source_package
WHERE
  uccontract EQ source_package-uccontract.

End Routine


LOOP AT result_package
  ASSIGNING <result_fields>.

  CLEAR l_tabix.

  l_tabix = sy-tabix.

  READ TABLE
    t_puccontract
  INTO
    wa_puccontract
  WITH KEY
    uccontract =  <result_fields>-uccontract.

  IF sy-subrc EQ 0 AND
     wa_puccontract-outline_id EQ 0.

    DELETE
      result_package
    INDEX
      l_tabix.

  ENDIF.

ENDLOOP.

Edited by: Dennis Scoville on Jul 14, 2009 11:58 AM

Former Member
0 Kudos

Dennis- Thanks! It worked. The only change I made was to include the deletion of the unwanted record in the start routine itself instead of in the End Routine since I have large volume of records.

Full points awarded!.

Naresh

Former Member
0 Kudos

Hi Naresh,

Would appreciate if you could share your start routine code here as I also looking for something similar. Please help.

Thanks,

smiley

Answers (0)