<?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_DOCUMENT_CREATE error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create-error/m-p/8011384#M1607738</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;do you run the BAPI several times in a loop, if yes then does it work first time? If yes, that would mean that the BAPI buffer has not been refreshed between the 2 calls. To do it, you must use function modules BAPI_TRANSACTION_COMMIT and BAPI_TRANSACTION_ROLLBACK, instead of COMMIT WORK and ROLLBACK WORK respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There seems to be some batch input somewhere (I see variables BDC...) in your program, around the BAPI?, how do they work together?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Jul 2011 21:05:21 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2011-07-20T21:05:21Z</dc:date>
    <item>
      <title>BAPI_DOCUMENT_CREATE error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create-error/m-p/8011381#M1607735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using this bapi to create one document number but I am getting error: BAPI Error creating REF doc &lt;/P&gt;&lt;P&gt;Below is my code can somebody tell me wht I am missing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: ls_doc    like bapi_doc_draw,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        ls_return like bapiret2.&lt;/P&gt;&lt;P&gt;  data: lf_doctype    like bapi_doc_draw-documenttype,&lt;/P&gt;&lt;P&gt;        lf_docnumber  like bapi_doc_draw-documentnumber,&lt;/P&gt;&lt;P&gt;        lf_docpart    like bapi_doc_draw-documenttype,&lt;/P&gt;&lt;P&gt;        lf_docversion like bapi_doc_draw-documenttype.&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Allocate document data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  ls_doc-documenttype    = 'REF'.&lt;/P&gt;&lt;P&gt;  ls_doc-documentnumber  = doknr.&lt;/P&gt;&lt;P&gt;  ls_doc-documentversion = '000'.&lt;/P&gt;&lt;P&gt;  ls_doc-documentpart    = '00'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ls_doc-description    = dktxt.&lt;/P&gt;&lt;P&gt;  ls_doc-statusextern   = 'FR'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ls_doc-authoritygroup = p_auth_group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  call function 'BAPI_DOCUMENT_CREATE'&lt;/P&gt;&lt;P&gt;       exporting: documentdata         = ls_doc&lt;/P&gt;&lt;P&gt;       importing: documenttype         = lf_doctype&lt;/P&gt;&lt;P&gt;                  documentnumber       = lf_docnumber&lt;/P&gt;&lt;P&gt;                  documentpart         = lf_docpart&lt;/P&gt;&lt;P&gt;                  documentversion      = lf_docversion&lt;/P&gt;&lt;P&gt;                  return               = ls_return.&lt;/P&gt;&lt;P&gt;  clear bdc_status.&lt;/P&gt;&lt;P&gt;  bdc_status-session_name    = e_group.&lt;/P&gt;&lt;P&gt;  bdc_status-tran_id         = 'BAPI'.&lt;/P&gt;&lt;P&gt;  bdc_status-object_id       = part32.&lt;/P&gt;&lt;P&gt;  bdc_status-plant           = ' '.&lt;/P&gt;&lt;P&gt;  bdc_status-process_date    = sy-datum.&lt;/P&gt;&lt;P&gt;  bdc_status-process_time    = sy-uzeit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="2" type="ul"&gt;&lt;P&gt;Error occurred ??&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;  if ls_return-type ca 'EA'.&lt;/P&gt;&lt;P&gt;    rollback work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    bdc_status-message_type    = 'E'.&lt;/P&gt;&lt;P&gt;    bdc_status-message_nbr     = '000000'.&lt;/P&gt;&lt;P&gt;    concatenate 'BAPI Error creating REF doc' doknr&lt;/P&gt;&lt;P&gt;           into bdc_status-messages separated by space.&lt;/P&gt;&lt;P&gt;    append bdc_status.&lt;/P&gt;&lt;P&gt;    bdc_status-messages = ls_return-message.&lt;/P&gt;&lt;P&gt;    append bdc_status.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    bdc_status-message_type    = 'S'.&lt;/P&gt;&lt;P&gt;    bdc_status-message_nbr     = '000000'.&lt;/P&gt;&lt;P&gt;    concatenate 'REF doc' doknr 'Created successfully'&lt;/P&gt;&lt;P&gt;           into bdc_status-messages separated by space.&lt;/P&gt;&lt;P&gt;    append bdc_status.&lt;/P&gt;&lt;P&gt;    commit work and wait.              &lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2011 17:10:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create-error/m-p/8011381#M1607735</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-20T17:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_DOCUMENT_CREATE error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create-error/m-p/8011382#M1607736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try running this BAPI from se37 with all the parameters you are passing through the program. if not try it, . You can see teh messages and understand if any error occurs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2011 17:30:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create-error/m-p/8011382#M1607736</guid>
      <dc:creator>lijisusan_mathews</dc:creator>
      <dc:date>2011-07-20T17:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_DOCUMENT_CREATE error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create-error/m-p/8011383#M1607737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It worked in SE37. But not workin in program. I don't know what I am missing in code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2011 18:33:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create-error/m-p/8011383#M1607737</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-07-20T18:33:02Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_DOCUMENT_CREATE error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create-error/m-p/8011384#M1607738</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;do you run the BAPI several times in a loop, if yes then does it work first time? If yes, that would mean that the BAPI buffer has not been refreshed between the 2 calls. To do it, you must use function modules BAPI_TRANSACTION_COMMIT and BAPI_TRANSACTION_ROLLBACK, instead of COMMIT WORK and ROLLBACK WORK respectively.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There seems to be some batch input somewhere (I see variables BDC...) in your program, around the BAPI?, how do they work together?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;Sandra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jul 2011 21:05:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-document-create-error/m-p/8011384#M1607738</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2011-07-20T21:05:21Z</dc:date>
    </item>
  </channel>
</rss>

