Document created succsesfully  but attached file unable to open.

Dear Friends,
For testing i was writing a program which is reading data from a db table and i am attaching its  text file to newly created DMS. this below program created the DMS dcoument and shows the attachment but it is not opening it and giving message "File TEST.TXT could not be accessed"
REPORT  z_file2.
DATA: fname(40),
      w_line TYPE i VALUE 1.
DATA:
  BEGIN OF fs_flight,
    carrid   LIKE sflight-carrid,
    connid   LIKE sflight-connid,
    fldate   LIKE sflight-fldate,
  END OF fs_flight.
DATA:
  t_flight LIKE
     TABLE OF
           fs_flight.
SELECT-OPTIONS:
  s_carrid FOR fs_flight-carrid,
  s_connid FOR fs_flight-connid.
fname = 'TEST.TXT'.
SELECT * INTO CORRESPONDING FIELDS OF TABLE t_flight FROM sflight WHERE carrid IN s_carrid AND connid IN s_connid.
IF t_flight IS NOT INITIAL.
  OPEN DATASET fname FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
  LOOP AT t_flight INTO fs_flight.
    TRANSFER fs_flight TO fname.
  ENDLOOP.
  IF sy-subrc EQ 0.
    WRITE: 'File Opened On Apps Server'.
  ELSE.
    WRITE: 'File could not be opened'.
  ENDIF.
  CLOSE DATASET fname.
ENDIF.
DATA: documentdata            TYPE bapi_doc_draw2,
             documentdatax           TYPE bapi_doc_drawx2,
             characteristicvalues    TYPE bapi_characteristic_values,
             classallocations        TYPE bapi_class_allocation,
             bapiret2                TYPE bapiret2,
             ls_longtexts            TYPE bapi_doc_text,
             file_location           TYPE bapi_doc_files2,
             lit_file_location       TYPE TABLE OF bapi_doc_files2.
DATA: it_classallocations     TYPE TABLE OF bapi_class_allocation,
      it_characteristicvalues TYPE TABLE OF  bapi_characteristic_values,
      lit_longtexts           TYPE TABLE OF  bapi_doc_text,
      lv_docno  TYPE bapi_doc_aux-docnumber.
documentdata-documenttype         = 'ZTS'.
documentdatax-documenttype        = 'X'.
documentdata-description          = 'lv_name_org' .
documentdatax-description         = 'X'.
file_location-wsapplication   = 'TXT'.
file_location-docpath = ''.
file_location-docfile = 'TEST.TXT'.
APPEND file_location TO lit_file_location.
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
  EXPORTING
    documentdata               = documentdata
  HOSTNAME                   =
  DOCBOMCHANGENUMBER         =
  DOCBOMVALIDFROM            =
  DOCBOMREVISIONLEVEL        =
  CAD_MODE                   = ' '
  PF_FTP_DEST                = ' '
  PF_HTTP_DEST               = ' '
  IMPORTING
  DOCUMENTTYPE               =
   documentnumber             = lv_docno
  DOCUMENTPART               =
  DOCUMENTVERSION            =
    return                     = bapiret2
TABLES
  CHARACTERISTICVALUES       =
  CLASSALLOCATIONS           =
  DOCUMENTDESCRIPTIONS       =
  OBJECTLINKS                =
  DOCUMENTSTRUCTURE          =
   documentfiles              = lit_file_location
  LONGTEXTS                  =
  COMPONENTS                 =
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    wait = '1'.
regards,
Satyawan

Satyawan,
      I think the problem is that you are trying to create the file in the SAP app server and the SAP DMS storage doesn't upload file from the app server in the way you have programmed it.
I would go about it in the following way,
1. Download the contents as a text file using ws_download on to the local.
2. Build reference to this file location and upload using the BAPI FM.
The first part and the last part of your program is ok.
Try this and let me know the results,
Sojan

