<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: MM01 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/mm01/m-p/2829730#M662230</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This step-by-step code sample helps you upload data using BDC.	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Procedure&lt;/P&gt;&lt;P&gt; 	Give the t-code shdb in the command field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	Click the new recording button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	Give a name to the recording and the t-code you want to record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g.: &lt;/P&gt;&lt;P&gt;          Recording                           : ZMAT_UPLOAD&lt;/P&gt;&lt;P&gt;          Transaction code                : MM01&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	When you click save, it takes you to t-code (MM01) you would like to do recording for upload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	Record carefully. Fill in the details you want to upload. In this case I have entered the material no, industry sector, material type, material description and basic unit of measure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	Then the Transaction recorder &amp;#150; edit recording ZMAT_UPLOAD screen is displayed. You can edit your recording or just save it and click back button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	Select your recording and click create program button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	Enter the program name say ZMAT_UPLOAD.Select the transfer from recording option. Save it.Give the program title, type as executable program and click source code button at the bottom.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	The following piece of code is generated automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report ZMAT_UPLOAD&lt;/P&gt;&lt;P&gt;no standard page heading line-size 255.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;include bdcrecx1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform open_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '0060'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                       'RMMG1-MATNR'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                       '=AUSW'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'RMMG1-MATNR'&lt;/P&gt;&lt;P&gt;                                       'MYMATERIAL10'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'RMMG1-MBRSH'&lt;/P&gt;&lt;P&gt;                                       'P'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'RMMG1-MTART'&lt;/P&gt;&lt;P&gt;                                       'ZOH'. &lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '0070'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                       'MSICHTAUSW-DYTXT(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                       '=ENTR'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'MSICHTAUSW-KZSEL(01)'&lt;/P&gt;&lt;P&gt;                                       'X'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4004'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                       '=BU'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                       'MY MATERIAL10'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                       'MARA-MEINS'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                       'G'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'MARA-MTPOS_MARA'&lt;/P&gt;&lt;P&gt;                                       'NORM'.&lt;/P&gt;&lt;P&gt;perform bdc_transaction using 'MM01'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perform close_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	From the above code it is clear that recording has been created using matnr = mymaterial10 , industry sector = p , material type = zoh , description = my material10 , basic unit of measure = g. For our case I have assumed industry sector and material type to be constant and have not included in flat file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The bold lines in the below code are the changes made to the sap generated program , to upload our data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report ZMAT_UPLOAD&lt;/P&gt;&lt;P&gt;       no standard page heading line-size 255.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;types declaration..........................................................................&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;types : begin of t_mat,&lt;/P&gt;&lt;P&gt;   matnr(20),&lt;/P&gt;&lt;P&gt;   desc(50),&lt;/P&gt;&lt;P&gt;   uom(5),&lt;/P&gt;&lt;P&gt;end of t_mat.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;internal table and workarea declaration.......................................&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;data : i_mat type table of t_mat.&lt;/P&gt;&lt;P&gt;data : wa_mat type t_mat.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;include bdcrecx1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;moving the flat file content to internal table................................&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CALL FUNCTION 'UPLOAD'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;         FILETYPE                                      = 'DAT'&lt;/P&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;P&gt;         data_tab                                           = i_mat&lt;/P&gt;&lt;P&gt;         .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform open_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;loop at i_mat into wa_mat.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '0060'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                   'RMMG1-MATNR'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '=AUSW'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RMMG1-MATNR'&lt;/P&gt;&lt;P&gt;                                   &amp;lt;b&amp;gt; wa_mat-matnr.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RMMG1-MBRSH'&lt;/P&gt;&lt;P&gt;                                    'P'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RMMG1-MTART'&lt;/P&gt;&lt;P&gt;                                    'ZOH'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro   using 'SAPLMGMM' '0070'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                    'MSICHTAUSW-DYTXT(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '=ENTR'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'&lt;/P&gt;&lt;P&gt;                                    'X'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro   using 'SAPLMGMM' '4004'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '=BU'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                             &amp;lt;b&amp;gt;       wa_mat-desc.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                    'MARA-MEINS'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  &amp;lt;b&amp;gt;  wa_mat-uom.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARA-MTPOS_MARA'&lt;/P&gt;&lt;P&gt;                                    'NORM'.&lt;/P&gt;&lt;P&gt;perform bdc_transaction using 'MM01'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perform close_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Hope this is helpful, Do reward points&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Oct 2007 07:35:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-03T07:35:14Z</dc:date>
    <item>
      <title>MM01</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mm01/m-p/2829727#M662227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear sir,&lt;/P&gt;&lt;P&gt;i m ABAP Programmer..&lt;/P&gt;&lt;P&gt;i need step by step procedure create material using MM01.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Regards,&lt;/P&gt;&lt;P&gt;Shankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 06:02:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mm01/m-p/2829727#M662227</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T06:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: MM01</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mm01/m-p/2829728#M662228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi dear..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;its better if you open a material in MM03..and create new using same values..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if u still not able to find any value open table MARA, MARC MVKE etc to see the value to put in screen.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this idea ll helpful..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 06:04:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mm01/m-p/2829728#M662228</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T06:04:40Z</dc:date>
    </item>
    <item>
      <title>Re: MM01</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mm01/m-p/2829729#M662229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Maria,&lt;/P&gt;&lt;P&gt;check this sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES : IBIPPARMS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*&amp;amp; Types&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF TY_ITAB,&lt;/P&gt;&lt;P&gt;MATNR TYPE MATNR, "MATERIAL NO&lt;/P&gt;&lt;P&gt;WERKS TYPE WERKS, "PLANT&lt;/P&gt;&lt;P&gt;STLAN TYPE STLAN, "BOM USAGE&lt;/P&gt;&lt;P&gt;DATUV TYPE DATUV, "VALID DATE&lt;/P&gt;&lt;P&gt;BMENG TYPE BMENG, "BASE QUANTITY&lt;/P&gt;&lt;P&gt;IDNRK TYPE IDNRK, "COMPONENT&lt;/P&gt;&lt;P&gt;MENGE TYPE RC29P-MENGE, "QUANTITY&lt;/P&gt;&lt;P&gt;MEINS TYPE MEINS, "UNIT&lt;/P&gt;&lt;P&gt;POSTP TYPE POSTP, "ITEM CATEGORY&lt;/P&gt;&lt;P&gt;END OF TY_ITAB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;*&amp;amp; DATA Declaration&lt;/P&gt;&lt;P&gt;***********************************************************************&lt;/P&gt;&lt;P&gt;DATA : IT_ITAB TYPE TABLE OF TY_ITAB WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA : IT_BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA : IT_BDCMSGCOLL TYPE TABLE OF BDCMSGCOLL WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA : P_FILE1 TYPE STRING ,"FILE NAME&lt;/P&gt;&lt;P&gt;V_LINES TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : IT1_ITAB like IT_ITAB occurs 0 with header line.&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;*&amp;amp; SELECTION-SCREEN DECLARATION&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.&lt;/P&gt;&lt;P&gt;PARAMETERS : P_FILE TYPE LOCALFILE OBLIGATORY."FILE NAME&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN END OF BLOCK B1 .&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;AT-SELECTION-SCREEN DECALRATION *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;*&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear : P_FILE.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'F4_FILENAME'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;PROGRAM_NAME = SYST-CPROG&lt;/P&gt;&lt;P&gt;DYNPRO_NUMBER = SYST-DYNNR&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;FILE_NAME = P_FILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF P_FILE IS NOT INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;VALIDATE FILE TYPE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;PERFORM SUB_VALIDATE_txt_TYPE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;START-OF-SELECTION&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform upload.&lt;/P&gt;&lt;P&gt;perform bdc.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form upload&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt; p1 text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;lt;-- p2 text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM upload .&lt;/P&gt;&lt;P&gt;clear : P_FILE1.&lt;/P&gt;&lt;P&gt;P_FILE1 = P_FILE.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'GUI_UPLOAD'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;FILENAME = P_FILE1&lt;/P&gt;&lt;P&gt;FILETYPE = 'ASC'&lt;/P&gt;&lt;P&gt;HAS_FIELD_SEPARATOR = 'X'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;DATA_TAB = IT_ITAB&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;FILE_OPEN_ERROR = 1&lt;/P&gt;&lt;P&gt;FILE_READ_ERROR = 2&lt;/P&gt;&lt;P&gt;NO_BATCH = 3&lt;/P&gt;&lt;P&gt;GUI_REFUSE_FILETRANSFER = 4&lt;/P&gt;&lt;P&gt;INVALID_TYPE = 5&lt;/P&gt;&lt;P&gt;NO_AUTHORITY = 6&lt;/P&gt;&lt;P&gt;UNKNOWN_ERROR = 7&lt;/P&gt;&lt;P&gt;BAD_DATA_FORMAT = 8&lt;/P&gt;&lt;P&gt;HEADER_NOT_ALLOWED = 9&lt;/P&gt;&lt;P&gt;SEPARATOR_NOT_ALLOWED = 10&lt;/P&gt;&lt;P&gt;HEADER_TOO_LONG = 11&lt;/P&gt;&lt;P&gt;UNKNOWN_DP_ERROR = 12&lt;/P&gt;&lt;P&gt;ACCESS_DENIED = 13&lt;/P&gt;&lt;P&gt;DP_OUT_OF_MEMORY = 14&lt;/P&gt;&lt;P&gt;DISK_FULL = 15&lt;/P&gt;&lt;P&gt;DP_TIMEOUT = 16&lt;/P&gt;&lt;P&gt;OTHERS = 17.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;ENDFORM. " upload&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;form bdc.&lt;/P&gt;&lt;P&gt;*COPY DATA FROM IT_ITAB INTO IT_ITAB1&lt;/P&gt;&lt;P&gt;****************************************************&lt;/P&gt;&lt;P&gt;IT1_ITAB[] = IT_ITAB[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*IF SY-SUBRC &amp;lt;&amp;gt; 0 OR IT_ITAB IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;UNABLE TO UPLOAD DATA FROM FLAT FILE&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;*MESSAGE I003(ZMSG).&lt;/P&gt;&lt;P&gt;*ENDIF.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form bdc&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt; p1 text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;lt;-- p2 text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*FORM BDC.&lt;/P&gt;&lt;P&gt;LOOP AT IT_ITAB.&lt;/P&gt;&lt;P&gt;REFRESH IT_BDCDATA .&lt;/P&gt;&lt;P&gt;*FIRST SCREEN&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPLCSDI' '0100'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'RC29N-DATUV'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29N-MATNR'&lt;/P&gt;&lt;P&gt;IT_ITAB-MATNR.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29N-WERKS'&lt;/P&gt;&lt;P&gt;IT_ITAB-WERKS.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29N-STLAN'&lt;/P&gt;&lt;P&gt;IT_ITAB-STLAN.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29N-DATUV'&lt;/P&gt;&lt;P&gt;IT_ITAB-DATUV.&lt;/P&gt;&lt;P&gt;*SECOND SCREEN&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPLCSDI' '0110'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'RC29K-BMENG'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29K-BMENG'&lt;/P&gt;&lt;P&gt;IT_ITAB-BMENG.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29K-STLST'&lt;/P&gt;&lt;P&gt;'1'.&lt;/P&gt;&lt;P&gt;*THIRD SCREEN&lt;/P&gt;&lt;P&gt;LOOP AT IT1_ITAB WHERE MATNR = IT_ITAB-MATNR.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPLCSDI' '0111'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'RC29K-LABOR'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPLCSDI' '0140'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'RC29P-POSTP(02)'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;*perform bdc_field using 'RC29P-IDNRK(01)'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IT_ITAB-IDNRK.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;perform bdc_field using 'RC29P-IDNRK(SY-TABIX)'&lt;/P&gt;&lt;P&gt;IT_ITAB-IDNRK.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-IDNRK(02)'&lt;/P&gt;&lt;P&gt;'100017'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-MENGE(SY-TABIX)'&lt;/P&gt;&lt;P&gt;IT_ITAB-MENGE.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-MENGE(02)'&lt;/P&gt;&lt;P&gt;'200'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-MEINS(SY-TABIX)'&lt;/P&gt;&lt;P&gt;IT_ITAB-MEINS.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-MEINS(02)'&lt;/P&gt;&lt;P&gt;'kg'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-POSTP(SY-TABIX)'&lt;/P&gt;&lt;P&gt;IT_ITAB-POSTP.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-POSTP(02)'&lt;/P&gt;&lt;P&gt;'l'.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPLCSDI' '0130'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'RC29P-POSNR'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-POSNR'&lt;/P&gt;&lt;P&gt;'0010'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-IDNRK'&lt;/P&gt;&lt;P&gt;'100012'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-MENGE'&lt;/P&gt;&lt;P&gt;'150'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-MEINS'&lt;/P&gt;&lt;P&gt;'KG'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPLCSDI' '0131'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'RC29P-POTX1'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-SANKA'&lt;/P&gt;&lt;P&gt;'X'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPLCSDI' '0130'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'RC29P-POSNR'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-POSNR'&lt;/P&gt;&lt;P&gt;'0020'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-IDNRK'&lt;/P&gt;&lt;P&gt;'100017'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-MENGE'&lt;/P&gt;&lt;P&gt;'200'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-MEINS'&lt;/P&gt;&lt;P&gt;'KG'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPLCSDI' '0131'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'/00'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'RC29P-POTX1'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'RC29P-SANKA'&lt;/P&gt;&lt;P&gt;'X'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro using 'SAPLCSDI' '0140'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;'RC29P-POSNR(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;'=FCBU'.&lt;/P&gt;&lt;P&gt;*perform bdc_transaction using 'CS01'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*perform close_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'CS01' USING IT_BDCDATA MODE 'N'&lt;/P&gt;&lt;P&gt;UPDATE 'S'&lt;/P&gt;&lt;P&gt;MESSAGES INTO IT_BDCMSGCOLL.&lt;/P&gt;&lt;P&gt;CLEAR IT_ITAB.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**GET THE NUMBER OF LINES&lt;/P&gt;&lt;P&gt;*DESCRIBE TABLE IT_BDCMSGCOLL LINES V_LINES.&lt;/P&gt;&lt;P&gt;**ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form SUB_VALIDATE_TXT_TYPE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt; p1 text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;&amp;lt;-- p2 text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM SUB_VALIDATE_txt_TYPE .&lt;/P&gt;&lt;P&gt;DATA : STR1 TYPE LOCALFILE,&lt;/P&gt;&lt;P&gt;STR2 TYPE CHAR3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPLIT P_FILE AT '.' INTO STR1 STR2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TRANSLATE STR2 TO LOWER CASE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF STR2 NE 'txt'.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;please enter '.txt' file format&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;MESSAGE I001(ZMSG).&lt;/P&gt;&lt;P&gt;LEAVE LIST-PROCESSING.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM. " SUB_VALIDATE_TXT_TYPE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form bdc_dynpro&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt;P_0160 text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt;P_0161 text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM bdc_dynpro USING PROGRAM DYNPRO.&lt;/P&gt;&lt;P&gt;CLEAR IT_BDCDATA.&lt;/P&gt;&lt;P&gt;IT_BDCDATA-PROGRAM = PROGRAM.&lt;/P&gt;&lt;P&gt;IT_BDCDATA-DYNPRO = DYNPRO.&lt;/P&gt;&lt;P&gt;IT_BDCDATA-DYNBEGIN = 'X'.&lt;/P&gt;&lt;P&gt;APPEND IT_BDCDATA.&lt;/P&gt;&lt;P&gt;ENDFORM. " bdc_dynpro&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; Form bdc_field&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt;P_0160 text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;--&amp;gt;P_ENDLOOP text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM bdc_field USING FNAM FVAL.&lt;/P&gt;&lt;P&gt;CLEAR IT_BDCDATA. .&lt;/P&gt;&lt;P&gt;IT_BDCDATA-FNAM = FNAM.&lt;/P&gt;&lt;P&gt;IT_BDCDATA-FVAL = FVAL.&lt;/P&gt;&lt;P&gt;APPEND IT_BDCDATA.&lt;/P&gt;&lt;P&gt;ENDFORM. " bdc_field &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or this link is helpfull for u..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://allaboutsap.blogspot.com/2007/03/bdc-explained-part-2-sample-program-for.html" target="test_blank"&gt;http://allaboutsap.blogspot.com/2007/03/bdc-explained-part-2-sample-program-for.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward is usefull.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank's.&lt;/P&gt;&lt;P&gt;Patil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 06:19:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mm01/m-p/2829729#M662229</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T06:19:15Z</dc:date>
    </item>
    <item>
      <title>Re: MM01</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mm01/m-p/2829730#M662230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This step-by-step code sample helps you upload data using BDC.	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Procedure&lt;/P&gt;&lt;P&gt; 	Give the t-code shdb in the command field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	Click the new recording button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	Give a name to the recording and the t-code you want to record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g.: &lt;/P&gt;&lt;P&gt;          Recording                           : ZMAT_UPLOAD&lt;/P&gt;&lt;P&gt;          Transaction code                : MM01&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	When you click save, it takes you to t-code (MM01) you would like to do recording for upload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	Record carefully. Fill in the details you want to upload. In this case I have entered the material no, industry sector, material type, material description and basic unit of measure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	Then the Transaction recorder &amp;#150; edit recording ZMAT_UPLOAD screen is displayed. You can edit your recording or just save it and click back button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	Select your recording and click create program button.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	Enter the program name say ZMAT_UPLOAD.Select the transfer from recording option. Save it.Give the program title, type as executable program and click source code button at the bottom.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	The following piece of code is generated automatically.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report ZMAT_UPLOAD&lt;/P&gt;&lt;P&gt;no standard page heading line-size 255.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;include bdcrecx1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform open_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '0060'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                       'RMMG1-MATNR'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                       '=AUSW'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'RMMG1-MATNR'&lt;/P&gt;&lt;P&gt;                                       'MYMATERIAL10'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'RMMG1-MBRSH'&lt;/P&gt;&lt;P&gt;                                       'P'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'RMMG1-MTART'&lt;/P&gt;&lt;P&gt;                                       'ZOH'. &lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '0070'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                       'MSICHTAUSW-DYTXT(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                       '=ENTR'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'MSICHTAUSW-KZSEL(01)'&lt;/P&gt;&lt;P&gt;                                       'X'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4004'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                       '=BU'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                       'MY MATERIAL10'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                       'MARA-MEINS'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                       'G'.&lt;/P&gt;&lt;P&gt;perform bdc_field          using 'MARA-MTPOS_MARA'&lt;/P&gt;&lt;P&gt;                                       'NORM'.&lt;/P&gt;&lt;P&gt;perform bdc_transaction using 'MM01'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perform close_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 	From the above code it is clear that recording has been created using matnr = mymaterial10 , industry sector = p , material type = zoh , description = my material10 , basic unit of measure = g. For our case I have assumed industry sector and material type to be constant and have not included in flat file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The bold lines in the below code are the changes made to the sap generated program , to upload our data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;report ZMAT_UPLOAD&lt;/P&gt;&lt;P&gt;       no standard page heading line-size 255.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;types declaration..........................................................................&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;types : begin of t_mat,&lt;/P&gt;&lt;P&gt;   matnr(20),&lt;/P&gt;&lt;P&gt;   desc(50),&lt;/P&gt;&lt;P&gt;   uom(5),&lt;/P&gt;&lt;P&gt;end of t_mat.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;internal table and workarea declaration.......................................&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;data : i_mat type table of t_mat.&lt;/P&gt;&lt;P&gt;data : wa_mat type t_mat.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;include bdcrecx1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;moving the flat file content to internal table................................&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;CALL FUNCTION 'UPLOAD'&lt;/P&gt;&lt;P&gt;     EXPORTING&lt;/P&gt;&lt;P&gt;         FILETYPE                                      = 'DAT'&lt;/P&gt;&lt;P&gt;     TABLES&lt;/P&gt;&lt;P&gt;         data_tab                                           = i_mat&lt;/P&gt;&lt;P&gt;         .&lt;/P&gt;&lt;P&gt;IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ENDIF.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform open_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;loop at i_mat into wa_mat.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '0060'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                   'RMMG1-MATNR'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '=AUSW'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RMMG1-MATNR'&lt;/P&gt;&lt;P&gt;                                   &amp;lt;b&amp;gt; wa_mat-matnr.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RMMG1-MBRSH'&lt;/P&gt;&lt;P&gt;                                    'P'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RMMG1-MTART'&lt;/P&gt;&lt;P&gt;                                    'ZOH'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro   using 'SAPLMGMM' '0070'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                    'MSICHTAUSW-DYTXT(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '=ENTR'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'&lt;/P&gt;&lt;P&gt;                                    'X'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro   using 'SAPLMGMM' '4004'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                    '=BU'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                             &amp;lt;b&amp;gt;       wa_mat-desc.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                    'MARA-MEINS'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  &amp;lt;b&amp;gt;  wa_mat-uom.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARA-MTPOS_MARA'&lt;/P&gt;&lt;P&gt;                                    'NORM'.&lt;/P&gt;&lt;P&gt;perform bdc_transaction using 'MM01'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perform close_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Hope this is helpful, Do reward points&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 07:35:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mm01/m-p/2829730#M662230</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T07:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: MM01</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/mm01/m-p/2829731#M662231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check these links,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Program to create Material Master data using BAPIs &lt;/P&gt;&lt;P&gt;&lt;A href="http://allaboutsap.blogspot.com/2007/09/program-to-create-material-master-data.html" target="test_blank"&gt;http://allaboutsap.blogspot.com/2007/09/program-to-create-material-master-data.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BDC explained (Basics, Thumb rules, Tips &amp;amp; Tricks, Sample program for MM01 upload) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://allaboutsap.blogspot.com/2007/03/bdc-explained-part-2-sample-program-for.html" target="test_blank"&gt;http://allaboutsap.blogspot.com/2007/03/bdc-explained-part-2-sample-program-for.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful,&lt;/P&gt;&lt;P&gt;Karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 07:37:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/mm01/m-p/2829731#M662231</guid>
      <dc:creator>former_member189629</dc:creator>
      <dc:date>2007-10-03T07:37:42Z</dc:date>
    </item>
  </channel>
</rss>

