<?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 BAPI for DB/CR note request with reference to invoice in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-db-cr-note-request-with-reference-to-invoice/m-p/8309346#M1636327</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found BAPI for DB/CR note request with reference to Invoice (BAPI_SALESDOCU_CREATEFROMDATA) , which is working fine. But in reference field is not working. Please help me out. Please find the code details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: order_header_in type BAPISDHEAD.&lt;/P&gt;&lt;P&gt;data: SALESDOCUMENT type BAPIVBELN-VBELN.&lt;/P&gt;&lt;P&gt;data: RETURN type BAPIRETURN1.&lt;/P&gt;&lt;P&gt;data: ORDER_ITEMS_IN type standard table of BAPIITEMIN WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;data: ORDER_PARTNERS type standard table of BAPIPARTNR WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA: SOLD_TO_PARTY TYPE  BAPISOLDTO,&lt;/P&gt;&lt;P&gt;      SHIP_TO_PARTY TYPE  BAPISHIPTO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;order_header_in-DOC_TYPE = 'ZCR'. "Credit note request type&lt;/P&gt;&lt;P&gt;order_header_in-SALES_ORG = '1000'.&lt;/P&gt;&lt;P&gt;order_header_in-DISTR_CHAN = '10'.&lt;/P&gt;&lt;P&gt;order_header_in-DIVISION = '05'.&lt;/P&gt;&lt;P&gt;order_header_in-SALES_OFF = '1130'.&lt;/P&gt;&lt;P&gt;order_header_in-REF_DOC = '1116002582'. "Invoice no&lt;/P&gt;&lt;P&gt;order_header_in-REF_DOC_CA = 'M'.&lt;/P&gt;&lt;P&gt;order_header_in-SD_DOC_CAT = 'K'.&lt;/P&gt;&lt;P&gt;order_header_in-PURCH_NO = 'Credit Note'.&lt;/P&gt;&lt;P&gt;order_header_in-PURCH_DATE = SY-DATUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;order_items_in-ITM_NUMBER = '000010'.&lt;/P&gt;&lt;P&gt;order_items_in-REF_DOC   = '1116002582'.  "Invoice no&lt;/P&gt;&lt;P&gt;order_items_in-REF_DOC_IT = '000010'.&lt;/P&gt;&lt;P&gt;order_items_in-REF_DOC_CA  = 'M'.&lt;/P&gt;&lt;P&gt;order_items_in-COND_TYPE = 'ZP01'. "Pricing cond Type&lt;/P&gt;&lt;P&gt;order_items_in-COND_VALUE = 551. "Amt&lt;/P&gt;&lt;P&gt;APPEND order_items_in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;order_partners-PARTN_ROLE = 'AG'.&lt;/P&gt;&lt;P&gt;order_partners-PARTN_NUMB = '0010000493'.&lt;/P&gt;&lt;P&gt;APPEND order_partners.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    order_header_in           = order_header_in&lt;/P&gt;&lt;P&gt;    business_object           = 'BUS2094'&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   SALESDOCUMENT             = SALESDOCUMENT&lt;/P&gt;&lt;P&gt;   RETURN                    = RETURN&lt;/P&gt;&lt;P&gt;  tables&lt;/P&gt;&lt;P&gt;    order_items_in            = order_items_in&lt;/P&gt;&lt;P&gt;    order_partners            = order_partners.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in VBAK table, I did compare with another credit not request (created in GUI TCode VA01), where I found reference no is taking by the BAPI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Nov 2011 07:16:37 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-11-30T07:16:37Z</dc:date>
    <item>
      <title>BAPI for DB/CR note request with reference to invoice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-db-cr-note-request-with-reference-to-invoice/m-p/8309346#M1636327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found BAPI for DB/CR note request with reference to Invoice (BAPI_SALESDOCU_CREATEFROMDATA) , which is working fine. But in reference field is not working. Please help me out. Please find the code details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: order_header_in type BAPISDHEAD.&lt;/P&gt;&lt;P&gt;data: SALESDOCUMENT type BAPIVBELN-VBELN.&lt;/P&gt;&lt;P&gt;data: RETURN type BAPIRETURN1.&lt;/P&gt;&lt;P&gt;data: ORDER_ITEMS_IN type standard table of BAPIITEMIN WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;data: ORDER_PARTNERS type standard table of BAPIPARTNR WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA: SOLD_TO_PARTY TYPE  BAPISOLDTO,&lt;/P&gt;&lt;P&gt;      SHIP_TO_PARTY TYPE  BAPISHIPTO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;order_header_in-DOC_TYPE = 'ZCR'. "Credit note request type&lt;/P&gt;&lt;P&gt;order_header_in-SALES_ORG = '1000'.&lt;/P&gt;&lt;P&gt;order_header_in-DISTR_CHAN = '10'.&lt;/P&gt;&lt;P&gt;order_header_in-DIVISION = '05'.&lt;/P&gt;&lt;P&gt;order_header_in-SALES_OFF = '1130'.&lt;/P&gt;&lt;P&gt;order_header_in-REF_DOC = '1116002582'. "Invoice no&lt;/P&gt;&lt;P&gt;order_header_in-REF_DOC_CA = 'M'.&lt;/P&gt;&lt;P&gt;order_header_in-SD_DOC_CAT = 'K'.&lt;/P&gt;&lt;P&gt;order_header_in-PURCH_NO = 'Credit Note'.&lt;/P&gt;&lt;P&gt;order_header_in-PURCH_DATE = SY-DATUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;order_items_in-ITM_NUMBER = '000010'.&lt;/P&gt;&lt;P&gt;order_items_in-REF_DOC   = '1116002582'.  "Invoice no&lt;/P&gt;&lt;P&gt;order_items_in-REF_DOC_IT = '000010'.&lt;/P&gt;&lt;P&gt;order_items_in-REF_DOC_CA  = 'M'.&lt;/P&gt;&lt;P&gt;order_items_in-COND_TYPE = 'ZP01'. "Pricing cond Type&lt;/P&gt;&lt;P&gt;order_items_in-COND_VALUE = 551. "Amt&lt;/P&gt;&lt;P&gt;APPEND order_items_in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;order_partners-PARTN_ROLE = 'AG'.&lt;/P&gt;&lt;P&gt;order_partners-PARTN_NUMB = '0010000493'.&lt;/P&gt;&lt;P&gt;APPEND order_partners.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    order_header_in           = order_header_in&lt;/P&gt;&lt;P&gt;    business_object           = 'BUS2094'&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   SALESDOCUMENT             = SALESDOCUMENT&lt;/P&gt;&lt;P&gt;   RETURN                    = RETURN&lt;/P&gt;&lt;P&gt;  tables&lt;/P&gt;&lt;P&gt;    order_items_in            = order_items_in&lt;/P&gt;&lt;P&gt;    order_partners            = order_partners.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in VBAK table, I did compare with another credit not request (created in GUI TCode VA01), where I found reference no is taking by the BAPI.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Nov 2011 07:16:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-db-cr-note-request-with-reference-to-invoice/m-p/8309346#M1636327</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-11-30T07:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI for DB/CR note request with reference to invoice</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-db-cr-note-request-with-reference-to-invoice/m-p/8309347#M1636328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sanjeet Kumar Yadav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please see note [Note 370988 - BAPIs in SD: Creation with reference|https://service.sap.com/sap/support/notes/370988], I believe that this note can help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Bruno Xavier.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jan 2012 22:35:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-for-db-cr-note-request-with-reference-to-invoice/m-p/8309347#M1636328</guid>
      <dc:creator>brunobex</dc:creator>
      <dc:date>2012-01-31T22:35:39Z</dc:date>
    </item>
  </channel>
</rss>

