Skip to Content
author's profile photo Former Member
Former Member

Addding Custom Field

Hi experts,

We are adding few custom fileds ( Z1,Z2) for Material Master data. We want to pull this into BW. Can anyone post the code that we enter in Inculde. I would appreciate if you could also describe the logic behind that code..

Thanks,

DV

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Mar 04, 2007 at 11:23 PM

    hi first you have to make declaration.

    declare the table where you have to fetch data for example

    tables : mara.

    declare the structure for example

    • Declaration for datasource 0MATERIAL_ATTR

    DATA : BEGIN OF S_BIW_MARA_S.

    INCLUDE STRUCTURE BIW_MARA_S.

    DATA : END OF S_BIW_MARA_S.

    *Here BIW_MARA_S corresponds to the structure of your datasource *0MATERIAL_ATTR

    *then you have to declare a when with the datasource on which you want to *populate the appended new fields.

    *for example :

    WHEN '0MATERIAL_ATTR'.

    *then do a loop across your strcuture

    LOOP AT C_T_DATA INTO S_BIW_MARA_S.

    *a select from the table

    SELECT SINGLE * FROM MARA

    WHERE MATNR = S_BIW_MARA_S-MATNR.

    *a check to see if your select is ok

    IF SY-SUBRC = 0.

    *if it is ok then your field in your structure is corresponding to a field in the table

    S_BIW_MARA_S-Z1 = MARA-Z1.

    S_BIW_MARA_S-Z2 = MARA-Z2.

    *the c_t_data will be updated from what you get in your structure.

    MODIFY C_T_DATA FROM S_BIW_MARA_S.

    ENDIF.

    ENDLOOP.

    You can optimise of course this code. I would recommend you to ask the support of an abap consultant in your project.

    hope this could help you.

    regards

    Boujema

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.