'BAPI_DOCUMENT_CREATE2': store attachment using 'SAP-SYSTEM'

while i am checkin a document (attachment) using storage category KPRO ,the document is getting stored but when i use SAP-SYSTEM the Document is not getting stored. How can I get it stored using 'SAP-SYSTEM'
Following is the code;
DATA:
lv_docnum TYPE bapi_doc_aux-docnumber,
lw_docdata TYPE bapi_doc_draw2,
lw_return TYPE bapiret2,
lw_dsp TYPE bapi_doc_drat,
lw_objlink TYPE bapi_doc_drad,
lw_docfile TYPE bapi_doc_files2,
lt_dsp TYPE STANDARD TABLE OF bapi_doc_drat,
lt_objlink TYPE STANDARD TABLE OF bapi_doc_drad,
lt_docfile TYPE STANDARD TABLE OF bapi_doc_files2.
START-OF-SELECTION.
*CALL 'SAPCORE' ID 'ID' FIELD 'VERSION'
ID 'TABLE' FIELD kernel_version-sys*.
*READ TABLE kernel_version INDEX 11.
*w_hostname = kernel_version-data.
  CLEAR lw_docdata.
  lw_docdata-documenttype = 'ZAP'.
  lw_docdata-documentversion = 'A0'.
  lw_docdata-documentpart = '000'.
  lw_docdata-laboratory = '001'.
  CLEAR lw_dsp.
  lw_dsp-description = 'Test created by xyz'.
  lw_dsp-language = 'E'.
  APPEND lw_dsp TO lt_dsp.
  lw_docfile-docfile = 'C:\test.pdf'.
   lw_docfile-docpath = 'C:\test.pdf'.
LW_DOCFILE-ORIGINALTYPE = '1'.
  lw_docfile-storagecategory = 'SAP-SYSTEM'.
lw_docfile-storagecategory = 'DMS_C1_ST'.
  lw_docfile-wsapplication = 'PDF'.
  lw_docfile-language = 'E'.
  lw_docfile-checkedin = ' '.
lw_docfile-checkedin = 'X'.
  lw_docfile-active_version = 'X'.
  APPEND lw_docfile TO lt_docfile.
  CLEAR lw_objlink.
  lw_objlink-objecttype = 'VBAP'.
  lw_objlink-objectkey = '0040011233000010'.
  lw_objlink-documentdirection = 'X'.
  APPEND lw_objlink TO lt_objlink.
  CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
    EXPORTING
      documentdata         = lw_docdata
pf_ftp_dest = 'SAPFTPA'
pf_http_dest = 'SAPHTTPA'
    IMPORTING
      documentnumber       = lv_docnum
      return               = lw_return
    TABLES
      documentdescriptions = lt_dsp
      objectlinks          = lt_objlink
      documentfiles        = lt_docfile.
  IF lw_return-type CA 'EA'.
    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
    MESSAGE ID lw_return-id
    TYPE lw_return-type
    NUMBER lw_return-number.
  ELSE.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
      EXPORTING
        wait = 'X'.
    CLEAR lw_return.
    CALL FUNCTION 'BAPI_DOCUMENT_CHECKIN2'
      EXPORTING
        documenttype    = 'ZAP'
        documentnumber  = lv_docnum
        documentpart    = '000'
        documentversion = 'A0'
      IMPORTING
        return          = lw_return
      TABLES
        documentfiles   = lt_docfile.
    IF lw_return-type CA 'EA'.
      CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      MESSAGE ID lw_return-id
      TYPE lw_return-type
      NUMBER lw_return-number.
    ELSE.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait = 'X'.
    WRITE: / 'document number = ', lv_docnum.
    ENDIF.
  ENDIF.

