<?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: Re: BAPI uploading data in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-bapi-uploading-data/m-p/3698647#M890595</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Umakanth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Business Application Programming Interfaces enables the user to access the business objects from one R/3 system to another.&lt;/P&gt;&lt;P&gt;And at the same time the BAPIs in the Business Object Repository have the openness to be accessable from other software applications like Java, visual basic, etc.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For its creation u follow the steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create the structures like zkna1 and zvbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. write a function module to obtain the sales details  by giving the importing parameter as kunnr.&lt;/P&gt;&lt;P&gt;   The function module must be remote enabled and the parameters must be only pass by value type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Release the function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Go to SWo1 and give the function module that u have created as a method and implement it then release it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Now implement ur bapi that was created in SWO1 in ur calling program and pass the appropriate parameters according to ur requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reward if Helpful.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jagadish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Apr 2008 04:42:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-04T04:42:49Z</dc:date>
    <item>
      <title>Re: BAPI uploading data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-bapi-uploading-data/m-p/3698645#M890593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi  Experts,&lt;/P&gt;&lt;P&gt;       I want to how exactly BAPI's are used as interfaces and for data transfering . Please provide me example codes for uploadinfg data into r/3 using BAPI's. &lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Points will be awrded surely.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Umakanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 04:33:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-bapi-uploading-data/m-p/3698645#M890593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T04:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Re: BAPI uploading data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-bapi-uploading-data/m-p/3698646#M890594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need a FM or BAPI in R/3 which modify the table. This FM should be cal by a buttom in your VC...you can have a look to this document&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/marcel.salein/blog/2007/02/01/visual-composer-and-abap-rfcbapi-a-powerful-combination-part-i&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 04:42:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-bapi-uploading-data/m-p/3698646#M890594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T04:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Re: BAPI uploading data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-bapi-uploading-data/m-p/3698647#M890595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Umakanth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Business Application Programming Interfaces enables the user to access the business objects from one R/3 system to another.&lt;/P&gt;&lt;P&gt;And at the same time the BAPIs in the Business Object Repository have the openness to be accessable from other software applications like Java, visual basic, etc.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For its creation u follow the steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create the structures like zkna1 and zvbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. write a function module to obtain the sales details  by giving the importing parameter as kunnr.&lt;/P&gt;&lt;P&gt;   The function module must be remote enabled and the parameters must be only pass by value type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Release the function module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Go to SWo1 and give the function module that u have created as a method and implement it then release it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Now implement ur bapi that was created in SWO1 in ur calling program and pass the appropriate parameters according to ur requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Reward if Helpful.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jagadish.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 04:42:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-bapi-uploading-data/m-p/3698647#M890595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-04T04:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: Re: BAPI uploading data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-bapi-uploading-data/m-p/3698648#M890596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi umakanth  ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A BAPI is defined as a method of an SAP Business Object.&lt;/P&gt;&lt;P&gt;To use a BAPI method, an application program only needs to know how to call the method; that is, it needs to know the method's interface definition. A BAPI interface is defined by:&lt;/P&gt;&lt;P&gt;Import parameters&lt;/P&gt;&lt;P&gt;Export parameters&lt;/P&gt;&lt;P&gt;Import/export (table) parameters&lt;/P&gt;&lt;P&gt;The BAPIs in the R/3 System are currently implemented as function modules, all of which are held in the Function Builder. Each function module underlying a BAPI:&lt;/P&gt;&lt;P&gt;· Supports the Remote Function Call (RFC) protocol&lt;/P&gt;&lt;P&gt;· Has been assigned as a method to an SAP Business Object in the BOR&lt;/P&gt;&lt;P&gt;· Is processed without returning any screen dialogs to the calling application&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;steps involved in BAPI&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the application hierarchy of the BAPI Browser you can display all the SAP business object types for which BAPIs have been implemented:&lt;/P&gt;&lt;P&gt;Tools -&amp;gt;Business Framework -&amp;gt; BAPI Browser : BAPI45.&lt;/P&gt;&lt;P&gt;Expand the nodes and the subordinate nodes of one of the application components &lt;/P&gt;&lt;P&gt;To open an object type, double-click on it.&lt;/P&gt;&lt;P&gt;To display a list of the key fields of the object, expand the node Key fields&lt;/P&gt;&lt;P&gt;To display a list of the BAPIs available for this SAP business object type, expand the node Methods&lt;/P&gt;&lt;P&gt;To display the parameters of a BAPI, expand the node for the BAPI and then the Parameters node&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Eg Program:&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;BAPI_GOODSMVT_CREATE to post Goods Movement 

