Reg:Document Attachment

Hi Experts,
I need to take a document from sapia and attach it under a specified audit component in plmd_audit transaction.
I tried using this function module "BDS_BUSINESSDOCUMENT_CREATEF" ,but it gives "Transfer Error".
In the Files table under directory i passed the sapia path.
Please give some suggestions.
Thanks !
Keerthi vasan.M

uploading into BW Docs after reading the files from application server . Check it so as to get some idea.
REPORT ZMAST_BWDOC_IMPORT.
TEXT ELEMENTS
001 Error reading file/directory
002 Error uploading file
003 Successfully Loaded
DATA: l_s_chavl TYPE rsod_s_chanm_chavl.
DATA: l_t_chavl TYPE TABLE OF rsod_s_chanm_chavl.
DATA: l_s_excpt(5) TYPE c.
DATA: l_t_data_tab_asc TYPE sdokcntascs.
DATA: l_t_data_tab_bin TYPE sdokcntbins.
DATA: rc TYPE sy-subrc.
DATA: wa_dir(100). " like file_info.
DATA: day(2) TYPE c.
DATA: l_s_content_info TYPE rsod_s_content_info.
DATA: dir_tab TYPE STANDARD TABLE OF file_info.
DATA: dir_entry(100).
*DATA: p_path(40) type C .
DATA: l_s_peri LIKE t009b-poper.
DATA: l_s_per(2) TYPE c.
TYPES: BEGIN OF fileinfostruc,
zcustomer(18),
END OF fileinfostruc.
TYPES: date TYPE sy-datum.
DATA: l_s_year LIKE t009b-bdatj.
DATA: fileinfo TYPE fileinfostruc.
DATA: date TYPE date.
DATA: count TYPE i.
DATA: len TYPE i.
DATA: offset TYPE i.
DATA: id TYPE i.
DATA: filename TYPE string.
DATA: thema TYPE string.
DATA: pfad TYPE c.
DATA: dir TYPE string.
DATA: descr TYPE sdok_descr.
DATA: name TYPE skwf_urlp.
DATA: l_t_return TYPE bapiret2.
DATA: l_filelength TYPE i.
DATA: file_tab TYPE filetable,
single_file TYPE filetable.
DATA: file_line LIKE LINE OF file_tab.
DATA: ls_path TYPE string.
INTERFACE IF_RSOD_CONST LOAD.
PARAMETER p_path(40) OBLIGATORY DEFAULT 'C:\'.
Display file selection dialog
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
PERFORM get_files.
START-OF-SELECTION.
PERFORM section_main.
*& Form get_files
text
FORM get_files.
dir = p_path.
DATA: folder TYPE string.
CALL METHOD cl_gui_frontend_services=>directory_browse
EXPORTING
WINDOW_TITLE =
initial_folder = 'C:\'
CHANGING
selected_folder = folder.
EXCEPTION
CNTL_ERROR = 1
ERROR_NO_GUI = 2
NOT_SUPPORTED_BY_GUI = 3
others = 4
IF sy-subrc 0.
add your error message here
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
p_path = folder.
*fetch all files from directory, use *.doc as mask
CALL METHOD cl_gui_frontend_services=>directory_list_files
EXPORTING
directory = folder
filter = '*.doc'
files_only = 'X'
DIRECTORIES_ONLY =
CHANGING
file_table = dir_tab
count = count
EXCEPTIONS
cntl_error = 1
directory_list_files_failed = 2
wrong_parameter = 3
error_no_gui = 4
not_supported_by_gui = 5
OTHERS = 6.
ENDFORM. "get_files
*& Form section_main
text
FORM section_main.
LOOP AT dir_tab INTO dir_entry.
Build filename
TRANSLATE dir_entry TO UPPER CASE.
CLEAR: filename.
CONCATENATE p_path '\' dir_entry INTO filename.
call upload
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = filename
filetype = 'BIN'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
IMPORTING
filelength = l_filelength
TABLES
data_tab = l_t_data_tab_bin
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc 0.
WRITE: / text-002, sy-subrc, dir_entry. "Error in uploading File
EXIT.
ENDIF.
fill assignments for Customer
len = strlen( dir_entry ) - 4.
REFRESH l_t_chavl.
l_s_chavl-chanm = 'ZCUSTOMER'.
l_s_chavl-chavl = dir_entry+0(len).
APPEND l_s_chavl TO l_t_chavl.
set mime-type
l_s_content_info-mimetype = 'application/msword'.
l_s_content_info-file_name = dir_entry.
l_s_content_info-file_size = l_filelength.
set name and title
name = dir_entry.
CLEAR l_t_return.
upload document
CALL FUNCTION 'RSOD_DOC_MAST_CHANGE'
EXPORTING
i_chanm = l_s_chavl-chanm
i_chavl = l_s_chavl-chavl
I_DOC_TYPE =
i_description = descr
i_name = name
I_LANGU = SY-LANGU
i_overwrite_mode = if_rsod_const=>mode_replace_phio
i_with_content = 'X'
i_s_content_info = l_s_content_info
I_WITH_URL =
I_URL =
I_COPY_URL_CONTENT =
IMPORTING
E_NAME =
e_s_return = l_t_return
TABLES
i_t_file_content_ascii = l_t_data_tab_asc
i_t_file_content_binary = l_t_data_tab_bin.
IF l_t_return-type = 'E' OR
l_t_return-type = 'W' OR
l_t_return-type = 'A'.
error
WRITE: / dir_entry(25), text-004, l_t_return-type,
l_t_return-id, l_t_return-number.
ELSE.
successfuly loaded
WRITE: / dir_entry(25), text-003.
ENDIF.
ENDLOOP.
ENDFORM. "section_main
kindly reward if found helpful

