<?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 for invoice in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-invoice/m-p/2864794#M671874</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use the BAPI 'BAPI_INCOMINGINVOICE_CREATE' for invoice creation and bapi BAPI_INCINV_CREATE_HEADER for invoice header creation.Below is code for invoice creation.From Bapi call function in the code, u will get to know what header data , item data and accounting data i have to consider and take into account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method DO_HANDLE_EVENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data zinvheader_it type ZRMINV_HEAD_TAB.&lt;/P&gt;&lt;P&gt;data: zinvheader type BAPI_INCINV_CREATE_HEADER.&lt;/P&gt;&lt;P&gt;data: ddate type BLDAT.&lt;/P&gt;&lt;P&gt;data: pdate type BUDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if htmlb_event is bound and htmlb_event-&amp;gt;server_event = 'onsave'.&lt;/P&gt;&lt;P&gt;data: temp_tab1 type zrminvhead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zinvheader-doc_type = 'RE'.&lt;/P&gt;&lt;P&gt;zinvheader-doc_date = request-&amp;gt;get_form_field( 'IDate' ).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATE_EXTERNAL = zinvheader-doc_date&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ACCEPT_INITIAL_DATE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATE_INTERNAL = ddate&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATE_EXTERNAL_IS_INVALID = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;/LI&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;LI level="1" type="ul"&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;zinvheader-doc_date = ddate.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zinvheader-pstng_date = request-&amp;gt;get_form_field( 'PDate' ).&lt;/P&gt;&lt;P&gt;zinvheader-comp_code = request-&amp;gt;get_form_field( 'CCode' ).&lt;/P&gt;&lt;P&gt;zinvheader-gross_amount = request-&amp;gt;get_form_field( 'Amt' ).&lt;/P&gt;&lt;P&gt;zinvheader-partner_bk = request-&amp;gt;get_form_field( 'PBank' ).&lt;/P&gt;&lt;P&gt;zinvheader-currency = request-&amp;gt;get_form_field( 'Curr' ).&lt;/P&gt;&lt;P&gt;zinvheader-invoice_ind = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zitem1-invoice_doc_item = request-&amp;gt;get_form_field( 'IDItem' ).&lt;/P&gt;&lt;P&gt;zitem1-po_number = request-&amp;gt;get_form_field( 'po_num' ).&lt;/P&gt;&lt;P&gt;zitem1-po_item = request-&amp;gt;get_form_field( 'po_item' ).&lt;/P&gt;&lt;P&gt;zitem1-tax_code = request-&amp;gt;get_form_field( 'TCode' ).&lt;/P&gt;&lt;P&gt;zitem1-item_amount = request-&amp;gt;get_form_field( 'IAmt' ).&lt;/P&gt;&lt;P&gt;zitem1-quantity = request-&amp;gt;get_form_field( 'quantity' ).&lt;/P&gt;&lt;P&gt;zitem1-po_unit = request-&amp;gt;get_form_field( 'po_unit' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append zitem1 to zitem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;HEADERDATA = zinvheader&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ADDRESSDATA =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INVOICEDOCNUMBER = inv_no&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FISCALYEAR =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;ITEMDATA = zitem&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ACCOUNTINGDATA =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GLACCOUNTDATA =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MATERIALDATA =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TAXDATA =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITHTAXDATA =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;VENDORITEMSPLITDATA =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;RETURN = ZRET&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;WAIT = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RETURN =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF INV_NO = ' '.&lt;/P&gt;&lt;P&gt;inv_no = 'Try Again'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward point if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Oct 2007 15:07:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-03T15:07:14Z</dc:date>
    <item>
      <title>bapi for invoice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-invoice/m-p/2864790#M671870</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;Can any one tell me the BAPI to create invoice with reference to a Delivey document number.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 14:20:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-invoice/m-p/2864790#M671870</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T14:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: bapi for invoice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-invoice/m-p/2864791#M671871</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;BAPI_INCOMINGINVOICE_CREATE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Headerdata&lt;/P&gt;&lt;P&gt;DOC_DATE 02/08/2005 &lt;/P&gt;&lt;P&gt;INVOICE_IND X Post Invoice&lt;/P&gt;&lt;P&gt;PSTNG_DATE 02/08/2005 &lt;/P&gt;&lt;P&gt;COMP_CODE 5010 Hospira Inc.&lt;/P&gt;&lt;P&gt;CURRENCY/ CURRENCY_ISO USD United States Dollar&lt;/P&gt;&lt;P&gt;GROSS_AMOUNT 100.0000 &lt;/P&gt;&lt;P&gt;DOC_TYPE RE PO Invoice&lt;/P&gt;&lt;P&gt;REF_DOC_NO 1 Billing document no&lt;/P&gt;&lt;P&gt;EXCH_RATE 1.00000 &lt;/P&gt;&lt;P&gt;CALC_TAX_IND X &lt;/P&gt;&lt;P&gt;HEADER_TXT header text &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Item Data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INVOICE_DOC_ITEM 000001 Invoice Document no&lt;/P&gt;&lt;P&gt;PO_NUMBER 4500125768 PO No&lt;/P&gt;&lt;P&gt;PO_ITEM 1 PO item no&lt;/P&gt;&lt;P&gt;ITEM_AMOUNT 100.0000 &lt;/P&gt;&lt;P&gt;QUANTITY 10.000 &lt;/P&gt;&lt;P&gt;PO_UNIT EA Each&lt;/P&gt;&lt;P&gt;REF_DOC 5000000007 Goods Receipt No&lt;/P&gt;&lt;P&gt;REF_DOC_YEAR 2005 GR year&lt;/P&gt;&lt;P&gt;REF_DOC_IT 0001 Goods Receipt item no&lt;/P&gt;&lt;P&gt;TAX_CODE I0 AP, not relevant to tax&lt;/P&gt;&lt;P&gt;ITEM_TEXT Text &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please give me reward point if it is useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Murali Poli&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 14:28:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-invoice/m-p/2864791#M671871</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T14:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: bapi for invoice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-invoice/m-p/2864792#M671872</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Murali,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually the reference for my delivery is Sales Order not PO.Also can u explain what REF_DOC_NO 1 Billing document no means??can i use this bapi for sales document too..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Challa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 14:49:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-invoice/m-p/2864792#M671872</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T14:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: bapi for invoice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-invoice/m-p/2864793#M671873</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Bhasker,&lt;/P&gt;&lt;P&gt;see the sample for the BAPI code&lt;/P&gt;&lt;P&gt;BAPI_BILLINGDOC_CREATEMULTIPLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: t_success TYPE STANDARD TABLE OF bapivbrksuccess WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA: t_billing TYPE STANDARD TABLE OF bapivbrk WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA: t_return TYPE STANDARD TABLE OF bapireturn1 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_billing-salesorg = vbak-vkorg.&lt;/P&gt;&lt;P&gt;t_billing-DISTR_CHAN = vbak-vtweg.&lt;/P&gt;&lt;P&gt;t_billing-DIVISION = vbak-spart.&lt;/P&gt;&lt;P&gt;t_billing-DOC_TYPE = vbak-auart.&lt;/P&gt;&lt;P&gt;t_billing-ref_doc = vbak-vbeln.&lt;/P&gt;&lt;P&gt;t_billing-ref_item = vbap-posnr.&lt;/P&gt;&lt;P&gt;t_billing-doc_number = vbak-vbeln.&lt;/P&gt;&lt;P&gt;t_billing-ITM_NUMBER = vbap-posnr.&lt;/P&gt;&lt;P&gt;t_billing-ordbilltyp = 'BILLING TYPE'.&lt;/P&gt;&lt;P&gt;t_billing-price_date = sy-datum.&lt;/P&gt;&lt;P&gt;t_billing-ref_doc_ca = vbak-vbtyp.&lt;/P&gt;&lt;P&gt;t_billing-sold_to = vbak-kunnr.&lt;/P&gt;&lt;P&gt;t_billing-material = vbap-matnr.&lt;/P&gt;&lt;P&gt;t_billing-plant = vbap-werks.&lt;/P&gt;&lt;P&gt;APPEND t_billing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;billingdatain = t_billing&lt;/P&gt;&lt;P&gt;return = t_return&lt;/P&gt;&lt;P&gt;success = t_success.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;commit work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 14:51:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-invoice/m-p/2864793#M671873</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T14:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: bapi for invoice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-invoice/m-p/2864794#M671874</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use the BAPI 'BAPI_INCOMINGINVOICE_CREATE' for invoice creation and bapi BAPI_INCINV_CREATE_HEADER for invoice header creation.Below is code for invoice creation.From Bapi call function in the code, u will get to know what header data , item data and accounting data i have to consider and take into account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method DO_HANDLE_EVENT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data zinvheader_it type ZRMINV_HEAD_TAB.&lt;/P&gt;&lt;P&gt;data: zinvheader type BAPI_INCINV_CREATE_HEADER.&lt;/P&gt;&lt;P&gt;data: ddate type BLDAT.&lt;/P&gt;&lt;P&gt;data: pdate type BUDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if htmlb_event is bound and htmlb_event-&amp;gt;server_event = 'onsave'.&lt;/P&gt;&lt;P&gt;data: temp_tab1 type zrminvhead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zinvheader-doc_type = 'RE'.&lt;/P&gt;&lt;P&gt;zinvheader-doc_date = request-&amp;gt;get_form_field( 'IDate' ).&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATE_EXTERNAL = zinvheader-doc_date&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ACCEPT_INITIAL_DATE =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATE_INTERNAL = ddate&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;DATE_EXTERNAL_IS_INVALID = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;OTHERS = 2&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;/LI&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;LI level="1" type="ul"&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;zinvheader-doc_date = ddate.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zinvheader-pstng_date = request-&amp;gt;get_form_field( 'PDate' ).&lt;/P&gt;&lt;P&gt;zinvheader-comp_code = request-&amp;gt;get_form_field( 'CCode' ).&lt;/P&gt;&lt;P&gt;zinvheader-gross_amount = request-&amp;gt;get_form_field( 'Amt' ).&lt;/P&gt;&lt;P&gt;zinvheader-partner_bk = request-&amp;gt;get_form_field( 'PBank' ).&lt;/P&gt;&lt;P&gt;zinvheader-currency = request-&amp;gt;get_form_field( 'Curr' ).&lt;/P&gt;&lt;P&gt;zinvheader-invoice_ind = 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zitem1-invoice_doc_item = request-&amp;gt;get_form_field( 'IDItem' ).&lt;/P&gt;&lt;P&gt;zitem1-po_number = request-&amp;gt;get_form_field( 'po_num' ).&lt;/P&gt;&lt;P&gt;zitem1-po_item = request-&amp;gt;get_form_field( 'po_item' ).&lt;/P&gt;&lt;P&gt;zitem1-tax_code = request-&amp;gt;get_form_field( 'TCode' ).&lt;/P&gt;&lt;P&gt;zitem1-item_amount = request-&amp;gt;get_form_field( 'IAmt' ).&lt;/P&gt;&lt;P&gt;zitem1-quantity = request-&amp;gt;get_form_field( 'quantity' ).&lt;/P&gt;&lt;P&gt;zitem1-po_unit = request-&amp;gt;get_form_field( 'po_unit' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append zitem1 to zitem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;HEADERDATA = zinvheader&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ADDRESSDATA =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INVOICEDOCNUMBER = inv_no&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FISCALYEAR =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;ITEMDATA = zitem&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ACCOUNTINGDATA =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GLACCOUNTDATA =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MATERIALDATA =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;TAXDATA =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;WITHTAXDATA =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;VENDORITEMSPLITDATA =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;RETURN = ZRET&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;WAIT = 'X'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;RETURN =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF INV_NO = ' '.&lt;/P&gt;&lt;P&gt;inv_no = 'Try Again'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward point if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 15:07:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-invoice/m-p/2864794#M671874</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T15:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: bapi for invoice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-invoice/m-p/2864795#M671875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anji,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You..I heared a lot about You..i was wondering whether u will respond to this question or not..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what i understand from the sample code is creating a invoice against a sales order...but in my program there is another condition to create a invoice against a delivery..and the reference for this delivery is a saled order.can i use the same bapi for this too..if yes can i  use likp-vbeln instead of vbak-vbeln ..canu tell me what  i need to pass in the other fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t_billing-salesorg = &lt;/P&gt;&lt;P&gt;t_billing-DISTR_CHAN = &lt;/P&gt;&lt;P&gt;t_billing-DIVISION = &lt;/P&gt;&lt;P&gt;t_billing-DOC_TYPE =&lt;/P&gt;&lt;P&gt;t_billing-ref_doc = .&lt;/P&gt;&lt;P&gt;t_billing-ref_item =.&lt;/P&gt;&lt;P&gt;t_billing-doc_number =&lt;/P&gt;&lt;P&gt;t_billing-ITM_NUMBER =&lt;/P&gt;&lt;P&gt;t_billing-ordbilltyp =.&lt;/P&gt;&lt;P&gt;t_billing-price_date = sy-datum.&lt;/P&gt;&lt;P&gt;t_billing-ref_doc_ca = &lt;/P&gt;&lt;P&gt;t_billing-sold_to = &lt;/P&gt;&lt;P&gt;t_billing-material =&lt;/P&gt;&lt;P&gt;t_billing-plant = .&lt;/P&gt;&lt;P&gt;APPEND t_billing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;P&gt;challa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Oct 2007 15:07:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-invoice/m-p/2864795#M671875</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-03T15:07:19Z</dc:date>
    </item>
  </channel>
</rss>

