cancel
Showing results for 
Search instead for 
Did you mean: 

Enhancing Datasource of 0Material

Former Member
0 Kudos

I have a requirement to add Batch Number (0BATCH) into Material (0Material) as an attribute of 0Material. Can you please help me out how i can enhance Material Datasource in ECC and populate the batch number.

Thanks in advance.

Harman

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

Follow the steps mentioned in the above thread.

Also Check the below link:

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/302d4b15-5847-2a10-93bb-9c45d9f0...;

Reg

Pra

dennis_scoville4
Active Contributor
0 Kudos

1. Enhance Extraction Structure

2. Implement User Exit in CMOD (EXIT_SAPLRSAP_002)

3. Re-generate DataSource

4. Replicate Datasources in BW

Here's some sample code for the User Exit in CMOD - this gets a custom field off of MARA.


DATA: l_t_mat LIKE biw_mara_s,
      l_tabix LIKE sy-tabix.

CASE i_datasource.

WHEN '0MATERIAL_ATTR'.

  LOOP AT i_t_data INTO l_s_mat.

    l_tabix = sy-tabix.

    CLEAR l_t_data-zzcage.

    SELECT SINGLE
      zzcage
    INTO
      l_t_date-zzcage
    FROM
      mara
    WHERE
      matnr = l_t_mat-matnr.

    MODIFY i_t_data FROM l_t_mat INDEX l_tabix.
    
  ENDLOOP.

ENDCASE.