cancel
Showing results for 
Search instead for 
Did you mean: 

Start routine in update rules using field symbols.

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi BW,

I think you defined the internal tables globally. so these data(I_TEMPPUR2)is available for all field wise routines.

You can write a field wise routines to populate the data by reading this internal table for all the new fields in CUBE. Why you are using field symbols.. any specific reason..??

Or simply you can define an internal table same as your ODS1 and pull the entire data into it. Then write field level routines to populate the fields in cube.

OR enhace(by adding the extra fields in cube) to ODS2 datamart infosource. Now these fields will be available in start routine data_package, so you can map directly(But dont generate export data source again, all these added fields will go off).

Hope it Helps

Srini

Former Member
0 Kudos

hi,

you need to write at info object level. you can access the Data Package. still data package structure shows ODS structure means it won't recongnize new fields added in the cube. if you want to add the data for new fields you need to write in the respective Infoobjects routines.

even though it won't give good performence, but we don't have any option do write in Start Routine. <b>In the Start Routine, Data_package will point to ODS not cube</b>.

all the best.

Regards,

Nagesh Ganisetti.