Skip to Content

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

Start routine in update rules using field symbols.

Hi BW Experts!!

We need to add 10 fields to an infocube C1.These fields are not there in the source ODS of C1(ODS2)and hence taking from another ODS ODS1.

Below is the routine written. (shown here only 3 fields)

PROGRAM UPDATE_ROUTINE.

TABLES: /BIC/AZTO_PUR200.

Data: BEGIN OF I_TEMPPUR2 OCCURS 0.

INCLUDE STRUCTURE /BIC/CS8ZTO_PUR4.

DATA: TABIX like SY-TABIX.

DATA: Purch_org like /bic/azto_pur200-PURCH_ORG,

Vendor like /bic/azto_pur200-/bic/ztvendor,

Mat_grp like /bic/azto_pur200-/bic/ztmat_grp,

DATA END OF I_TEMPPUR2.

DATA: begin of PUR02_info,

pur_doc like /BIC/AZTO_PUR200-/BIC/ZDOC_NUM,

pur_item like /BIC/AZTO_PUR200-/BIC/ZDOC_ITEM,

Purch_org like /bic/azto_pur200-PURCH_ORG,

Vendor like /bic/azto_pur200-/bic/ztvendor,

Mat_grp like /bic/azto_pur200-/bic/ztmat_grp,

end of PUR02_info.

DATA: IT_ZPUR02 LIkE PUR02_info occurs 0 WITH HEADER LINE.

FIELD-SYMBOLS : <FS_ZPUR02> like I_TEMPPUR2,

<FS_ZPUR02_info> LIKE PUR02_info.

$$ end of global - insert your declaration only before this line -

• The follow definition is new in the BW3.x

$$ begin of routine - insert your code only below this line -

  • fill the internal tables "MONITOR" and/or "MONITOR_RECNO",

  • to make monitor entries

  • field symbol

REFRESH: I_TEMPPUR2, IT_ZPUR02.

CLEAR: I_TEMPPUR2, IT_ZPUR02.

I_TEMPPUR2[] = DATA_PACKAGE[].

SELECT /BIC/ZDOC_NUM

/BIC/ZDOC_item

PURCH_ORG

/bic/ztvendor

/bic/ztmat_grp

FROM /BIC/AZTO_PUR200

INTO TABLE IT_ZPUR02

FOR ALL ENTRIES IN I_TEMPPUR2

WHERE /BIC/ZDOC_NUM = I_TEMPPUR2-/BIC/ZDOC_NUM AND

/BIC/ZDOC_item = I_TEMPPUR2-/BIC/ZDOC_item.

LOOP AT I_TEMPPUR2 ASSIGNING <FS_ZPUR02>.

<FS_ZPUR02>-tabix = sy-tabix.

READ TABLE IT_ZPUR02 assigning <FS_ZPUR02_info> WITH KEY

PUR_DOC = <FS_ZPUR02>-/BIC/ZDOC_NUM

PUR_item = <FS_ZPUR02>-/BIC/ZDOC_item.

IF SY-SUBRC = 0.

<FS_ZPUR02>-PURCH_ORG = <FS_ZPUR02_info>-PURCH_ORG.

<FS_ZPUR02>-Mat_grp = <FS_ZPUR02_info>-Mat_grp.

<FS_ZPUR02>-Vendor = <FS_ZPUR02_info>-Vendor.

endif.

endloop.

sort I_TEMPPUR2 by tabix.

I_TEMPPUR2 , the table which is getting populated perfectly.

How do we proceed next in update routines during assignment to the fields ?

Could you please help us ?

Thanks in Advance.

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