<?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 BAPI_ACC_DOCUMENT_POST in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-bapi-acc-document-post/m-p/3066316#M726624</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Karthikeyan i am not seeking to know how to use the FM in totality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to know how to make use of the COPA characteristics. If you have an example of that please do forward me the same. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The answer you provided is not what i am looking for,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Nov 2007 10:36:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-11-19T10:36:50Z</dc:date>
    <item>
      <title>BAPI BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-bapi-acc-document-post/m-p/3066314#M726622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to transfer COPA characteristics to an accounting document being created using FM BAPI_ACC_DOCUMENT_POST. I am in doubt of how i should go about using the tables CRITERIA and VALUEFIELD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please share a code example for the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2007 10:10:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-bapi-acc-document-post/m-p/3066314#M726622</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-19T10:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-bapi-acc-document-post/m-p/3066315#M726623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is an example code on how to use this puppy:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it_acc_gl LIKE bapiacgl09 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;it_acc_ap LIKE bapiacap09 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;it_return LIKE bapiret2 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;it_curr_amt LIKE bapiaccr09 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;it_doc_header LIKE bapiache09 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;it_acc_tax LIKE bapiactx09 OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;obj_type LIKE bapiache09-obj_type,&lt;/P&gt;&lt;P&gt;obj_key LIKE bapiache09-obj_key,&lt;/P&gt;&lt;P&gt;obj_sys LIKE bapiache09-obj_sys,&lt;/P&gt;&lt;P&gt;pstng_date LIKE it_doc_header-pstng_date,&lt;/P&gt;&lt;P&gt;doc_date LIKE it_doc_header-doc_date,&lt;/P&gt;&lt;P&gt;loop_cnt TYPE i VALUE 0,&lt;/P&gt;&lt;P&gt;gv_vendor(10) TYPE c,&lt;/P&gt;&lt;P&gt;gv_gl_acc(10) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT bdc_source.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;First line of table is heading so don't do anything&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IF bdc_layout IS INITIAL.&lt;/P&gt;&lt;P&gt;MOVE bdc_source TO bdc_layout.&lt;/P&gt;&lt;P&gt;TRANSLATE bdc_layout TO UPPER CASE.&lt;/P&gt;&lt;P&gt;CONTINUE.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;bdc_out = bdc_source.&lt;/P&gt;&lt;P&gt;CLEAR: obj_type, obj_sys, obj_key, pstng_date, doc_date, gv_vendor, gv_gl_acc.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Setup the dates in correct format&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CONCATENATE bdc_source-col_c&lt;EM&gt;6(4) bdc_source-col_c(2) bdc_source-col_c&lt;/EM&gt;3(2) INTO pstng_date.&lt;/P&gt;&lt;P&gt;CONCATENATE bdc_source-col_b&lt;EM&gt;6(4) bdc_source-col_b(2) bdc_source-col_b&lt;/EM&gt;3(2) INTO doc_date.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Padding zeros, very important otherwise bunch of stuff is missing&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;input = bdc_source-col_e&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;output = gv_vendor.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;input = bdc_source-col_j&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;output = gv_gl_acc.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Header&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;REFRESH it_doc_header.&lt;/P&gt;&lt;P&gt;it_doc_header-bus_act = 'RFBU'.&lt;/P&gt;&lt;P&gt;it_doc_header-username = sy-uname.&lt;/P&gt;&lt;P&gt;it_doc_header-header_txt = bdc_source-col_h. " Invoice Text&lt;/P&gt;&lt;P&gt;it_doc_header-comp_code = bdc_source-col_a. " Company Code&lt;/P&gt;&lt;P&gt;it_doc_header-doc_date = doc_date. " Invoice Date&lt;/P&gt;&lt;P&gt;it_doc_header-pstng_date = pstng_date. " Posting Date&lt;/P&gt;&lt;P&gt;it_doc_header-doc_type = 'KR'. " Return Order...?&lt;/P&gt;&lt;P&gt;it_doc_header-ref_doc_no = bdc_source-col_d. " Invoice Number&lt;/P&gt;&lt;P&gt;APPEND it_doc_header.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;GL Account&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;REFRESH it_acc_gl.&lt;/P&gt;&lt;P&gt;it_acc_gl-itemno_acc = '1'.&lt;/P&gt;&lt;P&gt;it_acc_gl-gl_account = gv_gl_acc. " GL Account&lt;/P&gt;&lt;P&gt;it_acc_gl-item_text = bdc_source-col_o. " Line Item Text&lt;/P&gt;&lt;P&gt;it_acc_gl-doc_type = 'KR'. " Return Order...?&lt;/P&gt;&lt;P&gt;it_acc_gl-comp_code = bdc_source-col_a. " Company Code&lt;/P&gt;&lt;P&gt;it_acc_gl-pstng_date = pstng_date. " Posting Date&lt;/P&gt;&lt;P&gt;it_acc_gl-vendor_no = gv_vendor. " Vendor Number&lt;/P&gt;&lt;P&gt;it_acc_gl-costcenter = bdc_source-col_k. " Cost Center&lt;/P&gt;&lt;P&gt;it_acc_gl-wbs_element = bdc_source-col_q. " WBS Element&lt;/P&gt;&lt;P&gt;"it_acc_gl-tax_code = bdc_source-col_m. " Tax Code&lt;/P&gt;&lt;P&gt;it_acc_gl-network = bdc_source-col_p. " Internal Order&lt;/P&gt;&lt;P&gt;conv_s_amt = bdc_source-col_f. " Invoice Amount&lt;/P&gt;&lt;P&gt;REPLACE ALL OCCURRENCES OF ',' IN conv_s_amt WITH ''.&lt;/P&gt;&lt;P&gt;IF conv_s_amt &amp;lt; 0.&lt;/P&gt;&lt;P&gt;it_acc_gl-de_cre_ind = 'H'. " H-Credit&lt;/P&gt;&lt;P&gt;conv_s_amt = - conv_s_amt.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;it_acc_gl-de_cre_ind = 'S'. " S-Debit&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;CONDENSE conv_s_amt.&lt;/P&gt;&lt;P&gt;APPEND it_acc_gl.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;AP Account&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;REFRESH it_acc_ap.&lt;/P&gt;&lt;P&gt;it_acc_ap-itemno_acc = '2'. " Invoice Number&lt;/P&gt;&lt;P&gt;it_acc_ap-vendor_no = gv_vendor. " Vendor Number&lt;/P&gt;&lt;P&gt;it_acc_ap-comp_code = bdc_source-col_a. " Company Code&lt;/P&gt;&lt;P&gt;it_acc_ap-item_text = bdc_source-col_o. " Line Item Text&lt;/P&gt;&lt;P&gt;APPEND it_acc_ap.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Currancy&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;REFRESH it_curr_amt.&lt;/P&gt;&lt;P&gt;it_curr_amt-itemno_acc = '1'. " Invoice Number&lt;/P&gt;&lt;P&gt;it_curr_amt-curr_type = '00'.&lt;/P&gt;&lt;P&gt;it_curr_amt-currency = bdc_source-col_g. " Currancy&lt;/P&gt;&lt;P&gt;it_curr_amt-amt_doccur = conv_s_amt. " Line Item Amount&lt;/P&gt;&lt;P&gt;APPEND it_curr_amt.&lt;/P&gt;&lt;P&gt;it_curr_amt-itemno_acc = '2'. " Invoice Number&lt;/P&gt;&lt;P&gt;it_curr_amt-curr_type = '00'.&lt;/P&gt;&lt;P&gt;it_curr_amt-currency = bdc_source-col_g. " Currancy&lt;/P&gt;&lt;P&gt;it_curr_amt-amt_doccur = conv_s_amt * -1. " Line Item Amount&lt;/P&gt;&lt;P&gt;APPEND it_curr_amt.&lt;/P&gt;&lt;P&gt;REFRESH it_return.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Do the post to GL Account and AP&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;documentheader = it_doc_header&lt;/P&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;P&gt;obj_type = obj_type&lt;/P&gt;&lt;P&gt;obj_key = obj_key&lt;/P&gt;&lt;P&gt;obj_sys = obj_sys&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;accountgl = it_acc_gl&lt;/P&gt;&lt;P&gt;currencyamount = it_curr_amt&lt;/P&gt;&lt;P&gt;accountpayable = it_acc_ap&lt;/P&gt;&lt;P&gt;return = it_return.&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;Check for any errors&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;loop_cnt = 0.&lt;/P&gt;&lt;P&gt;LOOP AT it_return.&lt;/P&gt;&lt;P&gt;IF it_return-type = 'E'.&lt;/P&gt;&lt;P&gt;bdc_out-code = 'E'.&lt;/P&gt;&lt;P&gt;error_count = error_count + 1.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;bdc_out-code = 'S'.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;loop_cnt = loop_cnt + 1.&lt;/P&gt;&lt;P&gt;IF loop_cnt = 1.&lt;/P&gt;&lt;P&gt;bdc_out-mesg1 = it_return-message.&lt;/P&gt;&lt;P&gt;ELSE.&lt;/P&gt;&lt;P&gt;IF loop_cnt = 2.&lt;/P&gt;&lt;P&gt;bdc_out-mesg2 = it_return-message.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;APPEND bdc_out.&lt;/P&gt;&lt;P&gt;cur_line = cur_line + 1.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2007 10:24:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-bapi-acc-document-post/m-p/3066315#M726623</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-19T10:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-bapi-acc-document-post/m-p/3066316#M726624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Karthikeyan i am not seeking to know how to use the FM in totality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to know how to make use of the COPA characteristics. If you have an example of that please do forward me the same. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The answer you provided is not what i am looking for,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2007 10:36:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-bapi-acc-document-post/m-p/3066316#M726624</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-19T10:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-bapi-acc-document-post/m-p/3066317#M726625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Karthikeyan  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where are the tables CRITERIA and VALUEFIELD asked for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may win some merits answering questions, not necessarily for posting code without direct relevance to the question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND: If you post any code, please use the Code button on top of the text input window. This retains the formatting and helps read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We all hate the point-grabbers, don't we?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2007 11:39:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-bapi-acc-document-post/m-p/3066317#M726625</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-11-19T11:39:12Z</dc:date>
    </item>
  </channel>
</rss>

