Start Routine needs to read a master data value
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)
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.
Dennis Scoville replied
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.
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.
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