<?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 FI Document Post in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fi-document-post/m-p/7282797#M1531709</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;A FI document is posted against a customer. Now I want to copy the details of same document and post it to another customer and post one more document for the original customer with the debit indicator. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do we have any FM or BAPI for this ..&lt;/P&gt;&lt;P&gt;Please help me.. I am stuck in the issue...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Rgds,&lt;/P&gt;&lt;P&gt;Sameer..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Oct 2010 06:37:02 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-10-04T06:37:02Z</dc:date>
    <item>
      <title>FI Document Post</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fi-document-post/m-p/7282797#M1531709</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;A FI document is posted against a customer. Now I want to copy the details of same document and post it to another customer and post one more document for the original customer with the debit indicator. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do we have any FM or BAPI for this ..&lt;/P&gt;&lt;P&gt;Please help me.. I am stuck in the issue...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Rgds,&lt;/P&gt;&lt;P&gt;Sameer..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 06:37:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fi-document-post/m-p/7282797#M1531709</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-04T06:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: FI Document Post</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fi-document-post/m-p/7282798#M1531710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use 'BAPI_ACC_DOCUMENT_POST'.Please read the documentation for the business type to be passed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 06:39:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fi-document-post/m-p/7282798#M1531710</guid>
      <dc:creator>jyotheswar_p2</dc:creator>
      <dc:date>2010-10-04T06:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: FI Document Post</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fi-document-post/m-p/7282799#M1531711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
 CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
      EXPORTING
        documentheader = documentheader
      TABLES
        accountgl      = accountgl
        currencyamount = currencyamount
        return         = return
        extension1     = extension1
      EXCEPTIONS
        OTHERS         = 1.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE e999(re) WITH 'Problem occured'.
    ELSE.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 10:57:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fi-document-post/m-p/7282799#M1531711</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-05T10:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: FI Document Post</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fi-document-post/m-p/7282800#M1531712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use [BAPI_ACC_DOCUMENT_POST|http://www.sdn.sap.com/irj/scn/advancedsearch?query=bapi_acc_document_post#sdn_content_category_value_wiki] to post to the new customer and [BAPI_ACC_DOCUMENT_REV_POST|http://www.sdn.sap.com/irj/scn/advancedsearch?query=bapi_acc_document_post#sdn_content_category_value_wiki] for the old one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 11:09:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fi-document-post/m-p/7282800#M1531712</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2010-10-05T11:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: FI Document Post</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fi-document-post/m-p/7282801#M1531713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 DATA:
  obj_type LIKE bapiache02-obj_type,
  obj_key LIKE bapiache02-obj_key,
  obj_sys LIKE bapiache02-obj_sys,
*  documentheader LIKE bapiache08,
  documentheader LIKE bapiache09,
*  accountgl LIKE bapiacgl08 OCCURS 0 WITH HEADER LINE,
*  currencyamount LIKE bapiaccr08 OCCURS 0 WITH HEADER LINE,
*  extension1 LIKE bapiextc   OCCURS 0 WITH HEADER LINE,
  return LIKE bapiret2 OCCURS 0 WITH HEADER LINE,
  accountgl LIKE bapiacgl09  OCCURS 0 WITH HEADER LINE,
  currencyamount LIKE bapiaccr09 OCCURS 0 WITH HEADER LINE,
  extension1 LIKE bapiacextc   OCCURS 0 WITH HEADER LINE,
  t_edidd LIKE edidd OCCURS 0 WITH HEADER LINE,
  bapi_retn_info LIKE bapiret2 OCCURS 0 WITH HEADER LINE.

  DATA: error_flag.
  DATA: gs_wait TYPE bapita-wait,
  wa_comm_return TYPE bapiret2.
  DATA : zline LIKE bapiacgl09-itemno_acc.
  LOOP AT itab.

    IF itab-shkzg = 'H'.
      CONCATENATE itab-mblnr itab-mjahr INTO documentheader-header_txt.
      documentheader-username = sy-uname.
      documentheader-comp_code = '1000'.
      documentheader-doc_date = itab-bldat.
      documentheader-pstng_date = itab-budat.
      documentheader-doc_type = 'SA'.
      documentheader-ref_doc_no = itab-xblnr.
***line item 1
      accountgl-itemno_acc = '2'.
      accountgl-gl_account = '0000232900'.
      accountgl-comp_code = '1000'.
      accountgl-pstng_date = itab-budat.
      accountgl-doc_type = 'SA'.
      accountgl-profit_ctr = itab-prctr.
      accountgl-alloc_nmbr = itab-zuonr.
      accountgl-po_number  = itab-ebeln.
      accountgl-po_item = itab-ebelp.