The following is an abap program making used of the BAPI function BAPI_GOODSMVT_CREATE to do Goods Receipts for Purchase Order after importing the data from an external system. 

*
* BAPI TO Upload Inventory Data
*
* GMCODE Table T158G - 01 - MB01 - Goods Receipts for Purchase Order
*                      02 - MB31 - Goods Receipts for Prod Order
*                      03 - MB1A - Goods Issue
*                      04 - MB1B - Transfer Posting
*                      05 - MB1C - Enter Other Goods Receipt
*                      06 - MB11
*
* Domain: KZBEW - Movement Indicator
*      Goods movement w/o reference
*  B - Goods movement for purchase order
*  F - Goods movement for production order
*  L - Goods movement for delivery note
*  K - Goods movement for kanban requirement (WM - internal only)
*  O - Subsequent adjustment of "material-provided" consumption
*  W - Subsequent adjustment of proportion/product unit material
*
report zbapi_goodsmovement.

parameters: p-file like rlgrap-filename default
                                 'c:sapdataTEST.txt'.
parameters: e-file like rlgrap-filename default
                                 'c:sapdatagdsmvterror.txt'.

parameters: xpost like sy-datum default sy-datum.

data: begin of gmhead.
        include structure bapi2017_gm_head_01.
data: end of gmhead.

data: begin of gmcode.
        include structure bapi2017_gm_code.
data: end of gmcode.

data: begin of mthead.
        include structure bapi2017_gm_head_ret.
data: end of mthead.

data: begin of itab occurs 100.
        include structure bapi2017_gm_item_create.
data: end of itab.

data: begin of errmsg occurs 10.
        include structure bapiret2.
data: end of errmsg.

data: wmenge like iseg-menge,
      errflag.

data: begin of pcitab occurs 100,
        ext_doc(10),           "External Document Number
        mvt_type(3),           "Movement Type
        doc_date(8),           "Document Date
        post_date(8),          "Posting Date
        plant(4),              "Plant
        material(18),          "Material Number
        qty(13),               "Quantity
        recv_loc(4),           "Receiving Location
        issue_loc(4),          "Issuing Location
        pur_doc(10),           "Purchase Document No
        po_item(3),            "Purchase Document Item No
        del_no(10),            "Delivery Purchase Order Number
        del_item(3),           "Delivery Item
        prod_doc(10),          "Production Document No
        scrap_reason(10),      "Scrap Reason
        upd_sta(1),            "Update Status
      end of pcitab.

call function 'WS_UPLOAD'
  exporting
    filename                      = p-file
    filetype                      = 'DAT'
* IMPORTING
*   FILELENGTH                    =
  tables
    data_tab                      = pcitab
* EXCEPTIONS
*   FILE_OPEN_ERROR               = 1
*   FILE_READ_ERROR               = 2
*   NO_BATCH                      = 3
*   GUI_REFUSE_FILETRANSFER       = 4
*   INVALID_TYPE                  = 5
*   OTHERS                        = 6
          .
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.
  exit.
endif.

gmhead-pstng_date = sy-datum.
gmhead-doc_date = sy-datum.
gmhead-pr_uname = sy-uname.
gmcode-gm_code = '01'.   "01 - MB01 - Goods Receipts for Purchase Order

