<?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: Problem with BAPI_CREATE_DOCUMENT2 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-create-document2/m-p/5962053#M1337828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Rajesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Aug 2009 13:58:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-21T13:58:33Z</dc:date>
    <item>
      <title>Problem with BAPI_CREATE_DOCUMENT2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-create-document2/m-p/5962050#M1337825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to create a document info record with file attachment using BAPI_DOCUMENT_CREATE2 for quality management module. I am getting an error in return table  "Error uploading document /tmp/notification.pdf'. It doesn't specify what the actual error is. When i executed this function module with a file on local system(presentation server) its creating document info record and can see the attachment in actual transaction. but when i execute with a file in application server i have this error. i have all authorizations required to read the file from the application server. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our file is a PDF file and is in application server and here's my code. I created one RFC function module and called this BAPI inside this RFC function module. The file is in our SAP application server /tmp of directory DIR_TEMP in AL11 transaction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please suggest me some solution. Thanks in advance.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rajesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2009 05:49:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-create-document2/m-p/5962050#M1337825</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-21T05:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with BAPI_CREATE_DOCUMENT2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-create-document2/m-p/5962051#M1337826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;FUNCTION ZTEST_DMS.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     VALUE(I_QMNUM) LIKE  VIQMEL-QMNUM
*"----------------------------------------------------------------------
*structures and tables for BAPI
  DATA: LS_DOC LIKE BAPI_DOC_DRAW2.
  DATA: LT_FILES LIKE BAPI_DOC_FILES2 OCCURS 0 WITH HEADER LINE.
  DATA: LT_DRAD LIKE BAPI_DOC_DRAD OCCURS 0 WITH HEADER LINE.
  DATA: LS_RETURN LIKE BAPIRET2.
  DATA: FILE_TYPE(3) TYPE C.

*key fields of new document
  DATA: LF_DOCTYPE    LIKE BAPI_DOC_DRAW-DOCUMENTTYPE,
        LF_DOCNUMBER  LIKE BAPI_DOC_DRAW-DOCUMENTNUMBER,
        LF_DOCPART    LIKE BAPI_DOC_DRAW-DOCUMENTTYPE,
        LF_DOCVERSION LIKE BAPI_DOC_DRAW-DOCUMENTVERSION.

  DATA: W_HOSTNAME TYPE BAPI_DOC_AUX-HOSTNAME.
  DATA: BEGIN OF KERNEL_VERSION OCCURS 0,
                  KEY TYPE CHAR21,
                  DATA TYPE CHAR69,
             END OF KERNEL_VERSION.

    CALL 'SAPCORE' ID 'ID' FIELD 'VERSION'
    ID 'TABLE' FIELD KERNEL_VERSION-*SYS*.
    READ TABLE KERNEL_VERSION INDEX 11.
    W_HOSTNAME = KERNEL_VERSION-DATA.

 FILE_TYPE = 'PDF'.

** Allocate document data
  LS_DOC-DOCUMENTTYPE    = 'SQN'.
  LS_DOC-DOCUMENTVERSION = '000'.
  LS_DOC-DOCUMENTPART    = '00'.
  LS_DOC-WSAPPLICATION1 = 'PDF'.

 CONCATENATE FILE_TYPE '- SQN -' I_QMNUM INTO LS_DOC-DESCRIPTION SEPARATED BY SPACE.
 LS_DOC-STATUSEXTERN   = 'AA'.

 MOVE: LS_DOC-DOCUMENTTYPE    TO LT_FILES-DOCUMENTTYPE,
             LS_DOC-DOCUMENTPART    TO LT_FILES-DOCUMENTPART,
             LS_DOC-DOCUMENTVERSION TO LT_FILES-DOCUMENTVERSION,
             LS_DOC-DESCRIPTION     TO LT_FILES-DESCRIPTION,
             '1'                    TO LT_FILES-ORIGINALTYPE,
             'SAP-SYSTEM'           TO LT_FILES-STORAGECATEGORY,
             LS_DOC-WSAPPLICATION1   TO LT_FILES-WSAPPLICATION,
            '/tmp/notification.pdf'           TO LT_FILES1-DOCFILE.
   TRANSLATE LT_FILES1-WSAPPLICATION TO UPPER CASE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2009 05:51:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-create-document2/m-p/5962051#M1337826</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-21T05:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with BAPI_CREATE_DOCUMENT2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-create-document2/m-p/5962052#M1337827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
        EXPORTING
          DOCUMENTDATA    = LS_DOC
          HOSTNAME        = W_HOSTNAME
          PF_HTTP_DEST    = 'SAPHTTPA'
          PF_FTP_DEST     = 'SAPFTPA'
        IMPORTING
          DOCUMENTTYPE    = LF_DOCTYPE
          DOCUMENTNUMBER  = LF_DOCNUMBER
          DOCUMENTPART    = LF_DOCPART
          DOCUMENTVERSION = LF_DOCVERSION
          RETURN          = LS_RETURN
        TABLES
          OBJECTLINKS     = LT_DRAD
          DOCUMENTFILES   = LT_FILES.
      IF LS_RETURN-TYPE CA 'EA'.
        ROLLBACK WORK.
        MESSAGE ID '26' TYPE 'I' NUMBER '000'
                WITH LS_RETURN-MESSAGE.
      ELSE.
        COMMIT WORK.
        MESSAGE ID '26' TYPE 'I' NUMBER '000'
                WITH 'Attachement added'.
      ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2009 05:51:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-create-document2/m-p/5962052#M1337827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-21T05:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with BAPI_CREATE_DOCUMENT2</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-create-document2/m-p/5962053#M1337828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Rajesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Aug 2009 13:58:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-bapi-create-document2/m-p/5962053#M1337828</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-21T13:58:33Z</dc:date>
    </item>
  </channel>
</rss>