*    accountgL-DE_CRE_IND = 'S'.
      APPEND accountgl.

      currencyamount-itemno_acc = '2'.
      currencyamount-currency = 'USD'.
      currencyamount-amt_doccur = itab-grval.
      APPEND currencyamount.
*    zline = zline + 1.
***line itme 2
      accountgl-itemno_acc = '1'.
      accountgl-gl_account = '0000261000'.
      accountgl-comp_code = '1000'.
      accountgl-pstng_date = itab-budat.
      accountgl-doc_type = 'SA'.
      accountgl-profit_ctr = itab-prctr.
      accountgl-alloc_nmbr = itab-zuonr.
*    accountgl-po_number  = itab-ebeln.
      accountgl-po_item = itab-ebelp.
*    accountgL-DE_CRE_IND = 'H'.
      APPEND accountgl.
      currencyamount-itemno_acc = '1'.
      currencyamount-currency = 'USD'.
      itab-grval = itab-grval * -1.
      currencyamount-amt_doccur = itab-grval.
      APPEND currencyamount.
    ELSE.

      documentheader-username = sy-uname.
      CONCATENATE itab-mblnr itab-mjahr INTO documentheader-header_txt.
      documentheader-comp_code = '1000'.
      documentheader-doc_date = itab-bldat.
      documentheader-pstng_date = itab-budat.
      documentheader-doc_type = 'SA'.
      documentheader-ref_doc_no = itab-xblnr.
***line item 1
      accountgl-itemno_acc = '1'.
      accountgl-gl_account = '0000261000'.
      accountgl-comp_code = '1000'.
      accountgl-pstng_date = itab-budat.
      accountgl-doc_type = 'SA'.
      accountgl-profit_ctr = itab-prctr.
      accountgl-alloc_nmbr = itab-zuonr.
*    accountgL-DE_CRE_IND = 'S'.
      APPEND accountgl.

      currencyamount-itemno_acc = '1'.
      currencyamount-currency = 'USD'.
      currencyamount-amt_doccur = itab-grval.
      APPEND currencyamount.
*    zsched_line = zsched_line + 1.
***line itme 2
      accountgl-itemno_acc = '2'.
      accountgl-gl_account = '0000232900'.
      accountgl-comp_code = '1000'.
      accountgl-pstng_date = itab-budat.
      accountgl-doc_type = 'SA'.
      accountgl-profit_ctr = itab-prctr.
      accountgl-alloc_nmbr = itab-zuonr.
      accountgl-po_number  = itab-ebeln.
      accountgl-po_item = itab-ebelp.
*    accountgL-DE_CRE_IND = 'H'.
      APPEND accountgl.

      currencyamount-itemno_acc = '2'.
      currencyamount-currency = 'USD'.
      itab-grval = itab-grval * -1.
      currencyamount-amt_doccur = itab-grval.
      APPEND currencyamount.
    ENDIF.
  
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Krupaji on Oct 7, 2010 9:30 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Oct 2010 07:30:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fi-document-post/m-p/7282801#M1531713</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-07T07:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: FI Document Post</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fi-document-post/m-p/7282802#M1531714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Continue...........&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
      EXPORTING
        documentheader = documentheader
      TABLES
        accountgl      = accountgl
        currencyamount = currencyamount
        return         = return
        extension1     = extension1
      EXCEPTIONS
        OTHERS         = 1.
    IF sy-subrc &amp;lt;&amp;gt; 0.
      MESSAGE e999(re) WITH 'Problem occured'.
    ELSE.
      .
      LOOP AT return.
        IF NOT return IS INITIAL.
          CLEAR bapi_retn_info.
          MOVE-CORRESPONDING return TO bapi_retn_info.
          IF return-type = 'A' OR return-type = 'E'.
            error_flag = 'X'.
          ENDIF.
          APPEND bapi_retn_info.
        ENDIF.
      ENDLOOP.
      IF error_flag = 'X'.
        MESSAGE e999(re) WITH 'Problem occured'.
        ROLLBACK WORK.
      ELSE.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait   = gs_wait
          IMPORTING
            return = wa_comm_return.
        WRITE :/ return-message+0(30),return-message+36(10).
      ENDIF.
    ENDIF.
    REFRESH: currencyamount,accountgl,return,extension1.
    CLEAR: currencyamount,accountgl,documentheader,return,extension1.
  ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Oct 2010 07:31:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fi-document-post/m-p/7282802#M1531714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-07T07:31:31Z</dc:date>
    </item>
  </channel>
</rss>

