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

Guidance for uploading material master data

Hi,

I need guidance to fetch following Material master data from the system.Please guide me for the same.

>BASIC DATA1

>BASIC DATA2

>MRP1,2,3,4

>WORK SCHEDULING

>QUALITY MANAGEMENT

>ACCOUNTING1

>ACCOUNTING2

>COSTING1,2

>PURCHASING

>PURCHASE ORDER TEXTSALES ORG1,2

>SALES GENERAL/PLANT

>PLANT DATA/STOR.1,2

>WAREHOUSE MGMNT1,2

Also please tell me in general what is the reason for error while uploading the data into system using BAPi(AM talking about return message error).

Thank you.

Edited by: sanu debu on Feb 24, 2009 10:19 AM

Edited by: sanu debu on Feb 24, 2009 10:20 AM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Feb 24, 2009 at 09:32 AM

    Hi Sanu,

    You can use bapi 'BAPI_MATERIAL_SAVEREPLICA'. I have used it 3 times earlier and it works correctly.

    LOOP AT it_mat_data INTO lwa_mat_data.

    MOVE lwa_mat_data TO wa_mat_data.

    *Populate header data

    wa_bapie1matheader-function = c_ins.

    wa_bapie1matheader-material = wa_mat_data-material.

    wa_bapie1matheader-ind_sector = c_m.

    wa_bapie1matheader-matl_type = c_ersa.

    wa_bapie1matheader-basic_view = c_x.

    wa_bapie1matheader-purchase_view = c_x.

    wa_bapie1matheader-account_view = c_x.

    APPEND wa_bapie1matheader TO it_bapie1matheader.

    *Populate MARA data to BAPIE1MARA

    wa_bapie1mara-function = c_ins.

    wa_bapie1mara-material = wa_mat_data-material.

    wa_bapie1mara-base_uom = wa_mat_data-base_uom.

    wa_bapie1mara-base_uom_iso = wa_mat_data-base_uom.

    wa_bapie1mara-matl_group = wa_mat_data-matl_group.

    APPEND wa_bapie1mara TO it_bapie1mara.

    *Populate MARA data to BAPIE1MARAX

    wa_bapie1marax-function = 'INS'.

    wa_bapie1marax-material = wa_mat_data-material.

    wa_bapie1marax-base_uom = c_x.

    wa_bapie1marax-base_uom_iso = c_x.

    wa_bapie1marax-matl_group = c_x.

    APPEND wa_bapie1marax TO it_bapie1marax.

    **Populate MARC data to BAPIE1MARC

    wa_bapie1marc-function = c_ins.

    wa_bapie1marc-material = wa_mat_data-material.

    wa_bapie1marc-plant = wa_mat_data-plant.

    wa_bapie1marc-pur_group = c_001.

    APPEND wa_bapie1marc TO it_bapie1marc.

    *

    **Populate MARC data to BAPIE1MARCX

    wa_bapie1marcx-function = c_ins.

    wa_bapie1marcx-material = wa_mat_data-material.

    wa_bapie1marcx-plant = wa_mat_data-plant.

    wa_bapie1marcx-pur_group = c_x.

    APPEND wa_bapie1marcx TO it_bapie1marcx.

    *Populate MAKT data to BAPIE1MAKT

    SELECT SINGLE matnr

    maktx

    INTO ws_makt

    FROM makt

    WHERE matnr EQ wa_mat_data-material

    AND spras EQ 'EN'.

    IF sy-subrc EQ 0.

    ELSE.

    wa_bapie1makt-function = c_ins.

    wa_bapie1makt-material = wa_mat_data-material.

    wa_bapie1makt-langu = c_e.

    wa_bapie1makt-langu_iso = c_en.

    wa_bapie1makt-matl_desc = wa_mat_data-matl_desc.

    APPEND wa_bapie1makt TO it_bapie1makt.

    ENDIF.

    **Populate MBEW data to BAPIE1MBEW

    wa_bapie1mbew-function = c_ins.

    wa_bapie1mbew-material = wa_mat_data-material.

    wa_bapie1mbew-val_area = wa_mat_data-plant.

    wa_bapie1mbew-moving_pr = wa_mat_data-moving_pr.

    wa_bapie1mbew-mov_pr_pp = wa_mat_data-moving_pr.

    APPEND wa_bapie1mbew TO it_bapie1mbew.

    *Populate MBEW data to BAPIE1MBEWX

    wa_bapie1mbewx-function = c_ins.

    wa_bapie1mbewx-material = wa_mat_data-material.

    wa_bapie1mbewx-val_area = wa_mat_data-plant.

    wa_bapie1mbewx-moving_pr = c_x.

    wa_bapie1mbewx-mov_pr_pp = c_x.

    APPEND wa_bapie1mbewx TO it_bapie1mbewx.

    CALL FUNCTION 'BAPI_MATERIAL_SAVEREPLICA'

    EXPORTING

    noappllog = c_x

    nochangedoc = c_x

    testrun = ' '

    inpfldcheck = ' '

    TABLES

    headdata = it_bapie1matheader

    clientdata = it_bapie1mara

    clientdatax = it_bapie1marax

    plantdata = it_bapie1marc

    plantdatax = it_bapie1marcx

    valuationdata = it_bapie1mbew

    valuationdatax = it_bapie1mbewx

    materialdescription = it_bapie1makt

    returnmessages = it_return.

    IF sy-subrc EQ 0.

    READ TABLE it_return INTO wa_return WITH KEY type = c_e.

    IF sy-subrc NE 0.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    EXPORTING

    wait = 'X'

    • IMPORTING

    • RETURN =

    .

    REFRESH : it_return,

    it_bapie1matheader ,

    it_bapie1mara ,

    it_bapie1marax ,

    it_bapie1marc ,

    it_bapie1marcx .

    ELSE.

    LOOP AT it_return INTO wa_return WHERE type EQ 'E'.

    v_error_desc = wa_return-message.

    PERFORM log_error USING v_error_id v_file_id v_rec_id v_error_desc.

    ENDLOOP.

    ENDIF.

    ENDIF.

    CLEAR wa_mat_data.

    REFRESH it_return.

    ENDLOOP.

    Let me know if you need any more informtaion.

    Regrads,

    Anil

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 24, 2009 at 09:23 AM

    BAPI_MATERIAL_GETALL

    BAPI_MATERIAL_DISPLAY

    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.