Similar Messages

  • RMS stopped. Users told "only documents created in a signed application can be opened in a signed application"

    Hi
    I hope you can help and that this is the right forum.
    We have a RMS 1.0 sp1 server which has stopped working.
    Users get "only documents  created in a signed application can be opened in a signed application" when trying to protect a document in word or Outlook, and are unable to open previously protected documents.
    C:\Users\username\Local Settings\Application Data\Microsoft\DRM - only has the one file in it which is DRM-Machine. the .eul .CLC and .Gic files are missing from this folder.
    The server running the rms has an event id 82. " the callers machine certificate has a certificate chain that is not valid"
    I ran an irmcheck on the local machine which showed " No user Certificate"
    I can connect to the rms server urls , both licensing and certificate with no errors and IE shows the zone to be local intranet.
    Can anyone see what my problem might be and suggest why the workstations are not getting their certs and allowed protection? What else should I be checking?
    Best Regards
    Steen

    Hi
    Here is the answer which resolved my situation, I hope it helps yours.
    Guybrush-Threepwood I've marked your post as helpful as we had installed SP2 but it was not installed correctly and installing correctly was part of the solution.
    PROBLEM:
    Client began seeing the error:
    “Only documents created in a signed application can be opened in a signed application”
    On the server we were getting events:
    “The callers machine certificate has a certificate chain that is not valid”
    CAUSE:  
    Servers running RMS before SP2 can no longer get a valid Server Licensor Certificate.
    RESOLUTION:
    1. Install RMS v1 SP2 from:
    http://www.microsoft.com/en-us/download/details.aspx?id=14329
    2. Locate and then click the following key in the registry.
    For the enrollment URL on x86 versions of Windows Server 2003:
    HKEY_LOCAL_MACHINE\Software\Microsoft\DRMS\1.0\
    For the enrollment URL on x64 versions of Windows Server 2003:
    HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\DRMS\1.0\
    3. On the Edit menu, point to New, and then click String value.
    4. Type EnrollmentURL, and then press Enter.
     5. On the Edit menu, click Modify.
     6. Type
    https://activation.drm.microsoft.com/enrollment/enrollservice.asmx, and then click OK.
     7. On the Edit menu, point to New, and then click String value.
    8. Type CloudGicURL, and then press Enter.
     9. On the Edit menu, click Modify.
     10. Type
    https://certification.drm.microsoft.com/certification/certification.asmx, and then click OK.
    11. Go into the RMS Web interface and renew the SLC
    HTH

  • Can`t open document on Illustrator but adobe reader and photoshop opens it, why?

    Can`t open document on Illustrator but adobe reader and photoshop opens it, it is a problem with the text font Futura T-Bold. How to open it on Illustrator?

    I downloaded the file, and:
    It is not a Photoshop PDF.
    I get the same result attempting to open in Illustrator; mangled font substitution. That's because I don't have one or more of the exact fonts used in the document installed on my computer, and I suspect the same is true of yours.
    The fact that it opens without issue in Reader and Photoshop is essentally meaningless, (or at least it's not an inidication that it also should open without issue in Illustrator, which is what your original post seems to imply). Reader displays the correct fonts because subsets of them are embedded in the PDF for use by Reader. Photohop just rasterises the whole page, so there is no font data needed.
    If you had the fonts, you wouldn't get the substitution in Illustrator. It works that way for any PDF.

  • I uploaded an rtf (word) document to icloud, but when I try to open in Pages, I get a message that it does not support rtf format. What is going on?

    I uploaded an rtf (word) document to icloud, but when I try to open in Pages, I get a message that it does not support rtf format. What is going on?

    Supported file formats for iOS Pages
    Import:
    Pages ’09 for Mac
    Microsoft Word - Office Open XML (.docx) and Office 97 or later (.doc)
    Plain Text files (.txt)
    Export:
    Pages ’09 for Mac
    Microsoft Word (.doc)
    PDF
    As you can see -  .rtf is not supported.

  • Itunes  11.4.0.18 crashing when clicking on app store  Itunes is getting crash when clicked on app store. I tried to get some information for this crash and got the above message in debugging mode. Please fix this if required but i am unable to open

    Itunes  11.4.0.18 crashing when clicking on app store
    Itunes is getting crash when clicked on app store. I tried to get some information for this crash and got the above message in debugging mode. Please fix this if required but i am unable to open app store.

    Click here and follow the instructions to change the iTunes Store country.
    (97125)

  • I had an app which disables an iPhone to connect to the internet via mobile network. In the meantime I have deleted that app but it still affects my phone. For example iPhone shows that 3G sign on the top (next to the time) but it is unable to open any we

    I had an app which disables an iPhone to connect to the internet via mobile network. In the meantime I have deleted that app but it still affects my phone. For example iPhone shows that 3G sign on the top (next to the time) but it is unable to open any website. Is there anything I can do about it?

    What was the app you are referring to? I'm not aware of anything on the app store that is designed to do that, unless you're talking about an app that was causing a problem...
    Was/is your phone jailbroken?

  • HT6154 I have an inportant app that stores all my passwords, etc... and it transfered to my new iphone 5 but I am unable to open it to view my stored information.

    I have an important app that stores critital information that was transfered to my new apple 5c but I am unable to open the app from my new phone
    I can still access it from both my old iphone and ipad but not the apple 5c

    Ask the app developer how to transfer your data.

  • HT201272 I preordered a book and when I started downloading the book it never finished.  It shows up on my bookshelf but I'm unable to open or delete the book

    I pre-ordered a book and when I started downloading the book it must have stopped in the middle of the download.  The book shows up on my bookshelf but I'm unable to open the book or delete the book

    Disregard this question, I just noticed that it wanted an Adobe password.

  • Attachment list - Unable to open document

    Hi all,
    I archive TIF image of Account Payable documents via the BAPI Archiv_Create_Synchron_Meta which create attachments to the SAP documents.
    When I go to the transaction code FB03, I open one of my documents and, in "Attachment list", I find my archive in the attachments.
    But, when I double-click on it, an error message appears and says: "UNABLE TO OPEN DOCUMENT".
    BUT I have also tried to attach DOC, XLS, PDF and I CAN open it easily!
    I have one entry for each doc type in transaction OAC0.
    What's the matter ?
    Thanks for your help.
    Yohan

    In firefox go to Tools>Options>Applications. Find Portable document format (PDF), click the drop-down next to it and choose "Use Adobe Reader.

  • Document created in Pages 06 will no longer open with it!

    I have a document created in Pages 06. I have the trial version of Pages 08, but it's run out of it's trial period. I just opened the document briefly to read it, and 08 opened it. I wanted to see it in 06, as I needed to change it and save it, but, once closed, if I try to open it with version 2, I get a message saying it needs a newer version to open it! Get Info makes it appear that I can open it with version 2 by selecting that, but in the end, I get the same error message. It's looking like I'm being forced into upgrading here! Any help? P.S. In Get Info window, I see that version 3 is marked "default." Perhaps if there were a way to change that, I'd be OK. But "changing all" in that same window does not fix the problem.

    It would appear that you saved that document at least once with Pages 3/'08. Unless you marked the box to save in iWork '06 format, it will save in the current version. Changing would require opening it in Pages 3 & saving as iWork '06.
    If it is only that one file, you can send it to me (zip/archive it first) & I will save it as Pages 2 & send it back. Click my name in blue next to this post. My public e-mail address is in the biography section. Just replace (AT) with @.

  • All my Numbers and Pages files unable to open on iPad and iCloud

    It looks like all of my Pages and Numbers files from my iPad have been lost by iCloud? I don't use these apps often, but now when I launch them, all of my files have an upwards arrow icon in the upper right corner. When I select any file, the arrow goes away in under a minute, but the file never opens. When I try to access the files from iCloud.com from my MacBook, it says "Spreadsheet can't be downloaded. Please try again." What happened to my files!!!! I can open the "Getting Started" help files in each app.
    My iPad is set up to backup Documents & Data to iCloud. The Storage & Backup options say I have 1.9 GB out of 5GB available. When I go into Manage Storage, it says I am using 5.1 MB for Numbers and 3.6 MB for Pages. When I drill down on each, it lists all of my files that won't open.
    I can open my Keynote files from iCloud and my iPad. These do not show the arrow on the files. Reading through help files, the arrow seems to indicate that the file needs to be uploaded to iCloud? Turning off wifi on the iPad does not affect how this works. Force closing the apps and rebooting have no effect.
    Any ideas? Is this an Apple bug or a confusing new feature of iCloud?

    well, did the test again.. created on the iPad : see screenshot and date. Don't see any document preview.
    Also opened all documents on iPad... same result.

  • Pages Documents created on iPad or iCloud will not open in iWork Pages on Macbook

    I recently purchased the iPad Air and installed the latest version of Pages on it to share and create documents in Pages over iCloud between my devices. Before, I never had any issue creating a Pages document, say on a Windows OS at work, and then opening it up on my Macbook Pro in the latest version of Pages (5.0). Now when I attempt to open a Pages document created or edited on my iPad or through a browser using iCloud, it will give this message on my Macbook:
    "You need a newer version of Pages to open this document. You can download the latest version of Pages from the Mac App Store."
    I have repeatedly checked and all software is up to date. I have also attempted turning iCloud off and on again on both devices. One of the biggest reasons I bought the iPad was to have my documents on the go, but if I can't edit them later on my laptop, what's the point? Any ideas?

    Jeff,
    In the few moments after answering your first reply, I double-checked the Mac App Store and it revealed an update for Pages 5.1 -- Issue Resolved! I guess it was just cranky software today. Thanks for your patience.
    Kimberly

  • Exchange Server 2010 Move mailbox to database but display MapiExceptionNoAccess: Unable to open message store. (hr=0x80070005, ec=-2147024891)

    I have 2 exchange server "A" and "B". Server "A" have "Test1" database and Server "B" have "Test2" database. I tried move some mailboxes from "Test1" to "Test2"
    but sometimes mailboxes cannot finished and display below error.  I used Domain administrator to move mailboxes and grant "Manage full access permission" to these mailboxes but still failed. Finally, I clear the failed move request
    and repeat the move mailboxes action several times.  Then, the move request completed without error. Have any suggestion? Please help. Thank you!
    Mailbox move for 'xxx.com/xxx/xxx/xxx - Users/xxx/Peter' (331d5b4e-0bd1-428a-ae28-d97581ae0d7f) has failed.
    Error code: -2147024891
    MapiExceptionNoAccess: Unable to open message store. (hr=0x80070005, ec=-2147024891)
    Diagnostic context:
        Lid: 18969   EcDoRpcExt2 called [length=132]
        Lid: 27161   EcDoRpcExt2 returned [ec=0x80070005][length=202][latency=0]
        Lid: 32881   StoreEc: 0x80070005
        Lid: 50035 
        Lid: 64625   StoreEc: 0x80070005
        Lid: 1494    ---- Remote Context Beg ----
        Lid: 26426   ROP: ropLogon [254]
        Lid: 56503 
        Lid: 12716   StoreEc: 0x80070005
        Lid: 20794 
        Lid: 28474   StoreEc: 0x80070005
        Lid: 22330   dwParam: 0x0        Msg: 14.03.0123.002:NHK-S08-MBD02
        Lid: 1750    ---- Remote Context End ----
        Lid: 23354   StoreEc: 0x80070005
        Lid: 25913 
        Lid: 21817   ROP Failure: 0x80070005
        Lid: 26297 
        Lid: 16585   StoreEc: 0x80070005
        Lid: 32441 
        Lid: 1706    StoreEc: 0x80070005
        Lid: 24761 
        Lid: 20665   StoreEc: 0x80070005
        Lid: 25785 
        Lid: 29881   StoreEc: 0x80070005
    Context:
    Mailbox: Primary (331d5b4e-0bd1-428a-ae28-d97581ae0d7f)

    Hi Gordon 
    This could happen if there is any mailbox which has occupied more space than its normal quota allocated.
    As suggested by geo try to clean all the DB's first 
    You can probably run Get-Mailboxdatabase | Clean-Mailboxdatabase which will clean all of your DB's wait for some time until it gets completed
    Also try running the command with the MRS server parameter switch and specify a CAS FQDN and see the results if it gets succeded
    Get-Mailbox -Database 'DBNAME'| New-MoveRequest -TargetDatabase DBNAME -BatchName "BATCHNAME" -BadItemLimit 100 -AcceptLargeDataLoss -MRSserver CAS server FQDN Good Luck !!Please mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you.
    Regards,
    Sathish

  • When I open a document from any of my files, it only opens in a small screen and I can't make the screen bigger.

    Hello!  I'm hoping someone can help me with a recent problem on my MacBook Pro.  When I try to open a document from one of my files, it only seems to open in a small screen and I can't seem to make that screen any bigger to work on it.  Has this happened to anyone else before?  Thank you for your answer in advance!

    Oh, I wanted to add that trying to drag the little diagonal lines to the right of the page doesn't seem to work.

  • Have macbook pro 10.6 -macosx snow leopard what ??  windows have if any have alot of .exe files unable to open

    i have a macbook pro 10.6 (2010) i think this is OSX with snow leopard, i am confused how do i figure this out iguess i dont have any windows? all of .exe files i cant open and some downloads say i am in DOS mode. Where do i start to know what i have and what i  need and what i am running on? new to this world. Thanks Do i do anything with the bootcamp app at this time?

    how do i check before downloading?
    By reading the system requirements prior to any downloading or installation.
    Rule of thumb: You should never let your hard drive get to where you have only 10-15% of space left.
    Slimming your hard drive

Maybe you are looking for

  • DVD conversion on Mac

    I use Handbrake to convert my DVDs for use on my iPod but it has a bug with certain audio tracks having anomalies. What other programs do people use? iBook G4; 1.2 GHz, 768 MB   Mac OS X (10.4.2)  

  • Browsing in Safari has gone slow, Chrome 5 is super fast, how do I fix it?

    Hi everyone, I've been experiencing slow browsing speeds in Safari for some time now, and I've always thought that it was my ISP. Eventually I got used to it and I stopped worrying about it. Today I downloaded Chrome 5 out of curiosity and I was blow

  • How to create screen variant in search criteria in POWL.

    Hi All, i have requirement to create screen data variant in POWL. am using standard POWL application and custom feeder class, in which i created my selection screen fields. User wants to save data entered in selection screen fields in the form of var

  • Does anyone know a source for a EOS D30 camera lithium battery cover CB2 0666-000

    I am wondering if anyone can help me. I have a Canon EOS D30 I inherited from my parents. They hardly used it, so I would like to sell it. However, the round black battery cover for the lithium battery on the bottom of the camera is missing. I though

  • Mobile site

    Hi, I've finished designing the layout for the desktop site, and everything seems to be working fine.  I'm having some issues with the mobile site...when I change the phone in preview mode, the sizing is working correctly.  As an example, when I sele