<?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: Looking for Bapi in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-bapi/m-p/4106642#M982055</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;Listed the function modules...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BAPI_MATERIAL_GETINTNUMBER&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BAPI_MATERIAL_SAVE_DATA&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BAPI_MATERIAL_GET_ALL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Narin Nandivada.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Jun 2008 19:40:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-06-28T19:40:44Z</dc:date>
    <item>
      <title>Looking for Bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-bapi/m-p/4106639#M982052</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;help me any one this is very very required plese help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am Looking for Standarad bapi. the requirement is plant and material and any ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;requiry fields is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fullyqualifiedname&lt;/P&gt;&lt;P&gt;Type name&lt;/P&gt;&lt;P&gt;created on&lt;/P&gt;&lt;P&gt;modified on&lt;/P&gt;&lt;P&gt;description&lt;/P&gt;&lt;P&gt;icon index source&lt;/P&gt;&lt;P&gt;min&lt;/P&gt;&lt;P&gt;max&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is one of the product in&lt;/P&gt;&lt;P&gt;incuity....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plese help any body&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Satish.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2008 12:58:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-bapi/m-p/4106639#M982052</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-28T12:58:28Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for Bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-bapi/m-p/4106640#M982053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BAPI_MATERIAL_SAVEDATA&lt;/P&gt;&lt;P&gt;BAPI_MATERIAL_GET_ALL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2008 13:01:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-bapi/m-p/4106640#M982053</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-28T13:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for Bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-bapi/m-p/4106641#M982054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sathibabu,&lt;/P&gt;&lt;P&gt;Here is the sample BAPI code which might be helpful for you to use t he BAPI.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;************&lt;STRONG&gt;Reward Points if helpful&lt;/STRONG&gt;****************&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZCC_BAPI_MM01
*&amp;amp;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Develper: Chidanand Chauhan
*&amp;amp;  Date: 04/27/2006
*&amp;amp;  Desc: Upload MM01 through BAPI
*&amp;amp;---------------------------------------------------------------------*

report  zcc_bapi_mm01 message-id zmm01bap.


*&amp;amp;--declration of tables

*tables :

*&amp;amp;--declration of structure.
types : begin of s_upload,
        material(18) type c,
        ind_sector(1) type c,
        mat_type(4) type c,
        basic_view(1) type c,
        purchase_view(1) type c,
        storage_view(1) type c,
        sale_view(1) type c,
        mrp_view(1) type c,
        mat_group(2) type c,              " start of client data
        base_uom(3) type c,
*        base_uom_iso(3) TYPE c,
        unit_of_wt(3) type c,
*        UNIT_OF_WT_ISO(3) TYPE C,
*        net_weight(13) TYPE c,
        division(2) type c,
        pur_status(2) type c,
        plant(4) type c,                " start of plantdata
        pur_group(3) type c,
        mrp_type(2) type c,
        mrp_ctrler(3) type c,
        period_ind(1) type c,
        lotsizekey(2) type c,
        proc_type(1) type c,
        minlotsize(13) type c,
        maxlotsize(13) type c,
*        proc_type TYPE beskz,
        inhseeprodt(2) type c,
        avaialcheck(2) type c,
        plannplant(4) type c,
        strgplant(4) type c,
        stge_loc(4) type c,
        langu(2) type c,
        " start of storage location
        materialdescription(40) type c,      " table data fro descrip
        sales_org(4) type c,                " sale data
        distr_channel(2) type c,
        alt_unit(3) type c,
        end of s_upload.

data : s_headdata type bapimathead,
       s_clientdata type bapi_mara,
       s_clientdatax type bapi_marax,
       s_plantdata type bapi_marc,
       s_plantdatax type bapi_marcx,
       s_planningdata type bapi_mpgd,
       s_planningdatax type bapi_mpgdx,
       s_storagelocationdata type bapi_mard,
       s_storagelocationdatax type bapi_mardx,
*       s_valuationdatax type bapi_mbew,
*       s_valuationdatax type bapi_mbewx,
       s_salesdata type bapi_mvke,
       s_saledatax type bapi_mvkex,
       s_return type bapiret2,
       s_return1 type bapireturn1.

*&amp;amp;--declration of internal tables.
data : t_upload type table of s_upload,
       t_maktx type table of bapi_makt,
       t_material_number type table of bapimatinr,
       t_measure type table of bapi_marm,
       t_measurex type table of bapi_marm.

