cancel
Showing results for 
Search instead for 
Did you mean: 

Enhancing 0MATERIAL_ATTR

Former Member
0 Kudos

Hi All,

We have a new database view "ZPPV_MARASPEKOZ" which reads data from "MARA" and "ZPP_OBE_SPEK" tables with 6 key fields "MANDT", "ZFIRMA", "ZSPEK", "ZOBESAYAC", "ZREVIZYON", "ZMTIP" on R/3 side. What I need is to add some of the fields from ZPPV_MARASPEKOZ  to data source of 0MATERIAL's attributes 0MATERIAL_ATTR. Required fields are "ZURUNTIPI","ZKALINLIK", "znomboy", "znomen", "ZBASKITUR", "ZBOMBETUR", "ZOTOCAMTIP".

Does anyone have any idea

Oya.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

1. Goto RSA6

2. Find 0material_attr data source and click on the 'Enhance extraction structure' button in the tool bar...

3. Create an append structure and add the required fields

4. Activate the structure

5. Create a customer exit code to populate the values for these fields

sample code :

CASE I_DATASOURCE.

  WHEN '0MATERIAL_ATTR'.

    LOOP AT I_T_DATA INTO L_S_MARA.

      L_TABIX = SY-TABIX.

      SELECT SINGLE * FROM MARA WHERE MATNR = L_S_MARA-MATNR.

          IF SY-SUBRC = 0.

             L_S_MARA-ZZETXT   =    MARA-ZZETXT.

             L_S_MARA-ZZVWBR   =    MARA-ZZVWBR.

             L_S_MARA-ZZWVB    =    MARA-ZZWVB.

             L_S_MARA-ZZNTNR   =    MARA-ZZNTNR.

             L_S_MARA-ZZATNR   =    MARA-ZZATNR.

             L_S_MARA-ZZOTNR   =    MARA-ZZOTNR.

             L_S_MARA-ZZNTQM   =    MARA-ZZNTQM.

             L_S_MARA-ZZOPGR   =    MARA-ZZOPGR.

             MODIFY I_T_DATA FROM L_S_MARA INDEX L_TABIX.

          ENDIF.

     ENDLOOP.

ENDCASE.

i.e. this code is not optimized for performance please get help of an abaper for optimizing this code...

Hope you have already have CMOD project where you can write the code...

If not follow the below steps

1. Goto CMOD

2.create a project by selecting  Enhancement assigment radio button and save it

3.  Give the enhancement name as RSAP0001 save and go back

4. click components

5. click exitsaplrsap_002 in case of master data and write the above code...

Hope this helps you...

Thanks,

Nithesh.

Answers (2)

Answers (2)

Former Member
0 Kudos

This message was moderated.

yasemin_kilinc
Active Contributor
0 Kudos

Hi Oya,

I think you have two options. One option is you can create a new datasource using your view, and upload your master data material (just as 0employee, an infoobject may be uploaded from many datasources). The other option is enhancing the datasource 0material_attr. You can add the required code in customer exit in R/3. What I suggest is the first option.

Hope it helps

Yasemin...

Former Member
0 Kudos

Hi Yasemin,

Thanks for your kind reply. We don't want to create a new data source, we want to use standard data source, so user exit is the only option. What I have to learn is how to write this code.

Oya.

Former Member
0 Kudos

Hi Oya,

For user exit in cmod,

select required fields from MARA and ZPP_OBE_SPEK tables in the internal table where condition for selection is as per your key in view.

now update 0MATERIAL_ATTR with those fields from that interal table with key as a material.

Regards

Sunil

yasemin_kilinc
Active Contributor
0 Kudos

Hi Oya,

There are many how to enhance a datasource documents in sdn, you may search as well. One is in the link below, if you face any trouble let us know.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00c1f726-1dc2-2c10-f891-ddfbffdb1...

Hope it helps

Yasemin...