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

bapi_material_maintaindata_rt or bapi_material_upload_save

Hi all,

I am trying to update the field PLIFZ from table MARC using one of these BAPIs, but I can´t get it to work.

Anyone has a tip?

Thanks in advance!


Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Jul 08, 2005 at 07:28 PM

    I got this code working pretty good......

    report zrich_0001.
    data begin of i_mara  occurs   0.
            include structure mara_ueb.              "Basic Data Views
    data end of i_mara.
    data begin of i_marc occurs   0.
            include structure marc_ueb.              "Plant Views
    data end   of i_marc.
    data: i_marcx type table of marc with header line.
    data: tranc(10) value '0000000001'.
    parameters: p_matnr type mara-matnr,
                p_werks type marc-werks,
                p_plifz type marc-plifz.
    select * into corresponding fields of table i_marcx
          from marc where matnr = p_matnr
                      and werks = p_werks.
    tranc = '0000000001'.
    loop at i_marcx.
    * Reset I_Mara to new material number
      clear i_mara. refresh i_mara.
      select * into corresponding fields of table i_mara
            from mara where matnr = p_matnr.
      read table i_mara index 1.
      i_mara-tcode = 'MM02'.
      i_mara-tranc = tranc.
      modify i_mara index 1.
    * Get Plant Data
      clear i_marc. refresh i_marc.
      select * into corresponding fields of table i_marc
            from marc where matnr = i_marcx-matnr
                        and werks = i_marcx-werks.
      read table i_marc index 1.
      i_marc-plifz  = p_plifz.
      i_marc-tranc = tranc.
      modify i_marc index 1.
      tranc = tranc + '0000000001'.
    *Create Plant associated views
      perform create_material_views.
    form create_material_views.
    * Variable for "Maintain_Material_Dark" Function Module
      data: numerror like tbist-numerror.
      data: last_matnr type mara-matnr.
      data: begin of i_delfields occurs 20.
              include structure mfieldres.
      data: end of i_delfields.
      data: begin of i_errors occurs 20.
              include structure merrdat.
      data: end of i_errors.
      call function 'MATERIAL_MAINTAIN_DARK'
                  sperrmodus                = ' '
                  kz_prf                    = 'W'
                  max_errors                = ' '
                  p_kz_no_warn              = 'X'
                  kz_verw                   = 'X'
                  kz_aend                   = 'X'
                  kz_dispo                  = 'X'
                  kz_test                   = ' '
                  flag_muss_pruefen         = ' '
                  call_mode                 = 'ACT'
                  number_errors_transaction = numerror
                  matnr_last     = last_matnr
                 amara_ueb      = i_mara    "Basic Data
    *             amakt_ueb      = i_makt    "Descriptions
                 amarc_ueb      = i_marc    "Plant
    *             amard_ueb      = i_mard    "Storage Location
    *            AMFHM_UEB      = I_MFHM    "Production Tools
    *             amarm_ueb      = i_marm    "Units of Measure
    *            AMEA1_UEB      = I_MEA1    "Internal Mangagement -  EANs
    *             ambew_ueb      = i_mbew    "Accounting/Costing
    *             asteu_ueb      = i_steu    "Tax Data
    *             astmm_ueb      = i_steumm  "Tax Data
    *            AMLGN_UEB      = I_MLGN    "Warehouse Data
    *            AMLGT_UEB      = I_MLGT    "Storage Type Data
    *            AMPGD_UEB      = I_MPGD    "Change Documents
    *            AMPOP_UEB      = I_MPOP    "Forcast Parameters
    *            AMVEG_UEB      = I_MVEG    "Total Consumption Data
    *            AMVEU_UEB      = I_MVEU    "Unplanned Consumption Data
    *             amvke_ueb      = i_mvke    "Sales Data
    *             altx1_ueb      = i_ltx1    "Sales Text
    *            AMPRW_UEB      = I_MPRW    "Forcast Values
                 amfieldres     = i_delfields
                 amerrdat       = i_errors
                  kstatus_empty             = 01
                  tkstatus_empty            = 02
                  t130m_error               = 03
                  internal_error            = 04
                  update_error              = 05
                  too_many_errors           = 06.
      if sy-subrc <> 0.
        rollback work.
        call function 'DEQUEUE_ALL'.
        commit work and wait.
        call function 'DEQUEUE_ALL'.
      clear: i_mara, i_marc.
      refresh: i_mara, i_marc.


    Rich Heilman

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 12, 2005 at 02:06 PM

    Thank you all for your help. I just didn´t have the rights to modify the field (when I was suppossed to), It worked great as soon as I got it.

    Best Regards,

    Ezequiel Martin

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 18, 2005 at 02:26 AM

    Do you need to use Bapi?? I know there is a function that available from SAP that can update MARC/WRPL/MPOP...but this function only available in 4.7.. otherwise.. search oss note for this function..

    "MATERIAL_UPDATE_LOGISTICS_DATA".. This is a mass update function and it only update thousands of MARC records within a few seconds....

    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.