Hi,
based on the posted coding I think that the reason for this behavior is that the used document type has set the flag 'Use KPRO' in transaction DC10. Because the storage category 'SAP-SYSTEM' is not a KPRO storage category like DMS_C1_ST. So if this flag is set in the customer then only originals checked in to a KPRO storage category are displayed. Without this flag the originals in "older" storage categories are displayed (e.g. SAP-SYSTEM, archive,...).
Regarding the limitation of 2 originals per document info record, I can inform you that this is a standard restriction of you do not
check in your originals to a KPRO. With the KPRO storage there is no such limitation.
Generally I'm asking myself why you are using the BAPI_DOCUMENT_CREATE2 and then also the CHECKIN BAPI. Because you can enter the original data also at the CREATE2 BAPI. If you want to checkin files to the KPRO then the filedata has to be
handed over in table DOCUMENTFILES. If you want to check in originals to SAP-SYSTEM then the data has to be entered in table DOCUMENTDATA. For further information please see SAP note 766277 which has a complete BAPI documentation added in its attachment area.
Best regards,
Christoph

Similar Messages

  • Dms : Error using SAP-SYSTEM Storage Category

    hi guys ,
    i have  some issue related to  checkin document . 
    while  i am checkin a document using storage category KPRO ,the document is getting stored but when i use SAP-SYSTEM the Document is not getting stored
    I have used the BAPI CVAPI_DOC_CHECKIN
    CALL FUNCTION 'CVAPI_DOC_CHECKIN'
           EXPORTING
                pf_dokar           = lv_doc_type
                pf_doknr           = lv_doc_num
                pf_dokvr           = lv_doc_ver
                pf_doktl           = lv_doc_part
                pf_content_provide = 'TBL'
           IMPORTING
                psx_message        = ls_message
           TABLES
                pt_files_x         = lt_files
                pt_content         = lt_drao.
    for checkin the document
    Please let me know ASAP
    Regards
    Parin

    Dear Parin,
    based on your description I'm quite sure that in the customizing of your used document type (transaction DC10) the flag
    'Use KPRO' is set. If this flag is maintained then the originals could only be stored in the content server storage category which is not SAP-SYSTEM.
    SAP-SYSTEM is a non-KPRO storage alternative and I would recommend you to use the KPRO storage concept in DMS.
    Best regards,
    Christoph

  • Problem: Accessing BAPI using SAP System Connector and setting SELOPT_TAB

    Hi,
    I am trying to use the SAP System Connector (based on JCA) to connect to a BAPI and do a search for a customer with EP SP15. (Using BAPI_CUSTOMER_FIND).
    I established the connection and can set simple input parameters, however I didn't find a way for setting the SELOPT_TAB in the IInteraction instance.
    This is what the table should contain:
    Table SELOPT_TAB
    Field Content
    COMP_CODE SPACE
    TABNAME KNA1
    FIELDNAME NAME1
    FIELDVALUE Ma*
    Here the import parameter:
    IMPORT-Parameter
    MAX_CNT 100
    PL_HOLD X
    And here the code for the IInteraction without the SELOPT_TAB that I want to include.
    // Get the Interaction interface for executing the command
    IInteraction ix = connection.createInteractionEx();
    IInteractionSpec ixspec = ix.getInteractionSpec();
    String functionName = "BAPI_CUSTOMER_FIND";
    ixspec.setPropertyValue("Name", functionName);
    String function_out = "RESULT_TAB";
    RecordFactory rf = ix.getRecordFactory();
    MappedRecord input = rf.createMappedRecord("input");
    // put function input parameters
    input.put("MAX_CNT", "100");
    input.put("PL_HOLD", "X");
    MappedRecord output = (MappedRecord) ix.execute(ixspec, input);
    Does anybody know how to set the SELOPT_TABLE as input parameter?
    Any help would be appreciated.
    Regards, Andy

    Maybe your application isn´t run in x84
    #Go to properties of your project ->Build -> changed platform target of "Any CPU" to "x86"
    #Copy these libraries from our 32-bit environment :
    *SAP.Connector.dll
    *SAP.Conector.Rfc.dll
    *librfc32.dll
    *msvcp71.dll
    *msvcr71.dll
    In 64 bits environment:
    1. librfc32.dll to C:WINDOWSsystem
    2. msvcp71.dll to C:WINDOWSsystem32
    3. msvcp71.dll and  msvcr71.dll to C:WINDOWSSysWOW64
    4. SAP.Connector.dll and SAP.Conector.Rfc.dll to C:WINDOWSassembly (DRAG)

  • How to serach  text  via TREX  with cryptograph attachment in SAP system?

    Dear friend,
    In my customer site, all the office document cryptograph.
    If cryptograph program is not installed, file cannot be open.
    The customer need to search the text in the attached
    office file in CRM system through TREX.
    Currently, it is not possible cause it is cryptograph.
    So, we want to know where should we apply breaking cryptograph. Breaking cryptograph program can be provided by the customer.
    I guess it might be applied when compiling or to Trex.
    Do you have any case similar with this?
    Your recommendation would be appreciated.
    Message was edited by:
            Ji Eun Kang
    Message was edited by:
            Ji Eun Kang

    Hi
    I'd recommend you to use NetWeaver Enterprise Search instead of TREX.
    Best Regards,
    Luis

  • Extracting data from SAP system using Shared directory

    Hi,
    sapian.
           I need the detail steps about creation of data store for a sap system in BODS for extraction of data in Direct download method.Can any of you suggest me the steps about it. I need the details about Application server: Working directory:  credentials....
    Thanks in advance,
    Regards
    Kishor

    Check this -
    SAP Topics - Enterprise Information Management - SCN Wiki

  • SAP System DB usage for SAP E-recruitment.

    Hi experts,
    We are in the process of implementting SAP E-recruitmetn 600 in an integrated scenario with SAP Ecc6.0.
    We would like to know the consequences of using SAP system DataBase as storgare system for SAP E-REcruitment. If this is the case, all external and internal candidates CVs and otehr documents will store in SAP System DB.
    We would like to konw,
    1.) Will this collection of huge data ruins the preformance of SAP system?
    2.) How to proceed with backup for E-recruitment if DB is SAP DB
    3.) Work-around Document for the above process
    4.) What are the impacts
    5.) What are the possibilities to restore data from SAP DB to content server once Content server issue resolved?
    Thanks & Regards,
    Sudheer Kumar P.

    Hi Sudheer,
    Have you got answers to your questions?  I am also stuck with the same questions.  If you could help me with these I would be very thankful.
    My email is [email protected]
    Edited by: Manoj Chauhan on Jun 11, 2008 12:38 PM

  • Using SAP Content Server for SAP E-Recruitment

    Hi SAP Experts,
    We are presently implementing SAP E-Recruitment using BSP services, We are successfully runnig with Whole E-recruitng cycle when we use SAP system DB as storgae for External Candidtes' Documents.
    But, Our Client wants to have SAP Content Server to store all documents uploaded by External/Internal Candidates becuase client is worrying that if SAP system DB holds such huge data base of Resumes, it may slow down the performance of SAP System.
    So, We need inputs from you suggesting whether is it feasible to use SAP Content server for SAP E-Recruitment Implementation. SAP no where suggests to Content server. So, we are in deliema to go for content server or not. If it is feasible to use Content server, pls provide me proper links or documents for reference.
    Please give your valuable inputs,
    Thanks & Regards,
    Sudheer Kumar P

    Hi Sudheer,
    We are considering the same option.  We are concerned about performance after all these documents are uploaded too.  Did you install a content server?  How did it go and was it difficult to set up with e-rec?
    Thanks
    Shane

  • Using SAP ECC as a MDM Hub

    I would like to know the pros and cons of using SAP ECC as a MDM hub instead of using standard MDM tool like SAP MDM.  Many folks in my company thinks that it is  possible by adding some  governance functionality & quality tools to standard SAP ECC. 
        Please  let me know if this is a good idea , if not what are the reasons.
    Thanks

    Hi,
    To answer in general terms, It is like going to a physician for surgery instead of going to a surgeon.
    There is no restriction of exploring ECC for master data & governance. But SAP's EIM solution products like SAP NW MDM are result of growing market requirements for speciality tools. Read more about customer success stories of using SAP NW MDM solutions at - http://www.sap.com/platform/netweaver/components/mdm/index.epx
    Few highlights -
    SAP MDM is designed to be a central hub of master data. MDM will maintain global attributes that can be sent to different target systems including your ECC. Then each of your target systems can maintain their local attributes in additon to the global attributes sent by MDM. MDM will maintain the global unique ID's thus providing a single version of truth for your master data across the organization. SAP NW MDM can be integrated with SAP BOBJ DS and a continuous cleansing/validating/removing duplicates can be achieved. Master data Address cleansing/D&B enrichment can be achieved with real time services present in BOBJ DS & MDM. Enterprise Portal/BPM has standard MDM API's providing data governance capability at its best.
    SAP ECC on other hand is a transactional system/operational system. The load on ECC of maintaining global master data will unncessarily affect the performance. Maintaining master data, removing duplicates, running data vaidations/assignments for cleansing data, then adding central data maintenance with data governance is like adding load on your transactional system. The outmost priority of ECC system is its performance and availability.
    Similar SDN thread - MDM Vs ECC
    Thanks,
    Shambhu.

  • With Sap system  Release 7 .0 Level 15 test a service

    Hi,
    We are using Sap system  Release 7 .0 Level 15.
    I have created a web service from a function module and want to ask you what is
    the easiest shortest way to test this created webservice ?
    Regards
    ertas ilhan

    hi ilhan,
    u can test the web service from web service test environment,
    to do so u use transaction SOAMANAGER in th epage clikc business adminsitration then web service administration , search by service and giev the service name onc eu get the name of it select the service and click applly selection , under overview tab u have open webservice navigator for selected bindign link and u get the test enviornment on it u have test link click it and u get input paramters fill it and test
    hope it solves ur query

  • How to implement SSO to non-SAP systems using SAP logon ticket?

    Hello,
    We would like to implement Single Sign On between our SAP Netweaver system and a Siebel which is a non-SAP system using SAP logon tickets.
    Can anyone please give me some leads on this, in particular:
    1. Is there a JAVA API or an SAP plug-in that can be implemented on the Siebel machine to extract the SAP logon ticket?
    2. As the other machine might seat on a complete different domain, is it possible to implement SAP logon ticket without using cookies (perhaps through the HTTP header?
    3. In case you think using SAP logon tickets is not the best solution here I would be happy to hear any other suggestions you might have.
    Roy

    Hi,
    I'm currently using SAML as well. Unfortunately the SAP J2EE cannot work as authority (identity provider) but what you can do is using an open implementation of SAML such as opensso which is an open version of SUNs Java System access manager.
    There are a couple of other projects such as opensaml, apache's wss4j or shibboleth that might be interesting in this context.
    I just installed opensso and got it working with SAP J2EE 7.0 using SAPs JAAS SAMLLoginModule to authenticate users within SAP J2EE.
    In this scenario opensso serves as identity provider just as you need! There are a couple of Policy agents available on SUNs Download site you can use with Apache, Tomcat, JBOSS, WebSphere, Bea Web Logic etc. in order to authenticate! Otherwise you just directly authenticate against opensso. When installing opensso you can configure the type of user store you want  to use! By default it uses LDAP but you can also use different types of user store using JDBC or other mechanisms. Since you have a Directory Service you could easily connect it to your existing directory.
    There is also a way to map user ids directly in opensso by adding a uid mapping class. I created some documentation with lots of screenshots about using opensso with SAP J2EE. You can easily use opensso with any other system that supports SAML. In the case of SAP the usage is currently limited to SAML versions 1.0 and 1.1. Version 2.0 is not yet supported but should be in one of the following versions.
    Here are some links you might want to check:
    OpenSAML: https://spaces.internet2.edu/display/OpenSAML/Home
    wss4j: http://ws.apache.org/wss4j/
    shibboleth: http://shibboleth.internet2.edu/
    opensso: https://opensso.dev.java.net/
    On SDN you will find a documentation on how to connect SUN Java System Access Manager to SAP J2EE (see https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/906d9fc6-31b9-2910-1385-90edad7d7570). As I said opensso is based on the SUN Access Manager code and looks quite the same. So you can adapt this documentation in order to configure opensso or you can just ask me for the documentation.
    Hope this is helpful...
    Let me know if you need further assistance on this topic
    Cheers

  • Attachment list in ME23N using SAP Archive link not working

    Hello Everyone,
    We are using Documentum as our document management system and have linked it to SAP through Archive link to link scanned Invoices against purchase orders.
    After we run a query to link a PDF document to a purchase order in Documentum and then Login to ECC and tcode "ME23" and display the purchase order->Environment->Display Originals the document attached to the purchase order is getting displayed in Document viewer. But we want to display the document in "ME23N" and also against the Invoice document in "MIR4".
    Can anyone please help me in finding a way to display the document in ME23N. I would greatly appreciate your help.
    Regards,
    Gopal.

    Do a search. There are plenty of posts which cover the configuration of DMS and ArchiveLink as separate issues. Its not something you could add as a single post, its an entire module in itself.
    On the issue of versioning, some products do support versioning with ArchiveLink but TRIM is not one of them. To get versioning on TRIM, you would need to use SAP DMS using TRIM as a repository. Open Text supports ArchiveLink with versioning with a product called Extended ECM which is designed to give similar functionality to SAP DMS but driven from the Open Text product as opposed to the SAP DMS. I.e. you create documents and publish them to SAP rather than creating them in SAP and storing them in the 3rd party content server.
    Edited by: Athol Hill on Oct 6, 2010 9:45 AM

  • How to use SAP delivered extractors(BI Content) in bi system

    Hi all,
          I have tried to load he data from SAP system(components) using business content to SAP BW, after replicating the data source I have activated my data source in my bw source system.But I don't know what is procedure for next steps. Can anyone tell me the complete steps how to load data into my bw data target system.
         Find the attachment what I have done.
    Regards,
    Hityshi G.

    Hello,
    Steps t upload the delta records:
    ECC Side:
    T code- /LBWE: Select the data source and on right side there is an icon to select the delta mode...I mean
    direct delta, queued delta etc.
    Note: There are 4 delta update modes-direct, queued, serialised V3 update and unserialised.
    Once any record is changed , it comes to extraction queue automatically. Check the same(T code- /SMQ1).
    Schedule the V3 Job..once scheduled, records move to Delta queue (T code- /RSA7)
    BW Side:
    On the BW side, Create an infopackage and DTP (but in this case -Delta DTP) the way you loaded the Init request in the target.
    Hope this gives you a clear idea.
    Regards
    NS

  • Sending Attachment from SAP ECC to a Thirdy Party system

    All,
    Any inputs on how to send an attachment from SAP ECC to an external system(3rd party). I think this has something to do with creation of RFC destination of connection type "G". But then how can i use this RFC destination in a program?
    Correct Answers will be rewarded suitably.
    Thanks

    Hi Narasimha,
    We can do this with the help of PI. Please find the below link.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/404ee507-3fbc-2e10-00bc-be90ab28d036?QuickLink=index&overridelayout=true&52239687237174
    Its from SAP PI to any other system.
    Check this link too.. Proxy with Attachments.
    Regards,
    Siva

  • CE71SR5 install failure (Start SAP Secure Store in the File System)

    Hi!
        when i install CE71SR5 CompositionPlatform,met a question, below is the log information, waiting help,thanks.
    An error occurred while processing service SAP NetWeaver CE Developer Edition > SAP NetWeaver CE Development System( Last error reported by the step :Cannot create the secure store. SOLUTION: See output of log file SecureStoreCreate.log: INFO: Loading tool launcher... INFO: [OS: Windows XP] [VM vendor: SAP AG] [VM version: 5.1.021] [VM type: SAP Java Server VM] INFO: Main class to start: "com.sap.security.core.server.secstorefs.SecStoreFS" INFO: Loading 8 JAR files: [C:\usr\sap\CE1\SYS\global\security\lib\tools\iaik_jce.jar, C:\usr\sap\CE1\SYS\global\security\lib\tools\iaik_jsse.jar, C:\usr\sap\CE1\SYS\global\security\lib\tools\iaik_smime.jar, C:\usr\sap\CE1\SYS\global\security\lib\tools\iaik_ssl.jar, C:\usr\sap\CE1\SYS\global\security\lib\tools\w3c_http.jar, C:\Program Files\sapinst_instdir\CE71_DEV_ADA\INSTALL\install\lib\sap.comtcexceptionimpl.jar, C:\Program Files\sapinst_instdir\CE71_DEV_ADA\INSTALL\install\lib\sap.comtcloggingjavaimpl.jar, C:\Program Files\sapinst_instdir\CE71_DEV_ADA\INSTALL\install\lib\sap.comtcsecsecstorefsjavacore.jar] INFO: Start SAP Secure Store in the File System - Copyright (c) 2003 SAP AG FATAL: Main class "com.sap.security.core.server.secstorefs.SecStoreFS" cannot be started: java.lang.ExceptionInInitializerError at javax.crypto.Cipher.getInstance(DashoA12275) at javax.crypto.Cipher.getInstance(DashoA12275) at iaik.security.provider.IAIK.a(Unknown Source) at iaik.security.provider.IAIK.addAsJDK14Provider(Unknown Source) at iaik.security.provider.IAIK.addAsJDK14Provider(Unknown Source) at com.sap.security.core.server.secstorefs.Crypt. (Crypt.java:85) at com.sap.security.core.server.secstorefs.SecStoreFS.setSID(SecStoreFS.java:175) at com.sap.security.core.server.secstorefs.SecStoreFS.handleCreate(SecStoreFS.java:836) at com.sap.security.core.server.secstorefs.SecStoreFS.main(SecStoreFS.java:1306) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at com.sap.engine.offline.OfflineToolStart.main(OfflineToolStart.java:161) Caused by: java.lang.SecurityException: Cannot set up certs for trusted CAs at javax.crypto.SunJCE_b. (DashoA12275) ... 14 more Caused by: java.lang.SecurityException: Cannot locate policy or framework files! at javax.crypto.SunJCE_b.i(DashoA12275) at javax.crypto.SunJCE_b.g(DashoA12275) at javax.crypto.SunJCE_r.run(DashoA12275) at java.security.AccessController.doPrivileged(Native Method) ... 15 more FATAL: com.sap.engine.offline.OfflineToolStart will abort now with exitcode 2.). You may now
    choose Retry to repeat the current step.
    choose View Log to get more information about the error.
    stop the task and continue with it later.
    Log files are written to C:\Program Files/sapinst_instdir/CE71_DEV_ADA/INSTALL.

    I have the same problem.
    Although i try it use jdk1.5.0.16, the same err occured.
    Also i use the jce_policy-1_5_0.zip.
    I will appreciate your answer.
    I have resolved the problem by copy the
    local_policy.jar
    US_export_policy.jar
    to
    sapinst_instdir\CE71_DEV_ADA\INSTALL\sapjvm\sapjvm_5\jre\lib\security
    Edited by: wang zhen on Aug 28, 2008 11:08 AM
    Edited by: wang zhen on Aug 29, 2008 9:53 AM

  • Migrate all Open Sales Orders From Legacy System (SAP) To SAP System using

    Hi Experts,
                 I've to Migrate all Open Sales Orders From Legacy System (SAP) To SAP System using Business Objects with a new SALES ORDER DOCUMENT NUMBER referencing the older one.
               I'll get all the required data with field in an excel file.
                 Does any standard transaction exist for it ? Or how to go ahead with it ?
    Thanks and regards,
    Jyoti Shankar

    Hi
    If you are checking for CREATE option then Sales Doc Type
    For more Info goto SWO1 transaction -> BUS2032 --> DIsplay --> Execute --> There SELECT the method which you want to perform... There you can fine the MANDATORY parameters also....
    Or in DISPLAY mode PLACE Cursor on the Required Method and CLick the PARAMETERS button on toolbar...
    That will show the MANDATORY parameters...
    Reward if helpful....
    Message was edited by:
            Enter the Dragon

Maybe you are looking for