<?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: BAPI......How to use custom and system defined Bapi's... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-how-to-use-custom-and-system-defined-bapi-s/m-p/2501995#M565390</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manoj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Demo.txt is the test data file, pls create the test data files and then save it in c:\ drive&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward pts if found usefull:)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sathish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jul 2007 07:13:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-19T07:13:24Z</dc:date>
    <item>
      <title>BAPI......How to use custom and system defined Bapi's...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-how-to-use-custom-and-system-defined-bapi-s/m-p/2501991#M565386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;1. I have created a Bapi named 'zbapi_str'.&lt;/P&gt;&lt;P&gt;   It appears in the Bapi interface (Tcode BAPI).&lt;/P&gt;&lt;P&gt;   But , i cannnot find out . how to use this object.&lt;/P&gt;&lt;P&gt;2. There are system Defined Bapi's also. ..How to use them..&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plz  give me some step wise details....&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Manoj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2007 15:25:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-how-to-use-custom-and-system-defined-bapi-s/m-p/2501991#M565386</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-18T15:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI......How to use custom and system defined Bapi's...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-how-to-use-custom-and-system-defined-bapi-s/m-p/2501992#M565387</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;You can get good help form the following links,&lt;/P&gt;&lt;P&gt;BAPI-step by step&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapgenie.com/abap/bapi/example.htm" target="test_blank"&gt;http://www.sapgenie.com/abap/bapi/example.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;list of all bapis&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.planetsap.com/LIST_ALL_BAPIs.htm" target="test_blank"&gt;http://www.planetsap.com/LIST_ALL_BAPIs.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;for BAPI's&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapiintro.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapiintro.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapiprg.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapiprg.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapiactx.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapiactx.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapilst.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapilst.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapiexer.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapiexer.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://service.sap.com/ale" target="test_blank"&gt;http://service.sap.com/ale&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://service.sap.com/bapi" target="test_blank"&gt;http://service.sap.com/bapi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCMIDAPII/CABFAAPIINTRO.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/CABFABAPIREF/CABFABAPIPG.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf" target="test_blank"&gt;http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE8/BCFESDE8.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.planetsap.com/Bapi_main_page.htm" target="test_blank"&gt;http://www.planetsap.com/Bapi_main_page.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.topxml.com/sap/sap_idoc_xml.asp" target="test_blank"&gt;http://www.topxml.com/sap/sap_idoc_xml.asp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/" target="test_blank"&gt;http://www.sapdevelopment.co.uk/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf" target="test_blank"&gt;http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also refer to the following links..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.sappoint.com/abap/bapiintro.pdf" target="test_blank"&gt;www.sappoint.com/abap/bapiintro.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.sap-img.com/bapi.htm" target="test_blank"&gt;www.sap-img.com/bapi.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.sap-img.com/abap/bapi-conventions.htm" target="test_blank"&gt;www.sap-img.com/abap/bapi-conventions.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.planetsap.com/Bapi_main_page.htm" target="test_blank"&gt;www.planetsap.com/Bapi_main_page.htm&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.sap.com/www.sapgenie.com/abap/bapi/index.htm" target="test_blank"&gt;www.sapgenie.com/abap/bapi/index.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.htl" target="test_blank"&gt;http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.htl&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://techrepublic.com.com/5100-6329-1051160.html#" target="test_blank"&gt;http://techrepublic.com.com/5100-6329-1051160.html#&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/bapi.htm" target="test_blank"&gt;http://www.sap-img.com/bapi.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/bapi-conventions.htm" target="test_blank"&gt;http://www.sap-img.com/abap/bapi-conventions.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sappoint.com/abap/bapiintro.pdf" target="test_blank"&gt;http://www.sappoint.com/abap/bapiintro.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://sap-img.com/bapi.htm" target="test_blank"&gt;http://sap-img.com/bapi.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;BAPI_SALESORDER_CREATEFROMDAT1&lt;/P&gt;&lt;P&gt;BAPI_SALESORDER_CREATEFROMDAT2 &lt;/P&gt;&lt;P&gt;ex:&lt;/P&gt;&lt;P&gt;REPORT ZBAPI_SALES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: order_header_in type bapisdhd1.&lt;/P&gt;&lt;P&gt;DATA: order_partners type table of BAPIPARNR.&lt;/P&gt;&lt;P&gt;data: return type table of BAPIRET2.&lt;/P&gt;&lt;P&gt;data: errmsg type BAPIRET2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETER: p_vbeln LIKE vbrk-vbeln OBLIGATORY,&lt;/P&gt;&lt;P&gt;p_kunnr LIKE kuagv-kunnr OBLIGATORY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;order_header_in-doc_type = 'OR'.&lt;/P&gt;&lt;P&gt;order_header_in-sales_org = '1000'.&lt;/P&gt;&lt;P&gt;order_header_in-distr_chan = '30'.&lt;/P&gt;&lt;P&gt;order_header_in-division = '00'.&lt;/P&gt;&lt;P&gt;order_header_in-ref_doc = p_vbeln.&lt;/P&gt;&lt;P&gt;ORDER_HEADER_IN-REFDOCTYPE = 'ZQSR'.&lt;/P&gt;&lt;P&gt;ORDER_HEADER_IN-SD_DOC_CAT = 'C'.&lt;/P&gt;&lt;P&gt;CLEAR order_partners.&lt;/P&gt;&lt;P&gt;order_partners-partn_numb = p_kunnr.&lt;/P&gt;&lt;P&gt;order_partners-partn_role = 'SP'.&lt;/P&gt;&lt;P&gt;APPEND order_partners.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SALESDOCUMENTIN =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;order_header_in = order_header_in&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_HEADER_INX =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SENDER =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;BINARY_RELATIONSHIPTYPE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;INT_NUMBER_ASSIGNMENT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;BEHAVE_WHEN_ERROR =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;LOGIC_SWITCH =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TESTRUN =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CONVERT = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;salesdocument = sd_vbeln&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;RETURN = return&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_ITEMS_IN =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_ITEMS_INX =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;order_partners = order_partners&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_SCHEDULES_IN =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_SCHEDULES_INX =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_CONDITIONS_IN =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_CONDITIONS_INX =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_CFGS_REF =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_CFGS_INST =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_CFGS_PART_OF =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_CFGS_VALUE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_CFGS_BLOB =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_CFGS_VK =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_CFGS_REFINST =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_CCARD =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_TEXT =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ORDER_KEYS =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXTENSIONIN =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;PARTNERADDRESSES =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jul 2007 15:44:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-how-to-use-custom-and-system-defined-bapi-s/m-p/2501992#M565387</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-18T15:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI......How to use custom and system defined Bapi's...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-how-to-use-custom-and-system-defined-bapi-s/m-p/2501993#M565388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manoj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you know how to use a standard Bapi you will obviously know how to use a custom bapi. The best example i have is Bapi_po_create1. Just try this code and get bk to me if you need further assistance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  zpo_create                              .
