Skip to Content

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

Start Routine needs to read a master data value

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

Former Member
replied

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

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