loop at pcitab.
  itab-move_type  = pcitab-mvt_type.
  itab-mvt_ind    = 'B'.
  itab-plant      = pcitab-plant.
  itab-material   = pcitab-material.
  itab-entry_qnt  = pcitab-qty.
  itab-move_stloc = pcitab-recv_loc.
  itab-stge_loc   = pcitab-issue_loc.
  itab-po_number  = pcitab-pur_doc.
  itab-po_item    = pcitab-po_item.
  concatenate pcitab-del_no pcitab-del_item into itab-item_text.
  itab-move_reas  = pcitab-scrap_reason.

  append itab.
endloop.

loop at itab.
  write:/ itab-material, itab-plant, itab-stge_loc,
          itab-move_type, itab-entry_qnt, itab-entry_uom,
          itab-entry_uom_iso, itab-po_number, itab-po_item,
                                              pcitab-ext_doc.
endloop.

call function 'BAPI_GOODSMVT_CREATE'
  exporting
    goodsmvt_header             = gmhead
    goodsmvt_code               = gmcode
*   TESTRUN                     = ' '
* IMPORTING
    goodsmvt_headret            = mthead
*   MATERIALDOCUMENT            =
*   MATDOCUMENTYEAR             =
  tables
    goodsmvt_item               = itab
*   GOODSMVT_SERIALNUMBER       =
    return                      = errmsg
          .
clear errflag.
loop at errmsg.
  if errmsg-type eq 'E'.
    write:/'Error in function', errmsg-message.
    errflag = 'X'.
  else.
    write:/ errmsg-message.
  endif.
endloop.

if errflag is initial.
  commit work and wait.
  if sy-subrc ne 0.
    write:/ 'Error in updating'.
    exit.
  else.
    write:/ mthead-mat_doc, mthead-doc_year.
    perform upd_sta.
  endif.
endif.

*---------------------------------------------------------------------*
*       FORM UPD_STA                                                  *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
form upd_sta.
  loop at pcitab.
    pcitab-upd_sta = 'X'.
    modify pcitab.
  endloop.

  call function 'WS_DOWNLOAD'
    exporting
      filename                      = p-file
      filetype                      = 'DAT'
* IMPORTING
*   FILELENGTH                    =
    tables
      data_tab                      = pcitab
* EXCEPTIONS
*   FILE_OPEN_ERROR               = 1
*   FILE_READ_ERROR               = 2
*   NO_BATCH                      = 3
*   GUI_REFUSE_FILETRANSFER       = 4
*   INVALID_TYPE                  = 5
*   OTHERS                        = 6
            .

endform.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REWARD POINTS IF HELPFUL&lt;/P&gt;&lt;P&gt;~&lt;SUB&gt;Lakshmiraj&lt;/SUB&gt;~&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 04:44:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-bapi-uploading-data/m-p/3698648#M890596</guid>
      <dc:creator>abapdeveloper20</dc:creator>
      <dc:date>2008-04-04T04:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Re: BAPI uploading data</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/re-bapi-uploading-data/m-p/3698649#M890597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good Links!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;BAPI-step by step
http://www.sapgenie.com/abap/bapi/example.htm

list of all bapis

http://www.planetsap.com/LIST_ALL_BAPIs.htm

for BAPI's
http://www.sappoint.com/abap/bapiintro.pdf
http://www.sappoint.com/abap/bapiprg.pdf
http://www.sappoint.com/abap/bapiactx.pdf
http://www.sappoint.com/abap/bapilst.pdf
http://www.sappoint.com/abap/bapiexer.pdf&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2008 04:45:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/re-bapi-uploading-data/m-p/3698649#M890597</guid>
      <dc:creator>abapdeveloper20</dc:creator>
      <dc:date>2008-04-04T04:45:33Z</dc:date>
    </item>
  </channel>
</rss>