PARAMETERS: p-file LIKE rlgrap-filename DEFAULT
                          'c:demo3.txt'.
 
DATA: BEGIN OF itab OCCURS 0,
  line(1000),
  END OF itab.
DATA l_item(5) TYPE n.
TABLES : zerror.
DATA lcounter(3) TYPE n.
DATA : l_errflag.
 
DATA : l_po_header LIKE bapimepoheader.
DATA : l_po_headerx LIKE bapimepoheaderx.
DATA : t_po_account LIKE bapimepoaccount OCCURS 0 WITH HEADER LINE.
DATA : t_po_accountx LIKE bapimepoaccountx OCCURS 0 WITH HEADER LINE.
DATA : l_new_po(10), l_last_po(10).
 
DATA : l_purchaseorder LIKE bapimepoheader-po_number.
*DATA : L_HEADER LIKE BAPIMEPOHEADER STRUCTURE BAPIMEPOHEADER.
 
 
 
DATA : BEGIN OF t_po_items OCCURS 0.
        INCLUDE STRUCTURE bapimepoitem.
DATA : END OF t_po_items.
 
 
DATA : BEGIN OF t_po_itemsx OCCURS 0.
        INCLUDE STRUCTURE bapimepoitemx.
DATA : END OF t_po_itemsx.
 
 
DATA : BEGIN OF t_return OCCURS 0.
        INCLUDE STRUCTURE bapiret2.
DATA : END OF t_return.
 
CLEAR : l_po_header.
 
CALL FUNCTION 'WS_UPLOAD'
  EXPORTING
    filename                = p-file
    filetype                = 'DAT'
  TABLES
    data_tab                = itab
  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.
 
LOOP  AT itab.
  IF itab-line(1) EQ 'K'.
    l_new_po = itab-line(10).
    IF l_last_po NE  l_new_po AND l_last_po NE space.
      PERFORM create_po.
      PERFORM refresh_table.
    ENDIF.
    IF itab-line+13(2) EQ '40'.
      PERFORM append_header.
    ENDIF.
    IF itab-line+13(2) EQ '81'.
      PERFORM append_item.
    ENDIF.
    l_last_po = l_new_po.
 
  ENDIF.
ENDLOOP.
IF sy-subrc EQ 0.
  PERFORM create_po.
  PERFORM refresh_table.
ENDIF.
 
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  CREATE_PO
*&amp;amp;---------------------------------------------------------------------*
* PO Create
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM create_po .
  CLEAR : l_purchaseorder.
 
  CALL FUNCTION 'BAPI_PO_CREATE1'
    EXPORTING
      poheader                     = l_po_header
     poheaderx                    = l_po_headerx
