<?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: Issue with BAPI_ACC_DOCUMENT_CHECK &amp; BAPI_ACC_DOCUMENT_POST in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-bapi-acc-document-check-bapi-acc-document-post/m-p/6695423#M1451767</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First guess, since I don't have access to FI....the message would indicate to me that I have supplied a value to the OBJ_TYPE field that is not an "acceptable", e.g., configured value for OBJ_TYPE.  Go to SE11, look up the OBJ_TYPE, forward navigate to the domain, and look for a value range (or more likely) a config table.  Look at the entries in that T table....  I think it's likely that you're supplying a value in your input that has not been defined to SAP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 06 Mar 2010 00:31:52 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-06T00:31:52Z</dc:date>
    <item>
      <title>Issue with BAPI_ACC_DOCUMENT_CHECK &amp; BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-bapi-acc-document-check-bapi-acc-document-post/m-p/6695422#M1451766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wrote a program code to post a document for F-43 transaction using a BAPI.&lt;/P&gt;&lt;P&gt;Unfortunately, the BAPI comes back with an error message&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1 E RW 609	Error in document: BKPF 1900022387208 2010 SYS01                  1900022387208 2010&lt;/P&gt;&lt;P&gt;2 E RW 628	Incorrect entry in field OBJ_TYPE: BKPF                                          DOCUMENTHEADER 1 OBJ_TYPE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT z_test_f44 NO STANDARD PAGE HEADING LINE-COUNT 65 LINE-SIZE 132
MESSAGE-ID zfi.

TABLES: bsik, t003.
TYPES:
  BEGIN OF tp_tab_bsik,
    bukrs TYPE bukrs,
    lifnr TYPE lifnr,
    gjahr TYPE gjahr,
    budat TYPE budat,
    bldat TYPE bldat,
    blart TYPE blart,
    bschl TYPE bschl,
  END OF tp_tab_bsik.


SELECTION-SCREEN:BEGIN OF BLOCK blck01 WITH FRAME TITLE text-001.

PARAMETERS:
    p_per(2)            TYPE c                    DEFAULT sy-datum+4(2),
    p_dt                LIKE sy-datum             DEFAULT sy-datum,
    p_hkont             TYPE hkont                DEFAULT '105010',
    p_waers             LIKE bkpf-waers           DEFAULT 'USD',
    p_blart             LIKE bkpf-blart           DEFAULT 'KR',
    p_xblnr            LIKE bkpf-xblnr            DEFAULT 'V01',
    p_xblnr1           LIKE bkpf-xblnr            DEFAULT 'A01',
    p_amt              LIKE bseg-wrbtr            DEFAULT '10.00',
    p_bukrs            LIKE bkpf-bukrs            DEFAULT '208',
    p_lifnr            LIKE lfa1-lifnr            DEFAULT '1000165'.

SELECTION-SCREEN:END OF BLOCK blck01.
*----------------end of selection parameters-----------------------*


*------------------START OF SELECTION----------------------------------*
START-OF-SELECTION.


  PERFORM process_data.          "Posting using F-44(Bapi)



*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;      Form  process_data
*&amp;amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM process_data.
  DATA:
  l_documentheader   LIKE bapiache09,
  l_accountgl        LIKE bapiacgl09 OCCURS 2 WITH HEADER LINE,
  l_vendoritem       LIKE bapiacap09 OCCURS 2 WITH HEADER LINE,
  l_currencyamount   LIKE bapiaccr09 OCCURS 2 WITH HEADER LINE,
  l_currencytype     LIKE bapiaccr09-currency_iso,
  l_return           LIKE bapiret2 OCCURS 5 WITH HEADER LINE,
  l_obj_type         LIKE bapiache02-obj_type,
  l_obj_key          LIKE bapiache02-obj_key,
  l_obj_sys          LIKE bapiache02-obj_sys,
  l_obj_sys_1        LIKE tbdls-logsys,
  ls_t003            TYPE t003,
  l_belnr            TYPE bkpf-belnr,

  l_awtyp            LIKE acchd-awtyp,   " Anwendungsreferenz
  l_awref            LIKE acchd-awref,   "
  l_aworg            LIKE acchd-aworg,   "
  l_awsys            LIKE acchd-awsys,   "
  l_awkey            LIKE bkpf-awkey.    "

  BREAK-POINT.
  CLEAR:
         l_documentheader, l_vendoritem, l_accountgl,
         l_currencyamount, l_return.

  REFRESH:l_vendoritem, l_currencyamount, l_return.


* Get Your Logical System
  CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
    IMPORTING
      own_logical_system             = l_obj_sys_1
    EXCEPTIONS
      own_logical_system_not_defined = 1
      OTHERS                         = 2.
* Number Range Information
  SELECT SINGLE *
    FROM t003
    INTO CORRESPONDING FIELDS OF t003
   WHERE blart = p_blart.

* Get the additional Number Range Details.
  CALL FUNCTION 'FAGL_GET_NUMBER_RANGE_FOR_PN'
    EXPORTING
      i_rldnr       = '0L'     "Ledger
      i_blart       = p_blart
    IMPORTING
      es_t003       = ls_t003
    EXCEPTIONS
      error_message = 1.

* Get the next BELNR
  t003-numkr = ls_t003-numkr.
  CALL FUNCTION 'RF_GET_DOCUMENT_NUMBER'
    EXPORTING
      company         = p_bukrs
      range           = t003-numkr
      year            = sy-datum+0(4)
    IMPORTING
      document_number = l_belnr.

