<?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: BDC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/3146953#M748166</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just copy paste, this program activate and run this program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Before cheking this code prepare an excel sheet which has the same fields as t_data structure in this program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is to take the datas from Excel sheet which we have prepared and puts it into internal table and this internal table data is passed to MM01 transaction for saving that material.&lt;/P&gt;&lt;P&gt;&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; I N C L U D E S&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;include zf_jaganmm01_bdc_top.    "global declarations&lt;/P&gt;&lt;P&gt;include zf_jaganmm01_bdc_forms.  "forms &lt;STRONG&gt;&amp;lt;--This includes all the perform forms.&lt;/STRONG&gt;   &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;  Include           ZF_JAGANMM01_BDC_TOP&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;&lt;/P&gt;&lt;P&gt;*Structure for the internal table which is going to hold the data from excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*TYPES: BEGIN OF t_data occurs 0,&lt;/P&gt;&lt;P&gt;types: begin of t_data,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*MARA&lt;/P&gt;&lt;P&gt;        matnr(18),              "Component&lt;/P&gt;&lt;P&gt;        mbrsh(1),               "Indstrl Sctr&lt;/P&gt;&lt;P&gt;        mtart(4),               "Type of Material&lt;/P&gt;&lt;P&gt;        matkl(9),               "Material group&lt;/P&gt;&lt;P&gt;        spart(2),               "Division&lt;/P&gt;&lt;P&gt;        mtpos_mara(4),          "General item category group&lt;/P&gt;&lt;P&gt;        brgew(17),              "Gross weight&lt;/P&gt;&lt;P&gt;        gewei(3),               "Weight Unit&lt;/P&gt;&lt;P&gt;        ntgew(17),              "Net weight&lt;/P&gt;&lt;P&gt;        meins(3),               "Base Unit of Measure&lt;/P&gt;&lt;P&gt;        ferth(18),              "Production/inspection memo&lt;/P&gt;&lt;P&gt;        normt(18),              "Industry Standard Description (such as ANSI or ISO)&lt;/P&gt;&lt;P&gt;        tragr(4),               "Transportation group&lt;/P&gt;&lt;P&gt;        bstme(3),               "Order unit&lt;/P&gt;&lt;P&gt;        iprkz(1),               "Period indicator for shelf life expiration date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*MAKT&lt;/P&gt;&lt;P&gt;        matkx(4),               "Material description&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*MARC&lt;/P&gt;&lt;P&gt;        werks(4),               "Plant&lt;/P&gt;&lt;P&gt;        atpkz(1),               "Replacement part&lt;/P&gt;&lt;P&gt;        mtvfp(2),               "Checking Group for Availability Check&lt;/P&gt;&lt;P&gt;        ladgr(4),               "Loading group&lt;/P&gt;&lt;P&gt;        ekgrp(3),               "Purchasing group&lt;/P&gt;&lt;P&gt;        mmsta(2),               "Plant-Specific Material Status&lt;/P&gt;&lt;P&gt;        disgr(4),               "MRP Group&lt;/P&gt;&lt;P&gt;        dismm(2),               "MRP Type&lt;/P&gt;&lt;P&gt;        dispo(3),               "MRP controller&lt;/P&gt;&lt;P&gt;        disls(2),               "Lot size (materials planning)&lt;/P&gt;&lt;P&gt;        beskz(1),               "Procurement Type&lt;/P&gt;&lt;P&gt;        lgpro(4),               "Issue Storage Location&lt;/P&gt;&lt;P&gt;        fabkz(1),               "Indicator: Item relevant to JIT delivery schedules&lt;/P&gt;&lt;P&gt;        eprio(4),               "Stock determination group&lt;/P&gt;&lt;P&gt;        plifz(3),               "Planned delivery time in days&lt;/P&gt;&lt;P&gt;        dzeit(3),               "In-house production time&lt;/P&gt;&lt;P&gt;        webaz(3),               "Goods receipt processing time in days&lt;/P&gt;&lt;P&gt;        fhori(3),               "Scheduling Margin Key for Floats&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*MARD&lt;/P&gt;&lt;P&gt;        lgort(4),               "Storage location&lt;/P&gt;&lt;P&gt;        lgpbe(10),              "Storage bin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end of t_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Internal Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*DATA: it_data TYPE STANDARD TABLE OF t_data WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;data: it_data type standard table of t_data with header line.&lt;/P&gt;&lt;P&gt;data: mess(140),&lt;/P&gt;&lt;P&gt;      c type i,&lt;/P&gt;&lt;P&gt;      t type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: i_col type i,&lt;/P&gt;&lt;P&gt;      i_row type i,&lt;/P&gt;&lt;P&gt;      i_endcol type i,&lt;/P&gt;&lt;P&gt;      i_endrow type i,&lt;/P&gt;&lt;P&gt;      d_val(5).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of t_alsmex_tabline,&lt;/P&gt;&lt;P&gt;       row type kcd_ex_row_n,&lt;/P&gt;&lt;P&gt;       col type kcd_ex_col_n,&lt;/P&gt;&lt;P&gt;       value type char50,&lt;/P&gt;&lt;P&gt;       end of t_alsmex_tabline.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_data1 like alsmex_tabline occurs 0 with header line.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;fs_data1&amp;gt; type data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Replacing INCLUDE BDCREX1.&lt;/P&gt;&lt;P&gt;data : bdcdata like bdcdata occurs 0 with header line,&lt;/P&gt;&lt;P&gt;       bdcmsgcoll like bdcmsgcoll occurs 0 with header line,&lt;/P&gt;&lt;P&gt;       it_bdcmsgcoll like bdcmsgcoll occurs 0 with header line,&lt;/P&gt;&lt;P&gt;       d_total(5).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*S E L E C T I O N - S C R E E N.&lt;/P&gt;&lt;P&gt;selection-screen begin of line.&lt;/P&gt;&lt;P&gt;selection-screen comment 3(20) text-s01 for field group.&lt;/P&gt;&lt;P&gt;selection-screen position 25.&lt;/P&gt;&lt;P&gt;parameters group(12) default 'MM01'. "group name of session&lt;/P&gt;&lt;P&gt;selection-screen comment 48(20) text-s05 for field ctumode.&lt;/P&gt;&lt;P&gt;selection-screen position 70.&lt;/P&gt;&lt;P&gt;parameters ctumode like ctu_params-dismode default 'A'.&lt;/P&gt;&lt;P&gt;"A: show all dynpros&lt;/P&gt;&lt;P&gt;"E: show dynpro on error only&lt;/P&gt;&lt;P&gt;"N: do not display dynpro&lt;/P&gt;&lt;P&gt;selection-screen end of line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen skip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of line.&lt;/P&gt;&lt;P&gt;selection-screen comment 1(33) text-s10 for field nodata.&lt;/P&gt;&lt;P&gt;parameters: nodata default '/' lower case.          "nodata&lt;/P&gt;&lt;P&gt;selection-screen end of line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of line.&lt;/P&gt;&lt;P&gt;selection-screen comment 1(33) for field smalllog.&lt;/P&gt;&lt;P&gt;parameters: smalllog as checkbox.  "' ' = log all transactions&lt;/P&gt;&lt;P&gt;"'X' = no transaction logging&lt;/P&gt;&lt;P&gt;selection-screen end of line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Initializing all the Internal table and its content.&lt;/P&gt;&lt;P&gt;initialization.&lt;/P&gt;&lt;P&gt;  refresh: it_data1,&lt;/P&gt;&lt;P&gt;           it_data.&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  zf_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 zf_upload .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: v_f4_filename type ibipparms-path.&lt;/P&gt;&lt;P&gt;  data: v_alsm_filename type rlgrap-filename.&lt;/P&gt;&lt;P&gt;  data: v_repid type sy-repid.&lt;/P&gt;&lt;P&gt;  data: v_dynnr type sy-dynnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  v_repid = sy-repid.&lt;/P&gt;&lt;P&gt;  v_dynnr = sy-dynnr.&lt;/P&gt;&lt;P&gt;&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        = v_repid&lt;/P&gt;&lt;P&gt;     dynpro_number       = v_dynnr&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FIELD_NAME          =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   importing&lt;/P&gt;&lt;P&gt;     file_name           = v_f4_filename.&lt;/P&gt;&lt;P&gt;  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  v_alsm_filename = v_f4_filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      filename                = v_alsm_filename&lt;/P&gt;&lt;P&gt;      i_begin_col             = 1&lt;/P&gt;&lt;P&gt;      i_begin_row             = 1&lt;/P&gt;&lt;P&gt;      i_end_col               = 36&lt;/P&gt;&lt;P&gt;      i_end_row               = 65536&lt;/P&gt;&lt;P&gt;    tables&lt;/P&gt;&lt;P&gt;      intern                  = it_data1&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      inconsistent_parameters = 1&lt;/P&gt;&lt;P&gt;      upload_ole              = 2&lt;/P&gt;&lt;P&gt;      others                  = 3.&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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refresh: it_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_data1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign component it_data1-col of structure it_data to &amp;lt;fs_data1&amp;gt;.&lt;/P&gt;&lt;P&gt;move: it_data1-value to &amp;lt;fs_data1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of row.&lt;/P&gt;&lt;P&gt;  append it_data.&lt;/P&gt;&lt;P&gt;  clear: it_data.&lt;/P&gt;&lt;P&gt;endat.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " zf_upload&lt;/P&gt;&lt;P&gt;&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; S T A R T - O F - S E L E C T I O N&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;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*THIS PERFORM IS USED TO FETCH ALL THE NECESSARY DATA.&lt;/P&gt;&lt;P&gt;  perform zf_upload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*STARTING BDC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  sort it_data by matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    refresh: it_data.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at it_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    refresh bdcdata.&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;                                  '/00'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMG1-MATNR'&lt;/P&gt;&lt;P&gt;                                  it_data-matnr.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMG1-MBRSH'&lt;/P&gt;&lt;P&gt;                                  it_data-mbrsh.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMG1-MTART'&lt;/P&gt;&lt;P&gt;                                  it_data-mtart.&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(13)'.&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_field       using 'MSICHTAUSW-KZSEL(02)'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MSICHTAUSW-KZSEL(04)'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MSICHTAUSW-KZSEL(06)'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MSICHTAUSW-KZSEL(09)'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MSICHTAUSW-KZSEL(12)'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MSICHTAUSW-KZSEL(13)'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '0080'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'RMMG1-LGORT'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=DEF_SAVE'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMG1-WERKS'&lt;/P&gt;&lt;P&gt;                                  it_data-werks.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMG1-LGORT'&lt;/P&gt;&lt;P&gt;                                  it_data-lgort.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '0080'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'RMMG1-WERKS'.&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 'RMMG1-WERKS'&lt;/P&gt;&lt;P&gt;                                  it_data-werks.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMG1-LGORT'&lt;/P&gt;&lt;P&gt;                                  it_data-lgort.&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;                                  '=PB26'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MATKL'&lt;/P&gt;&lt;P&gt;                                  it_data-matkl.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-SPART'&lt;/P&gt;&lt;P&gt;                                  it_data-spart.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MTPOS_MARA'&lt;/P&gt;&lt;P&gt;                                  it_data-mtpos_mara.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MARA-NTGEW'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-BRGEW'&lt;/P&gt;&lt;P&gt;                                  it_data-brgew.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-GEWEI'&lt;/P&gt;&lt;P&gt;                                  it_data-gewei.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-NTGEW'&lt;/P&gt;&lt;P&gt;                                  it_data-ntgew.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4300'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=MAIN'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&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;                                  '=SP02'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MATKL'&lt;/P&gt;&lt;P&gt;                                  it_data-matkl.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-SPART'&lt;/P&gt;&lt;P&gt;                                  it_data-spart.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MTPOS_MARA'&lt;/P&gt;&lt;P&gt;                                  it_data-mtpos_mara.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-BRGEW'&lt;/P&gt;&lt;P&gt;                                  it_data-brgew.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-GEWEI'&lt;/P&gt;&lt;P&gt;                                  it_data-gewei.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-NTGEW'&lt;/P&gt;&lt;P&gt;                                  it_data-ntgew.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'DESC_LANGU_GDTXT'&lt;/P&gt;&lt;P&gt;                                  'E'.&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;                                  '=SP04'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MARA-NORMT'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-FERTH'&lt;/P&gt;&lt;P&gt;                                  it_data-ferth.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-NORMT'&lt;/P&gt;&lt;P&gt;                                  it_data-normt.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=SP06'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-SPART'&lt;/P&gt;&lt;P&gt;                                  it_data-spart.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MATKL'&lt;/P&gt;&lt;P&gt;                                  it_data-matkl.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=SP09'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MARC-ATPKZ'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-ATPKZ'&lt;/P&gt;&lt;P&gt;                                  it_data-atpkz.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-BRGEW'&lt;/P&gt;&lt;P&gt;                                  it_data-brgew.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-GEWEI'&lt;/P&gt;&lt;P&gt;                                  it_data-gewei.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-NTGEW'&lt;/P&gt;&lt;P&gt;                                  it_data-ntgew.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-MTVFP'&lt;/P&gt;&lt;P&gt;                                  it_data-mtvfp.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-TRAGR'&lt;/P&gt;&lt;P&gt;                                  it_data-tragr.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-LADGR'&lt;/P&gt;&lt;P&gt;                                  '0001'.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=SP12'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MG03STEUMM-TAXIM'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-BSTME'&lt;/P&gt;&lt;P&gt;                                  it_data-bstme.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-EKGRP'&lt;/P&gt;&lt;P&gt;                                  it_data-ekgrp.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MATKL'&lt;/P&gt;&lt;P&gt;                                  it_data-matkl.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-MMSTA'&lt;/P&gt;&lt;P&gt;                                  it_data-mmsta.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MG03STEUMM-TAXIM'&lt;/P&gt;&lt;P&gt;                                  ''.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '0510'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'RMMZU-UMREZ'.&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 'RMMZU-UMREN'&lt;/P&gt;&lt;P&gt;                                  '100'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMZU-UMREZ'&lt;/P&gt;&lt;P&gt;                                  '1'.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=SP12'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-BSTME'&lt;/P&gt;&lt;P&gt;                                  it_data-bstme.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-EKGRP'&lt;/P&gt;&lt;P&gt;                                  it_data-ekgrp.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MATKL'&lt;/P&gt;&lt;P&gt;                                  it_data-matkl.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-MMSTA'&lt;/P&gt;&lt;P&gt;                                  it_data-mmsta.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=SP13'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-DISGR'&lt;/P&gt;&lt;P&gt;                                  it_data-disgr.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-EKGRP'&lt;/P&gt;&lt;P&gt;                                  it_data-ekgrp.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-MMSTA'&lt;/P&gt;&lt;P&gt;                                  it_data-mmsta.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-DISMM'&lt;/P&gt;&lt;P&gt;                                  it_data-dismm.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-DISPO'&lt;/P&gt;&lt;P&gt;                                  it_data-dispo.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MARC-DISLS'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-DISLS'&lt;/P&gt;&lt;P&gt;                                  it_data-disls.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=SP19'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-BESKZ'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-LGPRO'&lt;/P&gt;&lt;P&gt;                                  it_data-lgpro.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-FABKZ'&lt;/P&gt;&lt;P&gt;                                  it_data-fabkz.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-EPRIO'&lt;/P&gt;&lt;P&gt;                                  it_data-eprio.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MARC-PLIFZ'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-DZEIT'&lt;/P&gt;&lt;P&gt;                                  it_data-dzeit.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-PLIFZ'&lt;/P&gt;&lt;P&gt;                                  it_data-plifz.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-WEBAZ'&lt;/P&gt;&lt;P&gt;                                  it_data-webaz.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-FHORI'&lt;/P&gt;&lt;P&gt;                                  it_data-fhori.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&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;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MARD-LGPBE'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARD-LGPBE'&lt;/P&gt;&lt;P&gt;                                  it_data-lgpbe.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-IPRKZ'&lt;/P&gt;&lt;P&gt;                                  it_data-iprkz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*perform bdc_transaction using 'MM01'.&lt;/P&gt;&lt;P&gt;    call transaction 'MM01' using bdcdata&lt;/P&gt;&lt;P&gt;                             mode ctumode&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                          UPDATE 'S'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                           messages into bdcmsgcoll.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Getting the system message-id, message number, language keys through bdcmsgcoll.&lt;/P&gt;&lt;P&gt;refresh: it_bdcmsgcoll.&lt;/P&gt;&lt;P&gt;  loop at bdcmsgcoll.&lt;/P&gt;&lt;P&gt;  move: bdcmsgcoll-msgspra to it_bdcmsgcoll-msgspra,&lt;/P&gt;&lt;P&gt;        bdcmsgcoll-msgid to it_bdcmsgcoll-msgid,&lt;/P&gt;&lt;P&gt;        bdcmsgcoll-msgnr to it_bdcmsgcoll-msgnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  append it_bdcmsgcoll.&lt;/P&gt;&lt;P&gt;  endloop.&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;*For printing Error messages.&lt;/P&gt;&lt;P&gt;   loop at it_bdcmsgcoll.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   call function 'FORMAT_MESSAGE'&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      id              = it_bdcmsgcoll-msgid&lt;/P&gt;&lt;P&gt;      lang            = it_bdcmsgcoll-msgspra&lt;/P&gt;&lt;P&gt;      no              = it_bdcmsgcoll-msgnr&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     V1              = SY-MSGV1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     V2              = SY-MSGV2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     V3              = SY-MSGV3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     V4              = SY-MSGV4&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      msg             = mess&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      not_found       = 1&lt;/P&gt;&lt;P&gt;      others          = 2&lt;/P&gt;&lt;P&gt;             .&lt;/P&gt;&lt;P&gt;   if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; message id sy-msgid type sy-msgty number sy-msgno&lt;/P&gt;&lt;P&gt;         with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Getting the system messages.&lt;/P&gt;&lt;P&gt;write:/5 it_data-matnr color 2,&lt;/P&gt;&lt;P&gt;       30 mess color 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;       Start new screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&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 bdcdata.&lt;/P&gt;&lt;P&gt;  bdcdata-program  = program.&lt;/P&gt;&lt;P&gt;  bdcdata-dynpro   = dynpro.&lt;/P&gt;&lt;P&gt;  bdcdata-dynbegin = 'X'.&lt;/P&gt;&lt;P&gt;  append bdcdata.&lt;/P&gt;&lt;P&gt;endform.                    "bdc_dynpro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;       Insert field&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&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;  if fval &amp;lt;&amp;gt; nodata.&lt;/P&gt;&lt;P&gt;    clear bdcdata.&lt;/P&gt;&lt;P&gt;    bdcdata-fnam = fnam.&lt;/P&gt;&lt;P&gt;    bdcdata-fval = fval.&lt;/P&gt;&lt;P&gt;    append bdcdata.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Dec 2007 09:30:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-24T09:30:28Z</dc:date>
    <item>
      <title>BDC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/3146951#M748164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Friends I need the process to upload data from an EXCEL file located in the APPLICATION server to the internal table. I need your valuable inputs on this front.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Dec 2007 09:16:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/3146951#M748164</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-24T09:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: BDC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/3146952#M748165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use cg3y transaction to download file from app to local and convert XL in to txt file format with tab delimited and use gui_upload function module to down the file into your internal table to process .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plzz reward points if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;jai.m&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Dec 2007 09:27:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/3146952#M748165</guid>
      <dc:creator>jayakummar</dc:creator>
      <dc:date>2007-12-24T09:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: BDC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/3146953#M748166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just copy paste, this program activate and run this program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: Before cheking this code prepare an excel sheet which has the same fields as t_data structure in this program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is to take the datas from Excel sheet which we have prepared and puts it into internal table and this internal table data is passed to MM01 transaction for saving that material.&lt;/P&gt;&lt;P&gt;&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; I N C L U D E S&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;include zf_jaganmm01_bdc_top.    "global declarations&lt;/P&gt;&lt;P&gt;include zf_jaganmm01_bdc_forms.  "forms &lt;STRONG&gt;&amp;lt;--This includes all the perform forms.&lt;/STRONG&gt;   &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;  Include           ZF_JAGANMM01_BDC_TOP&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;&lt;/P&gt;&lt;P&gt;*Structure for the internal table which is going to hold the data from excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*TYPES: BEGIN OF t_data occurs 0,&lt;/P&gt;&lt;P&gt;types: begin of t_data,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*MARA&lt;/P&gt;&lt;P&gt;        matnr(18),              "Component&lt;/P&gt;&lt;P&gt;        mbrsh(1),               "Indstrl Sctr&lt;/P&gt;&lt;P&gt;        mtart(4),               "Type of Material&lt;/P&gt;&lt;P&gt;        matkl(9),               "Material group&lt;/P&gt;&lt;P&gt;        spart(2),               "Division&lt;/P&gt;&lt;P&gt;        mtpos_mara(4),          "General item category group&lt;/P&gt;&lt;P&gt;        brgew(17),              "Gross weight&lt;/P&gt;&lt;P&gt;        gewei(3),               "Weight Unit&lt;/P&gt;&lt;P&gt;        ntgew(17),              "Net weight&lt;/P&gt;&lt;P&gt;        meins(3),               "Base Unit of Measure&lt;/P&gt;&lt;P&gt;        ferth(18),              "Production/inspection memo&lt;/P&gt;&lt;P&gt;        normt(18),              "Industry Standard Description (such as ANSI or ISO)&lt;/P&gt;&lt;P&gt;        tragr(4),               "Transportation group&lt;/P&gt;&lt;P&gt;        bstme(3),               "Order unit&lt;/P&gt;&lt;P&gt;        iprkz(1),               "Period indicator for shelf life expiration date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*MAKT&lt;/P&gt;&lt;P&gt;        matkx(4),               "Material description&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*MARC&lt;/P&gt;&lt;P&gt;        werks(4),               "Plant&lt;/P&gt;&lt;P&gt;        atpkz(1),               "Replacement part&lt;/P&gt;&lt;P&gt;        mtvfp(2),               "Checking Group for Availability Check&lt;/P&gt;&lt;P&gt;        ladgr(4),               "Loading group&lt;/P&gt;&lt;P&gt;        ekgrp(3),               "Purchasing group&lt;/P&gt;&lt;P&gt;        mmsta(2),               "Plant-Specific Material Status&lt;/P&gt;&lt;P&gt;        disgr(4),               "MRP Group&lt;/P&gt;&lt;P&gt;        dismm(2),               "MRP Type&lt;/P&gt;&lt;P&gt;        dispo(3),               "MRP controller&lt;/P&gt;&lt;P&gt;        disls(2),               "Lot size (materials planning)&lt;/P&gt;&lt;P&gt;        beskz(1),               "Procurement Type&lt;/P&gt;&lt;P&gt;        lgpro(4),               "Issue Storage Location&lt;/P&gt;&lt;P&gt;        fabkz(1),               "Indicator: Item relevant to JIT delivery schedules&lt;/P&gt;&lt;P&gt;        eprio(4),               "Stock determination group&lt;/P&gt;&lt;P&gt;        plifz(3),               "Planned delivery time in days&lt;/P&gt;&lt;P&gt;        dzeit(3),               "In-house production time&lt;/P&gt;&lt;P&gt;        webaz(3),               "Goods receipt processing time in days&lt;/P&gt;&lt;P&gt;        fhori(3),               "Scheduling Margin Key for Floats&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*MARD&lt;/P&gt;&lt;P&gt;        lgort(4),               "Storage location&lt;/P&gt;&lt;P&gt;        lgpbe(10),              "Storage bin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end of t_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Internal Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*DATA: it_data TYPE STANDARD TABLE OF t_data WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;data: it_data type standard table of t_data with header line.&lt;/P&gt;&lt;P&gt;data: mess(140),&lt;/P&gt;&lt;P&gt;      c type i,&lt;/P&gt;&lt;P&gt;      t type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: i_col type i,&lt;/P&gt;&lt;P&gt;      i_row type i,&lt;/P&gt;&lt;P&gt;      i_endcol type i,&lt;/P&gt;&lt;P&gt;      i_endrow type i,&lt;/P&gt;&lt;P&gt;      d_val(5).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of t_alsmex_tabline,&lt;/P&gt;&lt;P&gt;       row type kcd_ex_row_n,&lt;/P&gt;&lt;P&gt;       col type kcd_ex_col_n,&lt;/P&gt;&lt;P&gt;       value type char50,&lt;/P&gt;&lt;P&gt;       end of t_alsmex_tabline.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: it_data1 like alsmex_tabline occurs 0 with header line.&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;fs_data1&amp;gt; type data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Replacing INCLUDE BDCREX1.&lt;/P&gt;&lt;P&gt;data : bdcdata like bdcdata occurs 0 with header line,&lt;/P&gt;&lt;P&gt;       bdcmsgcoll like bdcmsgcoll occurs 0 with header line,&lt;/P&gt;&lt;P&gt;       it_bdcmsgcoll like bdcmsgcoll occurs 0 with header line,&lt;/P&gt;&lt;P&gt;       d_total(5).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*S E L E C T I O N - S C R E E N.&lt;/P&gt;&lt;P&gt;selection-screen begin of line.&lt;/P&gt;&lt;P&gt;selection-screen comment 3(20) text-s01 for field group.&lt;/P&gt;&lt;P&gt;selection-screen position 25.&lt;/P&gt;&lt;P&gt;parameters group(12) default 'MM01'. "group name of session&lt;/P&gt;&lt;P&gt;selection-screen comment 48(20) text-s05 for field ctumode.&lt;/P&gt;&lt;P&gt;selection-screen position 70.&lt;/P&gt;&lt;P&gt;parameters ctumode like ctu_params-dismode default 'A'.&lt;/P&gt;&lt;P&gt;"A: show all dynpros&lt;/P&gt;&lt;P&gt;"E: show dynpro on error only&lt;/P&gt;&lt;P&gt;"N: do not display dynpro&lt;/P&gt;&lt;P&gt;selection-screen end of line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen skip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of line.&lt;/P&gt;&lt;P&gt;selection-screen comment 1(33) text-s10 for field nodata.&lt;/P&gt;&lt;P&gt;parameters: nodata default '/' lower case.          "nodata&lt;/P&gt;&lt;P&gt;selection-screen end of line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of line.&lt;/P&gt;&lt;P&gt;selection-screen comment 1(33) for field smalllog.&lt;/P&gt;&lt;P&gt;parameters: smalllog as checkbox.  "' ' = log all transactions&lt;/P&gt;&lt;P&gt;"'X' = no transaction logging&lt;/P&gt;&lt;P&gt;selection-screen end of line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Initializing all the Internal table and its content.&lt;/P&gt;&lt;P&gt;initialization.&lt;/P&gt;&lt;P&gt;  refresh: it_data1,&lt;/P&gt;&lt;P&gt;           it_data.&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  zf_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 zf_upload .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: v_f4_filename type ibipparms-path.&lt;/P&gt;&lt;P&gt;  data: v_alsm_filename type rlgrap-filename.&lt;/P&gt;&lt;P&gt;  data: v_repid type sy-repid.&lt;/P&gt;&lt;P&gt;  data: v_dynnr type sy-dynnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  v_repid = sy-repid.&lt;/P&gt;&lt;P&gt;  v_dynnr = sy-dynnr.&lt;/P&gt;&lt;P&gt;&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        = v_repid&lt;/P&gt;&lt;P&gt;     dynpro_number       = v_dynnr&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  FIELD_NAME          =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;   importing&lt;/P&gt;&lt;P&gt;     file_name           = v_f4_filename.&lt;/P&gt;&lt;P&gt;  .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  v_alsm_filename = v_f4_filename.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      filename                = v_alsm_filename&lt;/P&gt;&lt;P&gt;      i_begin_col             = 1&lt;/P&gt;&lt;P&gt;      i_begin_row             = 1&lt;/P&gt;&lt;P&gt;      i_end_col               = 36&lt;/P&gt;&lt;P&gt;      i_end_row               = 65536&lt;/P&gt;&lt;P&gt;    tables&lt;/P&gt;&lt;P&gt;      intern                  = it_data1&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      inconsistent_parameters = 1&lt;/P&gt;&lt;P&gt;      upload_ole              = 2&lt;/P&gt;&lt;P&gt;      others                  = 3.&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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;refresh: it_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it_data1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign component it_data1-col of structure it_data to &amp;lt;fs_data1&amp;gt;.&lt;/P&gt;&lt;P&gt;move: it_data1-value to &amp;lt;fs_data1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at end of row.&lt;/P&gt;&lt;P&gt;  append it_data.&lt;/P&gt;&lt;P&gt;  clear: it_data.&lt;/P&gt;&lt;P&gt;endat.&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.                    " zf_upload&lt;/P&gt;&lt;P&gt;&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; S T A R T - O F - S E L E C T I O N&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;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*THIS PERFORM IS USED TO FETCH ALL THE NECESSARY DATA.&lt;/P&gt;&lt;P&gt;  perform zf_upload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*STARTING BDC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  sort it_data by matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;    refresh: it_data.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at it_data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    refresh bdcdata.&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;                                  '/00'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMG1-MATNR'&lt;/P&gt;&lt;P&gt;                                  it_data-matnr.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMG1-MBRSH'&lt;/P&gt;&lt;P&gt;                                  it_data-mbrsh.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMG1-MTART'&lt;/P&gt;&lt;P&gt;                                  it_data-mtart.&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(13)'.&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_field       using 'MSICHTAUSW-KZSEL(02)'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MSICHTAUSW-KZSEL(04)'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MSICHTAUSW-KZSEL(06)'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MSICHTAUSW-KZSEL(09)'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MSICHTAUSW-KZSEL(12)'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MSICHTAUSW-KZSEL(13)'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '0080'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'RMMG1-LGORT'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=DEF_SAVE'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMG1-WERKS'&lt;/P&gt;&lt;P&gt;                                  it_data-werks.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMG1-LGORT'&lt;/P&gt;&lt;P&gt;                                  it_data-lgort.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '0080'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'RMMG1-WERKS'.&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 'RMMG1-WERKS'&lt;/P&gt;&lt;P&gt;                                  it_data-werks.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMG1-LGORT'&lt;/P&gt;&lt;P&gt;                                  it_data-lgort.&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;                                  '=PB26'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MATKL'&lt;/P&gt;&lt;P&gt;                                  it_data-matkl.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-SPART'&lt;/P&gt;&lt;P&gt;                                  it_data-spart.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MTPOS_MARA'&lt;/P&gt;&lt;P&gt;                                  it_data-mtpos_mara.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MARA-NTGEW'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-BRGEW'&lt;/P&gt;&lt;P&gt;                                  it_data-brgew.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-GEWEI'&lt;/P&gt;&lt;P&gt;                                  it_data-gewei.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-NTGEW'&lt;/P&gt;&lt;P&gt;                                  it_data-ntgew.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4300'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=MAIN'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&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;                                  '=SP02'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MATKL'&lt;/P&gt;&lt;P&gt;                                  it_data-matkl.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-SPART'&lt;/P&gt;&lt;P&gt;                                  it_data-spart.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MTPOS_MARA'&lt;/P&gt;&lt;P&gt;                                  it_data-mtpos_mara.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-BRGEW'&lt;/P&gt;&lt;P&gt;                                  it_data-brgew.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-GEWEI'&lt;/P&gt;&lt;P&gt;                                  it_data-gewei.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-NTGEW'&lt;/P&gt;&lt;P&gt;                                  it_data-ntgew.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'DESC_LANGU_GDTXT'&lt;/P&gt;&lt;P&gt;                                  'E'.&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;                                  '=SP04'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MARA-NORMT'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-FERTH'&lt;/P&gt;&lt;P&gt;                                  it_data-ferth.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-NORMT'&lt;/P&gt;&lt;P&gt;                                  it_data-normt.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=SP06'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-SPART'&lt;/P&gt;&lt;P&gt;                                  it_data-spart.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MATKL'&lt;/P&gt;&lt;P&gt;                                  it_data-matkl.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=SP09'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MARC-ATPKZ'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-ATPKZ'&lt;/P&gt;&lt;P&gt;                                  it_data-atpkz.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-BRGEW'&lt;/P&gt;&lt;P&gt;                                  it_data-brgew.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-GEWEI'&lt;/P&gt;&lt;P&gt;                                  it_data-gewei.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-NTGEW'&lt;/P&gt;&lt;P&gt;                                  it_data-ntgew.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-MTVFP'&lt;/P&gt;&lt;P&gt;                                  it_data-mtvfp.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-TRAGR'&lt;/P&gt;&lt;P&gt;                                  it_data-tragr.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-LADGR'&lt;/P&gt;&lt;P&gt;                                  '0001'.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=SP12'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MG03STEUMM-TAXIM'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-BSTME'&lt;/P&gt;&lt;P&gt;                                  it_data-bstme.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-EKGRP'&lt;/P&gt;&lt;P&gt;                                  it_data-ekgrp.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MATKL'&lt;/P&gt;&lt;P&gt;                                  it_data-matkl.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-MMSTA'&lt;/P&gt;&lt;P&gt;                                  it_data-mmsta.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MG03STEUMM-TAXIM'&lt;/P&gt;&lt;P&gt;                                  ''.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '0510'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'RMMZU-UMREZ'.&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 'RMMZU-UMREN'&lt;/P&gt;&lt;P&gt;                                  '100'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'RMMZU-UMREZ'&lt;/P&gt;&lt;P&gt;                                  '1'.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=SP12'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-BSTME'&lt;/P&gt;&lt;P&gt;                                  it_data-bstme.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-EKGRP'&lt;/P&gt;&lt;P&gt;                                  it_data-ekgrp.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MATKL'&lt;/P&gt;&lt;P&gt;                                  it_data-matkl.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-MMSTA'&lt;/P&gt;&lt;P&gt;                                  it_data-mmsta.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=SP13'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-DISGR'&lt;/P&gt;&lt;P&gt;                                  it_data-disgr.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-EKGRP'&lt;/P&gt;&lt;P&gt;                                  it_data-ekgrp.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-MMSTA'&lt;/P&gt;&lt;P&gt;                                  it_data-mmsta.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-DISMM'&lt;/P&gt;&lt;P&gt;                                  it_data-dismm.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-DISPO'&lt;/P&gt;&lt;P&gt;                                  it_data-dispo.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MARC-DISLS'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-DISLS'&lt;/P&gt;&lt;P&gt;                                  it_data-disls.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                                  '=SP19'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-BESKZ'&lt;/P&gt;&lt;P&gt;                                  'X'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-LGPRO'&lt;/P&gt;&lt;P&gt;                                  it_data-lgpro.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-FABKZ'&lt;/P&gt;&lt;P&gt;                                  it_data-fabkz.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-EPRIO'&lt;/P&gt;&lt;P&gt;                                  it_data-eprio.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MARC-PLIFZ'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-DZEIT'&lt;/P&gt;&lt;P&gt;                                  it_data-dzeit.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-PLIFZ'&lt;/P&gt;&lt;P&gt;                                  it_data-plifz.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-WEBAZ'&lt;/P&gt;&lt;P&gt;                                  it_data-webaz.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARC-FHORI'&lt;/P&gt;&lt;P&gt;                                  it_data-fhori.&lt;/P&gt;&lt;P&gt;    perform bdc_dynpro      using 'SAPLMGMM' '4000'.&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;                                  'Iron Rod'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                                  'MARD-LGPBE'.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                                  it_data-meins.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARD-LGPBE'&lt;/P&gt;&lt;P&gt;                                  it_data-lgpbe.&lt;/P&gt;&lt;P&gt;    perform bdc_field       using 'MARA-IPRKZ'&lt;/P&gt;&lt;P&gt;                                  it_data-iprkz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*perform bdc_transaction using 'MM01'.&lt;/P&gt;&lt;P&gt;    call transaction 'MM01' using bdcdata&lt;/P&gt;&lt;P&gt;                             mode ctumode&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                          UPDATE 'S'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;                           messages into bdcmsgcoll.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Getting the system message-id, message number, language keys through bdcmsgcoll.&lt;/P&gt;&lt;P&gt;refresh: it_bdcmsgcoll.&lt;/P&gt;&lt;P&gt;  loop at bdcmsgcoll.&lt;/P&gt;&lt;P&gt;  move: bdcmsgcoll-msgspra to it_bdcmsgcoll-msgspra,&lt;/P&gt;&lt;P&gt;        bdcmsgcoll-msgid to it_bdcmsgcoll-msgid,&lt;/P&gt;&lt;P&gt;        bdcmsgcoll-msgnr to it_bdcmsgcoll-msgnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  append it_bdcmsgcoll.&lt;/P&gt;&lt;P&gt;  endloop.&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;*For printing Error messages.&lt;/P&gt;&lt;P&gt;   loop at it_bdcmsgcoll.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   call function 'FORMAT_MESSAGE'&lt;/P&gt;&lt;P&gt;    exporting&lt;/P&gt;&lt;P&gt;      id              = it_bdcmsgcoll-msgid&lt;/P&gt;&lt;P&gt;      lang            = it_bdcmsgcoll-msgspra&lt;/P&gt;&lt;P&gt;      no              = it_bdcmsgcoll-msgnr&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     V1              = SY-MSGV1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     V2              = SY-MSGV2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     V3              = SY-MSGV3&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     V4              = SY-MSGV4&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    importing&lt;/P&gt;&lt;P&gt;      msg             = mess&lt;/P&gt;&lt;P&gt;    exceptions&lt;/P&gt;&lt;P&gt;      not_found       = 1&lt;/P&gt;&lt;P&gt;      others          = 2&lt;/P&gt;&lt;P&gt;             .&lt;/P&gt;&lt;P&gt;   if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; message id sy-msgid type sy-msgty number sy-msgno&lt;/P&gt;&lt;P&gt;         with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.&lt;/P&gt;&lt;P&gt;   endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Getting the system messages.&lt;/P&gt;&lt;P&gt;write:/5 it_data-matnr color 2,&lt;/P&gt;&lt;P&gt;       30 mess color 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;       Start new screen&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&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 bdcdata.&lt;/P&gt;&lt;P&gt;  bdcdata-program  = program.&lt;/P&gt;&lt;P&gt;  bdcdata-dynpro   = dynpro.&lt;/P&gt;&lt;P&gt;  bdcdata-dynbegin = 'X'.&lt;/P&gt;&lt;P&gt;  append bdcdata.&lt;/P&gt;&lt;P&gt;endform.                    "bdc_dynpro&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;       Insert field&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&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;  if fval &amp;lt;&amp;gt; nodata.&lt;/P&gt;&lt;P&gt;    clear bdcdata.&lt;/P&gt;&lt;P&gt;    bdcdata-fnam = fnam.&lt;/P&gt;&lt;P&gt;    bdcdata-fval = fval.&lt;/P&gt;&lt;P&gt;    append bdcdata.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Dec 2007 09:30:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bdc/m-p/3146953#M748166</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-24T09:30:28Z</dc:date>
    </item>
  </channel>
</rss>