*     POADDRVENDOR                 =
*     TESTRUN                      =
*     MEMORY_UNCOMPLETE            =
*     MEMORY_COMPLETE              =
*     POEXPIMPHEADER               =
*     POEXPIMPHEADERX              =
*     VERSIONS                     =
*     NO_MESSAGING                 =
*     NO_MESSAGE_REQ               =
*     NO_AUTHORITY                 =
*     NO_PRICE_FROM_PO             =
   IMPORTING
     exppurchaseorder             = l_purchaseorder
*     EXPHEADER                    =
*     EXPPOEXPIMPHEADER            =
   TABLES
     return                       = t_return
     poitem                       = t_po_items
     poitemx                      = t_po_itemsx
*     POADDRDELIVERY               =
*     POSCHEDULE                   =
*     POSCHEDULEX                  =
     poaccount                    = t_po_account
*     POACCOUNTPROFITSEGMENT       =
     poaccountx                   = t_po_accountx
*     POCONDHEADER                 =
*     POCONDHEADERX                =
*     POCOND                       =
*     POCONDX                      =
*     POLIMITS                     =
*     POCONTRACTLIMITS             =
*     POSERVICES                   =
*     POSRVACCESSVALUES            =
*     POSERVICESTEXT               =
*     EXTENSIONIN                  =
*     EXTENSIONOUT                 =
*     POEXPIMPITEM                 =
*     POEXPIMPITEMX                =
*     POTEXTHEADER                 =
*     POTEXTITEM                   =
*     ALLVERSIONS                  =
*     POPARTNER                    =
            .
 
  l_errflag = space.
  lcounter  = 1.
  LOOP AT t_return .
    IF t_return-type = 'E'.
      l_errflag = 'X'.
      GET TIME.
      PERFORM append_error.
    ENDIF.
    WRITE : /1 t_return-message.
  ENDLOOP.
  IF l_errflag EQ space.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
* EXPORTING
* WAIT =
* IMPORTING
* RETURN =
    .
  ENDIF.
 
ENDFORM.                    " CREATE_PO
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  APPEND_HEADER
*&amp;amp;---------------------------------------------------------------------*
* PO Header print
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM append_header .
  l_po_header-comp_code = '1000'." Company Code
  l_po_header-doc_type = 'NB'. " Order Typr BSART
  l_po_header-creat_date = sy-datum. " P.O Dt - BEDAT
 
*CONCATENATE '0000' ITAB+72(6) INTO L_PO_HEADER-VENDOR .
  l_po_header-vendor = itab-line+71(6).
*L_PO_HEADER-VENDOR = ITAB+72(6)    " 'ABC'. "Vendor - EKKO-LIFNR
  IF itab-line(4) NE 'K034'.
    l_po_header-purch_org = '2000'. " Purch. Org - EKKO-EKORG
    l_po_header-pur_group = 'F01'. " Purch Group - EKKO-EKGRP
  ELSE.
    l_po_header-purch_org = '1000'. " Purch. Org - EKKO-EKORG
    l_po_header-pur_group = '001'. " Purch Group - EKKO-EKGRP
  ENDIF.
  l_po_header-currency_iso = 'USD'. " Currency Default field for Enjoy
  l_po_header-ref_1       = itab-line+1(9).
 
 
*L_PO_HEADER-DOC_CAT = 'F'. " Account Assign Cat EKPO-KNTTP
 
*_PO_HEADER-CREATED_BY = SY-UNAME.
 
  CLEAR : l_po_headerx.
 
  l_po_headerx-po_number = 'X'.
  l_po_headerx-comp_code = 'X'." Company Code
  l_po_headerx-doc_type = 'X'. " Order Typr BSART
 
  l_po_headerx-vendor = 'X'. "Vendor - EKKO-LIFNR
  l_po_headerx-purch_org = 'X'. " Purch. Org - EKKO-EKORG
  l_po_headerx-pur_group = 'X'. " Purch Group - EKKO-EKGRP
  l_po_headerx-currency_iso = 'X'. " Currency Default field for Enjoy
  l_po_headerx-ref_1       = 'X'.
 
 
 
ENDFORM.                    " APPEND_HEADER
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  APPEND_ITEM
*&amp;amp;---------------------------------------------------------------------*
* Material Number and Item print
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM append_item .
* PO Line Items
  l_item = l_item + 10.
  t_po_items-po_item = l_item.
*T_PO_ITEMS-PO_ITEM = '00010'." Line Item No - EKPO-EBELP
*T_PO_ITEMS-SHORT_TEXT = 'KSR TEXT'." Line Item TEXT
 
  CONCATENATE  '00000000' itab-line+32(10) INTO t_po_items-material.
