To change material using BAPI

Hi All,
We are using BAPI_MATERIAL_SAVEDATA to change a material. But end user is not having the authorization to modify using this bapi. because this BAPI is used for both creation and for changing so it is checking creation object Authorization and  it is failing.
Kindly suggest me some other BAPI to Change the material to avoid the above problem.

try these..
/SAPMP/BAPI_MATERIAL_SAVEDATA  Mill Products: Create and Change Material Master
BAPI_MATERIAL_MAINTAINDATA_RT  Create and change material master data (retail)
BAPI_MATERIAL_EDIT             Change Material

Similar Messages

  • Create material using bapi ' bapi_material_savedata'

    Hi Experts,
    i was tring to create material using bapi ' bapi_material_savedata' but the material is not updating in the table.
    please find the code and suggest me if any modification
    data: la_headdata type BAPIMATHEAD,
    la_clientdata type BAPI_MARA,
    la_CLIENTDATAX type BAPI_MARAX,
    la_return type BAPIRET2.
    data: i_materialdescription type table of BAPI_MAKT,
    wa_materialdescription like line of i_materialdescription.
    *la_headdata-MATERIAL = int_matnum-MATERIAL.
    *LOOP AT int_matnum.
    la_headdata-MATERIAL = int_matnum-MATERIAL.
    write : int_matnum-material.
    *ENDLOOP.
    la_headdata-MATERIAL = '100000518'."int_matnum-MATERIAL.
    la_headdata-IND_SECTOR = p_indsr.
    la_headdata-MATL_TYPE = p_matype.
    la_clientdata-BASE_UOM = 'FT3'.
    la_clientdata-pur_valkey = ' '.
    la_CLIENTDATAX-BASE_UOM = 'X'.
    la_clientdata-MATL_GROUP = '01'.
    la_CLIENTDATAX-MATL_GROUP = 'X'.
    wa_materialdescription = 'TEST'.
    append wa_materialdescription to i_materialdescription.
    clear: wa_materialdescription.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
    EXPORTING
    headdata = la_headdata
    CLIENTDATA = la_clientdata
    CLIENTDATAX = la_CLIENTDATAX
    PLANTDATA =
    PLANTDATAX =
    FORECASTPARAMETERS =
    FORECASTPARAMETERSX =
    PLANNINGDATA =
    PLANNINGDATAX =
    STORAGELOCATIONDATA =
    STORAGELOCATIONDATAX =
    VALUATIONDATA =
    VALUATIONDATAX =
    WAREHOUSENUMBERDATA =
    WAREHOUSENUMBERDATAX =
    SALESDATA =
    SALESDATAX =
    STORAGETYPEDATA =
    STORAGETYPEDATAX =
    FLAG_ONLINE = ' '
    FLAG_CAD_CALL = ' '
    IMPORTING
    RETURN = la_return
    TABLES
    MATERIALDESCRIPTION = i_materialdescription
    UNITSOFMEASURE =
    UNITSOFMEASUREX =
    INTERNATIONALARTNOS =
    MATERIALLONGTEXT =
    TAXCLASSIFICATIONS =
    RETURNMESSAGES =
    PRTDATA =
    PRTDATAX =
    EXTENSIONIN =
    EXTENSIONINX =
    Please Help me
    Regards,
    Naresh

    Hi all,
    Now it is asking me for the other fields,
    E ,
    The field MARA-XCHPF/BAPI_MARA-BATCH_MGMT is defined as a required field; it does not contain an entry
    i have passed this val as
    la_clientdata-batch_mgmt = 'X'.
    even though i am getting the same error.
    can you help me to solve the issue.
    Tthanks
    Naresh
    Edited by: naresh.k.dasari on Jan 4, 2011 10:36 AM

  • Creating Material Using BAPI

    Hi Friends,
    I want to create a material using BAPI, can anyone give me some sample program or can any one give me links which earlier posted this problem.
    Points for sure for sample program.
    thanks and regards
    Vijaya

    hi
    good
    go through this REPORT z_bapi_salesorder_create.
    Parameters
    Sales document type
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Sales organization
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Distribution channel
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Division.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Sold-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Ship-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Material
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Quantity.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Plant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    Initialization.
    INITIALIZATION.
    v_text   = 'Order type'.
    v_text1  = 'Sales Org'.
    v_text2  = 'Distribution channel'.
    v_text3  = 'Division'.
    v_text4  = 'Sold-to'.
    v_text5  = 'Ship-to'.
    v_text6  = 'Material'.
    v_text7  = 'Quantity'.
    v_text9  = 'Plant'.
    Start-of-selection.
    START-OF-SELECTION.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
           EXPORTING
                sales_header_in     = header
                sales_header_inx    = headerx
           IMPORTING
                salesdocument_ex    = v_vbeln
           TABLES
                return              = return
                sales_items_in      = item
                sales_items_inx     = itemx
                sales_schedules_in  = lt_schedules_in
                sales_schedules_inx = lt_schedules_inx
                sales_partners      = partner.
    Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
      ELSE.
    Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.
    thanks
    mrutyun^

  • Updating a child of a BOM material using bapi sales order change

    Hi, Appreciate your thoughts on the following issue..
    We have a batch program which uses a bapi sales order change and updates the plant at the line items of the sales order. when this plant is assigned.. if any of the line item is a BOM item, it explodes and the data from the parent ( like payment terms, fixed val date ) should get copied to the child items same as the parent. This is happening fine if manual mode using va01 and va02 but when plant is updated using bapi the childs are not getting the data from the parent ( which comes through config )...
    Appreciate your inputs and any additional information to be passed to the bapi for the BOM materials to get the same config data as parent to the child when exploded...
    Thanks and will reward helpful answers..

    Hi, Appreciate your thoughts on the following issue..
    We have a batch program which uses a bapi sales order change and updates the plant at the line items of the sales order. when this plant is assigned.. if any of the line item is a BOM item, it explodes and the data from the parent ( like payment terms, fixed val date ) should get copied to the child items same as the parent. This is happening fine if manual mode using va01 and va02 but when plant is updated using bapi the childs are not getting the data from the parent ( which comes through config )...
    Appreciate your inputs and any additional information to be passed to the bapi for the BOM materials to get the same config data as parent to the child when exploded...
    Thanks and will reward helpful answers..

  • Change Material using IDOC_INPUT_MATMAS01

    Hi all,
    we have some custom tables and these tables contains material related data. by reading data from these tables
    i am creating material using function moudule INBOUND_IDOC_PROCESS .once after material creation i am updating all custom tables with newly created material.
    its working fine.
    later,if i change data in custom tables i must also change the material master using idoc functions
    for this i am using function IDOC_INPUT_MATMAS01.
    but its not working...
    is anyone worked with this kind of requirement..?
    if so, plz respond to this asap.
    Thanks in advance.

    Thanks to quick reply.
    here is small exaple.
    i created material using FM INBOUND_IDOC_PROCESS
    this material has sales text which i am reading from my custom table and populating to E1MTXHM and E1MTXLM segments.
    And now, once after material creation if someone change sales text data in my custom table. i have to update this based on some checks.
    i am reading the changed data into the same segments and
    this time i am changing MSGFN = '004'. and calling IDOC_INPUT_MATMAS01 FM to update.
    But its not.
    [i can't use BAPI as i am using extended Idoc]

  • Creation of material using BAPI in LSMW without using material no.

    Hi SAP Gurus,
    I have a requirement of creating materials using the BAPI in LSMW.
    I tried to create a material using the BAPI (Business Object - BUS1001006 , and method - SAVEDATA) which should be created internally, but it is asking the material number to be given externally and my configuration is setup to create the material number internally.
    Even I looked into the material type which is associated with the number range and everything looks good.
    Is there any solution to create the material by using BAPI in LSMW without passing the material no. externally ?
    Appreciate your help.
    Kalikonda.

    Hi,
    it looks like it's not possible to call this BAPI wihtout material number. Here is a quote from BAPI documentation.
    When creating material master data, you must transfer the material
    number, the material type, and the industry sector to the method. You
    must also enter a material description and its language.
    Cheers

  • Posting an accounting document with material using BAPI (ver 4.6c)

    Hello!
    Can anyone help me out with this one please?
    I need to post an accounting document using BAPI.  Since the customer's SAP is 4.6c, the BAPI I found closest is BAPI_ACC_GL_POSTING_POST.
    The posting has 2 specific requirements:
    1.  For the Vendor item, the tax needs to be calculated; and
    2.  For the G/L items, the corresponding material/quantity needs to be entered
    So, my questions are:
    1.  How do you enable the "Calculate Tax" option, which is the Calculate Tax checkbox in F-02?
    2.  How do you enter the material and quantity for the G/L items?
    Thanks a lot!

    Hi,
    Before posting your document please check first whether this is reversal or not.
    please use BAPI_ACC_DOCUMENT_REV_CHECK to check reversal document
    Have a Nice Day,
    Regards,
    Sujeet

  • Problem in changing PR using BAPI With Error User already processing  PR

    Hello Experts,
                          When i am using BAPI_PR_CHANGE,  to change PR . Since i have many number of PRs to be changed in , i am running the program in background . Issue now is that i am getting already PR is been changed (processed) by User(myself), so changes cannot be made and stooping the process of change. I am using  BAPI_TRANSACTION_COMMIT with WAIT also. but i coukd not change the PR in background. How can i over come this problem? How the lock entries shall be removed fast so that next PR is changed.
    Please help me out experts.
    Thanks in advance

    Hi,
    What you can do is through yur program ENQUEUE the pr then used bapi (along with commit)and then DEQUEUE the PR.
    This way yur locking problem will not come.
    Hope it helps.
    Regards
    Hiren K.Chitalia

  • How to create material using BAPI  Methods?

    hi,
    how to create material master dat using BAPI?
    could u guide me
    i will be waiting for reply.
    REGARDS
    ESWAR.

    Hi eswar,
    Try this code to create gods mmovement...
    DATA: GOODSMVT_HEADER LIKE BAPI2017_GM_HEAD_01,
          " Material Document Header Data
          GOODSMVT_CODE LIKE BAPI2017_GM_CODE,
          " Assign code to transaction for BAPI goods movement
          MATERIALDOCUMENT LIKE BAPI2017_GM_HEAD_RET-MAT_DOC,
          " Number of Material Document
          GOODSMVT_ITEM LIKE BAPI2017_GM_ITEM_CREATE OCCURS 0 WITH HEADER
          LINE,
          " Create Material Document Item
          RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE
          " Return table for messages
    *Fill values in header
    GOODSMVT_HEADER-PSTNG_DATE = '20030825'.
    GOODSMVT_HEADER-DOC_DATE = '20030802'.
    *Fill GOODSMVT_CODE
    GOODSMVT_CODE-GM_CODE = '05' .
    *Fill Item Table
    GOODSMVT_ITEM-MATERIAL = '100-100'.
    GOODSMVT_ITEM-PLANT = '1000'.
    GOODSMVT_ITEM-STGE_LOC = '0001'.
    GOODSMVT_ITEM-MOVE_TYPE = '501'.
    GOODSMVT_ITEM-ENTRY_QNT = '50'.
    GOODSMVT_ITEM-ITEM_TEXT = 'Test Sanket'.
    *GOODSMVT_ITEM-COSTCENTER = '1000'.
    APPEND GOODSMVT_ITEM.
    *Create Good's movement
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
      EXPORTING
        GOODSMVT_HEADER  = GOODSMVT_HEADER
        GOODSMVT_CODE    = GOODSMVT_CODE
      IMPORTING
        MATERIALDOCUMENT = MATERIALDOCUMENT
      TABLES
        GOODSMVT_ITEM    = GOODSMVT_ITEM
        RETURN           = RETURN.
    *Commit BAPI
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        WAIT = 'X'.
    *Display Goods movement number
    FORMAT COLOR 6 INVERSE ON.
    READ TABLE RETURN WITH KEY TYPE = 'E'.
    IF SY-SUBRC = 0.
      WRITE: /,'ERROR! Goods movement not created'.
    ELSE.
      WRITE: /,'Goods movent number',MATERIALDOCUMENT COLOR 5,
               'posted for material',GOODSMVT_ITEM-MATERIAL.
    ENDIF.
    FORMAT COLOR OFF INVERSE OFF.
    try this on report program and create a goods movement.
    Sanket.

  • Sales order for variant material using BAPI "BAPI_SALESORDER_CREATEFROMDAT2

    Hi,
    I am using BAPI "BAPI_SALESORDER_CREATEFROMDAT2" for creating salesorder for variant configuration material. I am able to create a salesorder when have only one variant material, However when i have more than one variant material getting errors. Can some one tell me how to fill the material data in the config tables provided in the BAPI.
    Thanks.

    Hai Vinit
    Check the following Code & also Check the following Standard Programs
    L2032U12
    LCRMAU01
    LCRMAU11
    LZOC1U01
    MWWMJF32
    RBUS2032
    Structures for order header
    DATA: l_order_header_in    LIKE bapisdhd1,
          l_order_header_inx   LIKE bapisdhd1x,
    Tables for order items
          li_order_items_in    TYPE STANDARD TABLE OF bapisditm,
          li_order_items_inx   TYPE STANDARD TABLE OF bapisditmx,
    Order partners
          li_order_partners    TYPE STANDARD TABLE OF bapiparnr,
    *Schedule lines
          li_ORDER_SCHEDULES_IN  TYPE STANDARD TABLE OF BAPISCHDL,
          li_ORDER_SCHEDULES_INX  TYPE STANDARD TABLE OF BAPISCHDLX,
    *-condition type
          li_ORDER_CONDITIONS_IN   TYPE  STANDARD TABLE OF BAPICOND,
          li_ORDER_CONDITIONS_INX   TYPE  STANDARD TABLE OF BAPICONDX,
    Return table from bapi call
          li_return TYPE STANDARD TABLE OF bapiret2,
    Sales document number
          l_vbeln LIKE bapivbeln-vbeln,
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    EXPORTING
    order_header_in  = l_order_header_in
    order_header_inx = l_order_header_inx
               testrun          = 'X'
    IMPORTING
    salesdocument    = l_vbeln
    TABLES
    return           = li_return
    order_items_in   = li_order_items_in
    order_items_inx  = li_order_items_inx
    order_partners   = li_order_partners
    ORDER_SCHEDULES_IN = li_ORDER_SCHEDULES_IN
    ORDER_SCHEDULES_INX = li_ORDER_SCHEDULES_INX
    ORDER_CONDITIONS_IN = li_ORDER_CONDITIONS_IN
    ORDER_CONDITIONS_INX = li_ORDER_CONDITIONS_INX.
    Thanks & Regards
    Sreenivasulu P

  • Deleting material using BAPI

    Hi Guys,
    I'm trying to delete a material, using BAPI_MATERIAL_SAVEDATA. The inputs i gave are the material number(Under Headdata Structure) and the Deletion Flag field as "X" (under ClientData structure). I'm also commiting the transaction..
    But my material in SAP doesn't show a deletion flag to be set.
    The doubt i have is, am i missing someother important field to do this??
    Pls help me on this guys
    Thanks
    Varun

    The field MANUF_PROF was mandatory

  • Fasing some problem in Material using BAPI..?

    Hi... Guru's..
    thanks in advance and will give full points...
    I am creating material master using the BAPI and the data is in presentation server....
    this is is the error message i am getting while control ebterinng into CALL BAPI(FM)....
    Key fields for use data PLANTDATA and checkbox structure PLANTDATAX are different
    please look into the program and and let me know if any chenges required...
    i am able get the data from presentation layer and i am able to move field values from internal table to BAPI fields and values are populating properly....
    while entering control into BAPI ..i am getting the above error..(error message ....i found in debugging mode...)
    TYPE      :  E
    ID            : MM
    NUMBER : 360
    MESSAG :Key fields for use data PLANTDATA and checkbox structure PLANTDATAX are different
    LOG_NO                                       
    LOG_MSG_NO : 000000
    MESSAGE_V1 : PLANTDATA
    MESSAGE_V2 : PLANTDATAX
    MESSAGE_V3                                       
    MESSAGE_V4                                       
    PARAMETER                                       
    ROW                                             0
    FIELD                                       
    SYSTEM                                             
    Program logic:
    DATA:gs_bapimathead          TYPE bapimathead,
         gs_clientdata           TYPE bapi_mara,
         gs_clientdatax          TYPE bapi_marax,
         gs_plantdata            TYPE bapi_marc,
         gs_plantdatax           TYPE bapi_marcx,
         gs_forecastparameters   TYPE bapi_mpop,
         gs_forecastparametersx  TYPE bapi_mpopx,
         gs_valuationdata        TYPE bapi_mbew,
         gs_valuationdatax       TYPE bapi_mbewx,
         gs_salesdata            TYPE bapi_mvke,
         gs_salesdatax           TYPE bapi_mvkex,
         gs_storagelocationdata  TYPE bapi_mard,
         gs_storagelocationdatax TYPE bapi_mardx,
         gt_materialdescription  TYPE STANDARD TABLE OF bapi_makt,
         gwa_materialdescription TYPE bapi_makt,
         gt_taxclassifications   TYPE STANDARD TABLE OF bapi_mlan,
         gwa_taxclassifications  TYPE bapi_mlan,
         gt_prtdata              TYPE STANDARD TABLE OF bapi_mfhm,
         gwa_prtdata             TYPE bapi_mfhm,
         gt_prtdatax             TYPE STANDARD TABLE OF bapi_mfhmx,
         gwa_prtdatax            TYPE bapi_mfhmx,
         gt_unitsofmeasure       TYPE STANDARD TABLE OF bapi_marm,
         gwa_unitsofmeasure      TYPE bapi_marm,
         gt_unitsofmeasurex      TYPE STANDARD TABLE OF bapi_marmx,
         gwa_unitsofmeasurex     TYPE bapi_marmx,
         gs_return               TYPE bapiret2.
    TYPES:BEGIN OF gty_itab1,
             matnr(18),
             mbrsh(1),
             mtart(4),
             werks(4),
             lgort(4),
             vkorg(4),
             vtweg(2),
             maktx(40),
             meins(3),
             matkl(9),
             spart(2),
             brgew(13),
             ntgew(13),
             gewei(3),
             dwerk(4),
             taxkm(1),
             kondm(2),
             ktgrm(2),
             mtpos(4),
             tragr(4),
             ladgr(4),
             disgr(4),
             dismm(2),
             dispo(3),
             beskz(1),
             mtvfp(2),
             prmod(1),
             planv(3),
             bklas(4),
             vprsv(1),
             peinh(5),
             stprs(11),
          END OF gty_itab1.
    DATA:gt_itab1 TYPE STANDARD TABLE OF gty_itab1,
         gwa_itab1 TYPE gty_itab1.
    TYPES:BEGIN OF gty_itab2,
          abc(1000),
    END OF gty_itab2.
    DATA:gt_itab2 TYPE STANDARD TABLE OF gty_itab2,
         gwa_itab2 TYPE gty_itab2.
    PARAMETERS:p_files TYPE string.
    START-OF-SELECTION.
      CALL METHOD cl_gui_frontend_services=>gui_upload
        EXPORTING
          filename = p_files
          filetype = 'ASC'
        CHANGING
          data_tab = gt_itab2
        EXCEPTIONS
          OTHERS   = 8.
      LOOP AT gt_itab2 INTO gwa_itab2.
        gwa_itab1 = gwa_itab2-abc(1000).
        APPEND gwa_itab1 TO gt_itab1.
      ENDLOOP.
      LOOP AT gt_itab1 INTO gwa_itab1.
        gs_bapimathead-material                      = gwa_itab1-matnr.
        gs_bapimathead-ind_sector                    = gwa_itab1-mbrsh.
        gs_bapimathead-matl_type                     = gwa_itab1-mtart.
        gs_plantdata-plant                           = gwa_itab1-werks.
        gs_plantdatax-plant                          = 'X'.
        gs_salesdata-sales_org                       = gwa_itab1-vkorg.
        gs_salesdatax-sales_org                      = 'X'.
        gs_salesdata-distr_chan                      = gwa_itab1-vtweg.
        gs_salesdatax-distr_chan                     = 'X'.
        gs_salesdata-mat_pr_grp                      = gwa_itab1-kondm.
        gs_salesdatax-mat_pr_grp                     = 'X'.
        gs_salesdata-acct_assgt                      = gwa_itab1-ktgrm.
        gs_salesdatax-acct_assgt                     = 'X'.
        gs_salesdata-delyg_plnt                      = gwa_itab1-dwerk.
        gs_salesdatax-delyg_plnt                     = 'X'.
        gs_clientdata-base_uom                       = gwa_itab1-meins.
        gs_clientdatax-base_uom                      = 'X'.
        gs_clientdata-trans_grp                      = gwa_itab1-tragr.
        gs_clientdatax-trans_grp                     = 'X'.
        gs_clientdata-matl_group                     = gwa_itab1-matkl.
        gs_clientdatax-matl_group                    = 'X'.
        gs_clientdata-division                       = gwa_itab1-spart.
        gs_clientdatax-division                      = 'X'.
        gs_clientdata-net_weight                     = gwa_itab1-ntgew.
        gs_clientdatax-net_weight                    = 'X'.
        gs_clientdata-unit_of_wt                     = gwa_itab1-gewei.
        gs_clientdatax-unit_of_wt                    = 'X'.
        gs_plantdata-loadinggrp                      = gwa_itab1-ladgr.
        gs_plantdatax-loadinggrp                     = 'X'.
        gs_plantdata-mrp_type                        = gwa_itab1-dismm.
        gs_plantdatax-mrp_type                       = 'X'.
        gs_plantdata-availcheck                      = gwa_itab1-mtvfp.
        gs_plantdatax-availcheck                     = 'X'.
        gs_plantdata-mrp_group                       = gwa_itab1-disgr.
        gs_plantdatax-mrp_group                      = 'X'.
        gs_plantdata-mrp_ctrler                      = gwa_itab1-dispo.
        gs_plantdatax-mrp_ctrler                     = 'X'.
        gs_plantdata-proc_type                       = gwa_itab1-beskz.
        gs_plantdatax-proc_type                      = 'X'.
        gs_forecastparameters-fore_model             = gwa_itab1-prmod.
        gs_forecastparametersx-fore_model            = 'X'.
        gs_valuationdata-val_class                   = gwa_itab1-bklas.
        gs_valuationdatax-val_class                  = 'X'.
        gs_valuationdata-std_price                   = gwa_itab1-stprs.
        gs_valuationdatax-std_price                  = 'X'.
        gs_valuationdata-price_ctrl                  = gwa_itab1-vprsv.
        gs_valuationdatax-price_ctrl                 = 'X'.
        gs_valuationdata-price_unit                  = gwa_itab1-peinh.
        gs_valuationdatax-price_unit                 = 'X'.
        gs_storagelocationdata-stge_loc              = gwa_itab1-lgort.
        gs_storagelocationdatax-stge_loc             = 'X'.
        gwa_materialdescription-langu                = 'E'.
        gwa_materialdescription-matl_desc            = gwa_itab1-maktx.
        gwa_taxclassifications-taxclass_1            = gwa_itab1-taxkm.
        gwa_prtdata-prt_usage                        = gwa_itab1-planv.
        gwa_prtdatax-prt_usage                       = 'X'.
        gwa_unitsofmeasure-gross_wt                  = gwa_itab1-brgew.
        gwa_unitsofmeasurex-gross_wt                  = 'X'.
        APPEND gwa_materialdescription    TO gt_materialdescription.
        APPEND gwa_taxclassifications     TO gt_taxclassifications.
        APPEND gwa_prtdata                TO gt_prtdata.
        APPEND gwa_prtdatax               TO gt_prtdatax.
        APPEND gwa_unitsofmeasure         TO gt_unitsofmeasure.
        APPEND gwa_unitsofmeasurex        TO gt_unitsofmeasurex.
        CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
          EXPORTING
            headdata            = gs_bapimathead
            clientdata          = gs_clientdata
            clientdatax         = gs_clientdatax
            plantdata           = gs_plantdata
            plantdatax          = gs_plantdatax
            forecastparameters  = gs_forecastparameters
            forecastparametersx = gs_forecastparametersx
            valuationdata       = gs_valuationdata
            valuationdatax      = gs_valuationdatax
            salesdata           = gs_salesdata
            salesdatax          = gs_salesdatax
          IMPORTING
            return              = gs_return
          TABLES
            materialdescription = gt_materialdescription
            unitsofmeasure      = gt_unitsofmeasure
            unitsofmeasurex     = gt_unitsofmeasurex
            taxclassifications  = gt_taxclassifications
            prtdata             = gt_prtdata
            prtdatax            = gt_prtdatax.
    Check the return table.
        IF sy-subrc NE 0.
          CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
          WRITE: / 'Error occured while creating material'.
        ELSE.
          CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
          WRITE: / 'material',gwa_itab1-matnr,'created'.
        ENDIF.
      ENDLOOP.

    Hello,
    Unfortunately SAP does not support any BAPI's to change customer/vendor master data.
    The BAPI's were developed from different applications and were designed for their special needs.
    You can see the existing BAPIs via tranx BAPI.
    Please have a look at the SAP notes 390045 and 384462 which should
    explain the proceeding. If you want to use Batch Input, please also have a look at SAP note 306275.
    Another possibility is to use Trx XD99, object KNA1, Trx XK99, object LFA1.
    Regards,
    David

  • Change material using BAPI_CUSTOMERQUOTATION_CHANGE

    hi i want to change meterial from exsisting quotation. i.e. i am replacing lineitems 10 material A to B.
    when i am using manuly ,i mean direct run it is working fine. but when i am using to another bapi it is giving error.. that meterial is not defined for plant 2500"
    but directly it is updating.
    my code is
         I_HEADER1X-UPDATEFLAG = 'U'.
          I_HEADER1-QT_VALID_F = V_ANGDT.
          I_HEADER1-QT_VALID_T = SY-DATUM + 90.
          I_HEADER1X-QT_VALID_F = 'X'.
          I_HEADER1X-QT_VALID_T = 'X'.
          WA_ITEM-ITM_NUMBER = WA_VBAP1-POSNR.
          WA_ITEM-MATERIAL   =  MATERIAL_T.
          APPEND WA_ITEM TO I_ITEM.
          CLEAR WA_ITEM.
          WA_ITEMX-ITM_NUMBER = WA_VBAP1-POSNR.
          WA_ITEMX-UPDATEFLAG = 'U'.
          WA_ITEMX-MATERIAL  = 'X'.
          APPEND WA_ITEMX TO I_ITEMX.
          CLEAR WA_ITEMX.
      I_SWITCH-SCHEDULING = 'X'.
    CALL FUNCTION 'BAPI_CUSTOMERQUOTATION_CHANGE'
      EXPORTING
        SALESDOCUMENT                = V_VBELN
        QUOTATION_HEADER_IN          = I_HEADER1
        QUOTATION_HEADER_INX         = I_HEADER1X
       LOGIC_SWITCH                 =   I_SWITCH
      TABLES
        RETURN                       = RETURN
        QUOTATION_ITEM_IN            = I_ITEM
        QUOTATION_ITEM_INX           = I_ITEMX

    Directly i have try many times it is updating.  i have alrready use without i_switch..Please reply ASAP

  • Changing TL using BAPI

    Hi,
    we are using this BAPI --- BAPI_TRLSRVAPS_SAVEMULTI to change the existing transportation lane. we want to change the procuement priority to an earlier date.
    Can you inform if its possible even when there are orders referencing it. what is the procedure, inputs etc.
    Regards,
    Sireesh

    Hi,
    Thanks for the info. I need some more help on this problem.
    We have program written which uses this BAPI to align the Transportation lanes with R/3. The source of supply for a product is extented backwards ( i.e from 1.09.2009 to  01.03.2009) so the program has to change the validity of the Transportation lane accordingly, which is not happening.
    There are two tables  prod_procurement  &  prod_procurementx which are responsible for this. I need info on what should be the input to this tables so that it will change the existing lane validity (  1.09.2009 to  01.03.2009). Currently we are getting an error that the valdity period overlaps.
    Regards,
    Sireesh

  • To create a Material using BAPI with out passing the material number

    Hello Experts,
    I am using BAPI_MATERIAL_SAVEDATA to create a material of some Ztype. I am successfully creating a material if I am passing Material Number as input. I want the material number to generated internally.
    When I am doing material creation with same input data with out material number using BDC, it is working fine. It is generating the material number.
    But, not with the BAPI.
    Do, I need to specify this some where in the BAPI to generate the Material number internally? Please let me know.
    Please help me in this regard.
    Thanks & Regards,
    Naresh.

    Hi,
    Read the BAPI documentation regarding Internal Number range for materials.
    When you create material master data, the following fields must always
    contain a value in the structure:
    o   MATERIAL
        Only external number assignment is supported for the material number
        (MATERIAL). If you want the material number to be assigned
        internally, the method BAPI_MATERIAL_GETINTNUMBER must first be
        called. This method determines an internal number for the material
        to be created. You must enter this internal number in field
        HEADDATA-MATERIAL.
    Regards
    Vinod

Maybe you are looking for

  • How do I transfer my pictures on here ?.

    I want reset my phone but I want my pictures to be saved . How do I do that?

  • Moving to EclipseLink (SessionCustomizer problem)

    Hi, I moved from Toplink Essentials to EclipseLink with Tomcat 6.0.18 and have this problem: I created two web applications both uses EclipseLink. Due to using non-jta-datasources I created in both applications JPAEclipseLinkSessionCustomizer as show

  • Oracle 11g /proc file system files on Linux x86-64

    OS: RHEL 5.6 Oracle: 11.2.0.3 Standard Edition RAC (GI and DB) In 11.2.0.3, it is found that the pseudo files for Oracle processes in /proc filesystem were owned by root, even though the process owner is oracle. [oracle@dbserver proc]$ ps -ef|grep ck

  • ABOUT CIF'S

    can any one explain the steps to transfer the data from r/3 to apo dp using CIF'S

  • Exporting AVI to DV - wont work - why?

    Hi there, Im having problems exporting about 40mins of AVI footage to DV PAL format. Im doing it using Premiere Pro CS3 on a PC with more than sufficient spec. The error message i keep getting is as follows: "Error compiling video. Cannot create or o