*&amp;amp;--declration of work area.
data: w_upload type s_upload,
      w_maktx type bapi_makt,
      w_material_number type bapimatinr,
      w_measure type bapi_marm,
      w_measurex type bapi_marm.

*&amp;amp;--parameters for upload and download.
selection-screen begin of block ssn with frame title text-001 .
parameters: p_upload type ibipparms-path,
            d_chk type checkbox.
selection-screen end of block ssn.

*&amp;amp;--declration of variables.
data: v_filename type ibipparms-path,
      v_progname type sy-repid,
      f_path type string,
      sy_ucomm type sy-ucomm,
      z(60) type c.


initialization.
  refresh t_upload.
  refresh t_measure.
  v_progname = sy-repid.
*&amp;amp;--at selection screen.
at selection-screen.

at selection-screen on value-request for p_upload.
  perform f4_upload.

*&amp;amp;--Perform calling bapi.
start-of-selection.

*&amp;amp;--Perform uplaod of file in internal table.
  perform upload_file.
  perform bapi_create.

end-of-selection.
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  f4_upload
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
form f4_upload .

  call function 'F4_FILENAME'
   exporting
     program_name        = sy-repid
     dynpro_number       = syst-dynnr
*   FIELD_NAME          = 'p_upload'
   importing
     file_name           = v_filename
     .
  if sy-subrc = 0.
    p_upload = v_filename.

  endif.

endform.                                                    " f4_upload
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  upload_file
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
form upload_file .

  clear t_upload.
  f_path = v_filename.

  call function 'GUI_UPLOAD'
    exporting
      filename                      =  f_path
     filetype                      =  'ASC'
     has_field_separator           = 'X'
*     HEADER_LENGTH                 = 0
*     READ_BY_LINE                  = 'X'
*     DAT_MODE                      = ' '
*     CODEPAGE                      = ' '
*     IGNORE_CERR                   = ABAP_TRUE
*     REPLACEMENT                   = '#'
*     CHECK_BOM                     = ' '
*   IMPORTING
*     FILELENGTH                    =
*     HEADER                        =
    tables
      data_tab                      =  t_upload
   exceptions
     file_open_error               = 1
     file_read_error               = 2
     no_batch                      = 3
     gui_refuse_filetransfer       = 4
     invalid_type                  = 5
     no_authority                  = 6
     unknown_error                 = 7
     bad_data_format               = 8
     header_not_allowed            = 9
     separator_not_allowed         = 10
     header_too_long               = 11
     unknown_dp_error              = 12
     access_denied                 = 13
     dp_out_of_memory              = 14
     disk_full                     = 15
     dp_timeout                    = 16
     others                        = 17
            .
  if sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.

endform.                    " upload_file
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  bapi_create
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
form bapi_create .

  loop at t_upload into w_upload.

*&amp;amp;--moving wa of header structure.
    s_headdata-material = w_upload-material.
    s_headdata-ind_sector =  w_upload-ind_sector.
    s_headdata-matl_type = w_upload-mat_type.
    s_headdata-basic_view = w_upload-basic_view.
    s_headdata-sales_view = w_upload-sale_view.
    s_headdata-purchase_view = w_upload-purchase_view.
    s_headdata-mrp_view  = w_upload-mrp_view.
    s_headdata-storage_view = w_upload-storage_view.

*&amp;amp;--calling function to get material number, AT CREATE.

    if d_chk = 'X'.
      call function 'BAPI_MATERIAL_GETINTNUMBER'
        exporting
          material_type    = w_upload-mat_type
          industry_sector  = w_upload-ind_sector
          required_numbers = 1
        importing
          return           = s_return1
        tables
          material_number  = t_material_number.

      loop at t_material_number into w_material_number.
        s_headdata-material = w_material_number-material.
      endloop.
    endif.



*&amp;amp;--moving wa of client data .

    s_clientdata-matl_group = w_upload-mat_group.
    s_clientdata-base_uom = w_upload-base_uom.
*    s_clientdata-base_uom_iso = w_upload-base_uom_iso.
    s_clientdata-unit_of_wt = w_upload-unit_of_wt.
*    s_clientdata-unit_of_wt_ISO = w_upload-unit_of_wt_ISO.
*    s_clientdata-net_weight = w_upload-net_weight.
    s_clientdata-division = w_upload-division.
    s_clientdata-pur_status = w_upload-pur_status.


    s_clientdatax-matl_group = 'X'.
    s_clientdatax-base_uom = 'X'.
