In FM - MATERIAL_MAINTAIN_DARK -- field TRANC

Hi All,
I am using MATERIAL_MAINTAIN_DARK fm To upload material storage location.
I am passing '000000001' to TRANC fields in mard_ueb table.
What is TRANC field what is the meaning of 0000000001.
Can i pass 000000000002 or 0000000003?
Moderator message: please search for information and try yourself before asking.
Edited by: Thomas Zloch on Feb 21, 2011 11:40 AM

Hi,
Can you tell me why you are using this Fm. Are  you using this to extend the material.If it is for extension do not use that Fm. instead of that  BAPI_MATERIAL_SAVEDATA.
http://www.sap-img.com/abap/bapi-to-copy-materials-from-one-plant-to-another.htm.
Regards,
Madhu.
Edited by: madhurao123 on Feb 21, 2011 6:33 AM
Edited by: madhurao123 on Feb 21, 2011 6:35 AM

Similar Messages

  • To Extend material to plant using MATERIAL_MAINTAIN_DARK .

    I am tryin to extend material into plants using MATERIAL_MAINTAIN_DARK  function module.Can someone please check the code below and tell me how i should modify it to work.Is BDC a better option?
    DATA: t_amara_ueb LIKE mara_ueb OCCURS 0 WITH HEADER LINE.
    DATA: t_amarc_ueb LIKE marc_ueb OCCURS 0 WITH HEADER LINE.
    t_amara_ueb-mandt = sy-mandt.
    t_amara_ueb-matnr = it_reqdata-material.
    t_amara_ueb-tcode = 'MM01'.
    t_amara_ueb-tranc = 1.
    APPEND t_amara_ueb.
    CLEAR t_amara_ueb.
    t_amarc_ueb-mandt = sy-mandt.
    t_amarc_ueb-matnr = it_reqdata-material.
    t_amarc_ueb-werks = it_reqdata-plant.
    t_amarc_ueb-tranc = 1.
    t_amarc_ueb-KZKRI = 'X'.
    APPEND t_amarc_ueb.
    CLEAR t_amarc_ueb.
    call function 'MATERIAL_MAINTAIN_DARK'
      exporting
      flag_muss_pruefen = 'X'
    p_kz_no_warn = 'N'
    kz_prf = space
    kz_verw = 'X'
    kz_aend = 'X'
    kz_dispo = 'X'
      tables
       amara_ueb                       = t_amara_ueb
       AMARC_UEB                       = t_AMARC_UEB
    EXCEPTIONS
       KSTATUS_EMPTY                   = 1
       TKSTATUS_EMPTY                  = 2
       T130M_ERROR                     = 3
       INTERNAL_ERROR                  = 4
       TOO_MANY_ERRORS                 = 5
       UPDATE_ERROR                    = 6
       OTHERS                          = 7
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ELSE.
    COMMIT WORK.
    ENDIF.
    Thanks and Regards,
    Pratima.

    Hi ,
    Use the below code.
    DATA : lt_mara_ueb TYPE TABLE OF mara_ueb INITIAL SIZE 0,
           lt_marc_ueb TYPE TABLE OF marc_ueb INITIAL SIZE 0,
           lt_errors TYPE TABLE OF merrdat INITIAL SIZE 0.
    DATA : wa_mara_ueb TYPE mara_ueb,
           wa_marc_ueb TYPE marc_ueb,
           wa_messtab TYPE merrdat.
    DATA : l_mstring(480).
    parameters: l_matnr like mara-matnr.
    * Set up I_MARA
    REFRESH lt_mara_ueb.
    wa_mara_ueb-mandt = sy-mandt.
    wa_mara_ueb-tcode = 'MM01'.
    wa_mara_ueb-matnr = l_matnr.
    wa_mara_ueb-tranc = '0000000001'.
    APPEND wa_mara_ueb TO lt_mara_ueb.
    CLEAR wa_mara_ueb.
    SELECT SINGLE * FROM marc INTO CORRESPONDING FIELDS OF wa_marc_ueb
    WHERE matnr EQ l_matnr AND werks EQ '01FC'.
      IF sy-subrc EQ 0.
        MOVE '01BV' TO wa_marc_ueb-werks.
        wa_marC_ueb-tranc = '0000000001'.
        WA_MARC_UEB-PSTAT = SPACE.
        APPEND wa_marc_ueb TO lt_marc_ueb.
      ENDIF.
      CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
        EXPORTING
    *   FLAG_MUSS_PRUEFEN               = 'X'
    *   SPERRMODUS                      = 'E'
    *   MAX_ERRORS                      = 0
          p_kz_no_warn                    = 'N'
          kz_prf                          = 'W'
    *   KZ_VERW                         = 'X'
    *   KZ_AEND                         = 'X'
    *   KZ_DISPO                        = 'X'
    *   KZ_TEST                         = ' '
    *   NO_DATABASE_UPDATE              = ' '
    *   CALL_MODE                       = ' '
    *   CALL_MODE2                      = ' '
    *   USER                            = SY-UNAME
    *   SUPPRESS_ARRAY_READ             = ' '
    *   FLG_MASS                        = ' '
    * IMPORTING
    *   MATNR_LAST                      =
    *   NUMBER_ERRORS_TRANSACTION       =
        TABLES
          amara_ueb                       = lt_mara_ueb
    *   AMAKT_UEB                       =
          amarc_ueb                       = lt_marc_ueb
    *   AMARD_UEB                       =
    *   AMFHM_UEB                       =
    *   AMARM_UEB                       =
    *   AMEA1_UEB                       =
    *   AMBEW_UEB                       =
    *   ASTEU_UEB                       =
    *   ASTMM_UEB                       =
    *   AMLGN_UEB                       =
    *   AMLGT_UEB                       =
    *   AMPGD_UEB                       =
    *   AMPOP_UEB                       =
    *   AMVEG_UEB                       =
    *   AMVEU_UEB                       =
    *   AMVKE_UEB                       =
    *   ALTX1_UEB                       =
    *   AMPRW_UEB                       =
    *   AMFIELDRES                      =
    *   AMERRDAT                        =
    EXCEPTIONS
       KSTATUS_EMPTY                   = 1
       TKSTATUS_EMPTY                  = 2
       T130M_ERROR                     = 3
       INTERNAL_ERROR                  = 4
       TOO_MANY_ERRORS                 = 5
       UPDATE_ERROR                    = 6
       OTHERS                          = 7
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      COMMIT WORK.
    Regards,
    Raghav

  • Create material view with MATERIAL_MAINTAIN_DARK

    Hello !
    I have done a material migration program with FM MATERIAL_MAINTAIN_DARK. The program integrate the basic data, and then each view one by one.
    It works fine except with material with internal number. It creats the basic data but when i use the number generated to create the other view i get this message :
    No external number assignment possible for mat. type GENERIC MATERIALS
    I found this field in mara_ueb : KZ_MAT_RES
    But when i put X in it, it returns that i forgot mandatory data. So I tried to select the data already in MARA and MAKT, but now the message is that the material already exist ! It is true but I want to create another view.
    Here's a piece of my code to help you to understand, the commentary part is what I tried to do to resolved my problem :
      ADD 1 TO v_count.
      ADD 1 TO v_line.
      MOVE v_line TO v_line_c.
    *---MARA
      MOVE sy-mandt TO t_mara_ueb-mandt.
      MOVE 'MM01' TO t_mara_ueb-tcode.
      MOVE v_count TO t_mara_ueb-tranc.
      MOVE k_purcha TO t_mara_ueb-vpsta.
      SELECT COUNT(*) FROM t134 WHERE mtart = t_data_pur-mtart
                                   AND envop = space.
      IF sy-subrc = 0.
        TABLES : mara, makt.
       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
         EXPORTING
           input         = t_data_pur-matnr
        IMPORTING
          OUTPUT        = t_data_pur-matnr.
       SELECT SINGLE * FROM mara WHERE matnr = t_data_pur-matnr.
       MOVE-CORRESPONDING mara TO t_mara_ueb.
       SELECT SINGLE * FROM makt WHERE matnr = t_data_pur-matnr.
       MOVE-CORRESPONDING makt TO t_makt_ueb.
         MOVE 'X' TO t_mara_ueb-KZ_MAT_RES.
      ENDIF.
      MOVE t_data_pur-matnr TO t_mara_ueb-matnr.
      MOVE t_data_pur-mbrsh TO t_mara_ueb-mbrsh.
      MOVE t_data_pur-mtart TO t_mara_ueb-mtart.
      MOVE t_data_pur-ekwsl TO t_mara_ueb-ekwsl.
      APPEND t_mara_ueb.
    *---MARC
      MOVE sy-mandt TO t_marc_ueb-mandt.
      MOVE v_count TO t_marc_ueb-tranc.
      MOVE t_data_pur-matnr TO t_marc_ueb-matnr.
      MOVE t_data_pur-werks TO t_marc_ueb-werks.
      MOVE t_data_pur-ekgrp TO t_marc_ueb-ekgrp.
      MOVE t_data_pur-mmsta TO t_marc_ueb-mmsta.
      MOVE t_data_pur-mmstd TO t_marc_ueb-mmstd.
      MOVE t_data_pur-webaz TO t_marc_ueb-webaz.
      MOVE t_data_pur-kordb TO t_marc_ueb-kordb.
      MOVE t_data_pur-usequ TO t_marc_ueb-usequ.
      APPEND t_marc_ueb.
    *---!!! Call FUNCTION MODULE !!!
      CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
        EXPORTING
        FLAG_MUSS_PRUEFEN               = 'X'
        SPERRMODUS                      = 'E'
        MAX_ERRORS                      = 0
         p_kz_no_warn                    = 'X'
         kz_prf                          = space
        KZ_VERW                         = 'X'
        KZ_AEND                         = 'X'
        KZ_DISPO                        = 'X'
         kz_test                         = lv_test
        NO_DATABASE_UPDATE              = ' '
         call_mode                       = ' '   "OR RMD OR space OR BAP
        CALL_MODE2                      = ' '
         user                            = sy-uname
        SUPPRESS_ARRAY_READ             = ' '
        FLG_MASS                        = ' '
        IMPORTING
         matnr_last                      = lv_matnr
         number_errors_transaction       = lv_nb_error
        TABLES
         amara_ueb                       = t_mara_ueb
         amakt_ueb                       = t_makt_ueb
         amarc_ueb                       = t_marc_ueb
         amard_ueb                       = t_mard_ueb
        AMFHM_UEB                       =
        AMARM_UEB                       =
        AMEA1_UEB                       =
         ambew_ueb                       = t_mbew_ueb
         asteu_ueb                       = t_steu_ueb
        ASTMM_UEB                       =
         amlgn_ueb                       = t_mlgn_ueb
         amlgt_ueb                       = t_mlgt_ueb
        AMPGD_UEB                       =
         ampop_ueb                       = t_mpop_ueb
        AMVEG_UEB                       =
        AMVEU_UEB                       =
         amvke_ueb                       = t_mvke_ueb
        ALTX1_UEB                       =
        AMPRW_UEB                       =
        AMFIELDRES                      =
         amerrdat                        = t_amerrdat
       EXCEPTIONS
         kstatus_empty                   = 1
         tkstatus_empty                  = 2
         t130m_error                     = 3
         internal_error                  = 4
         too_many_errors                 = 5
         update_error                    = 6
         OTHERS                          = 7.
    I really need you help !
    thank you in advance.

    OK I found the answer !
    It is because the matnr generate add 00000... before the number. So I have to add it for the other view. But it is not the case for material number define externally. And the message was not comprensive.
    *---MARA
      MOVE sy-mandt TO t_mara_ueb-mandt.
      MOVE 'MM01' TO t_mara_ueb-tcode.
      MOVE v_count TO t_mara_ueb-tranc.
      MOVE k_purcha TO t_mara_ueb-vpsta.
      SELECT COUNT(*) FROM t134 WHERE mtart = t_data_pur-mtart
                                  AND envop = space.
      IF sy-subrc = 0.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
             EXPORTING
                  input  = t_data_pur-matnr
             IMPORTING
                  output = t_data_pur-matnr.
      ENDIF.
      MOVE t_data_pur-matnr TO t_mara_ueb-matnr.
      MOVE t_data_pur-mbrsh TO t_mara_ueb-mbrsh.
      MOVE t_data_pur-mtart TO t_mara_ueb-mtart.
      MOVE t_data_pur-ekwsl TO t_mara_ueb-ekwsl.
      APPEND t_mara_ueb.
    *---MARC
      MOVE sy-mandt TO t_marc_ueb-mandt.
      MOVE v_count TO t_marc_ueb-tranc.
      MOVE t_data_pur-matnr TO t_marc_ueb-matnr.
      MOVE t_data_pur-werks TO t_marc_ueb-werks.
      MOVE t_data_pur-ekgrp TO t_marc_ueb-ekgrp.
      MOVE t_data_pur-mmsta TO t_marc_ueb-mmsta.
      MOVE t_data_pur-mmstd TO t_marc_ueb-mmstd.
      MOVE t_data_pur-webaz TO t_marc_ueb-webaz.
      MOVE t_data_pur-kordb TO t_marc_ueb-kordb.
      MOVE t_data_pur-usequ TO t_marc_ueb-usequ.
      APPEND t_marc_ueb.
    Edited by: Louis-Arnaud Bouquin on Mar 5, 2008 3:04 PM

  • MATERIAL_MAINTAIN_DARK no mara append table update

    Hello,
    I've a little problem using MATERIAL_MAINTAIN_DARK to modify some materials.
    I have to update fields in two append structures (one in mara, one in marm)
    when I use this function module, the update is ok on marm but not on mara
    if anyone have an idea ??
    Thanks in advance

    Hai Fabrice
    check the following Code
    DATA: h_anzfehler LIKE  tbist-numerror.
    DATA: BEGIN OF t_mara_ueb OCCURS 1.
            INCLUDE STRUCTURE mara_ueb.
    DATA: END OF t_mara_ueb.
    DATA: BEGIN OF t_mbew_ueb OCCURS 1.
            INCLUDE STRUCTURE mbew_ueb.
    DATA: END OF t_mbew_ueb.
    DATA: t_merrdat TYPE merrdat OCCURS 0 WITH HEADER LINE.
    aufbauen T_MARA_UEB
              CLEAR:    t_mara_ueb.
              REFRESH:  t_mara_ueb.
              t_mara_ueb-mandt = sy-mandt.
              t_mara_ueb-matnr = t_mbew-matnr.
              t_mara_ueb-tcode = 'MM02'.
              t_mara_ueb-tranc = h_tranc.  "Transaktionszähler
              APPEND t_mara_ueb.
    aufbauen T_MBEW_UEB
              CLEAR:    t_mbew_ueb.
              REFRESH:  t_mbew_ueb.
              t_mbew_ueb-mandt = sy-mandt.
              t_mbew_ueb-matnr = t_mbew-matnr.
              t_mbew_ueb-bwkey = t_mbew-bwkey.
              t_mbew_ueb-bwtar = t_mbew-bwtar.
              t_mbew_ueb-tranc = h_tranc.  "Transaktionszähler
    Änderung der Preissteuerung in der lfd. Periode
              IF t_mbew-vprsv NE p_vprsvn.
                t_mbew_ueb-vprsv = p_vprsvn. "neue Preissteuerung->lfd.Per.
              ENDIF.
    Änderung der Preissteuerung in der Vorperiode
              IF t_mbew-vmvpr NE p_vprsvn.
                t_mbew_ueb-vmvpr = p_vprsvn. "neue Preissteuerung-> Vorper.
              ENDIF.
    Änderung der Preissteuerung in der letzten Periode des Vorjahres
              IF flag_vm_eq_vj = 'X'.      "Vorperiode = Vorjahr
                IF t_mbew-vjvpr NE p_vprsvn.
                  t_mbew_ueb-vjvpr = p_vprsvn. "neue Preissteuerung-> Vorjahr
                ENDIF.
              ENDIF.
              APPEND t_mbew_ueb.
              CLEAR:    t_merrdat.
              REFRESH:  t_merrdat.
              CLEAR:    h_anzfehler.
              CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
                   EXPORTING
                    FLAG_MUSS_PRUEFEN         = 'X'
                    SPERRMODUS                = 'E'
                    MAX_ERRORS                = 0
                        p_kz_no_warn              = 'N'
                        kz_prf                    = 'E'
                        kz_aend                   = 'X'
                        kz_dispo                  = ' '
                   IMPORTING
                        number_errors_transaction = h_anzfehler
                   TABLES
                        amara_ueb                 = t_mara_ueb
                        ambew_ueb                 = t_mbew_ueb
                        amerrdat                  = t_merrdat
                   EXCEPTIONS
                        kstatus_empty             = 1
                        tkstatus_empty            = 2
                        t130m_error               = 3
                        internal_error            = 4
                        too_many_errors           = 5
                        update_error              = 6
                        OTHERS                    = 7.
              IF NOT h_anzfehler IS INITIAL.
                PERFORM build_message.
                EXIT.                   "Abbruch Form-Verarbeitung
              ELSE.
                flag_vprsv_upd = 'X'.
              ENDIF.
    Thanks & Regards
    Sreenivasulu P

  • Updating problem in material_maintain_dark

    Hi All,
    I am trying to use FM  Material_maintain_dark to update Marm-umrez.But now it is not updating any table values.
    Can any one suggest me what to do in this case.Please find the code that is used below in my program.
    t_mara-mandt = sy-mandt.
      t_mara-matnr = p_material.
      t_mara-mbrsh = 'S'.
      t_mara-tcode = 'MM02'.
      t_mara-tranc = h_tranc.
      APPEND t_mara.
       t_marm-mandt = sy-mandt.
       t_marm-matnr = p_material.
       t_marm-meinh = p_meinh.
       t_marm-umrez = p_moq.
       t_marm-tranc = h_tranc.
       append t_marm.
       call function 'MATERIAL_MAINTAIN_DARK'
         exporting
           p_kz_no_warn                   = 'N'
           kz_prf                         = 'S'
         tables
          amara_ueb                       =  t_mara
          AMARM_UEB                       =  t_marm
          AMERRDAT                        =  t_amerrdat
        EXCEPTIONS
          KSTATUS_EMPTY                   = 1
          TKSTATUS_EMPTY                  = 2
          T130M_ERROR                     = 3
          INTERNAL_ERROR                  = 4
          TOO_MANY_ERRORS                 = 5
          UPDATE_ERROR                    = 6
          OTHERS                          = 7
       if sy-subrc <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       endif.
    Please help me out in this case ,
    Thanks ,
    Suman

    Hi Suman,
    t_mara-mandt = sy-mandt.
    t_mara-matnr = p_material.
    t_mara-mbrsh = 'S'.
    t_mara-tcode = 'MM02'.
    t_mara-tranc = h_tranc.
    APPEND t_mara.
    t_marm-mandt = sy-mandt.
    t_marm-matnr = p_material.
    t_marm-meinh = p_meinh.
    t_marm-umrez = p_moq.
    t_marm-tranc = h_tranc.
    append t_marm.
    call function 'MATERIAL_MAINTAIN_DARK'
    exporting
    p_kz_no_warn = 'N'
    kz_prf = 'S'
    tables
    amara_ueb = t_mara
    AMARM_UEB = t_marm
    AMERRDAT = t_amerrdat
    EXCEPTIONS
    KSTATUS_EMPTY = 1
    TKSTATUS_EMPTY = 2
    T130M_ERROR = 3
    INTERNAL_ERROR = 4
    TOO_MANY_ERRORS = 5
    UPDATE_ERROR = 6
    OTHERS = 7
    if sy-subrc &lt;&gt; 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    COMMIT WORK.
    COMMIT WORK
    should be the last statement of your program/transaction.
    Regards,
    Clemens

  • MATERIAL_MAINTAIN_DARK

    Hi folks,
    I am using this Funtion module  MATERIAL_MAINTAIN_DARK.
    But i am getting a error of No description transferred.
    Can any body give me sample code that uses this Function module.

    REPORT  ZSSS.
    INCLUDES                                                             *
    Definition data include
    INCLUDE ZPROGRAM_TOP.
    Forms definition include
    INCLUDE ZPROGRAM_SUB.
    Tables                                                               *
    TABLES: lfa1, LFB1,LFB5, lfm1,
            mara, marc, mbew, steu, mvke, mard.
    Types                                                                *
    Predefine classes                                                    *
    CLASS XXX.
    Data                                                                 *
    Data - Internal Tables
    Data - Structures
    Data - Variables and flags
    DATA:
      gt_errs       TYPE merrdat OCCURS 0 WITH HEADER LINE,
      gt_mara_ueb   TYPE mara_ueb OCCURS 0 WITH HEADER LINE,
      gt_marc_ueb   TYPE marc_ueb OCCURS 0 WITH HEADER LINE,
      gt_mard_ueb   TYPE mard_ueb OCCURS 0 WITH HEADER LINE,
      gt_mbew_ueb   TYPE mbew_ueb OCCURS 0 WITH HEADER LINE,
      gt_mvke_ueb   TYPE mvke_ueb OCCURS 0 WITH HEADER LINE.
    types: begin of g_ty_s_test,
             select_amount      type i,
             no_info_popup      type char1,
             info_popup_once    type char1,
             events             type lvc_fname occurs 0,
             events_info_popup  type lvc_fname occurs 0,
             bypassing_buffer   type char1,
             buffer_active      type char1,
           end   of g_ty_s_test,
      BEGIN OF tlfa1,
        lifnr LIKE lfa1-lifnr,
      AKONT LIKE LFB1-AKONT,
      ZUAWA LIKE LFB1-ZUAWA,
      FDGRV LIKE LFB1-FDGRV,
      VZSKZ LIKE LFB1-VZSKZ,
      ZINDT(10),
      ZINRT LIKE LFB1-ZINRT,
      DATLZ(10),
      ALTKN LIKE LFB1-ALTKN,
    qsskz like LFB1-qsskz,
      ZTERM LIKE LFB1-ZTERM,
      TOGRU LIKE LFB1-TOGRU,
    XVERR LIKE LFB1-XVERR,
    URLID LIKE LFB1-URLID,
    reprf like LFB1-reprf,
      ZWELS LIKE LFB1-ZWELS,
      ZAHLS LIKE LFB1-ZAHLS,
      XPORE LIKE LFB1-XPORE,
      XVERR LIKE LFB1-XVERR,
      HBKID LIKE LFB1-HBKID,
      ZGRUP LIKE LFB1-ZGRUP,
      KVERM LIKE LFB1-KVERM,
      busab LIKE LFB1-busab,
      BUKRS LIKE LFB1-BUKRS,
      END OF tlfa1.
    data: pol(2) type n, cnt1 type i, cnt2 type i.
    data: kostl1(10) type n.
    DATA: BEGIN OF ilfa1 OCCURS 100,
            lifnr LIKE lfa1-lifnr,
            bukrs LIKE LFB1-bukrs,
          END OF ilfa1.
    DATA: BEGIN OF tab OCCURS 500,
            text(500),
          END OF tab.
    DATA: BEGIN OF bdcdata OCCURS 500.
            INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdcdata.
    data: plus(2), minus(2).
    type-pools: slis.
    constants: con_true     type char1 value 'X',
               con_event_05 type lvc_fname value 'BEFORE_LINE_OUTPUT'.
    data: gs_test type g_ty_s_test.
    data: layout        type slis_layout_alv,
          s_fieldcat    type slis_fieldcat_alv,
          it_fieldcat   type slis_t_fieldcat_alv,
          s_event       type slis_alv_event,
          it_event      type slis_t_event,
          s_sort        type slis_sortinfo_alv,
          it_sort       type slis_t_sortinfo_alv,
          keyinfo       type slis_keyinfo_alv,
          s_lineinfo    type slis_lineinfo,
          printinfo     type slis_print_alv,
          xlfa1 TYPE tlfa1 OCCURS 100 WITH HEADER LINE,
          TABPOOL LIKE TEXTPOOL OCCURS 50 WITH HEADER LINE,
          workdays type p,
          g_repid       like sy-repid.
    data: hodnota1 LIKE ANLC-KANSW.
    data: hodnota2 LIKE ANLC-KANSW.
    Ranges                                                               *
    Field Groups                                                         *
    Field Symbols                                                        *
    Parameters and select options                                        *
    PARAMETERS:
    WERKS1   LIKE marc-werks  DEFAULT 'Z621',
    WERKS2   LIKE LFB1-bukrs DEFAULT 'Z605',
    vkorg1   LIKE knvv-vkorg DEFAULT 'Z004',
    vkorg2   LIKE knvv-vkorg DEFAULT 'Z001',
    ekorg(4) DEFAULT 'CE01'.
    MAPA  LIKE APQI-GROUPID DEFAULT 'importdod'.
    kostl LIKE anlz-kostl DEFAULT '0000011101'.
    select-options:
      material for marc-matnr.
    parameters:
    test as checkbox.
    Define classes                                                       *
    CLASS XXX DEFINITION.
    EVENTS                                                               *
    INITIALIZATION
    INITIALIZATION.
    ======================================================================
                                  Macros
    ======================================================================
    define addfc.
        s_fieldcat-fieldname      = &1.
        s_fieldcat-ref_fieldname  = &2.
        s_fieldcat-ref_tabname    = &3.
        s_fieldcat-key            = &4.
        s_fieldcat-icon           = &6.
        s_fieldcat-reptext_ddic   = &7.
        s_fieldcat-seltext_l      = &7.
        s_fieldcat-seltext_m      = &7.
        s_fieldcat-seltext_s      = &7.
        s_fieldcat-do_sum         = &8.
        s_fieldcat-no_out         = &5.
        append s_fieldcat to it_fieldcat.
    end-of-definition.
    START-OF-SELECTION
    START-OF-SELECTION.
    *PERFORM upload_from_disk USING sub.
    clear: cnt1, cnt2.
    select  * from marc
      where
        werks eq werks1
    and matnr in material.
    CLEAR: gt_mara_ueb,gt_marc_ueb, gt_mard_ueb, gt_mbew_ueb, gt_mvke_ueb.
    REFRESH: gt_mara_ueb,gt_marc_ueb, gt_mard_ueb, gt_mbew_ueb, gt_mvke_ueb.
    MOVE-CORRESPONDING marc TO gt_marc_ueb.
    select  single * from marc
      where matnr eq marc-matnr
        and werks eq werks2.
    check  sy-subrc ne 0.
    gt_marc_ueb-werks = werks2.
    if gt_marc_ueb-prctr(1) eq 'Z'.
      gt_marc_ueb-prctr(4) = werks2.
    endif.
    append gt_marc_ueb.
      SELECT SINGLE * FROM mara WHERE matnr = gt_marc_ueb-matnr.
      IF sy-subrc = 0.
        MOVE-CORRESPONDING mara TO gt_mara_ueb.
        gt_mara_ueb-tcode = 'MM01'.
        append gt_mara_ueb.
      ENDIF.
    select  single * from mard
      where matnr eq gt_marc_ueb-matnr
        and werks eq werks1.
    MOVE-CORRESPONDING mard TO gt_mard_ueb.
    select  single * from mard
      where matnr eq gt_marc_ueb-matnr
        and werks eq werks2.
    if sy-subrc ne 0.
    gt_mard_ueb-werks = werks2.
    append gt_mard_ueb.
    endif.
    select  single * from mbew
      where matnr eq gt_marc_ueb-matnr
        and bwkey eq werks1.
    MOVE-CORRESPONDING mbew TO gt_mbew_ueb.
    select  single * from mbew
      where matnr eq gt_marc_ueb-matnr
        and bwkey eq werks2.
    if sy-subrc ne 0.
    gt_mbew_ueb-bwkey = werks2.
    append gt_mbew_ueb.
    endif.
    select  single * from mvke
      where matnr eq gt_marc_ueb-matnr
        and vkorg eq vkorg1.
    MOVE-CORRESPONDING mvke TO gt_mvke_ueb.
    select  single * from mvke
      where matnr eq gt_marc_ueb-matnr
        and vkorg eq vkorg2.
    if sy-subrc ne 0.
    gt_mvke_ueb-vkorg = vkorg2.
    append gt_mvke_ueb.
    endif.
    *write:/ gt_marc_ueb-matnr, gt_marc_ueb-werks, gt_mvke_ueb-vkorg.
    if test ne space.
      write:/ gt_marc_ueb-matnr, gt_marc_ueb-werks, gt_mvke_ueb-vkorg.
    else.
      CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
        EXPORTING
        FLAG_MUSS_PRUEFEN               = 'X'
        SPERRMODUS                      = 'E'
          max_errors                      = 0
          p_kz_no_warn                    = 'X'
          kz_prf                          = ''
        KZ_VERW                         = 'X'
        KZ_AEND                         = 'X'
        KZ_DISPO                        = 'X'
          kz_test                         = TEST
        NO_DATABASE_UPDATE              = ' '
        CALL_MODE                       = ' '
        CALL_MODE2                      = ' '
          user                            = sy-uname
        SUPPRESS_ARRAY_READ             = ' '
        FLG_MASS                        = ' '
        IMPORTING
          matnr_last                      = gt_marc_ueb-matnr
         number_errors_transaction       = g_trnerr
        TABLES
          amara_ueb                       = gt_mara_ueb
        AMAKT_UEB                       =
          amarc_ueb                       = gt_marc_ueb
          AMARD_UEB                       = gt_mard_ueb
        AMFHM_UEB                       =
        AMARM_UEB                       =
        AMEA1_UEB                       =
          ambew_ueb                       = gt_mbew_ueb
        ASTEU_UEB                       =
        ASTMM_UEB                       =
        AMLGN_UEB                       =
        AMLGT_UEB                       =
        AMPGD_UEB                       =
        AMPOP_UEB                       =
        AMVEG_UEB                       =
        AMVEU_UEB                       =
          amvke_ueb                       = gt_mvke_ueb
        ALTX1_UEB                       =
        AMPRW_UEB                       =
        AE1CUCFG_UEB                    =
        AE1CUINS_UEB                    =
        AE1CUVAL_UEB                    =
        AE1CUCOM_UEB                    =
         amfieldres                      = gt_fieldres
          amerrdat                        = gt_errs
        EXCEPTIONS
          kstatus_empty                   = 1
          tkstatus_empty                  = 2
          t130m_error                     = 3
          internal_error                  = 4
          too_many_errors                 = 5
          update_error                    = 6
          OTHERS                          = 7
      loop at gt_errs.
      if gt_marc_ueb-matnr ne space.
        format color col_group.
        write:/ gt_marc_ueb-matnr, gt_marc_ueb-werks, gt_mvke_ueb-vkorg.
      else.
        format color col_negative.
        write:/ gt_marc_ueb-matnr,gt_errs.
      endif.
      endloop.
    if sy-subrc eq 0.
      if gt_marc_ueb-matnr ne space.
        cnt1 = cnt1 + 1.
      else.
        cnt2 = cnt2 + 1.
      endif.
    endif.
    endselect.
    *perform prepare_alv_grid_data.
    uline.
      format color col_total.
    write: / poc, ilfa1-anlkl, ilfa1-txt50,  ilfa1-aktiv, ilfa1-afasl01,
    *skansw, slfafa.
      if test eq space.
      format color col_group.
      write: / 'Poèet správnych:', cnt1.
      format color col_negative.
      write: / 'Poèet chybných:', cnt2.
      else.
      write: / 'Testovací re¾im'.
    endif.
    ======================================================================
                                 Top of Page
    ======================================================================
    form f01_alv_event_top_of_page.
    write:/ 'Business pipeline'(020).
    write: 40 'Pracovné dni:'(021), workdays.
    perforM VYPIS_SEL_OPT.
    endform.
    form f01_alv_event_END_OF_LIST.
    perform prepare_alv_grid_data1.
    endform.
          FORM DYNPRO                                                   *
    -->  PROGRAM                                                       *
    -->  DYNPRO                                                        *
    FORM dynpro USING program dynpro.
      CLEAR bdcdata.
      bdcdata-program = program.
      bdcdata-dynpro = dynpro.
      bdcdata-dynbegin = 'X'.
      APPEND bdcdata.
    ENDFORM.
          FORM PRG                                                      *
    -->  FNAM                                                          *
    -->  FVAL                                                          *
    FORM prg USING fnam fval.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = fval.
      APPEND bdcdata.
    ENDFORM.
    FORM prg1 USING fnam fval.
    if fval ne space.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = fval.
      APPEND bdcdata.
    endif.
    ENDFORM.
    FORM prg2 USING fnam fval.
    data: hodn like anlc-kansw.
    perform hodnota using fval hodn.
    if hodn ne 0.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = fval.
      APPEND bdcdata.
    endif.
    ENDFORM.
    FORM prg3 USING fnam fval.
    data: hodn like anlc-kansw.
    perform hodnota using fval hodn.
    if hodn eq 0.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = '0'.
      APPEND bdcdata.
    endif.
    ENDFORM.
    FORM prg4 USING fnam fval.
    data: hodn like anlc-kansw.
    data: txt(30).
    perform hodnota using fval hodn.
    if hodn ne 0.
      if hodn lt 0.
        concatenate fnam '(' minus ')' into txt.
      else.
        concatenate fnam '(' plus ')' into txt.
      endif.
      CLEAR bdcdata.
      bdcdata-fnam = txt.
      bdcdata-fval = fval.
      APPEND bdcdata.
    else.
      CLEAR bdcdata.
      bdcdata-fnam = txt.
      bdcdata-fval = fval.
      APPEND bdcdata.
    endif.
    ENDFORM.
    FORM prg5 USING fnam pol.
    data: txt(30).
        concatenate fnam '(' pol ')' into txt.
      CLEAR bdcdata.
      bdcdata-fnam = txt.
      bdcdata-fval = '0'.
      APPEND bdcdata.
    ENDFORM.
    FORM prg6 USING fnam pol fval.
    data: txt(30).
        concatenate fnam '(' pol ')' into txt.
      CLEAR bdcdata.
      bdcdata-fnam = txt.
      bdcdata-fval = fval.
      APPEND bdcdata.
    ENDFORM.
    FORM prg7 USING fnam fval pol.
    data: txt(30).
      concatenate fval '(' pol ')' into txt.
      CLEAR bdcdata.
      bdcdata-fnam = fnam.
      bdcdata-fval = txt.
      APPEND bdcdata.
    ENDFORM.
    -->  FILENAME                                                      *
    FORM upload_from_disk USING filename.
      DATA: name(80).
      REFRESH: tab.
      CALL FUNCTION 'WS_UPLOAD'
           EXPORTING
                filename        = filename
                filetype        = 'ASC'
           TABLES
                data_tab        = tab
           EXCEPTIONS
                file_open_error = 1
                file_read_error = 2.
      name = filename.
      CASE sy-subrc.
        WHEN 1.
         MESSAGE e704 WITH name3 name0(2).
        WHEN 2.
         MESSAGE e705 WITH name3 name0(2).
        WHEN OTHERS.
      ENDCASE.
    ENDFORM.
    FORM WRITE_BTR USING P_BTR P_EXCEL.
      if p_btr eq 0. clear P_EXCEL. exit. endif.
      WRITE P_BTR TO P_EXCEL.
      TRANSLATE P_EXCEL USING '. '.
    TRANSLATE P_EXCEL USING '.,'.
      CONDENSE P_EXCEL NO-GAPS.
      SHIFT P_EXCEL RIGHT CIRCULAR.
    ENDFORM.                               " WRITE_BTR
    form hodnota using hodntext hodn.
    data: text(18).
      text = hodntext.
    replace '-' with ' ' into text.
      replace ',' with '.' into text.
      condense text no-gaps.
      hodn = text.
    endform.
    *&      Form  prepare_alv_grid_data
          text
    -->  p1        text
    <--  p2        text
    form prepare_alv_grid_data.
      clear: s_fieldcat,
             keyinfo,
             s_event,
             layout,
             s_sort.
      refresh: it_fieldcat,
               it_sort,
               it_event.
      s_fieldcat-tabname   = 'ilfa1'.
    Data: txt(100).
      addfc:
        POLE, REF_TAB, KEY, NO-OUT, ICON, TEXT, DO-SUM
         'LIFNR' 'LIFNR'   'LFB1' '' '' ''  'Dodávateµ'(001)      '',
         'BUKRS' 'BUKRS'   'LFB1' '' '' ''  'Úèt. okruh'(001)      ''.
       s_sort-spos           = 1.
       s_sort-fieldname      = 'BEZEI'.
       s_sort-tabname      = 'IT_SUMM'.
       s_sort-up             = 'X'.
       s_sort-subtot         = 'X'.
       append s_sort to it_sort.
      layout-zebra             =  'X'.
      layout-totals_text       = 'Súetový riadok'.
      layout-NUMC_SUM          =  'X'.
      layout-colwidth_optimize =  'X'.
      layout-window_titlebar   =
      'Inv. majetok'(020).
      clear s_event.
      s_event-form = 'TOP_OF_PAGE'.
      s_event-name =  slis_ev_top_of_page.
      append s_event to gs_test-events.
      s_event-form = 'END_OF_LIST'.
      s_event-name =  SLIS_EV_END_OF_LIST.
      append s_event to gs_test-events.
      perform f01_alv_set_events changing it_event.
      g_repid = sy-repid.
      printinfo-no_print_selinfos  = 'X'.
      printinfo-no_print_listinfos = 'X'.
    call function 'REUSE_ALV_LIST_DISPLAY'
       call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
         i_callback_program             = g_repid
         I_GRID_TITLE                   = 'Inv. majetok ASO'(020)
         is_layout                      = layout
         it_fieldcat                    = it_fieldcat
        i_default                      = space  "'X'
          i_save                         = 'A'
         it_sort                        = it_sort
        it_events                      = it_event
        i_screen_start_line            = 0
        is_print                       = printinfo
         I_STRUCTURE_NAME               = 'ilfa1'
        tables
          t_outtab                      = ilfa1
       exceptions
         program_error                  = 1
         others                         = 2.
    endform.                    " prepare_alv_grid_data
    form prepare_alv_grid_data1.
      clear: s_fieldcat,
             keyinfo,
             s_event,
             layout,
             s_sort.
      refresh: it_fieldcat,
               it_sort,
               it_event.
      s_fieldcat-tabname   = 'ilfa1'.
    Data: txt(100).
      addfc:
        POLE, REF_TAB, KEY, NO-OUT, ICON, TEXT, DO-SUM
         'ANLKL' 'ANLKL'   'ANLA' '' '' ''  'Trieda IM'(001)      '',
         'ANLN1' 'ANLN1'   'ANLA' '' '' ''  'Hlavné èíslo IM'(002)      '',
         'TXT50' 'TXT50'   'ANLA' '' '' ''  'Oznaèenie'(015) '',
        'INVNR' 'INVNR'   'ANLA' '' '' ''  'Inventárne èíslo'(003) '',
         'KOSTL' 'KOSTL'   'ANLA' '' '' ''  'Náklad. stredisko'(004) '',
         'LIFNR' 'LIFNR'   'ANLA' '' '' ''  'Dodavatel'(004) ''.
       s_sort-spos           = 1.
       s_sort-fieldname      = 'BEZEI'.
       s_sort-tabname      = 'IT_SUMM'.
       s_sort-up             = 'X'.
       s_sort-subtot         = 'X'.
       append s_sort to it_sort.
      layout-zebra             =  'X'.
      layout-totals_text       = 'Súetový riadok'.
      layout-NUMC_SUM          =  'X'.
      layout-colwidth_optimize =  'X'.
      layout-window_titlebar   =
      'Inv. majetok'(020).
      clear s_event.
      s_event-form = 'TOP_OF_PAGE'.
      s_event-name =  slis_ev_top_of_page.
      append s_event to gs_test-events.
      s_event-form = 'END_OF_LIST'.
      s_event-name =  SLIS_EV_END_OF_LIST.
      append s_event to gs_test-events.
      perform f01_alv_set_events changing it_event.
      g_repid = sy-repid.
      printinfo-no_print_selinfos  = 'X'.
      printinfo-no_print_listinfos = 'X'.
    call function 'REUSE_ALV_LIST_DISPLAY'
       call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
         i_callback_program             = g_repid
         I_GRID_TITLE                   = 'Inv. majetok - odavatele'(020)
         is_layout                      = layout
         it_fieldcat                    = it_fieldcat
        i_default                      = space  "'X'
          i_save                         = 'A'
         it_sort                        = it_sort
        it_events                      = it_event
        i_screen_start_line            = 0
        is_print                       = printinfo
         I_STRUCTURE_NAME               = 'ilfa1'
        tables
          t_outtab                      = ilfa1
       exceptions
         program_error                  = 1
         others                         = 2.
    endform.                    " prepare_alv_grid_data
    form f01_alv_event_before_line_outp
                          using rs_lineinfo type slis_lineinfo. "#EC *
      data: l_event type lvc_fname. "#EC NEEDED
              it_summ-hl_fu = it_summ-volum / it_summ-cntf.
    if pa_brand ne space.
    perform compute_averageb using it_sumb.
    if it_sumb-volum ne 0.
       it_sumb-sk_hl = it_sumb-netwr / it_sumb-volum.
    else.
       it_sumb-sk_hl = 0.
    endif.
    else.
    perform compute_average using it_summ.
    endif.
      if rs_lineinfo-endsum ne space.
       perform prepare_alv_grid_data1.
      endif.
    if rs_lineinfo-tabindex eq 0.
      if rs_lineinfo-sumindex ne 0.
         uline.
        it_summ-tonaz = wa_summ-bezei.
      endif.
    else.
      wa_summ = it_summ.
    endif.
    if s_lineinfo-tabindex eq 0.
      if s_lineinfo-sumindex ne 0.
         uline.
      endif.
    endif.
    s_lineinfo = rs_lineinfo.
      if gs_test-info_popup_once eq con_true.
        read table gs_test-events_info_popup into l_event
                   with key table_line = 'BEFORE_LINE_OUTPUT'.
        if sy-subrc ne 0.
          insert 'BEFORE_LINE_OUTPUT' into gs_test-events_info_popup
                                      index 1.
          message i000(0k) with text-t05.
        endif.
      elseif gs_test-no_info_popup eq space.
        message i000(0k) with text-t05.
      endif.
    endform.                               " F01_ALV_EVENT_BEFORE_LINE_OUTP
    form f01_alv_set_events changing ct_events type slis_t_event.
      field-symbols: -form.
          endif.
        endloop.
      endif.
    endform.                    " f01_alv_set_events
    Reward points..

  • MATERIAL_MAINTAIN_DARK via dialog

    Hello everyone,
    I'm trying to use <b>MATERIAL_MAINTAIN_DARK</b> to create/change a material master record with data coming from a MATMAS idoc in <b>foreground(dialog mode)</b>, thus allowing the user to see the fields populated with the data, but so far I haven't been able to put it to work.
    Does anyone knows how to do it?
    I'm currently working with 4.0B
    Thanks in advance,
    Tiago.

    Hi Tiago,
    The purpose of MATERIAL_MAINTAIN_DARK is to create/change the material in background (atleast that is what I can understand from the function module documentation).
    I think the fm that you can try is MATERIAL_BDCDATA (I am not sure if it exists in 40B, please check). If it exists then take a look at where-used list of the fm particularly at report RMMMBIM0.
    MATERIAL_BDCDATA basically will prepare necessary screen logic for you and then you can do a CALL TRANSACTION in dialog mode to take the user into material master.
    Hope this helps..
    Sri

  • Determine material master mandatory fields

    Hello,
    I've developed an workflow based program to create material master.
    I want to set all fields in my proram as required
    which are defined mandatory in Customizing of material master.
    Can anybody give me a hint how to determine the mandatory fields for
    material master creation.
    What i tried up to now:
    I have tried MATERIAL_UPDATE_ALL ( used in MATERIAL_MAINTAIN_DARK )
    and then analysed the retrun table. This is working fine when calling from SE37 but
    fails when integrated in my own program.
    The Problem is:
    In SE37 following statement is true altough the fieldsymbol is empty (it's assigned and
    really empty, so it should not work).
    IF NOT <f3> IS INITIAL.
    In my program it fails, which is IMHO correct.
    Perheps someone can tell me why?
    If you have any other suggestions how to solve my problems let me know.
    Thanks for your time and efforts.
    Andy Iskalla

    Hi,
    In MAterial MAster, you can make any field mandatory or optional . It all depends on the business process.\
    Read the document from belwo link.
    http://help.sap.com/printdocu/core/print46c/en/data/pdf/LOMDMM/LOMDMM.pdf
    Any queries, le tme know.
    Regards,
    Smitha

  • Create Height field from 3D point cloud

    Hello,
    There is a VI called: Create Height Field.vi to craete surface to 3D picture control.
    "Converts a 2D array of values to a 3D height field and applies the height field to a 3D object that appears in a 3D scene."
    This should be perfect for me ( this function interpolates the whole surface) but, I have 3D  [x,y,z] point cloud, where the coordinates are not equally spaced. As I understad this VI can display point cloud with equidistant coordinates. How can I use this tool to display my data?
    I have tried the Create Mesh.vi to display my point cloud, but I really need the interpolated surface also. Could you give me some guide points where and how to do now?
    Thanks in advance,
    +++ In God we believe, in Trance we Trust +++
    [Hungary]
    Solved!
    Go to Solution.

    Hi D60!
    Sorry for the late reply.
    Is your problem still unsolved?
    If yes, I searched for some examples that use the Create Height Field VI.
    I only found one example code on Community: https://decibel.ni.com/content/docs/DOC-4765
    If your data points are not sampled on the same rate, you could use interpolation, to reach the same length.
    I guess the easiest way is to use the Mathscript node for this, like in this eaxmple: http://zone.ni.com/reference/en-XX/help/371361F-01/lvtextmath/msfunc_interpolate/
    Or this VI could be used for the same purpose: http://zone.ni.com/reference/en-XX/help/371361J-01/gmath/interpolate_2d/
    Please let me know, if my suggestions helped. If you have any questions, please don't hesitate to post them.
    Best Regards,
    Balazs Nagy

  • Help BAPI_MATERIAL_SAVE_DATA and customer fields

    Hello all,
    I have a problem updating a customer defined field for mara using the BAPI_MATERIAL_SAVE_DATA. out extension of mara has fields that go over 240 chars in EXTENSIONIN-VALUEPART1. In fact the total length of the customer fields is 258. I put the 18 chars in VALUEPART2. However, the value for the 2 fields that I place in VALUEPART2 is not posted to mara. I checked that the 2 fields are concatenated in the final AMARA_UEB table passed to FM MATERIAL_MAINTAIN_DARK.
    Has anyone had the same problem? I am in a 4.6 environment.
    Thanks,

    check this thread
    Urgent Help required please! BAPI_MATERIAL_SAVEDATA Extension
    check the notes mentioned in my post, and you need to add some entries to the table T130F
    Edited by: Vijay Babu Dudla on Oct 3, 2008 11:57 PM

  • Problems with update, material_maintain_dark

    Hi everybody,
    i have a minor Problem with the FM mentioned above.
    I have to update the MBEW (ZPLP2 and ZPLD2)
    in the end i  get the return-code '0', but the material (price in MBEW) is still not changed.
    Pleas have a look at the following code, maybe you have an answer for me
    LOOP AT xl_marc INTO wa_marc WHERE nplpr  GT '0.00' AND hknpr NE space.
        wa_mara-matnr = wa_marc-matnr.
        wa_mara-pstat = 'G'.
        wa_mara-tranc = 0000000001.
        wa_mara-tcode = 'MM02'.
        APPEND wa_mara TO xl_mara.
        wa_marc1-matnr = wa_marc-matnr.
        wa_marc1-werks = xs_00002-low.
        wa_marc1-tranc = 0000000001.
        APPEND wa_marc1 TO xl_marc1.
        wa_mbew-mandt = sy-mandt.
        wa_mbew-matnr = wa_marc-matnr.
        wa_mbew-zplp2 = wa_marc-nplpr.
        wa_mbew-bwkey = xs_00002-low.
        wa_mbew-zpld2 = sy-datum.
        wa_mbew-tranc = 0000000001.
        APPEND wa_mbew TO xl_mbew.
        CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
          EXPORTING
           flag_muss_pruefen               = 'X'
          sperrmodus                      = 'E'
           max_errors                      = 9999
            p_kz_no_warn                    = 'N'
            kz_prf                          = ' '
      KZ_VERW                         = 'X'
       kz_aend                         = 'X'
      KZ_DISPO                        = 'X'
      KZ_TEST                         = ' '
       NO_DATABASE_UPDATE              = ' '
      CALL_MODE                       = ' '
      CALL_MODE2                      = ' '
            user                            = sy-uname
      SUPPRESS_ARRAY_READ             = ' '
      FLG_MASS                        = ' '
        IMPORTING
           matnr_last                      = wa_marc-matnr
           number_errors_transaction       = numerror
        TABLES
            amara_ueb                       = xl_mara
            amarc_ueb                       = xl_marc1
            ambew_ueb                       =   xl_mbew
         EXCEPTIONS
           kstatus_empty                   = 1
           tkstatus_empty                  = 2
           t130m_error                     = 3
           internal_error                  = 4
           too_many_errors                 = 5
           update_error                    = 6
           OTHERS                          = 7
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDLOOP.
    Thanks for any help!
    regards
    Thomas

    Sorry to bother you again,
    okay i implemented this bapi.
    But the MBEW is still not updated
    Any solutions?
    regards
    Thomas

  • Field not ready for input

    Hi All,
    I am trying to upload few materials using 'MATERIAL_MAINTAIN_DARK' FM.
    But I am getting few warning messages as shown below.
    The field MBEW-VJVPR is not ready for input and was therefore not transferred
    The field MBEW-VMVPR is not ready for input and was therefore not transferred
    The field MBEW-ZPLP1 is not ready for input and was therefore not initialized
    Can someone please let me know the reason for the above warning messages?
    Thanks and Regards,
    Sachin M M

    Please check thru MM01 whether these fields are display only or can be input enabled ?

  • Fields in DSO & Cube

    Hi experts,
    I have the field 0fiscyear in my dso and also in the cube. But
    when creating transformation the field 0fiscyear is present in
    the dso but not in the cube. So that i am unable to create
    transformation for 0fiscyear.Anyone please explain me what
    should i do to make the field visible in the cube.
    And one more question. How can we select or hide the fields
    of 0fi_ar_3.This data source is not visible in LBWE.
    Full points will be assigned.
    Thanks & Regards,
    V N.

    Hi VN,
        Goto SBIW->Application Specific>Logistics>manage extract struvctures>initialization->appl specific setup of statistical dat -->select inventory mangement perform setup>
    in the select materil movement/Setup: Invoice Verification, Revaluation as per your choice to load.
    direct transaction OLI1BW for material movement
    OLIZBW for invoice verification
    once you gets into statistical setup give name of the run and termination time and date to setup then gofor excution
    once setup tables start loading gotoRSA3 which is extrac chekor to chk u r datasource data
    before all this make sure your data source as active.
    i hope this is clear na
    mahesh
    Edited by: Mahesh Kumar on May 19, 2008 7:00 AM
    Edited by: Mahesh Kumar on May 19, 2008 7:01 AM

  • Fields in Creation of free goods VBN1

    hi everybody,
    Can somebody expalin in detail the fields in creation of free goods(T-vbn1) like free goods quantity,additional quantity,documnet quantity and calculation rule....
    <b>Please dont copy paste anything form SAP help....I read that one......</b>
    I would appreciate if u explain with your sentence..
    Will reward point if it helps.
    Ghassan

    Hi Gafoor,
    Material
    Material, for which free goods is to be
    granted
    Minimum quantity
    Minimum quantity for which free
    goods can be granted
    From
    Quantity of sales material
    FGQ--- Quantity unit of free goods material
    Free goods -- Quantity of free goods with reference to the quantity and quantity unit of the sales material.
    AQU - Quantity unit of the free goods additional quantity
    Rule - Calculation rule
    Prorata
    whole units
    unit related
    D -- Delivery controlling -  it tells how you can manage the delivery of free goods with respect to the main item ordered.
    Additional material -  Additional material (only available for entry in exclusive free goods)
    Hope it helps. Please reward if helpful.
    Thanks & Regards
    Sadhu Kishore

  • Open Field in ALV Report

    Hi all,
    i have to develop a ALV report.
    In that report i have to put a open quantity column , so that the user can enter values in that, and that value should get updated in the database.
    So please suggest me how to develop such report with open field.
    Thanks in advance,
    Regards,
    Pawan

    Hi,
    Try executing the below code
    REPORT YMS_EDITBLOCKALV.
    TABLES : rmmg1,MCHB, mkpf.
    DATA: BEGIN OF t_mseg OCCURS 0,
    zeile LIKE mseg-zeile,
    menge LIKE mseg-menge,
    meins LIKE mseg-meins,
    matnr LIKE mseg-matnr,
    werks LIKE mseg-werks,
    charg LIKE mseg-charg,
    bwart LIKE mseg-bwart,
    END OF t_mseg.
    DATA:BEGIN OF t_mchb OCCURS 0.
    INCLUDE STRUCTURE mchb.
    data flag type c.
    matnr LIKE mchb-matnr,
    charg LIKE mchb-charg,
    werks LIKE mchb-werks,
    clabs LIKE mchb-clabs,
    DATA END OF t_mchb.
    TYPE-POOLS slis.
    data: progname like sy-repid,
    fieldcattab TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    data tabindex type i.
    data wa_matnr LIKE mchb-matnr.
    progname = sy-repid.
    SELECTION-SCREEN BEGIN OF BLOCK b_b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS s_docno FOR mkpf-mblnr. " OBLIGATORY.
    PARAMETERS p_docyr LIKE mkpf-mjahr. " OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b_b1.
    START-OF-SELECTION.
    SELECT zeile
    menge
    meins
    matnr
    werks
    charg
    bwart
    FROM mseg
    INTO TABLE t_mseg
    WHERE mblnr IN s_docno AND mjahr = p_docyr.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 1.
    fieldcattab-fieldname = 'ZEILE'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-fix_column = 'X'.
    fieldcattab-seltext_l = 'Item'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 2.
    fieldcattab-fieldname = 'MENGE'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Quantity'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 3.
    fieldcattab-fieldname = 'MEINS'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Unit'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 4.
    fieldcattab-fieldname = 'MATNR'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Material'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 5.
    fieldcattab-fieldname = 'WERKS'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Plant'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 6.
    fieldcattab-fieldname = 'CHARG'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Batch No'.
    APPEND fieldcattab.
    CLEAR fieldcattab.
    fieldcattab-col_pos = 7.
    fieldcattab-fieldname = 'BWART'.
    fieldcattab-tabname = 'T_MSEG'.
    fieldcattab-seltext_l = 'Inventory'.
    fieldcattab-hotspot = 'X'.
    APPEND fieldcattab.
    end-of-selection.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = PROGNAME
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = 'USERCOMMAND1'
    I_CALLBACK_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT =
    IT_FIELDCAT = fieldcattab[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IT_ALV_GRAPHICS =
    IT_ADD_FIELDCAT = fieldcattab
    IT_HYPERLINK =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = t_mseg
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    FORM usercommand1 USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
    slis_selfield.
    CASE r_ucomm.
    WHEN '&IC1'.
    tabindex = rs_selfield-tabindex.
    read table t_mseg INDEX tabindex.
    select * from mchb into table t_mchb where matnr = t_mseg-matnr.
    clear fieldcattab.
    CLEAR fieldcattab[].
    fieldcattab-col_pos = 1.
    fieldcattab-fieldname = 'FLAG'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-fix_column = 'X'.
    fieldcattab-seltext_l = 'Check Box'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    fieldcattab-checkbox = 'X'.
    APPEND fieldcattab.
    clear fieldcattab.
    fieldcattab-col_pos = 2.
    fieldcattab-fieldname = 'MATNR'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-fix_column = 'X'.
    fieldcattab-seltext_l = 'Material'.
    fieldcattab-emphasize = 'C1'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    fieldcattab-checkbox = 'X'.
    APPEND fieldcattab.
    clear fieldcattab.
    fieldcattab-col_pos = 3.
    fieldcattab-fieldname = 'CHARG'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-seltext_l = 'Batch No'.
    fieldcattab-emphasize = 'C2'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    APPEND fieldcattab.
    clear fieldcattab.
    fieldcattab-col_pos = 4.
    fieldcattab-fieldname = 'WERKS'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-seltext_l = 'Plant'.
    fieldcattab-emphasize = 'C30'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    APPEND fieldcattab.
    clear fieldcattab.
    fieldcattab-col_pos = 5.
    fieldcattab-fieldname = 'CLABS'.
    fieldcattab-tabname = 'T_MCHB'.
    fieldcattab-seltext_l = 'Stock'.
    fieldcattab-emphasize = 'C601'.
    fieldcattab-input = 'X'.
    fieldcattab-edit = 'X'.
    APPEND fieldcattab.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER =
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = PROGNAME
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = 'USERCOMMAND2'
    I_CALLBACK_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT =
    IT_FIELDCAT = FIELDCATTAB[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    IT_ALV_GRAPHICS =
    IT_ADD_FIELDCAT =
    IT_HYPERLINK =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = t_mchb
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endcase.
    endform.
    FORM usercommand2 USING r_ucomm LIKE sy-ucomm rs_selfield TYPE
    slis_selfield.
    CASE r_ucomm.
    WHEN '&IC1'.
    IF rs_selfield-sel_tab_field = 'T_MCHB-MATNR'.
    CALL FUNCTION 'ZALV2'
    EXPORTING
    CTU = 'X'
    MODE = 'E'
    UPDATE = 'A'
    GROUP =
    USER =
    KEEP =
    HOLDDATE =
    NODATA = '/'
    MATNR_001 = '200-200'
    KZSEL_01_002 = 'X'
    IMPORTING
    SUBRC =
    TABLES
    MESSTAB =
    SET PARAMETER ID 'RID' FIELD RMMG1-MATNR.
    CALL TRANSACTION 'MM03' and skip first screen.
    ENDIF.
    ENDCASE.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = progname
    i_callback_user_command = 'USERCOMMAND3'
    it_fieldcat = fieldcattab[]
    TABLES
    t_outtab = t_mchb
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    endcase.
    ENDFORM.
    Regards,
    chandru

Maybe you are looking for

  • Regarding Decimal notation

    Hi, I'm facing an issue in displaying an Quantity field in the report output. I declared a field of type MENGE_D (quantity field) and in debugging i can see the value say 125.000, but when i executed the report, the field value is changing from 125.0

  • Changing the attibutes of a field in the table will affect existing data

    Hi Experts, If I want to changne the field attribute of particular field in the table, this table whoes field is changed is used in 15 more tables.Will that affect the data in production after changing the field attributes in all the 15 tables. Thank

  • No one from Verizon has addressed my previous post, so I'll ask again:

    WHAT IN THE HECK happened during the 5/22/14 update that messed up Android phones on Verizon? Is it possible to UN-update??? I have a Motorola Droid Razr M. ( I have a friend who has a Samsung Galaxy Note, and she is having similar problems as me). 

  • Will recovery disks work on new hard drive

    I just installed new hard drive on hp laptop with Windows 7 64 bit. I used the iso file installation disc. Now I would like to use the recovery disks I made 2.5 years ago to load the original software and drivers as when the pc was new. When I put Di

  • Is bootcamp assistant not working in Mntn Lion?

    I'm trying to run Bootcamp Assistant (for the first time ever) in 10.8 and it is not playing ball. The download process seems extremely slow, it's wasted two blank DVDs by attempting to write to them then giving up and returning an error. So, I tried