LSMW for material master using Batch input recording method

Dears,
I am using Batch input recording method to upload material master data. But while selecting views , I need to scroll to select the vies lets say Plant storage loc view. While scrolling and selecting ,views are not recorded propelry . That is when I run in foreground system selects only basic data and purchasing views but the plant data views are not selected(palnt data views are selected by scrolling while recording).
How to resolve this issue.
Pls help
Regards
Kamesh

HI,
, I need to scroll to select the vies lets say Plant storage loc view. While scrolling and selecting ,views are not recorded propelry
Don,t scroll use Page down button from key Bord
like select Basis view and then press page down button from key board ,then you will get next view now select it
Regards
Kailas Ugale

Similar Messages

  • LSMW for  Vendor Master using Batch Input/Direct

    Hi Folk,
    I'm trying to create a LSMW for  Vendor Master using Batch Input/Direct Input and in the step Create Batch Inout Session a error message appears:
    Trans.     1 XK01: Acct already exists; general area not being processed.
    Can somebody help me with this...........

    Hi,
    Check manually create vendor. Check with recording steps means strucutre creadred while you choose BDC recording option. With same data r u able to create vendor.
    Regards
    Md.MahaboobKhan

  • Issue in LSMW for material master using standard input program RMDATIND!!

    Hello guys,
    I have a issue in LSMW for material master.
    I have a custom field in MARA table. which I want to add in my LSMW.
    I added the field in BMMH1 structure. I'm passing the value to this field, But it is not populated in the table when I run it.
    Is there anything else I need to do apart from addition of field in the structure BMMH1.
    Thanks in advance for your help.
    Regards,
    Sumeet....

    see oss note 44410, it gives you a step by step overview.
    https://service.sap.com/sap/support/notes/44410

  • LSMW FOR MATERIAL MASTER USING BAPI_MATERIAL_SAVEDATA -Adding Custom Fields

    Hi Gurus,
    I'm developing LSMW for Material Master Upload using BAPI method.
    Object:BUS1001006
    BAPI:BAPI_MATERIAL_SAVEDATA
    MESSAGE TYPE: MATMAS_BAPI
    BASIC TYPE : MATMAS_BAPI03.
    There is a requirement to use/map a custom field. Upon research custom field can be added to the parameter EXTENSIONIN and EXTENSIONINX, but I have no Idea on how to do it with LSMW. Please advise what approach is needed.
    Thanks and Regards,
    Jay

    Hi Gurus,
    I got the following code below.
    The custom field won't get updated.... Please advise on what should I do... I've checked different forums and still can't come up with the solution... Please advise..
    REPORT ztest_extend_matmas1.
    STRUCTURE
    TABLES:
    bapimathead, "Headerdata
    bapi_mara, "Clientdata
    bapi_marax, "Clientdatax
    bapi_marc, "Plantdata
    bapi_marcx, "Plantdatax
    bapi_makt, "Material description
    bapiparex, "Extensionstruktur
    bapiparexx,
    bapiret2. "Return messages
    DATA:
    bapi_te_mara LIKE bapi_te_mara,
    bapi_te_marax LIKE bapi_te_marax,
    v_file TYPE string.
    INTERNAL TABLE
    *to store the output data
    DATA:BEGIN OF it_material_number OCCURS 0.
            INCLUDE STRUCTURE bapimatinr.
    DATA:END OF it_material_number.
    *for materialtext
    DATA:BEGIN OF it_materialdesc OCCURS 0.
            INCLUDE STRUCTURE bapi_makt .
    DATA:END OF it_materialdesc.
    *für z-feld
    DATA:BEGIN OF it_bapiparex OCCURS 0.
            INCLUDE STRUCTURE bapiparex.
    DATA:END OF it_bapiparex.
    *für z-feldx
    DATA:BEGIN OF it_bapiparexx OCCURS 0.
            INCLUDE STRUCTURE bapiparexx.
    DATA:END OF it_bapiparexx.
    *to return messages
    DATA:BEGIN OF it_return2 OCCURS 0.
            INCLUDE STRUCTURE bapiret2.
    DATA:END OF it_return2.
    DATA:BEGIN OF it_return OCCURS 0.
            INCLUDE STRUCTURE bapiret1.
    DATA:END OF it_return.
    DATA
    lt_messages      TYPE bapiret2_t.
    PROCESSING
    *bapimathead-material = it_material_number-material.
    bapimathead-material = '100-2520'.
    bapimathead-ind_sector = 'P'.
    bapimathead-matl_type = 'AEM'.
    bapimathead-basic_view = 'X'.
    bapimathead-purchase_view = 'X'.
    bapimathead-inp_fld_check = 'I'.
    *bapimathead-BASIC_VIEW = 'X'.
    *bapimathead-SALES_VIEW = 'X'.
    *bapimathead-PURCHASE_VIEW = 'X'.
    *bapimathead-MRP_VIEW = 'X'.
    *bapimathead-FORECAST_VIEW = 'X'.
    *bapimathead-WORK_SCHED_VIEW = 'X'.
    *bapimathead-PRT_VIEW = 'X'.
    *bapimathead-STORAGE_VIEW = 'X'.
    *bapimathead-WAREHOUSE_VIEW = 'X'.
    bapi_mara-matl_group = '0001'.
    bapi_mara-old_mat_no = '100-251'.
    bapi_mara-base_uom = 'ST'.
    bapi_marax-matl_group = 'X'.
    bapi_marax-old_mat_no = 'X'.
    bapi_marax-base_uom = 'X'.
    bapi_marc-plant = '1000'.
    bapi_marcx-plant = '1000'.
    it_materialdesc-langu = 'EN'.
    it_materialdesc-matl_desc = 'DESC'.
    APPEND it_materialdesc.
    *bapi_te_mara-material = it_material_number-material.
    bapimathead-material = '100-2520'.
    *bapi_te_mara-zzforst = '4148'.
    bapi_te_mara-material = '100-2520'.
    bapi_te_mara-zzmar_field1 = '4148'.
    *bapi_te_marax-material = it_material_number-material.
    bapimathead-material = '100-2520'.
    *bapi_te_marax-zzforst = 'X'.
    bapi_te_marax-material  = '100-2520'.
    bapi_te_marax-zzmar_field1 = 'X'.
    it_bapiparex-structure = 'BAPI_TE_MARA'.
    it_bapiparex-valuepart1 = bapi_te_mara.
    APPEND it_bapiparex.
    it_bapiparexx-structure = 'BAPI_TE_MARAX'.
    it_bapiparexx-valuepart1 = bapi_te_marax.
    APPEND it_bapiparexx.
    CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
      EXPORTING
        headdata            = bapimathead
        clientdata          = bapi_mara
        clientdatax         = bapi_marax
        plantdata           = bapi_marc
        plantdatax          = bapi_marcx
      IMPORTING
        return              = it_return2
      TABLES
        materialdescription = it_materialdesc
        extensionin         = it_bapiparex
        extensioninx        = it_bapiparexx
        returnmessages      = lt_messages.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    THanks and Regards,
    Jay
    Edited by: jhayyy on May 17, 2011 6:54 AM

  • LSMW FOR MATERIAL MASTER USING BAPI_MATERIAL_SAVEDATA

    Hi Gurus,
    Im trying to develop lsmw for material master upload using bapi method.
    Object:BUS1001006
    BAPI:BAPI_MATERIAL_SAVEDATA
    MESSAGE TYPE: MATMAS_BAPI
    BASIC TYPE : MATMAS_BAPI01.
    I m unable to find parameters to load gross_weight volume and volume unit and also problem loading the custom fields of material master. Any body who has worked on this one, can you please help me.
    Thanks
    venkat

    The BAPI_MATERAIL_SAVEDATA support the gross_weight or the volume via the tables UNITSOFMEASURE and UNITSOFMEASUREX.
    eg.
    UNIT_OF_WT =KG
    ALT_UNIT = PCS
    NUMERATOR = 1
    DENOMINATR =1
    GROSS_WT =1000
    All the customer specific field are supported by the EXTENSIONIN and EXTENSIONINX tables.

  • LSMW for material master upload

    Hi gurus
    i have one problem while uploading material master with LSMW.
    I have murged 2 company codes in one so while creating material master system is asking me tax classification data in sales view for 2 country sales org and distrubition channel. I am using sap std LSMW for material master creation.
    system is giving me error as " tax classification data not maintained completely".
    need your valuable help to solve this problem

    Tax classification data is mandatory field in Sales view of MM01.
    Check out you mapping for the tax classification fields. usually classification value is 0 OR 1.
    You can first test the values in MM01 Sales View with the legacy data you have and this way you will able to find the mandatory fields also and can see the valid values for the fields.
    Remember you may have more than one Tax Classification values depending on the country code.
    For that you can add those many columns in legacy data file and map them.
    Hope it helps.

  • LSMW for Material master data

    Hi,
    Anybody can help me, how to make LSMW for Material master data.
    Thanks in Advance
    Arjun

    pls follow the thread:
    http://help.sap.com/saphelp_46c/helpdata/en/f6/ca0766a7a911d1950500a0c930e0da/frameset.htm
    regards,
    indranil

  • Error in the LSMW for vendor master using standard batch/direct input

    I am facing the problem in the LSMW for the Vendor master data. The vendor is initially created for the company code 350 by using LSMW. NOw when I try to uploasd the same vendor using the same LSMW for the company code 450 then I get the error in the Bach input creation as follows:
    Batch Input Interface for Vendors
    FB012                    Session 1 : Special character for 'empty field' is /
    FB007                    Session 1 session name VNDR_CREATE_ was opened
    FB104                    Trans. 2 XK01 : Acct already exists; general area not being processed
    FB125                    ... Data in table BLFA1 cannot be processed
    FB016                    ... Last header record ...
    FB014                    ... BLF00-STYPE 1
    FB014                    ... BLF00-TCODE XK01
    FB014                    ... BLF00-LIFNR 300951
    FB014                    ... BLF00-BUKRS 402
    FB014                    ... BLF00-EKORG /
    FB014                    ... BLF00-KTOKK VEND
    FB017                    ... Last data record ...
    FB014                    ... BLFA1-STYPE 2
    FB014                    ... BLFA1-TBNAM BLFA1
    FB014                    ... BLFA1-ANRED /
    FB014                    ... BLFA1-NAME1 SAVOIE AUTOMATISME DEXIS
    This is because when we use XK01 to create the vendor by using the

    Please check this answered link:
    Re: LSMW for Vendor Master
    LSMW Upload vendor master data
    Edited by: Afshad Irani on May 5, 2010 12:42 PM

  • Upload sales text for material master using LSMW direct input method

    Hello Experts,
    I was trying to upload sales text for a material master using LSMW direct input method.
    I followed the following steps for the same
    Tab dlimited Text file format
    MATNR           LONGTEXT                                                     LINE       
    MATERIAL1    LONGTEXT FOR MATERIAL MATERIAL1       1
    Step1 -> Maintain object attributes
    Object -> 0001
    Method-> 0001
    Program name -> /SAPDMC/SAP_LSMW_IMPORT_TEXTS
    Program type -> D
    Step2 -> Maintain Source Structure
    Source structure -> LONG_TEXT            Source structure for long text
    Step 3-> Maintain souce file
    Source Fields
    ZLONG_TEXT             Source structure for long text
                           MATNR                         C(018)    MATNR
                           LTEXT                          C(132)    LTEXT
    Step 4-> Maintain structure relationship
    Structure Relations
    /SAPDMC/LTXTH Long Texts: Header                                           <<<< ZLONG_TEXT Source structure for long text
                  Select Target Structure /SAPDMC/LTXTH .
    /SAPDMC/LTXTL Long Texts: Row                                              <<<< ZLONG_TEXT Source structure for long text
                 Select Target Structure /SAPDMC/LTXTL .
    Step 5-> Maintain Field mapping and conversion rules
    Here i have assigned constan rules to couple of them like
    /SAPDMC/LTXTH                  Long Texts: Header
    Fields
       OBJECT                Texts: Application Object
                                    Rule :   Constant
                                    Code:    /SAPDMC/LTXTH-OBJECT = 'MVKE'.
       NAME                  Name
                                    Source:  ZLONG_TEXT-MATNR (MATNR)
                                    Rule :   Transfer (MOVE)
                                    Code:    /SAPDMC/LTXTH-NAME = ZLONG_TEXT-MATNR.
       ID                         Text ID
                                    Rule :   Constant
                                    Code:    /SAPDMC/LTXTH-ID = '0001'.
       SPRAS                 Language Key
                                    Rule :   Constant
                                    Code:    /SAPDMC/LTXTH-SPRAS = 'E'.
    /SAPDMC/LTXTL                  Long Texts: Row
      Fields
        TEXTFORMAT     Tag column
                                    Rule :   Constant
                                    Code:    /SAPDMC/LTXTL-TEXTFORMAT = '/'.
        TEXTLINE             Text Line
                                    Source:  ZLONG_TEXT-LTEXT (LTEXT)
                                    Rule :   Transfer (MOVE)
                                    Code:    /SAPDMC/LTXTL-TEXTLINE = ZLONG_TEXT-LTEXT.
    Step6 -> Specify file
    Legacy Data          On the PC (Frontend)
                 Data                           D:\Sales_Longtext.txt
    Step7 -> Assign File
    ZLONG_TEXT Source structure for long text
                  Data D:\Sales_Longtext.txt
    Step8 -> Read data
    Output result
    Source Structure             Read      Written        Not Written
    ZLONG_TEXT              1                1              0
    Transactions Read:            1
    Records Read:                   1
    Transactions Written:         1
    Records Written:                 1
    Step 8 -> Display read data
    Field Name                    Field Text Field Value
    MATNR                          MATNR      MATERIA1
    LTEXT                            LTEXT      SALES TEXT FOR Material MATERIAL1
    Step 9 -> Convert data
    File Read:          ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.read
    File Written:       ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.conv
    Transactions Read:                 1
    Records Read:                        1
    Transactions Written:              1
    Records Written:                     2
    Step 10 -> Display converted data
    1 /SAPDMC/LTXTH                   1MVKE      MATERIAL1                                                                   0001E
    2 /SAPDMC/LTXTL                   2/ SALES TEXT FOR Material MATERIAL1
    Step 11 -> Start direct input program
    Output result for the same
    Legacy System Migration Workbench
    Project:                              ZNRD_PRJ1       ORH
    Subproject:                        ZNRD_SUBPRJ2    Upload long text
    Object:                               ZNRD_LTEXT      Long text tru direct input
    File :                                   ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.conv
    Long Texts in Total:                                1
    Successfully Transferred Long Texts:  1
    Non-Transferred Long Texts:                 0
    Now when i check the material master sales view -> sales text it is empty.
    Please help me with the same.
    Regards,
    Ranjith N

    Hello Experts, I was trying to upload sales text for a material master using LSMW direct input method.
    I followed the following steps for the same
    Tab dlimited Text file format
    MATNR             LONGTEXT                                              LINE
    MATERIAL1     LONGTEXT FOR MATERIAL MATERIAL1 1 *************************************************************************************************************
    Step1 -> Maintain object attributes
    Object -> 0001
    Method-> 0001
    Program name -> /SAPDMC/SAP_LSMW_IMPORT_TEXTS
    Program type -> D
    Step2 -> Maintain Source Structure
    Source structure -> LONG_TEXT Source structure for long text
    Step 3-> Maintain souce file Source Fields
    ZLONG_TEXT Source structure for long text
    MATNR C(018) MATNR
    LTEXT C(132) LTEXT
    Step 4-> Maintain structure relationship
    Structure Relations 
    /SAPDMC/LTXTH Long Texts:  Header <<<< ZLONG_TEXT Source structure for long text
    Select Target Structure
    /SAPDMC/LTXTH . /SAPDMC/LTXTL Long Texts: Row <<<< ZLONG_TEXT Source structure for long text
    Select Target Structure /SAPDMC/LTXTL .
    Step 5-> Maintain Field mapping and conversion rules
    Here i have assigned constan rules to couple of them like
    /SAPDMC/LTXTH Long Texts: Header
    Fields
    OBJECT            Texts: Application Object
                             Rule : Constant
                              Code: /SAPDMC/LTXTH-OBJECT = 'MVKE'.
    NAME               Name
                             Source: ZLONG_TEXT-MATNR (MATNR)
                             Rule : Transfer (MOVE)
                             Code: /SAPDMC/LTXTH-NAME = ZLONG_TEXT-MATNR.
    ID                     Text ID
                             Rule : Constant
                             Code: /SAPDMC/LTXTH-ID = '0001'.
    SPRAS             Language Key
                             Rule : Constant
                            Code: /SAPDMC/LTXTH-SPRAS = 'E'.
    /SAPDMC/LTXTL Long Texts: Row
    Fields
    TEXTFORMAT  Tag column 
                             Rule : Constant
                             Code: /SAPDMC/LTXTL-TEXTFORMAT = '/'.
    TEXTLINE          Text Line
                             Source: ZLONG_TEXT-LTEXT (LTEXT)
                             Rule : Transfer (MOVE)
                             Code: /SAPDMC/LTXTL-TEXTLINE = ZLONG_TEXT-LTEXT.
    Step6 -> Specify file Legacy
    Data On the PC (Frontend)
                 Data D:\Sales_Longtext.txt
    Step7 -> Assign File ZLONG_TEXT
    Source structure for long text
              Data D:\Sales_Longtext.txt
    Step8 -> Read data
    Output result
    Source Structure            Read                Written                Not Written
    ZLONG_TEXT                  1                       1                            0
    Transactions Read          1
    Records Read:                1
    Transactions Written:      1
    Records Written:             1
    Step 8 -> Display read data
    Field Name             Field Text                      Field Value
    MATNR                    MATNR                         MATERIA1
    LTEXT                     LTEXT                            SALES TEXT FOR Material MATERIAL1
    Step 9 -> Convert data
    File Read: ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.read
    File Written: ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.conv
    Transactions Read:    1
    Records Read:           1
    Transactions Written: 1
    Records Written:         2
    tep 10 -> Display converted data
    1 /SAPDMC/LTXTH     1    MVKE        MATERIAL1 0001   E
    2 /SAPDMC/LTXTL     2/   SALES TEXT FOR Material       MATERIAL1
    Step 11 -> Start direct input program
    Output result for the same
    Legacy System Migration Workbench Project:
    ZNRD_PRJ1  ORH
    Subproject:   ZNRD_SUBPRJ2     Upload long text
    Object:          ZNRD_LTEXT          Long text tru direct input
    File :              ZNRD_PRJ1_ZNRD_SUBPRJ2_ZNRD_LTEXT.lsmw.conv
    Long Texts in Total:                                1
    Successfully Transferred Long Texts:  1
    Non-Transferred Long Texts:                0
    Now when i check the material master sales view -> sales text it is empty. Please help me with the same.
    Regards,
    Ranjith N

  • About material master data batch input

    hello
        i wrote a batch input for material master data. but it can't work ,i can't use it to create material.hope someone help me!thanks.code is below.
    report z_mat_batchinput no standard page heading
          line-size 255 message-id YB.
           mat batch input
    include bdcrecx1.
    include .
    tables: mara,marm,MARC,MARD,T134,NRIV,T006A,T023,T001W,T001L,
            TVKO,TVTW,T025,TTGR,TLGR,TVKWZ,T006.
    data: DIMID like t006-DIMID.
    data: flag, K, tmp.
    DATA: X TYPE I.
    ************ÉÏÔØÎļþÄÚ±í************************
    data: begin of record occurs 0,
            MATNR(018),        " ÎïÁϺÅ
            MTART(004),        " ÎïÁÏÀàÐÍ
    **generaldata1**
            MAKTX(040),        " ÎïÁÏÃèÊö
           EAKTX(040),        " Ó¢ÎÄÃèÊö
            MEINS(003),        " »ù±¾¼ÆÁ¿µ¥Î»
            MATKL(009),        " ÎïÁÏ×é
            BISMT(018),        " ¾ÉÎïÁϺÅ
           EXTWG(018),        " ÍⲿÎïÁÏ×é
           SPART(002),        " ²¿ÃÅ
            MTPOS_MARA(004),   " ÆÕͨÏîÄ¿Àà±ð×é
            BRGEW(017),        " ëÖØ
            GEWEI(003),        " ÖØÁ¿µ¥Î»
            NTGEW(017),        " ¾»ÖØ
            VOLUM(017),        " Ìå»ý
            VOLEH(003),        " Ìå»ýµ¥Î»
            GROES(032),        " Á¿¸Ù
            MAGRV(004),        " ÎïÁÏ×éµÄ°ü×°Îï
    **generaldata2**
            NORMT(018),        " ¹¤Òµ±ê×¼ÃèÊö
            FERTH(018),        " ÀàÐÍ
            WRKST(048),        " ¹æ¸ñ
    **generaldata1**
           EAN11(018),        " ²úÆ·±íʶÂë
    **generaldata2**
           ZEIAR(003),        " ÎĵµÀàÐÍ£¬ºÏÀí´¢±¸ÖÜתÆÚ
            WERKS(004),        " ¹¤³§
            VKORG(004),        " ÏúÊÛ×éÖ¯
            VTWEG(002),        " ·ÖÏúÇþµÀ
    **salesorg 1**
           VRKME(003),        " ÏúÊÛµ¥Î»
           VMREN(006),        " ÏúÊÛµ¥Î»×ª»»Òò×Ó
           VMREZ(006),        " »ù±¾µ¥Î»×ª»»Òò×Ó
            SPART(002),        " ²úÆ·×é
            DWERK(004),        " ½»»õ¹¤³§
            TAXKM(001),        " ÎïÁÏË°·ÖÀà
    **salesorg 2**
            KONDM(002),        " ÎïÁ϶¨¼Û×é
            KTGRM(002),        " ¿ÆÄ¿ÉèÖÃ×é
           MVGR1(003),                                         " ÎïÁÏ×é 1
           MVGR2(003),                                         " ÎïÁÏ×é 2
            MTPOS(004),        " ÏîÄ¿Àà±ð×é
           VERSG(001),        " ÎïÁÏͳ¼Æ×é
    **ÏúÊÛ£ºÒ»°ã/¹¤³§Êý¾Ý**
            MTVFP(002),        " ¿ÉÓÃÐÔ¼ì²é
            XCHPF(001),        " Åú´Î¹ÜÀí
           YCHPF(001),        " ÅúÁ¿¹ÜÀí
            TRAGR(004),        " ÔËÊä×é
            ladgr(004),        " ×°ÔØ×é
    **pur**
           BSTME(003),        " ¶©µ¥µ¥Î»
           UMREZ(006),        " »ù±¾µ¥Î»×ª»»Òò×Ó
           UMREN(006),        " ¶©µ¥µ¥Î»×ª»»Òò×Ó
           WEBAZ(003),        " ÊÕ»õ´¦Àíʱ¼ä
            EKGRP(003),        " ²É¹º×é
          LGORT(004),        " ¿â´æµØ
    **Ò»°ã¹¤³§Êý¾Ý/²Ö´¢1**
           AUSME(003),        " ·¢»õµ¥Î»
           UMREJ(006),        " »ù±¾µ¥Î»×ª»»Òò×Ó
           UMREF(006),        " ·¢»õµ¥Î»×ª»»Òò×Ó
           XCHPF(001),        " ÅúÁ¿¹ÜÀí
    **MRP 1**
           DISGR(004),        " MRP×é
            DISMM(002),        " MRPÀàÐÍ
           FXHOR(003),        " ¼Æ»®µÄʱ½ì
            DISPO(003),        " MRP¿ØÖÆÕß
            DISLS(002),        " ÅúÁ¿
            MAABC(001),        " ABC±êʶ
           BSTFE(018),        " ¹Ì¶¨ÅúÁ¿´óС
    **MRP 2**
           RESKZ(001),        " »ñÈ¡ÀàÐÍ
            BESKZ(001),        " ²É¹ºÀàÐÍ
           SOBSL(002),        " ÌØÊâ²É¹ºÀà
           LGPRO(004),        " ·¢»õ²Ö´¢µØµã
           RGEKZ(001),        " ·´³å
            PLIFZ(003),        " ¼Æ»®½»»õʱ¼ä
           VEBAZ(003),        " ÊÕ»õ´¦Àíʱ¼ä
            DZEIT(008),        "×ÔÖÆÉú²ú
            FHORI(003),        " ¼Æ»®±ß¼ÊÂë
           EISBE(018),        " °²È«¿â´æ
    **MRP 3**
            PERKZ(001),        " ÆÚ¼ä±êʶ
            STRGR(002),        " ²ßÂÔ×é
           VRMOD(001),        " ÏûºÄģʽ
           VINT1(003),        " ÄæÏòÏûºÄÆÚ¼ä
           VINT2(003),        " ÏòÇ°ÏûºÄÆÚ¼ä
            NTVFP(002),        " ¿ÉÓÃÐÔ¼ì²é
    **MRP 4**
           SAUFT(001),        " Öظ´ÖÆÔì±êÖ¾
           SFEPR(004),        " Öظ´Éú²ú²ÎÊýÎļþ
    **¹¤×÷¼Æ»®**
           FEVOR(003),        " Éú²úµ÷¶ÈÔ±
           FRTME(003),        " Éú²úµ¥Î»
           SMREZ(006),        " »ù±¾µ¥Î»×ª»»Òò×Ó
           SMREN(006),        " Éú²úµ¥Î»×ª»»Òò×Ó
           UEETK(001),        " ÎÞÏÞÖƹýÁ¿½»»õ
    **»á¼Æ 1**
            BKLAS(004),        " ÆÀ¹ÀÀà
           BWTTY(001),        " ¹À¼Û·ÖÀà
            VPRSV(001),        " ¼Û¸ñ¿ØÖÆ
            PEINH(006),        " ¼Û¸ñµ¥Î»
            VERPR(015),        " Òƶ¯Æ½¾ù¼Û
            STPRS(015),        " ±ê×¼¼Û
    **»á¼Æ 2**
           BWPRH(014),        " ÉÌÒµ¼Û¸ñ 1
    **³É±¾ 1**
           LOSGR(018),        " ÅúÁ¿³É±¾ºËËã
    **³É±¾ 2**
           ZPLP1(014),        " ¼Æ»®¼Û¸ñ 1
           ZPLD1(010),        " ¼Æ»®ÈÕÆÚ 1
    **qm**
            ART1(8),            "¼ìÑéÀàÐÍ1
            AKTIV1(1),          "ÒѼ¤»î
            QMPUR(1),             "¼¤»î²É¹ºÖÐµÄ QM
            SSQSS(8),          "QM ¿ØÖÆÂë¡¢
           QMATV(8),          "QM¼ìÑéÉèÖÃ
           ART2(8),            "¼ìÑéÀàÐÍ2
           AKTIV2(6),          "ÒѼ¤»î
           ART3(8),            "¼ìÑéÀàÐÍ3
           AKTIV3(6),          "ÒѼ¤»î
          end of record.
    ************ÏÂÔظñʽ/´íÎóÎļþÄÚ±í**************
    data: begin of record1 occurs 0,
            MATNR(018),        " ÎïÁϺÅ
            MTART(008),        " ÎïÁÏÀàÐÍ
    **»ù±¾Êý¾Ý1**
            MAKTX(040),        " ÎïÁÏÃèÊö
           EAKTX(040),        " Ó¢ÎÄÃèÊö
            MEINS(013),        " »ù±¾¼ÆÁ¿µ¥Î»
            MATKL(009),        " ÎïÁÏ×é
            BISMT(018),        " ¾ÉÎïÁϺÅ
           EXTWG(018),        " ÍⲿÎïÁÏ×é
           SPART(002),        " ²¿ÃÅ
            MTPOS_MARA(004),   " ÆÕͨÏîÄ¿Àà±ð×é
            BRGEW(017),        " ëÖØ
            GEWEI(008),        " ÖØÁ¿µ¥Î»
            NTGEW(017),        " ¾»ÖØ
            VOLUM(017),        " Ìå»ý
            VOLEH(008),        " Ìå»ýµ¥Î»
            GROES(032),        " Á¿¸Ù
            MAGRV(014),        " ÎïÁÏ×éµÄ°ü×°Îï
    **»ù±¾Êý¾Ý2**
            NORMT(018),        " ¹¤Òµ±ê×¼ÃèÊö
            FERTH(018),        " ÀàÐÍ
            WRKST(048),        " ¹æ¸ñ
    **»ù±¾Êý¾Ý1**
           EAN11(018),        " ²úÆ·±íʶÂë
    **»ù±¾Êý¾Ý2**
           ZEIAR(003),        " ÎĵµÀàÐÍ£¬ºÏÀí´¢±¸ÖÜתÆÚ
            WERKS(004),        " ¹¤³§
            VKORG(008),        " ÏúÊÛ×éÖ¯
            VTWEG(008),        " ·ÖÏúÇþµÀ
    **ÏúÊÛ×éÖ¯ 1**
           VRKME(003),        " ÏúÊÛµ¥Î»
           VMREN(006),        " ÏúÊÛµ¥Î»×ª»»Òò×Ó
           VMREZ(006),        " »ù±¾µ¥Î»×ª»»Òò×Ó
            SPART(006),        " ²úÆ·×é
            DWERK(008),        " ½»»õ¹¤³§
            TAXKM(010),        " ÎïÁÏË°·ÖÀà
    **ÏúÊÛ×éÖ¯ 2**
            KONDM(010),        " ÎïÁ϶¨¼Û×é
            KTGRM(010),        " ¿ÆÄ¿ÉèÖÃ×é
           MVGR1(003),                                         " ÎïÁÏ×é 1
           MVGR2(003),                                         " ÎïÁÏ×é 2
            MTPOS(010),        " ÏîÄ¿Àà±ð×é
           VERSG(001),        " ÎïÁÏͳ¼Æ×é
    **ÏúÊÛ£ºÒ»°ã/¹¤³§Êý¾Ý**
            MTVFP(010),        " ¿ÉÓÃÐÔ¼ì²é
            XCHPF(008),        " Åú´Î¹ÜÀí
           YCHPF(001),        " ÅúÁ¿¹ÜÀí
            TRAGR(006),        " ÔËÊä×é
            ladgr(006),        " ×°ÔØ×é
    **²É¹º**
           BSTME(003),        " ¶©µ¥µ¥Î»
           UMREZ(006),        " »ù±¾µ¥Î»×ª»»Òò×Ó
           UMREN(006),        " ¶©µ¥µ¥Î»×ª»»Òò×Ó
           WEBAZ(003),        " ÊÕ»õ´¦Àíʱ¼ä
            EKGRP(006),        " ²É¹º×é
          LGORT(004),        " ¿â´æµØ
    **Ò»°ã¹¤³§Êý¾Ý/²Ö´¢1**
           AUSME(003),        " ·¢»õµ¥Î»
           UMREJ(006),        " »ù±¾µ¥Î»×ª»»Òò×Ó
           UMREF(006),        " ·¢»õµ¥Î»×ª»»Òò×Ó
           XCHPF(001),        " ÅúÁ¿¹ÜÀí
    **MRP 1**
           DISGR(004),        " MRP×é
            DISMM(009),        " MRPÀàÐÍ
           FXHOR(003),        " ¼Æ»®µÄʱ½ì
            DISPO(011),        " MRP¿ØÖÆÕß
            DISLS(004),        " ÅúÁ¿
            MAABC(007),        " ABC±êʶ
           BSTFE(018),        " ¹Ì¶¨ÅúÁ¿´óС
    **MRP 2**
           RESKZ(001),        " »ñÈ¡ÀàÐÍ
            BESKZ(008),        " ²É¹ºÀàÐÍ
           SOBSL(002),        " ÌØÊâ²É¹ºÀà
           LGPRO(004),        " ·¢»õ²Ö´¢µØµã
           RGEKZ(001),        " ·´³å
            PLIFZ(012),        " ¼Æ»®½»»õʱ¼ä
           VEBAZ(003),        " ÊÕ»õ´¦Àíʱ¼ä
            DZEIT(008),        "×ÔÖÆÉú²ú
            FHORI(010),        " ¼Æ»®±ß¼ÊÂë
           EISBE(018),        " °²È«¿â´æ
    **MRP 3**
            PERKZ(008),        " ÆÚ¼ä±êʶ
            STRGR(006),        " ²ßÂÔ×é
           VRMOD(001),        " ÏûºÄģʽ
           VINT1(003),        " ÄæÏòÏûºÄÆÚ¼ä
           VINT2(003),        " ÏòÇ°ÏûºÄÆÚ¼ä
            NTVFP(010),        " ¿ÉÓÃÐÔ¼ì²é
    **MRP 4**
           SAUFT(001),        " Öظ´ÖÆÔì±êÖ¾
           SFEPR(004),        " Öظ´Éú²ú²ÎÊýÎļþ
    **¹¤×÷¼Æ»®**
           FEVOR(003),        " Éú²úµ÷¶ÈÔ±
           FRTME(003),        " Éú²úµ¥Î»
           SMREZ(006),        " »ù±¾µ¥Î»×ª»»Òò×Ó
           SMREN(006),        " Éú²úµ¥Î»×ª»»Òò×Ó
           UEETK(001),        " ÎÞÏÞÖƹýÁ¿½»»õ
    **»á¼Æ 1**
            BKLAS(006),        " ÆÀ¹ÀÀà
           BWTTY(001),        " ¹À¼Û·ÖÀà
            VPRSV(008),        " ¼Û¸ñ¿ØÖÆ
            PEINH(008),        " ¼Û¸ñµ¥Î»
            VERPR(015),        " Òƶ¯Æ½¾ù¼Û
            STPRS(015),        " ±ê×¼¼Û
    **»á¼Æ 2**
           BWPRH(014),        " ÉÌÒµ¼Û¸ñ 1
    **³É±¾ 1**
           LOSGR(018),        " ÅúÁ¿³É±¾ºËËã
    **³É±¾ 2**
           ZPLP1(014),        " ¼Æ»®¼Û¸ñ 1
           ZPLD1(010),        " ¼Æ»®ÈÕÆÚ 1
    **ÖÊÁ¿¹ÜÀí**
            ART1(8),            "¼ìÑéÀàÐÍ1
            AKTIV1(6),          "ÒѼ¤»î
            QMPUR(010),             "¼¤»î²É¹ºÖÐµÄ QM
            SSQSS(8),          "QM ¿ØÖÆÂë¡¢
           QMATV(8),          "QM¼ìÑéÉèÖÃ
           ART2(8),            "¼ìÑéÀàÐÍ2
           AKTIV2(6),          "ÒѼ¤»î
           ART3(8),            "¼ìÑéÀàÐÍ3
           AKTIV3(6),          "ÒѼ¤»î
          end of record1.
    selection-screen begin of block 0 with frame title text-001.
    selection-screen begin of line .
    selection-screen position 1.
    parameters: test like rkec1-test .
    selection-screen
      comment 3(4) text-004 for field test.
    selection-screen position 26.
    parameters: oldfile like rlgrap-filename.
    selection-screen
      comment 9(17) text-003 for field oldfile.
    selection-screen: end of line.
    selection-screen begin of line.
    selection-screen position 1.
    parameters: dnldflag like rkec1-test default 'X'.
    selection-screen
      comment 3(4) text-005 for field dnldflag.
    selection-screen position 26.
    parameters: outfile like rlgrap-filename .
    selection-screen
      comment 9(17) text-006 for field outfile.
    selection-screen: end of line.
    selection-screen end of block 0 .
    SELECTION-SCREEN BEGIN OF BLOCK 1 WITH FRAME TITLE TEXT-002.
    selection-screen begin of line.
    selection-screen position 1.
    PARAMETERS: GEN1 LIKE RKEC1-TEST.
    selection-screen
      comment 3(9) text-007 for field GEN1.
    selection-screen position 26.
    PARAMETERS: GEN2 LIKE RKEC1-TEST.
    selection-screen
      comment 28(9) text-008 for field GEN2.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen position 1.
    PARAMETERS: SALORG1 LIKE RKEC1-TEST.
    selection-screen
      comment 3(21) text-009 for field SALORG1.
    selection-screen position 26.
    PARAMETERS: SALORG2 LIKE RKEC1-TEST.
    selection-screen
      comment 28(21) text-010 for field SALORG2.
    selection-screen position 51.
    PARAMETERS: SALPLANT LIKE RKEC1-TEST.
    selection-screen
      comment 53(19) text-011 for field SALPLANT.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen position 1.
    PARAMETERS: PURCHASE LIKE RKEC1-TEST.
    selection-screen
      comment 3(21) text-012 for field PURCHASE.
    selection-screen position 26.
    PARAMETERS: PLTSTRG1 LIKE RKEC1-TEST.
    selection-screen
      comment 28(21) text-018 for field PLTSTRG1.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen position 1.
    PARAMETERS: MRP1 LIKE RKEC1-TEST.
    selection-screen
      comment 3(4) text-013 for field MRP1.
    selection-screen position 13.
    PARAMETERS: MRP2 LIKE RKEC1-TEST.
    selection-screen
      comment 15(4) text-014 for field MRP2.
    selection-screen position 26.
    PARAMETERS: MRP3 LIKE RKEC1-TEST.
    selection-screen
      comment 28(4) text-015 for field MRP3.
    selection-screen position 37.
    PARAMETERS: MRP4 LIKE RKEC1-TEST.
    selection-screen
      comment 39(4) text-016 for field MRP4.
    selection-screen position 51.
    PARAMETERS: PLANTSTR LIKE RKEC1-TEST.
    selection-screen
      comment 53(8) text-017 for field PLANTSTR.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen position 1.
    PARAMETERS: QAU LIKE RKEC1-TEST.
    selection-screen
      comment 3(8) text-023 for field QAU.
    selection-screen position 13.
    PARAMETERS: ACC1 LIKE RKEC1-TEST.
    selection-screen
      comment 15(5) text-019 for field ACC1.
    selection-screen position 26.
    PARAMETERS: ACC2 LIKE RKEC1-TEST.
    selection-screen
      comment 28(5) text-020 for field ACC2.
    selection-screen position 37.
    PARAMETERS: COR1 LIKE RKEC1-TEST.
    selection-screen
      comment 39(5) text-021 for field COR1.
    selection-screen position 51.
    PARAMETERS: COR2 LIKE RKEC1-TEST.
    selection-screen
      comment 53(5) text-022 for field COR2.
    selection-screen end of line.
    SELECTION-SCREEN END OF BLOCK 1.
    at selection-screen on value-request for oldfile.
      call function 'KD_GET_FILENAME_ON_F4'
           EXPORTING
                mask      = ',Îı¾Îļþ(ÖƱí·û·Ö¸ô),*.txt'
                static    = 'X'
           CHANGING
                file_name = oldfile.
    at selection-screen on value-request for outfile.
      call function 'KD_GET_FILENAME_ON_F4'
           EXPORTING
                mask      = ',Microsoft Excel¹¤×÷²¾,*.xls'
                static    = 'X'
           CHANGING
                file_name = outfile.
    initialization.
    ******µÃµ½ÎļþĿ¼*******
      call function 'WS_QUERY'
           EXPORTING
                query  = 'CD'
           IMPORTING
                return = outfile.
      if sy-subrc <> 0.
        message e005 with outfile.
      endif.
      oldfile = outfile.
      concatenate outfile 'mat_fat' into outfile.
    *ÅúÊäÈëĬÈÏÃû³Æ
      group = 'MATBATCHIN'.
    start-of-selection.
      if dnldflag eq 'X' and not ( outfile is initial ).
        perform download_data.
        stop.
      endif.
      perform upload_data.
      if test = ' '.
    *ÊÓͼ²ÎÊý¼ì²é
        IF ( GEN1 NE 'X' AND GEN2 NE 'X' AND SALORG1 NE 'X'
           AND SALORG2 NE 'X' AND SALPLANT NE 'X'
           AND PURCHASE NE 'X' AND PLTSTRG1 NE 'X'
           AND MRP1 NE 'X' AND MRP2 NE 'X' AND MRP3 NE 'X'
               AND MRP4 NE 'X' AND PLANTSTR NE 'X'
           AND ACC1 NE 'X' AND ACC2 NE 'X'
           AND COR1 NE 'X' AND COR2 NE 'X' and qau ne 'X' ) .
          MESSAGE E000 WITH 'ÇëÑ¡ÔñÐèά»¤ÊÓͼ'.
        ENDIF.
        perform open_group.
        SORT RECORD BY WERKS MATNR.
        loop at record.
          perform bdc_fill.
          perform bdc_transaction using 'MM01'.
          clear: bdcdata.
          refresh: bdcdata.
        endloop.
        perform close_group.
      else.
        perform file_check.
      endif.
    end-of-selection.
    *&      Form  UPLOAD_DATA
          ÉÏÔØÅúÊäÈëÊý¾Ý
    -->  p1        text
    <--  p2        text
    form upload_data.
      call function 'WS_UPLOAD'
           EXPORTING
                filename                = oldfile
                filetype                = 'DAT'
           TABLES
                data_tab                = record
           EXCEPTIONS
                conversion_error        = 1
                file_open_error         = 2
                file_read_error         = 3
                invalid_table_width     = 4
                invalid_type            = 5
                no_batch                = 6
                unknown_error           = 7
                gui_refuse_filetransfer = 8
                customer_error          = 9
                others                  = 10.
      if sy-subrc <> 0.
        message E000 with 'ÇëÊäÈëÉÏÔØÎļþ'.
      endif.
      read table record with key MATNR = '**'.
      if sy-tabix lt 1.
        message E000 with 'ÉÏÔØÎļþÎļþÍ·ÓëÊý¾ÝÖ®¼äÎÞ**'.
      endif.
      delete record from 1 to sy-tabix.
    endform.                               " UPLOAD_DATA
    *&      Form  BDC_FILL
          ÅúÊäÈë
    -->  p1        text
    <--  p2        text
    form bdc_fill.
      data: N type I,
            M type I,
            S_MATNR(018),
            test(1) type N.
      PERFORM BDC_FILL_INITALSCR.    "³õʼÆÁÄ»
      tmp = '0'.
      condense record-matnr no-gaps.
      test =  record-matnr(1).
      if test <> ''.
        M = STRLEN( RECORD-MATNR ).
        M = 18 - M.
        DO M TIMES.
          CONCATENATE '0' RECORD-MATNR INTO S_MATNR.
          RECORD-MATNR = S_MATNR.
        ENDDO.
      endif.
    **ÅжÏÎïÁÏ»ù±¾ÊÓͼÊÇ·ñÒѾ±»Î¬»¤¹ý**
      SELECT SINGLE * FROM MARA WHERE MATNR = RECORD-MATNR.
      IF SY-SUBRC NE 0.
        K = '0'.
      Else.
        condense MARA-PSTAT no-gaps.
        N = strlen( mara-pstat ).
        M = 0.
        record-meins = mara-meins.
        do N times.
          K = MARA-PSTAT+M.
          IF K = 'K'.
            EXIT.
          ENDIF.
          M = M + 1.
        enddo.
      ENDIF.
      IF ( ( GEN1 EQ 'X' OR GEN2 EQ 'X' ) AND SALORG1 NE 'X'
         AND SALORG2 NE 'X' AND SALPLANT NE 'X'
         AND PURCHASE NE 'X' AND PLTSTRG1 NE 'X'
         AND MRP1 NE 'X' AND MRP2 NE 'X' AND MRP3 NE 'X'
             AND MRP4 NE 'X' AND PLANTSTR NE 'X'
         AND ACC1 NE 'X' AND ACC2 NE 'X'
         AND COR1 NE 'X' AND COR2 NE 'X' and qau ne 'X' ) .
        IF K EQ 'K'.
          perform bdc_dynpro      using 'SAPLMGMM' '0070'.
          perform bdc_field       using 'BDC_CURSOR'
                                        'MSICHTAUSW-DYTXT(15)'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '/N'.
        ELSE.
          PERFORM BDC_FILL_CHOICEVIEW.   "Ñ¡ÔñÊÓͼ
        ENDIF.
      ELSE.
        PERFORM BDC_FILL_CHOICEVIEW.   "Ñ¡ÔñÊÓͼ
        PERFORM BDC_FILL_ORGVIEW.      "×éÖ¯¼¶±ð
      ENDIF.
      TRANSLATE record-MEINS TO UPPER CASE.
    TRANSLATE record-BSTME TO UPPER CASE.
    TRANSLATE record-VRKME TO UPPER CASE.
    TRANSLATE record-FRTME TO UPPER CASE.
    TRANSLATE record-AUSME TO UPPER CASE.
      if gen1 eq 'X'.
        IF K NE 'K'.
          PERFORM GENERALDATA1.
        ENDIF.
      endif.
      if gen2 eq 'X'.
        IF K NE 'K'.
          perform generaldata2.
        ENDIF.
      endif.
      if salorg1 eq 'X'.
        perform salorg1.
      endif.
      if salorg2 eq 'X'.
        perform salorg2.
      endif.
      if salplant eq 'X'.
        perform salplant.
      endif.
      if purchase eq 'X'.
        perform purchasedata.
      endif.
      if mrp1 eq 'X'.
        perform MRP1.
      endif.
      if mrp2 eq 'X'.
        perform MRP2.
      endif.
      if mrp3 eq 'X'.
        perform MRP3.
      endif.
      if mrp4 eq 'X'.
        perform MRP4.
      endif.
      if PLANTSTR eq 'X'.
        perform PLANTSTR.
      endif.
      if PLTSTRG1 eq 'X'.
        perform PLTSTRG1.
      endif.
      if qau eq 'X'.
        perform qualitydata.
      endif.
      if ACC1 eq 'X'.
        perform ACC1DATA.
      endif.
      if ACC2 eq 'X'.
        perform ACC2DATA.
      endif.
      if COR1 eq 'X'.
        perform COR1DATA.
      endif.
      if COR2 eq 'X'.
        perform COR2DATA.
      endif.
      perform BDC_SAVE.
    endform.                               " BDC_FILL
    *&      Form  GENERALDATA1
          Ò»°ãÊý¾Ý 1
    -->  p1        text
    <--  p2        text
    form generaldata1.
      perform bdc_dynpro      using 'SAPLMGMM' '4004'.
      perform bdc_field       using 'BDC_OKCODE'
                                    "'=ZU01'.
                                    '/00'.
      perform bdc_field       using 'MAKT-MAKTX'
                                    record-MAKTX.       " ÎïÁÏÃèÊö
      perform bdc_field       using 'MARA-MEINS'
                                    record-MEINS.       " »ù±¾¼ÆÁ¿µ¥Î»
      perform bdc_field       using 'MARA-MATKL'
                                    record-MATKL.       " ÎïÁÏ×é
      perform bdc_field       using 'MARA-BISMT'
                                    record-BISMT.
    perform bdc_field       using 'MARA-EXTWG'
                                   record-EXTWG.
    perform bdc_field       using 'MARA-SPART'
                                   record-SPART.
      perform bdc_field       using 'MARA-MTPOS_MARA'
                                    record-MTPOS_MARA.
      perform bdc_field       using 'BDC_CURSOR'
                                    'MARA-GROES'.
      perform bdc_field       using 'MARA-BRGEW'
                                    record-BRGEW.
      if record-gewei = '' and ( salorg1 = 'X' or salorg2 = 'X'
                           or salplant = 'X' ).
        perform bdc_field       using 'MARA-GEWEI'
                                      'KG'.              " ÖØÁ¿µ¥Î»
      else.
        perform bdc_field       using 'MARA-GEWEI'
                                      record-GEWEI.      " ÖØÁ¿µ¥Î»
      endif.
      perform bdc_field       using 'MARA-NTGEW'
                                    record-NTGEW.
      perform bdc_field       using 'MARA-VOLUM'
                                    record-VOLUM.
      perform bdc_field       using 'MARA-VOLEH'
                                    record-VOLEH.
      perform bdc_field       using 'MARA-GROES'
                                    record-GROES.
    condense record-EAN11 no-gaps.
    if record-EAN11 <> ''.
       perform bdc_field       using 'MARA-EAN11'
                                     record-EAN11.
       perform bdc_field       using 'MARA-NUMTP'
                                     'HT'.
    endif.
      perform bdc_field       using 'MARA-MAGRV'
                                    record-MAGRV.
    perform bdc_dynpro      using 'SAPLMGMM' '4300'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=ZU02'.
    condense record-EAKTX no-gaps.
    if record-EAKTX <> ''.
       perform bdc_field       using 'SKTEXT-SPRAS(2)'
                                     'EN'.
       perform bdc_field       using 'SKTEXT-MAKTX(2)'
                                     record-EAKTX.
    endif.
    perform bdc_dynpro      using 'SAPLMGMM' '4300'.
    perform bdc_field       using 'BDC_OKCODE'
                                   '=MAIN'.
    if record-meins <> 'PAK'.
       perform bdc_field       using 'SMEINH-UMREN(05)'
                                     '1'.
       perform bdc_field       using 'SMEINH-MEINH(05)'
                                     'PAK'.
       perform bdc_field       using 'SMEINH-UMREZ(05)'
                                     '1'.
    endif.
      perform bdc_dynpro      using 'SAPLMGMM' '4004'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '/00'.
    endform.                               " GENERALDATA
    *&      Form  generaldata2
          Ò»°ãÊý¾Ý 2
    -->  p1        text
    <--  p2        text
    FORM generaldata2.
      perform bdc_dynpro      using 'SAPLMGMM' '4004'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '/00'.
      perform bdc_field       using 'MAKT-MAKTX'
                                    record-MAKTX.
      perform bdc_field       using 'BDC_CURSOR'
                                    'MARA-NORMT'.
      condense record-ferth no-gaps.
      if record-ferth <> ''.
        perform bdc_field       using 'MARA-FERTH'
                                      record-FERTH.
      endif.
      perform bdc_field       using 'MARA-NORMT'
                                    record-NORMT.
      perform bdc_field       using 'MARA-WRKST'
                                    record-WRKST.
    perform bdc_field       using 'MARA-ZEIAR'
                                   record-ZEIAR.
    ENDFORM.                    " generaldata2
    *&      Form  salorg1
          ÏúÊÛ×éÖ¯ 1
    -->  p1        text
    <--  p2        text
    FORM salorg1.
      condense RECORD-SPART no-gaps.
      PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '4000'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM BDC_FIELD       USING 'MAKT-MAKTX'
                                    RECORD-MAKTX.     " ÎïÁÏÃèÊö
      IF K NE 'K'.
        perform bdc_field       using 'MARA-MEINS'
                                      record-MEINS.   " »ù±¾¼ÆÁ¿µ¥Î»
      ENDIF.
      perform bdc_field       using 'MARA-SPART'
                                    record-SPART.     " ²úÆ·×é
      perform bdc_field       using 'MVKE-DWERK'
                                    record-DWERK.     " ½»»õ¹¤³§
      PERFORM BDC_FIELD       USING 'MG03STEUER-TAXKM(01)'
                                    RECORD-TAXKM.     " ÎïÁÏË°·ÖÀà
    condense RECORD-VRKME no-gaps.
    IF RECORD-MEINS <> RECORD-VRKME and RECORD-VRKME <> ''.
       perform bdc_field       using 'MVKE-VRKME'
                                     record-VRKME.     " ÏúÊÛµ¥Î»
       select single * from MARM where matnr = record-matnr
                     and meinh = record-vrkme.
       if SY-SUBRC NE 0.
         tmp = 'W'.
         select single * from t006 where MSEHI = record-meins.
         if t006-DIMID = 'AAAADL'.
           DIMID = ''.
         else.
           DIMID = t006-DIMID.
         endif.
         select single * from t006 where MSEHI = record-vrkme.
         if dimid <> t006-DIMID.
           PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0510'.
           PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                         '=ENTR'.
           perform bdc_field       using 'RMMZU-UMREN'
                                         record-VMREN.  "ÏúÊÛµ¥Î»×ª»»Òò×Ó
           perform bdc_field       using 'RMMZU-UMREZ'
                                         record-VMREZ.  "»ù±¾µ¥Î»×ª»»Òò×Ó
           PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '4000'.
           PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                         '/00'.
         endif.
       endif.
    ENDIF.
      perform bdc_dynpro      using 'SAPLMGMM' '4200'.
      perform bdc_field       using 'BDC_OKCODE'      " µ÷ÓÃË°Àà×ÓÆÁÄ»
                                    '/00'.
      PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '4000'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'      " ·µ»ØÏúÊÛ×éÖ¯ 1ÆÁÄ»
                                    '/00'.
    ENDFORM.                                                    " salorg1
    *&      Form  salorg2
          ÏúÊÛ×éÖ¯ 2
    -->  p1        text
    <--  p2        text
    FORM salorg2.
      PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '4000'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '/00'.
      PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                    'MVKE-KTGRM'.
    PERFORM BDC_FIELD       USING 'MVKE-VERSG'
                                   RECORD-VERSG.     " ÎïÁÏͳ¼Æ×é
      PERFORM BDC_FIELD       USING 'MVKE-KTGRM'
                                    RECORD-KTGRM.     " ¿ÆÄ¿ÉèÖÃ×é
      PERFORM BDC_FIELD       USING 'MVKE-KONDM'
                                    RECORD-KONDM.     " ÎïÁ϶¨¼Û×é
      perform bdc_field       using 'MVKE-MTPOS'
                                    RECORD-MTPOS.     " ÏîÄ¿Àà±ð×é
    PERFORM BDC_FIELD       USING 'MVKE-MVGR1'
                                   RECORD-MVGR1.               " ÎïÁÏ×é 1
    PERFORM BDC_FIELD       USING 'MVKE-MVGR2'
                                   RECORD-MVGR2.               " ÎïÁÏ×é 2
    ENDFORM.                                                    " salorg2
    *&      Form  salplant
          ÏúÊÛ£ºÒ»°ã/¹¤³§Êý¾Ý
    -->  p1        text
    <--  p2        text
    FORM salplant.
      PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '4000'.
      PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                    '/00'.
      select single * from marc where matnr = record-matnr
                                  and werks = record-werks.
      if SY-SUBRC NE 0  OR  MARC-MTVFP = ''.
        PERFORM BDC_FIELD       USING 'MARC-MTVFP'
                                      RECORD-MTVFP.     " ¿ÉÓÃÐÔ¼ì²é
      endif.
      PERFORM BDC_FIELD       USING 'MARA-TRAGR'
                                      RECORD-TRAGR.   " ÔËÊä×é
      PERFORM BDC_FIELD       USING 'MARC-LADGR'
                                    RECORD-LADGR.     " ×°ÔØ×é
      perform bdc_field       using 'MARC-XCHPF'
                                    record-XCHPF.     " ÅúÁ¿¹ÜÀí
    ENDFORM.                    " salplant
    *&      Form  PURCHASEDATA
          ²É¹ºÊý¾Ý
    -->  p1        text
    <--  p2        text
    form purchasedata.
      perform bdc_dynpro      using 'SAPLMGMM' '4000'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '/00'.
      perform bdc_field       using 'BDC_CURSOR'
                                    'MARC-WEBAZ'.
      perform bdc_field       using 'MAKT-MAKTX'
                                    record-MAKTX.
      IF K NE 'K'.
        perform bdc_field       using 'MARA-MEINS'
                                      record-MEINS.     " »ù±¾¼ÆÁ¿µ¥Î»
        perform bdc_field       using 'MARA-MATKL'
                                      record-MATKL.     " ÎïÁÏ×é
      ENDIF.
    condense RECORD-BSTME no-gaps.
    IF RECORD-MEINS <> RECORD-BSTME and RECORD-BSTME <> ''.
       perform bdc_field       using 'MARA-BSTME'
                                     record-BSTME.     " ¶©µ¥µ¥Î»
       select single * from MARM where matnr = record-matnr
                     and meinh = record-bstme.
       if SY-SUBRC NE 0 and
             ( record-vrkme <> record-bstme or tmp <> 'W' ).
         tmp = 'W'.
         select single * from t006 where MSEHI = record-meins.
         if t006-DIMID = 'AAAADL'.
           DIMID = ''.
         else.
           DIMID = t006-DIMID.
         endif.
         select single * from t006 where MSEHI = record-bstme.
         if dimid <> t006-DIMID.
           PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0510'.
           PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                         '=ENTR'.
           perform bdc_field       using 'RMMZU-UMREN'
                                         record-UMREN.  "¶©µ¥µ¥Î»×ª»»Òò×Ó
           perform bdc_field       using 'RMMZU-UMREZ'
                                         record-UMREZ.  "»ù±¾µ¥Î»×ª»»Òò×Ó
           PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '4000'.
           PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                         '/00'.
         endif.
       endif.
    ENDIF.
      perform bdc_field       using 'MARC-EKGRP'
                                    record-EKGRP.       " ²É¹º×é
    perform bdc_field       using 'MARC-WEBAZ'
                                   record-WEBAZ.       " ÊÕ»õ´¦Àíʱ¼ä
    endform.                               " PURCHASEDATA
    *&      Form  MRP1
          text
    -->  p1        text
    <--  p2        text
    FORM MRP1.
      perform bdc_dynpro      using 'SAPLMGMM' '4000'.
      perform bdc_field       using 'BDC_OKCODE'
                                    '/00'.
    perform bdc_field       using 'MAKT-MAKTX'
                                   record-MAKTX.       " ÎïÁÏÃèÊö
    IF K NE 'K'.
       perform bdc_field       using 'MARA-MEINS'
                                     record-MEINS.     " »ù±¾µ¥Î»
    ENDIF.
    perform bdc_field       using 'MARC-DISGR'
                                   record-DISGR.       " MRP×é
      perform bdc_field       using 'MARC-MAABC'
                                    record-MAABC.       " ABC±êʶ
      perform bdc_field       using 'MARC-DISMM'
                                    record-DISMM.       " MRPÀàÐÍ
    perform bdc_field       using 'MARC-FXHOR'
                                   record-FXHOR.       " ¼Æ»®µÄʱ½ì
      perform bdc_field       using 'MARC-DISPO'
                                    record-DISPO.       " MRP¿ØÖÆÕß
      perform bdc_field       using 'MARC-DISLS'
                                    record-DISLS.       " ÅúÁ¿
    perform bdc_field       using 'MARC-BSTFE'
                   

    Here is a sample program which creates a material with the bare minmal fields,  this will get you started.
    report zrich_0003 .
    data: headdata type bapimathead.
    data: clientdata type bapi_mara.
    data: clientdatax type bapi_marax.
    data: descdata type table of BAPI_MAKT with header line.
    data: return type  bapiret2 .
    data: returnm type table of bapi_matreturn2 with header line.
    data: xmara type mara.
    parameters: p_matnr type mara-matnr.
    headdata-material        = p_matnr.
    headdata-ind_sector      = 'M'.
    headdata-matl_type       = 'FERT'.
    headdata-basic_view = 'X'.
    clientdata-BASE_UOM   = 'EA'.
    clientdatax-BASE_UOM   = 'X'.
    clientdata-old_mat_no = 'Old Material'.
    clientdatax-old_mat_no = 'X'.
    clientdata-division = '00'.
    clientdatax-division = 'X'.
    descdata-LANGU = sy-langu.
    descdata-MATL_DESC = 'This is the description'.
    append descdata.
    call function 'BAPI_MATERIAL_SAVEDATA'
      exporting
        headdata                   = headdata
        clientdata                 = clientdata
        clientdatax                = clientdatax
    *   PLANTDATA                  =
    *   PLANTDATAX                 =
    *   FORECASTPARAMETERS         =
    *   FORECASTPARAMETERSX        =
    *   PLANNINGDATA               =
    *   PLANNINGDATAX              =
    *   STORAGELOCATIONDATA        =
    *   STORAGELOCATIONDATAX       =
    *   VALUATIONDATA              =
    *   VALUATIONDATAX             =
    *   WAREHOUSENUMBERDATA        =
    *   WAREHOUSENUMBERDATAX       =
    *   SALESDATA                  =
    *   SALESDATAX                 =
    *   STORAGETYPEDATA            =
    *   STORAGETYPEDATAX           =
    importing
       return                     = return
      tables
        MATERIALDESCRIPTION        = descdata
    *   UNITSOFMEASURE             =
    *   UNITSOFMEASUREX            =
    *   INTERNATIONALARTNOS        =
    *   MATERIALLONGTEXT           =
    *   TAXCLASSIFICATIONS         =
        returnmessages             = returnm
    *   PRTDATA                    =
    *   PRTDATAX                   =
    *   EXTENSIONIN                =
    *   EXTENSIONINX               =
    check sy-subrc  = 0.
    Regards,
    Rich Heilman

  • LSMW dump with '/' for PRODPER field  for AR load using Batch input.

    I am getting an dump saying
    Unable to interpret "/" as a number for  IF BBSEG-PRODPER(1)           
    which is last field in the lsmw .
    I defaulted to 200810 and also tried with blank and 102008 even though the dump exists.
    let me know .any clue

    BBSEG is intended for Batch Input, there should be only CHAR fields in it, if the field is a standard one look for OSS notes related, if it belongs to a customer include, correct your include (or CI include like CI_COBL_BI) as suggested in OSS notes mentioned above and use a char field with the length of the external format (e.g. 10 for date, etc.)
    The IF BBSEG-PRODPER(1) syntax is presupposing a CHAR field, but when the ABAP executes it first check the whole field BBSEG-PRODPER, and if this is not a CHAR field you got a conversion error. A "patch" solution would be to use CATCH SYSTEM-EXCEPTIONS CONVERSION_ERRORS = 1.  / ENDCATCH to catch the runtime error. You could also bypass the problem by redefining the field as char, use OVERLAY of FIELD-SYMBOLS for that.
    Regards

  • Classification view creation via LSMW for Material master

    Hi,
    We are planning to have an LSMW for creation of material master along with classification view for configurable materials.
    Though we see a flag to indicate classification view  - XEIC1                        Indicator: take Classification view into account
    We do not see a structure where in we can pass all the characteristics and the corresponding values.
    Is this something possible only with BAPIs such as -> BAPI_OBJCL_CREATE after creation of other view for that material.
    Regards,
    HR

    Hi,
    Thanks for the response. This is helpful.
    However, we were intending to use a single LSMW for creation of all views of material master including classification view. Right now we are using Program RMDATIND as direct input method in LSMW.
    Please let me know if there is a way to use single LSMW for creation of all views of material master.
    Thanks
    HR
    Edited by: Hema Rao on Jan 8, 2009 7:58 AM

  • LSMW for routing with standard batch input

    Hello All,
    I am trying to prepare one LSMW for routing upload for PP module. Routing data contains header data, operation data and master inspection characteristics data.
    I have created three source structures viz. material- task list header, task header data, operation and inspection.
    Header has been assigned to target structure BIMPL- Batch Input Structure for Allocation of Mat. to Task Lists,
    Task header data source structure has been assigned to BIPKO- Batch Input Structure for Task List Header,
    Operation source structure has been assigned to target structure BIPPO- Batch input structure for task list operation,
    and inspection source structure has been assigned to BIPMK- Inspection characteristics for batch input of task lists.
    Every source structure has been identified with an identifier value of which have been set as H, I,J,K for all source structures resp.
    The excel file has been prepared as follows,
    H     MATNR     WERKS     PLNNR     PLNAL               
    H     100045     1000     50000043     1               
    H     100045     1000     50000043     2               
    I     MATNR     WERKS     PLNNR     PLNAL     VALID_FROM     USAGE     STATUS
    I     100045     1000     50000043     1     01012000     1                1
    I     100045    1000     50000043     2     01012000     1                 1
    I have mentioned here the combination of first two structures only. But it contains data of other two source structures as well (for identifier J & K).
    The data from the excel is copied to the flat file and same is specified in LSMW in the step 'Specify file'.
    In 'Assign file' step the flat file is assigned to all the four source structure.
    Now at the time of reading data system is throwing me an error as 'Ensure field sequence is correct for data for mutiple source structures' Message no. /SAPDMC/LSMW_OBJ_060026
    How to overcome this?
    <removed by moderator> answers will be greatly appreciated........
    Mimiri
    Edited by: Thomas Zloch on Jul 11, 2011 10:16 AM

    Hello ,
    have you maintained this check box for the key fields"
    LSMW>Maintain Source fields>double click on fieds : MATNR WERKS PLNNR PLNAL
    Selection Parameter for "Import/Convert Data"-->Tick this check box
    regards

  • Lsmw using batch input record session

    hi experts,
                 My  requirement is to generate purchase info record number (PIR) for the flat file data containing vendor acc number(lifnr) , plant(werks) , purchase organization combination using me11 t code. after processing  the bdc for the first time it generates a PIR but for the next record it is showing the first PIR number.  how to give the default value as empty  to PIR  in LSMW.
    thanks & regards,
    srikanth.

    hi archana,
                  I tried it in BCD call transaction, it is not working in LSMW . If I default the field infnr(PIR) with ' '  next value is populating to the infnr fileld.
    Thanks,
    srikanth

  • Material master upload-Batch input method

    I am trying to extend sales view.When i try to upload,the system is thrwing error msg
    *     172     You have not fully maintained the tax classifications*
    The field is TAXKM,but this field not availbale in the field mapping.How to map this field & upload the tax
    Tax classification material

    Hi,
    Use Standard Batch/Direct Input method.
    Here you can use BMMH2 structure where the field TAXKM will be populated.
    Regards,
    Amol

Maybe you are looking for

  • Erro na J1BNFE (nota fiscal de entrada - categoria F1)

    Bom dia, Estou com um erro no monitor de nf-e, para uma nota de entrada - categoria F1: Os erros são: Erro de validação: Campo 44-Place Access Key: V11 (Campo ID) Erro de validação: Campo 44-Place Access Key: V06 (Campo ID) Erro de validação: Campo 4

  • Problems populating complex type structre in bpel

    Hi All, I'm trying to populate with no good results a complexType variable that contains n maxOccurs="unbounded" element. This is the schema: <xsd:complexType name="logWarnParam"> <xsd:sequence> <xsd:element name="Message" type="xsd:string"/> <xsd:el

  • What are process type and process variant in process chain?

    hi all, Can anyone explain me what is process type and process variant in process chain ? regds hari

  • How to Modify a POWL

    Hi Guys, I have a POWL in travel management (Type FITV_POWL_TRIPS_TR) and I want to add a column in this POWL that is not standard. Where can I customize this new column? Thanks, Thiago Cavalcante

  • Has anyone implemented Program exits in Workflow?

    hi all, i know we can capture workflow container values in the program exits. but i need to manipulate/change the container values and pass the new container values back to the task from the class. so how should i implement the binding and the class.