*    s_clientdataX-base_uom_iso = 'X'.
    s_clientdatax-unit_of_wt = 'X'.
*    s_clientdataX-unit_of_wt_ISO = 'X'.
*    s_clientdataX-net_weight = 'X'.
    s_clientdatax-division = 'X'.
    s_clientdatax-pur_status = 'X'.


*&amp;amp;--moving wa of plantdata
    s_plantdata-plant = w_upload-plant.
    s_plantdata-pur_group = w_upload-pur_group.
    s_plantdata-mrp_type = w_upload-mrp_type.
    s_plantdata-mrp_ctrler = w_upload-mrp_ctrler.
    s_plantdata-period_ind = w_upload-period_ind.
    s_plantdata-lotsizekey = w_upload-lotsizekey.
    s_plantdata-proc_type = w_upload-proc_type.
    s_plantdata-minlotsize = w_upload-minlotsize.
    s_plantdata-maxlotsize = w_upload-maxlotsize.
    s_plantdata-inhseprodt = w_upload-inhseeprodt.
    s_plantdata-availcheck = w_upload-avaialcheck.

    s_plantdatax-plant = w_upload-plant.
    s_plantdatax-pur_group = 'X'.
    s_plantdatax-mrp_type = 'X'.
    s_plantdatax-mrp_ctrler = 'X'.
    s_plantdatax-period_ind = 'X'.
    s_plantdatax-lotsizekey ='X'.
    s_plantdatax-proc_type = 'X'.
    s_plantdatax-minlotsize ='X'.
    s_plantdatax-maxlotsize = 'X'.
    s_plantdatax-inhseprodt = 'X'.
    s_plantdatax-availcheck = 'X'.


*&amp;amp;--moving planningdata.

    s_planningdata-plant = w_upload-plannplant.

    s_planningdatax-plant = w_upload-plannplant.
*&amp;amp;--moving wa storage location.
    s_storagelocationdata-plant = w_upload-strgplant.
    s_storagelocationdata-stge_loc = w_upload-stge_loc.

    s_storagelocationdatax-plant = w_upload-strgplant.
    s_storagelocationdatax-stge_loc = w_upload-stge_loc.

*&amp;amp;--moving wa sales
    s_salesdata-sales_org = w_upload-sales_org.
    s_salesdata-distr_chan = w_upload-distr_channel.

    s_saledatax-sales_org = w_upload-sales_org.
    s_saledatax-distr_chan = w_upload-distr_channel.

*&amp;amp;--append material description
    w_maktx-langu = w_upload-langu.
    w_maktx-matl_desc = w_upload-materialdescription.
    append w_maktx to t_maktx.

*&amp;amp;--appending measurement
    w_measure-alt_unit = w_upload-alt_unit.
    append w_measure to t_measure.

    w_measurex-alt_unit = w_upload-alt_unit.
    append w_measurex to t_measurex.

*&amp;amp;--calling bapi function.
    call function 'BAPI_MATERIAL_SAVEDATA'
      exporting
        headdata                   =   s_headdata
       clientdata                 =    s_clientdata
       clientdatax                =    s_clientdatax
       plantdata                  =    s_plantdata
       plantdatax                 =    s_plantdatax
       planningdata               =   s_planningdata
       planningdatax              =   s_planningdatax
       storagelocationdata        =  s_storagelocationdata
       storagelocationdatax       =  s_storagelocationdatax
       salesdata                  =  s_salesdata
       salesdatax                 =  s_saledatax

     importing
       return                     =  s_return
     tables
       materialdescription        =  t_maktx
              .
    if sy-subrc = 0 .
      z = s_return-message.
      message i002 with z.
    endif.

  endloop.

endform.                    " bapi_create
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2008 16:26:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-bapi/m-p/4106641#M982054</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-28T16:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: Looking for Bapi</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-bapi/m-p/4106642#M982055</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;Listed the function modules...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BAPI_MATERIAL_GETINTNUMBER&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BAPI_MATERIAL_SAVE_DATA&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;BAPI_MATERIAL_GET_ALL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Narin Nandivada.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2008 19:40:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/looking-for-bapi/m-p/4106642#M982055</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-06-28T19:40:44Z</dc:date>
    </item>
  </channel>
</rss>

