<?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 Problem with BAPI_DOCUMENT_CREATE2 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1336704#M170847</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the bapi BAPI_DOCUMENT_CREATE2 to create a document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;commit work&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; the document is created but not its characteristics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can i do to solve this issue ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is part of the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: it_draw LIKE STANDARD TABLE OF bapi_doc_draw2 WITH HEADER LINE,
        it_ltext LIKE STANDARD TABLE OF bapi_doc_text WITH HEADER LINE,
        it_drad LIKE STANDARD TABLE OF bapi_doc_drad WITH HEADER LINE,
        it_ausp LIKE STANDARD TABLE OF bapi_characteristic_values WITH HEADER LINE,
        it_clas LIKE STANDARD TABLE OF bapi_class_allocation WITH HEADER LINE,
        return LIKE bapiret2.

....
it_draw-documentnumber = it_cdp_c-doknr.
    it_draw-documenttype = 'FAB'.
....

    it_clas-classtype = '017'.
    it_clas-classname = 'DMS_FAB'.
    append it_clas.

   it_ausp-classname = 'FAB'.
    it_ausp-classtype = 'DMS_FAB'.
    it_ausp-charname = 'DMS_TIPODOCFAB'.
    it_ausp-charvalue = it_cdp_c-zztipodoc.
    APPEND it_ausp.
....

    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
      EXPORTING
        documentdata               = it_draw
      IMPORTING
        return                     = return
      TABLES
        characteristicvalues       = it_ausp
        classallocations           = it_clas
        objectlinks                = it_drad
        longtexts                  = it_ltext.

    IF return-type CA 'EA'.
      ROLLBACK WORK.
    ELSE.
      COMMIT WORK.
    ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 May 2006 19:57:32 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-26T19:57:32Z</dc:date>
    <item>
      <title>Problem with BAPI_DOCUMENT_CREATE2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1336704#M170847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the bapi BAPI_DOCUMENT_CREATE2 to create a document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After the &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;commit work&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; the document is created but not its characteristics.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What can i do to solve this issue ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help me ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is part of the code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: it_draw LIKE STANDARD TABLE OF bapi_doc_draw2 WITH HEADER LINE,
        it_ltext LIKE STANDARD TABLE OF bapi_doc_text WITH HEADER LINE,
        it_drad LIKE STANDARD TABLE OF bapi_doc_drad WITH HEADER LINE,
        it_ausp LIKE STANDARD TABLE OF bapi_characteristic_values WITH HEADER LINE,
        it_clas LIKE STANDARD TABLE OF bapi_class_allocation WITH HEADER LINE,
        return LIKE bapiret2.

....
it_draw-documentnumber = it_cdp_c-doknr.
    it_draw-documenttype = 'FAB'.
....

    it_clas-classtype = '017'.
    it_clas-classname = 'DMS_FAB'.
    append it_clas.

   it_ausp-classname = 'FAB'.
    it_ausp-classtype = 'DMS_FAB'.
    it_ausp-charname = 'DMS_TIPODOCFAB'.
    it_ausp-charvalue = it_cdp_c-zztipodoc.
    APPEND it_ausp.
....

    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
      EXPORTING
        documentdata               = it_draw
      IMPORTING
        return                     = return
      TABLES
        characteristicvalues       = it_ausp
        classallocations           = it_clas
        objectlinks                = it_drad
        longtexts                  = it_ltext.

    IF return-type CA 'EA'.
      ROLLBACK WORK.
    ELSE.
      COMMIT WORK.
    ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2006 19:57:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1336704#M170847</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-26T19:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with BAPI_DOCUMENT_CREATE2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1336705#M170848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here was my problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    it_clas-classtype = '017'.
    it_clas-classname = 'DMS_FAB'.
    append it_clas.

&amp;lt;b&amp;gt;    it_ausp-classname = 'DMS_FAB'.
    it_ausp-classtype = '017'.&amp;lt;/b&amp;gt;
    it_ausp-charname = 'DMS_TIPODOCFAB'.
    it_ausp-charvalue = it_cdp_c-zztipodoc.
    APPEND it_ausp.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 May 2006 20:22:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-document-create2/m-p/1336705#M170848</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-26T20:22:37Z</dc:date>
    </item>
  </channel>
</rss>