*T_PO_ITEMS-MATERIAL = '000000000000000043'. " Material No - EKPO-EMATN
  CONCATENATE  '00000000' itab-line+32(10) INTO t_po_items-ematerial.
  t_po_items-plant = '2001'. " Plant - EKPO-WERKS
  t_po_items-quantity = '1.000'.
  t_po_items-net_price = '10.00'. " EKPO-NETPR
 
  t_po_items-price_unit = '10 '.
*T_PO_ITEMS-TAX_CODE = 'A2'.
  IF  itab-line+0(4) EQ 'K034'.
    t_po_items-acctasscat = 'R'.
    t_po_items-plant = '1001'.
    t_po_account-po_item = l_item.
    t_po_account-profit_ctr = 'BR034'.
    t_po_account-gl_account = '0000135075'.
* T_PO_ACCOUNT-CO_AREA  = '1000'.
    APPEND t_po_account.
    CLEAR t_po_account.
    t_po_accountx-po_item = l_item.
    t_po_accountx-profit_ctr = 'X'.
    t_po_accountx-gl_account = 'X'.
* T_PO_ACCOUNTX-CO_AREA  = 'X'.
    APPEND t_po_accountx.
    CLEAR t_po_accountx.
 
  ENDIF.
  APPEND t_po_items.
  CLEAR t_po_items.
 
  t_po_itemsx-po_item = l_item.
  t_po_itemsx-po_itemx = 'X'.
 
  t_po_itemsx-acctasscat = 'X'.
 
  t_po_itemsx-material = 'X'.
  t_po_itemsx-ematerial = 'X'.
  t_po_itemsx-plant = 'X'.
  t_po_itemsx-quantity = 'X'.
  t_po_itemsx-net_price = 'X'.
 
  t_po_itemsx-price_unit = 'X'.
*T_PO_ITEMSX-TAX_CODE = 'X'.
 
  APPEND t_po_itemsx.
  CLEAR t_po_itemsx.
 
*** Second Line Item
 
 
ENDFORM.                    " APPEND_ITEM
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  REFRESH_TABLE
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM refresh_table .
  REFRESH : t_po_items, t_po_itemsx.
  CLEAR l_item.
ENDFORM.                    " REFRESH_TABLE
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  append_error
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  --&amp;gt;  p1        text
*  &amp;lt;--  p2        text
*----------------------------------------------------------------------*
FORM append_error .
  MOVE : sy-datum TO zerror-zdate,
          sy-uzeit TO zerror-ztime,
          itab+3(5) TO zerror-document_no,
          t_return-message    TO zerror-message.
  lcounter =  lcounter + 1.
  zerror-counter = lcounter .
  zerror-rec_type = itab-line(1).
  MODIFY zerror. CLEAR zerror.
  COMMIT WORK.
ENDFORM.                    " append_error&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if useful,&lt;/P&gt;&lt;P&gt;Aleem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 03:22:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-how-to-use-custom-and-system-defined-bapi-s/m-p/2501993#M565388</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T03:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI......How to use custom and system defined Bapi's...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-how-to-use-custom-and-system-defined-bapi-s/m-p/2501994#M565389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;  Thanks for your reply.&lt;/P&gt;&lt;P&gt;I go thru the code .but cannot find the format of file to be uplaoded.(.'c:\demo3.txt').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Actually i am new to BAPI and just learning this...I go thru all the links on the  net..and learn how to create.the bapi object type.&lt;/P&gt;&lt;P&gt; Can  you tell me how to use  standard Bapi .from where i find the bapi for my requirement.and step by step demo of using Bapi..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Waiting for u reply....manoj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 03:51:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-how-to-use-custom-and-system-defined-bapi-s/m-p/2501994#M565389</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T03:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI......How to use custom and system defined Bapi's...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-how-to-use-custom-and-system-defined-bapi-s/m-p/2501995#M565390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manoj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Demo.txt is the test data file, pls create the test data files and then save it in c:\ drive&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward pts if found usefull:)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sathish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 07:13:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-how-to-use-custom-and-system-defined-bapi-s/m-p/2501995#M565390</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T07:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI......How to use custom and system defined Bapi's...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-how-to-use-custom-and-system-defined-bapi-s/m-p/2501996#M565391</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanx ..&lt;/P&gt;&lt;P&gt; I need the format of the txt file..&lt;/P&gt;&lt;P&gt;can u plzz send me the same on  my Id : manojlakhanpal@gmail.com&lt;/P&gt;&lt;P&gt;And  plzz give me some idea how to use Standard Bapi's...&lt;/P&gt;&lt;P&gt;How to realize the need which badi is to be used...where.and how  ?&lt;/P&gt;&lt;P&gt; waiting for ur reply ..&lt;/P&gt;&lt;P&gt;  Manoj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2007 13:55:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-how-to-use-custom-and-system-defined-bapi-s/m-p/2501996#M565391</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-19T13:55:31Z</dc:date>
    </item>
  </channel>
</rss>

