cancel
Showing results for 
Search instead for 
Did you mean: 

Update Routine

Former Member
0 Kudos

I have an infoobject in my target cube that i have to populate with an attribute of the infoobject in the source cube. However no data is maintained for that attribute in the master data table of the source info object. It is maintained in a seperate table. How do i write a routine to populate the target infoobject from the source info object which is inturn reading the table.

Target Info Object: ZMAT_GRP (ZMAT_GRP is a attribute of ZMATERIAL)

Source Info Object: ZMATERIAL (Master data table/BIC/PZMATERIAL, but no data is maintained for ZMAT_GRP)

Table in which data is maintained for ZMAT_GRP: ZMAT_SUMMARY.

Thanks,

Rashmi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Is the ZMAT_SUMMARY table existing on R/3 side or BW ?

If BW you can have a lookup in start routine or endroutine of your cube to populate the Material group.

select ZMAT_GRP from ZMAT_SUMMARY where MATERIAL EQ ZMATERIAL(of cube).

Answers (1)

Answers (1)

Former Member
0 Kudos

If i understand your requirement correctly you want to write MAT_GRP value from MAT_SUMMARY table by looking at MATERIAL value.

Try below code in your update routine and let me know

DATA: T_ZMAT_SUMMARY TYPE STANDARD TABLE OF ZMAT_SUMMARY WITH HEADERLINE.

DATA: V_ZMAT_SUMMARY LIKE ZMAT_SUMMARY-/BIC/ZMAT_GRP.

CLEAR V_ZMAT_SUMMARY.

READ TABLE T_ZMAT_SUMMARY WITH KEY /BIC/ZMATERIAL = COMM_STRUCTURE-/BIC/ZMATERIAL BINARY SEARCH.

IF SY_SUBRC <>0.
RETURNCODE = 4.
    MONITOR-msgid = 'RSM'.
    MONITOR-msgty = 'W'.
    MONITOR-msgno = '799'.
    MONITOR-msgv1 = 'ZMAT_GRP: MATERIAL GROUP '.
    MONITOR-msgv2 = COMM_STRUCTURE-/BIC/ZMATERIAL.
    MONITOR-msgv3 = ' cannot be found'.
    APPEND MONITOR.
    EXIT.
    ELSE.

RESULT = T_ZMAT_SUMMARY-/BIC/ZMAT_GRP.

I think this should work.

If you have any errors, just let me know.

Cheers

Praveen

Former Member
0 Kudos

Hi Praveen,

How does this change if I am updating this attribute directly from the table by writing a tranfer routine i.e he attribute reading the table for data.

Thanks,

Rashmi

Former Member
0 Kudos

You need to have some sort of KEY field associated with it to read data from ZMAT_SUMMARY table.

How can you read MAT_GRP wihtout any KEY from MAT_SUMMARY ???

Former Member
0 Kudos

The problem is this, the key fileds in the table (MAT_SUMMARY) is the also an attribute of ZMATERIAL but ZMATERIAL itself is not the key and the attribute that i have to populate by the transfer routine is an attribute of ZMATERIAL.

Basically the look up table and the master data tables have different keys.

So how would my transfer routine look like,

Let me know if you would need more information

Thanks,

Rashmi

Former Member
0 Kudos

Can you send me more about what information (fields) you have in ZMAT_SUMMARY table and also your data flow .

you can find my email id in BC.