Similar Messages

  • Reg Document download attached to a Formulation in EHS domain

    Hi All,
    I am working in Environment Health & Safety domain. In this domain, We generally create a Formulation (Like Sales Order Number in SD Domain).
    We can attach different type of documents to a Formulation. My requirement is to download all the Document attached with a Formulation.
    Can somebody kindly help me out regarding this? I mean how to download a document?
    Best Regards,

    Hi Sachin.
    Th key to the documents attached to the formulation exists in the table DRAW.
    You can use function CV120_DOC_CHECKOUT_VIEW to download the documents attached to a formulation.Try this out.
    In case of some more assistance, let me know, I can give u some code extracts.

  • I need to visualize a document attached on a pdf file on an iPad.  Is there any application  to do that ?

    I need to visualize a document attached on a pdf file on an iPad.  Is there any application  to do that ?

    Yes. Quite a few actually.
    Starting with Apple's own iBooks App, I also see many recomendations for Goodreader, and Adobe's own PDF Reader.  Just to name a few. Look for them in the App Store. iBooks and Adobe reade are free.  You can also search the App Store for other alternatives.
    Also for most PDF's the Mail App can open them directly.

  • Why can I not attach a document to an email? Every time I want to send an email with a document attached to it, an error notice pops out. It tell me that the file is being used even when  it is not. How can I fix this issue?

    Why can I not attach a document to an email? Every time I want to send an email with a document attached to it, an error notice pops out. It tells me that the file is being used even when  iall other programs are closed. How can I fix this issue?

    Thanks Jeff, I was not aware that a template could be multi-page.  (All the existing templates were 1 page)
    But it worked, saving me some steps.  When I was finished I renamed the document, and locked it.
    Then tried to save it but  could not because it was locked.  I closed it, went to my Spread Sheet Folder ,
    to find it, it was not there.  The Finder could not find it either.
    So I start over again.
    I opened up Numbers and it showed my personal Numbers template folder, it contained both my new 
    original 4 page template and the vanished saved document!
    I tried to delete the template containing these document data and could not - I had to go to the Library/Application Support/Numbers to physically remove it from this folder. Then I started over again.  I Finally found out how to make it work: I can now "save as", and then lock, and it will go to place where I want it to be saved and locked.
    The secret is: Click on the document title in the menu bar, and it opens up  "Save as...", which works the same as in OS 10.4.11, and you can pick the place you want for saving.  Once done that, you can then lock the document in the same pull down menu, and then close it.
    I also found later that I can delete a template from its folder, by letting Numbers open the templates,
    clicking on the one I want to remove, then go to the "Numbers Menu/File/Move to...", select "Desktop"
    and from there the selected template can then be thrown into the Trash from there.
    It appears now that the real fault of the Numbers software is that the "Save as" command is not available in the "Edit" or "File" pull-down menus, but hidden behind the title of the document.

  • Office 2007 Document Attaching in Solution Manager

    Dear Gurus,
    When document attaching in Solution Manager 7.01, the system does not support Microsoft Office 2007 formats. (docx, xlsx) Are there any customizing for this topic?
    Thank you,

    Hi,
    Thanks, in lieu with your detailed system message, please try with this
    The warning is because the file extension docx is not known for the
    system. All the known extension is defined in table SDOKMIME by standard
    . And customer can extend it in table SDOKMIME_C.
    Actually that is only a warning message, which will not block the
    following up processing. The docx file will be attached if you click on
    the green tick. And the file can be previewed and checked later on.
    If you would like to get rid of this warning anyway, you may extend the
    customer table using the following step:
    -spro->SAP Customizing Implementation Guide
    ->SAP NetWeaver->Knowledge Management
    ->Settings in the Knowledge Warehouse System
    ->Document Management Service
    ->Define MIME Type for File Name Extension
    -add an entry like
    File name extension = docx
    MIME type of a Web object = application/vnd.openxmlformats
    After everything has been done as above, please retry to attach, it should help.
    Cheers,
    sh

  • When I open a word document attachment in mail for IOS 7.1.1 the previous jpeg is showing on the first page. When I open the attachment from mail in mac OS X the jpeg does not appear. Can anyone help?

    When I open a word document attachment in mail for IOS 7.1.1 the previous jpeg is showing on the first page. When I open the attachment from mail in mac OS X the jpeg does not appear. Can anyone help?

    gonsa47 wrote:
    When I open it in pages or word the correct company logo appears.
    Does the mail app display whatever is in the document without the ability to differentiate between hidden or non hidden images?
    The mail app will not display fillable form fields in PDF files that can be seen in real PDF apps. I say real PDF apps because the form fields in PDF apps will not appear in the iBooks app either. IMO, iBooks is not a real PDF app.
    So, I would say that the mail app cannot differentiate between hidden and non hidden items

  • New DMS document attachment to order header - can it also be done to a task list?

    With business function LOG_EAM_CI_6, you can now attach DMS documents to the order header or operation level in the 'Additional Data' tab.
    Since a lot of clients use documents to list complex preventive maintenance instructions, is it also possible to attach a DMS document to a task list header (or operation) and have it show up in the new 'Additional Data' screen area of the resulting order (using a maintenance item/plan to generate the order)?  Or do we still have to use the task list operation PRT functionality and have it show up in the order's operation PRT?

    Hi Arthur,
    I have configured Task list as per the SAP note 1821916  & activated DOC_TL_GUI. This allowed me to attach documents to the Operation &/or Header of the Task Lists. The problem I am facing is when I assign the task list to the work order the documents are not transferred . You have stated that they have transferred to the work order so I am wondering if there is something I missed.
    Arthur Balajthy wrote:
    And I checked that by adding documents to a task list header or operation, the work order generated from a maintenance plan/item referencing that task list does have those documents attached also.
    I haven't tried from a Plan but will do that now.
    I assumed if they were attached to the Task List Operation they would transfer to the Work Order like everything else on the Task List
    Thanks in advance

  • Enable to save documents attachement on purchase order

    Hi Experts
    I attach a document to a purchase order, i save it.
    When i open my purchase order i dont find mu documents attached, but when i apply on modify the system give me all documents attached on the purchase order.
    How can i resolve this please?
    Thanks

    Hi,
    I am a little confused. You said when you 'apply on modify', you call see all the attachments again.
    Would you please tell me what you mean by 'apply on modify'?
    Meanwhile I suggest you deactivate save and change BADI for PO and retest the issue.
    Regards,
    Ivy

  • Mass download of documents attached to change documents

    Hi to all,
    we've been using ChaRM in Solution Manager for more than 6 months on my project and we've added a lot of documents (word and excel files) in change documents (SDMI, SDHF). I wonder if there is a way to download all files from the change documents programmatically or if a transaction codes exists for that.
    Best regards,
    Stéphane.

    Hi Roel,
    Thanks for your reply. I was afraid the answer is no...
    As far as I know, documents attached to change documents are not accessible through SI80 (I didn't managed to find them). So i'm trying to create my own report to download documents from chosen solman transaction. Since i'm not an abap expert and Solution manager code is a little bit complex for me that could take time... I will let you know when/if I succeed.
    If anyone else has an answer to that question...
    Best regards,
    Stéphane.

  • Content server for Document attachment through "services for object" Icon.

    Guys,
    I have typical problem in installation of Content server for storing external documents.
    We all know that we can attach the document in SAP using the icon “SERVICES FOR OBJECT”. By this we can attach the document to the specific object we want.
    -Since my client wants only document attachment method not to completely implement SAP DMS, I proposed this method of attaching documents through services for object method.
    -If documents are stored though services for object ,The attached document will directly get stored in sap database(correct me if I am wrong) while  in  DMS it ask you to select the storage location while u check in for any document
    -By storing the doc thru "services for object " For long run when we store the documents in sap database our system will drastically get slow down.
    -In this regard I have a plan to incorporate external storage server.
    -Now I should know that how I should customize content server configuration so that the attachment through services for object will store into this content server I need to know how to define Client, Content Category, Content Repository, Document Area, Physical Machine, IP Address, Port. (OACT & OAC0)
    I appreciate for immediate solution and <u><b>Points will be rewarded for sure.</b></u>
    Regards,
    Murali.S

    Hi Murali,
    Don't Worry, its possible,
    All attachments can be stored in SAP Content Server also, but through archiving process.
    Set up a database storage system.
    Preparation
    Make sure that the HTTP plugin is active.
    Transaction <b>SMICM,</b> "Display Services" function key (shift F1)). The list of services must contain a port other than 0 for HTTP.If not, you must adjust the relevant profile parameter.
    <u>Typical entry:</u>
    icm/server_port_0         PROT=HTTP, PORT=1080, TIMEOUT=900
    <b>Make sure that the /sap/bc/contentserver service is active.</b>
    If no user is defined, then use transaction SU01 to create a new user. Use the "System" user type.Assign
    the SAP_ALL and SAP_NEW profiles to the user. (Eg: HRUSER/PLMUSER/PPUSER etc)
    Transaction <b>SICF,</b> select: default_host - sap - bc -contentserver. Select the function to display/change the service. Make sure that a user is defined.
    Using the relevant data from the newly created user, maintain the anonymous logon data for the
    /default_host/sap/bc/ service and save & activate the changes in transaction <b>SICF</b>.  Double click on content server and give the user name which has been created (HRUSER/PLMUSER/PPUSER/MMUSER etc)
    Check the system PSE.
    Start transaction <b>STRUST</b>. Expand the system PSE. The system PSE must be "green" for each application
    server.
    Determine a suitable exchange directory.
    The exchange directory must be accessible from each application server. If all application servers are running on the same platform (for example, Windows), one network directory that is accessible on all application server (for example,
    server\share) is sufficient. You can generally use the global directory
    (profile parameter DIR_GLOBAL).You can use the RSPARAM report to determine the profile parameters.
    Setting up the storage
    Create a table for storing the data. Using transaction <b>SE11</b>, create a copy of the SDOKCONT1
    table. If you want to create the repository database, you can name the table ZCONT_DB, for example. Save the
    table as a local object. Activate the table.
    Create a repository.
    Use transaction <b>OAC0</b> to create a new repository.
    Use the following parameters:
    Repository Max. two characters, for example,” Z1”
    DocArea: ARCHLINK
    Storage type: R/3 database
    Storage subtype: normal
    Version no. : 0046 
    Contents table <table name> for example: ZCONT_DB
    Exchange directory <directory name> for example:
    server\share\
    Make sure that the exchange list ends with a \ (or /on Unix).If you are using a variety of platforms, you must use transaction FILE to define a suitable logical file name and use this name. Save the settings.
    1. Maintain view table <b>TOAAR_C</b>, via SM31
       Cross client table displayed as information, forget it
    2. In field 'StSytm' you must entered 'Z1' as your system need, or anything that you need but you must configure HR Archive link too.
    3. In field 'Arch.path' (direct above Spoolpath), entered path in your system, this real path in your operating system. May be you should confirm to your Basis consultant where exactly you could store picture files. So if you enter '/', your file exists at root directory at your UNIX system.
    4. Choose 'File store' radio button
    5. Save.
    First
    <b>1. You have to create a number range for SAP ArchiveLink.
        IMG: Basis Components-> Basis Services -> SAP ArchiveLink -> Basic Settings-> Maintain number ranges   
        (Trxn <b>OANR).</b> Create number range 01 from 0000000001 to 9999999999 without the external number flag. 
    2. Document type <b>HRICOLFOTO</b> must exist with document class JPG.
        IMG: Basis Components->Basis Services->SAP ArchiveLink->System Settings->Maintain document types
        (Table<b> TOAVE, Trxn OAC2).</b>
    3. Document type <b>HRICOLFOTO</b> must be linked to object type PREL and Infotype PA0002.
        IMG: Personnel Management->Personnel Administration->Tools->Optical archiving->Set up Optical Archiving
        in HR.  (View V_T585O, no Trxn). In the first two columns there are minuses, the third (Date) has
       a plus - don't put a flag in the check box.
    4. Check which content repository (Archive) is linked to document type HRICOLFOTO and object type  
        PREL. IMG: <b>Basis Components->Basis Services->SAP ArchiveLink->Basic Settings->Maintain Links (Table 
       TOAOM_C, Trxn).</b></b>
    Test
    • Test the repository.
    Use transaction SE38 to start the RSCMSTH0 report. Specify your repository (i.e. Z1) and start the test.
    The report must run without errors. If no problems occurred, you can use the new repository with Archive Link after you carry out the Archive Link Customizing. If problems do occur, check whether one of the related
    notes helps.
    For More Details :
    http://service.sap.com/archivelink.
    <u><b>
    NOTE:- Screen Shots are missing, i was not able to paste here, One more thing is we did this for uploading a PHOTOS into Content Server, Similarly you have to create a REPOSITORY and Z-TABLE to bring all the Attachments from all the selected Objects and then route them to the CONTENT REPOSITORY.</b></u>
    Your Senior ABAP guy would help you in this, if not i may try to help you more by monday.
    Regards
    Rehman
    <b>Reward Your Points if Satisfied.</b>

  • Print word document attached to an order

    my requirement is to print the sap script for the PM order and as well as word documents attached to the order.
    for an order, for an operations when PRT tools selected
    word documents attached to it.
    i need to print those word douments attached to PRT tools for an oparation.
    pgm used is RIPRJT00
    form PM_COMMON
    i am able to oepn the documents attached to the order in PRINT PREVIEW.
    when choosing print option it goes to update termination
    Ajay

    In order to save any type of document on your phone you need to have an app that supports that form of document.
    There are several word processing apps but I prefer Pages.  Buy this app. Once it is on your phone you can tap the Word document in your email to view it then tap the Share icon and Open in Pages.
    If you edit the document and email it you will have the choice to send it as a Pages document, a Word document or a PDF file.

  • Subject: Document attached to record (Automtically convert to PDF)

    Dear All,
    My requirement in record management is as follows:
    I have a document attached to a record. (Tcode: SCASE)
    The document needs to be converted into pdf and attached a different node in the record. All of this should be done by the system automatically (as a background step of the workflow). Do we have any configuration set in the record/document management to convert them?  Please suggest.
    Thanks,
    nsp.

    Hi,
    Class CL_CRM_DOCUMENTS has different methods that you can use:
    CREATE_WITH_FILE
    CREATE_WITH_URL
    CREATE_WITH_TABLE
    Depending on the source of the document you want to attach, you can call one of those methods to attach your document.
    Embed this in a FM that you trigger out of your action, and you should be good to go
    regards

  • Transport document attached to infoobject from development to qualification

    Hi Experts,
    I am facing issues with transporting document attached to one infoobject.
    I tried to transport this by going into RSA1-documents-attributes and taking the logical and physical ID's. But it did not work.
    I tried transnporting the table entries BDSCONT8 and BWCONTMAST, but of no use.
    Could you please let me know the procedure to transport the document attached to the infoobject.
    Could you please let me know how to check where these documents are stored. I have no Idea if these are stored in BDS.
    Regards,
    Purnima

    Use program RSOD_CTO.

  • Print Preview of 'Document' attached to a PR/PO, Sale Order line item

    Is there a BADI/BAPI involved in 'Print Preview of Document attached to a PR/PO, Sale Order line item'. When I select a line item in PO for which a DIR is attached, it doesn't display the files content in the Print Preview.
    Q:) Is the system supposed to display the 'Original file' content attached to a DIR in the Print Preview Or is this the standard behavior that system won't display attached DIR - file content.
    Please advise.
    -Thanks

    Hi,
    unfortunately I have to inform you that from DMS point of view such a 'file preview' function is not available in the standard of the R/3 system.
    If you want to raise a development request at SAP please see the SAP note 11 for further information.
    Best regards,
    Christoph

  • Document Attachement to PO

    Whenever  a PO output gets triggered the document attachement in the PO also should go along the PO to the vendor.
    Is this function possible with the standard SAP settings

    It is currently not possible to send attached documents in a purchase
    order for email or SAPmail. The technical reason is: During the output,
    the form (e.g. MEDRUCK) is already handelled as an attachment. Therfore,
    it is not possible to attach documents together with the form.
    You could send a purchase order (PO) document via email "external send"
    as body text or to convert this PO as PDF attachement. To add aditionnal
    attachements in the same mail is not supported from the application.
    Therefore, for manual use, you could send the external mail to your
    mailbox and add any attachements before sending the email.

Maybe you are looking for

  • IPhone 5s issues on Verizon network

    does anyone have the iPhone 5s on Verizon? I've had issues with voice echo back and calls breaking up and they can't seem to fix it.. it's been 4 mos now?

  • What video capture card are you using? Do you like it?

    Hi there. I'm going to purchase a video capture card so I can feed my camcorder, vcr etc. into my iBook. I want to know what people are using and how they like it. DO you use firewire or USB? etc.

  • Allowing page extraction with a change permissions password enforced

    How can I enforce a change permission password for my PDF and still allow for page extraction?  All settings I have tried result in page extraction being not allowed.  I've seen on another discussion site that enabling printing and selecting any opti

  • Harddrive backup or External casing

    My 5th generation iPod 30gb, appeas to be broken, it could be logic board, harddrive, battery or a combination, am attempting to back up the harddrive is there an easy way to do this or alternatively would it be possible to turn the harddrive into an

  • Upgrading leaves the old version installed. Why and can I get rid of it?

    I had SQL Server 2008 R2 installed on a Win7 box, and upgraded it to SQL Server 2014. All seems to have gone well, but in the programs menu I can see that SSMS 2008 R2 is still installed. For some reason, I seem to have SQL Server 2012 installed as w