* Create Reference Keys
  CALL FUNCTION 'FI_REFERENCE_CREATE'
    EXPORTING
      i_awtyp           = 'BKPF '
      i_bukrs           = p_bukrs
      i_gjahr           = sy-datum+0(4)
      i_belnr           = l_belnr
    IMPORTING
      e_awtyp           = l_awtyp
      e_awref           = l_awref
      e_aworg           = l_aworg
      e_awkey           = l_awkey
      e_awsys           = l_awsys
    EXCEPTIONS
      object_type       = 1
      missing_parameter = 2
      OTHERS            = 3.
  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.
  ENDIF.


* Build Document Header
  l_documentheader-obj_type   = l_awtyp. "'BKPF'.
  l_documentheader-obj_key    = l_awkey.
  l_documentheader-obj_sys    = l_obj_sys_1.
  l_documentheader-bus_act    = 'RFBU'.
  l_documentheader-ac_doc_no  = l_belnr.
  l_documentheader-username   = sy-uname.
  l_documentheader-comp_code  = p_bukrs.
  l_documentheader-fis_period = p_per.
  l_documentheader-doc_date   = p_dt.
  l_documentheader-pstng_date = sy-datum.
  l_documentheader-fisc_year  = sy-datum+0(4).
  l_documentheader-doc_type   = p_blart.
  l_documentheader-ref_doc_no = p_xblnr.

  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      input  = p_hkont
    IMPORTING
      output = p_hkont.

* G/L Item
  l_accountgl-itemno_acc     = '000000001'.
*  l_accountgl-acct_key       = 'RFBU'.
  l_accountgl-gl_account     = p_hkont.
  l_accountgl-comp_code      = p_bukrs.
  l_accountgl-pstng_date     = sy-datum.
  l_accountgl-doc_type       = p_blart.
  APPEND l_accountgl. CLEAR l_accountgl.
* G/L Item $$$s
* Posting Key 50
  l_currencyamount-itemno_acc   = '000000001'.
  l_currencyamount-currency_iso = p_waers.
  l_currencyamount-currency     = p_waers.
  l_currencyamount-amt_doccur   = p_amt.
  APPEND l_currencyamount. CLEAR l_currencyamount.

* Vendor Item
  l_vendoritem-itemno_acc     = '000000002'.
*  l_accountgl-acct_key       = 'RFBU'.
  l_vendoritem-vendor_no     = p_lifnr.
  l_vendoritem-comp_code     = p_bukrs.
  APPEND l_vendoritem. CLEAR l_vendoritem.
* Vendor Item $$$s
* Posting Key 31
  l_currencyamount-itemno_acc   = '000000002'.
  l_currencyamount-currency_iso = p_waers.
  l_currencyamount-currency     = p_waers.
  l_currencyamount-amt_doccur   = p_amt.
  l_currencyamount-amt_doccur = l_currencyamount-amt_doccur * -1.
  APPEND l_currencyamount. CLEAR l_currencyamount.

  BREAK-POINT.
  CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'
    EXPORTING
      documentheader = l_documentheader
    TABLES
      accountgl      = l_accountgl
      accountpayable = l_vendoritem
      currencyamount = l_currencyamount
      return         = l_return.

*  CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
*    EXPORTING
*      documentheader = l_documentheader
*    IMPORTING
*      obj_key        = l_obj_key
*    TABLES
*      accountgl      = l_accountgl
*      accountpayable = l_vendoritem
*      currencyamount = l_currencyamount
*      return         = l_return.

  BREAK-POINT.

*  CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

ENDFORM.                    "process_data&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Mar 2010 23:33:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-bapi-acc-document-check-bapi-acc-document-post/m-p/6695422#M1451766</guid>
      <dc:creator>maulik</dc:creator>
      <dc:date>2010-03-05T23:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with BAPI_ACC_DOCUMENT_CHECK &amp; BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-bapi-acc-document-check-bapi-acc-document-post/m-p/6695423#M1451767</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First guess, since I don't have access to FI....the message would indicate to me that I have supplied a value to the OBJ_TYPE field that is not an "acceptable", e.g., configured value for OBJ_TYPE.  Go to SE11, look up the OBJ_TYPE, forward navigate to the domain, and look for a value range (or more likely) a config table.  Look at the entries in that T table....  I think it's likely that you're supplying a value in your input that has not been defined to SAP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Mar 2010 00:31:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-bapi-acc-document-check-bapi-acc-document-post/m-p/6695423#M1451767</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-06T00:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with BAPI_ACC_DOCUMENT_CHECK &amp; BAPI_ACC_DOCUMENT_POST</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-bapi-acc-document-check-bapi-acc-document-post/m-p/6695424#M1451768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually I am using Standard SAP Function modules to generate the OBJ_TYP.&lt;/P&gt;&lt;P&gt;Unfortunately the "Code" tag is not working for me in this browser to align the program code correctly.&lt;/P&gt;&lt;P&gt;But yes, to answer your question obj_typ is correctly done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Create Reference Keys
  call function 'FI_REFERENCE_CREATE'
    exporting
      i_awtyp           = 'BKPF '
      i_bukrs           = p_bukrs
      i_gjahr           = sy-datum+0(4)
      i_belnr           = l_belnr
    importing
      e_awtyp           = l_awtyp
      e_awref           = l_awref
      e_aworg           = l_aworg
      e_awkey           = l_awkey
      e_awsys           = l_awsys
    exceptions
      object_type       = 1
      missing_parameter = 2
      others            = 3.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Mar 2010 01:09:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/issue-with-bapi-acc-document-check-bapi-acc-document-post/m-p/6695424#M1451768</guid>
      <dc:creator>maulik</dc:creator>
      <dc:date>2010-03-06T01:09:55Z</dc:date>
    </item>
  </channel>
</rss>

