How to consume a webservice from sap crm

Hi All,
How to consume and access an external webservice from sap crm?
Suggest me.
Regards,
Sanjani
Edited by: Sanjani on Dec 6, 2010 3:09 PM
Edited by: Sanjani on Dec 10, 2010 1:08 PM

Please check the wiki link mentioned below. It will help you to an extent.
http://wiki.sdn.sap.com/wiki/display/CRM/CreatingWebServiceinSAP+CRM
Rg,
Harshit

Similar Messages

  • How can we delete prospects from SAP CRM

    Hello All,
    How can we delete prospects from SAP CRM in back ground for a list of selected BP's.
    Thanks,
    Raj.

    Hi Raj,
    You can use tx BUPA_DEL to delete the BP's you don't need anymore.
    Cheers,
    Heber Olivar

  • WebDynpro Application issue consuming asynchronous webservice from SAP PI

    Hello experts i ask you for help thie following issue:
    i am developing a webdynpro application which is supposed to
    send some data from inputfields, and a file, in order to achieve it, that dynpro application is consuming an asyncrhronous webservice , this service is running in SAP Process integration .it uses only a component.
    Iam having serious problems at mapping the asynchronous PI web service model -->to -->controller >and then to->view
    since when i deploy the application into the  SAP portal´s application server, it runs , but  inputfields cannot be written.i dont mean unabled, what i mean, is. cannot write anything on them.ECXEPT the file upload UI element.
    I have reviewed sap help page, 3 sappress books, about dynpro, and the procedure i am performind is agree with them.
    endpoint test answers the folloiwng:
    Message Servlet is in Status OK
    Status information:
    Servlet com.sap.aii.af.mp.soap.web.MessageServlet (Version $Id: //tc/xi/NW04S_20_REL/src/_adapters/_soap/java/com/sap/aii/af/mp/soap/web/MessageServlet.java#1 $) bound to /MessageServlet
    Classname ModuleProcessor: null
    Lookupname for localModuleProcessorLookupName: localejbs/ModuleProcessorBean
    Lookupname for remoteModuleProcessorLookupName: null
    ModuleProcessorClass not instantiated
    ModuleProcessorLocal is Instance of com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0_0
    ModuleProcessorRemote not instantiated
    what i did is the same as before(in another projects weh i used to import rfc models):
    1.- import webservice model,and add it to component
    2.-map web service model to controller context
    3.-map controller´s context to view context
    4.-create actions and methods
    5.-binding context controller to ui elements
    Dear experts, my questions are:
    What am i doing wrong?
    should i permorm another steps because the web service is in another application server (SAP PI)?
    Should i create a stand alone proxy and then access it from webdynpro?
    when i call the web service model excution it seems does not run, neverthless the invocation does not have any syntax error , what coul it be?
    Thanx in advance!!

    just for the sake of other who may hit this thread , the solution is to add sap-client=<clientno> in the url for wsdl

  • Call to webservice External (non sap) system from SAP CRM

    Hi,
    I have to make a call to External system from SAP CRM 5.0 system. The external system will provide a sample webservice which SAP will try to initiate
    Can you please tell me:
    1. What settings/object needs to be maintained in SAP in order to make this call.
    2. how I can make a call to this Web-Service from a BADI and pass the values to web service and also capture the returning value.
    Please explain in detail
    Thanks,
    Mike

    Hi,
    Check this
    Calling web service from ABAP - version 4.6C

  • Call to Web Sevice in external system from SAP CRM

    Hi,
    I have to make a call to External system from SAP CRM 5.0 system. The external system will provide a sample webservice which SAP will try to initiate
    Can you please tell me:
    1. What settings/object needs to be maintained in SAP in order to make this call.
    2. how I can make a call to this Web-Service from a BADI and pass the values to web service and also capture the returning value.
    Please explain in detail
    Thanks,
    Mike

    Mike,
    You should honestly search the SDN site for consuming web services with ABAP.  There are some good examples.
    However the general procedure is easy:
    1.  Generate an ABAP proxy using the WSDL provided to you by the external program
    2.  Configure an HTTP destination for the server of the web services (needed for HTTPS calls)
    3.  Configure the logical port for the web service using lpconfig
    4.  Write the abap code to call the webservice via the proxy.  Works very similar to FM call in my opinion.
    To expose a webservice(bapi being called from outside) you need to do a little more work
    1.  Create a web services for the RFC enabled function module via SE80
    2.  Use wsadmin and wsconfig to make the service available
    3.  Publish the service out to the UDDI as needed.
    Once again this code is pretty well documented in the standard help and SDN.  Do a simple search on ABAP proxies and you will find what you need.
    Take care,
    Stephen

  • Problem while Consuming Java Webservice from WCF client

    Hi,
    I am trying to Consume Java Webservice from WCF client.The webservice main functionality is digital data management.The client can Query Digital data and upload digital data by calling webservice methods.Problem is when i am trying to call webmethod from WCF client its giving "Unrecognised message versions".I have no idea about how the message objects are processed at serverside.but at server side they have used JAXP for XML document parsing.
    The response content type is Multipart/related and applicatio/XOP+XML.
    Can u plz help me how to handle this situation.I have minimum knowledge in Java WS architecture.Basically i am .Net programmer.
    Can U please guide me in a proper way to resolve the problem.

    Hi Abinash,
    I have the same problem. Have you solve that problem?
    I am using a java program to call a webservice too. And I have generated the client proxy definition for Stand alone proxy using NWDS. When I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
    The java code to call the webservice is as follows.
    MIDadosPessoaisSyncService service = new MIDadosPessoaisSyncServiceImpl();
    MIDadosPessoaisSync port = service.getLogicalPort("MIDadosPessoaisSyncPort");
    port._setProperty("javax.xml.rpc.security.auth.username","xpto");
    port._setProperty("javax.xml.rpc.security.auth.password","xpto");
    String out = port.MIDadosPessoaisSync("xpto", "xpto");
    System.out.println(out);
    The result I am getting is :
    Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
    Error Message is :com/sap/guid/GUIDGeneratorFactory
    <b>The result of the WS is correct!!!</b>
    The Java project does not have any warning. But the stand alone proxy project has following warnings associated with it.
    This method has a constructor name     MIDadosPessoaisSync.java     
    The import javax.xml.rpc.holders is never used     MIDadosPessoaisSyncBindingStub.java     
    The import javax.xml.rpc.encoding is never used     MIDadosPessoaisSyncBindingStub.java     
    The constructor BaseRuntimeException(ResourceAccessor, String, Throwable) is deprecated     MIDadosPessoaisSyncBindingStub.java
    It is very similar with your problem, could you help me?
    Thanks
    Gustavo Freitas

  • New JAVA application with data from SAP CRM and R/3

    Hi All,
    We have a requirement to create a new application which will have CRM BP Master data and D&B Data from R/3 and based on authorization different roles be able to edit some of the fields and workflows to confirm the new data .Once users edit the fields in the application the new data will be replicated back into BP Master Data in CRM.
    In our company we are using CRM 7.0 and R/3 4.7 system if we decided to create the application using JAVA can you please let me know the architecture(servers etc) we might need because of the JAVA application.
    How to connect Java application to SAP CRM 7.0. Can you please guide me the data flow structure
    I am not sure if this is the right forum if not please suggest appropriate forum.
    Thanks a lot ,
    Kitcha.

    Hi,
    You can connect to SAP Systems by consuming the RFCs.
    you can use the JCO API to connect to R/3. the [documentation |http://help.sap.com/saphelp_nw04/helpdata/en/6f/1bd5c6a85b11d6b28500508b5d5211/content.htm]
    alternatively  you can use SAP Enterprise Connector to generate JCO Proxies : [The Documentation|http://help.sap.com/saphelp_nw04/helpdata/EN/ed/897483ea5011d6b2e800508b6b8a93/frameset.htm]
    and somr more helps:
    http://help.sap.com/saphelp_nw04/helpdata/en/89/8a185c148e4f6582560a8d809210b4/frameset.htm
    Regards,
    Naga

  • Call to Web Sevice in External (non SAP) system from SAP CRM

    Hi,
    I have to make a call to External system from SAP CRM 5.0 system. The external system will provide a sample webservice which SAP will try to initiate
    Can you please tell me:
    1. What settings/object needs to be maintained in SAP in order to make this call.
    2. how I can make a call to this Web-Service from a BADI and pass the values to web service and also capture the returning value.
    Please explain in detail
    Thanks,
    Mike

    Hi Oliver,
    I have gone through the documentation and had been able to create a proxy object, uploaded the WSDL file (from local directory) and created logical port,
    However, when testing the service, I didn't received a sucess message but
    <CX_AI_SYSTEM_FAULT>
      <CODECONTEXT>Local</CODECONTEXT>
      <CODE>ERROR_WEBSERVICE_RUNTIME_INIT</CODE>
      <ERRORTEXT>Error when instantiating the Web service runtime (Error when initializing SOAP client application: ' error_text' )</ERRORTEXT>
      <LANGUAGE />
      </CX_AI_SYSTEM_FAULT>
      </cls:CX_AI_SYSTEM_FAULT>
    What might be the Problem ?

  • Upload/Read Documents from SAP-CRM to/from SharePoint

    Hello ,
    We have a requirement to upload documents from SAP CRM to share point(select the document from the desktop and pass the data to sharepoint server) , the user should also be able to view the documents located in Sharepoint.
    There are web methods in SharePoint already developed which will allow the uploading of the documents and passing the location of the stored documents as URL back to CRM.
    Could any one please help me in the follwoing
    1. Configurations to do on SAP side for Calling the methods developed in Sharepoint.
    2. Configuration to pass the document from SAP CRM(Uploaded from desktop) to sharepoint.
    Thanks in advance

    Hi Ravi,
    We also have a similar requirement in which we need to read the document stored in an external server from SAP CRM. Can you please let me know know how you achieved this. I will know the exact path (URL) of the document. Using this is it possible to retrieve the content of the document.
    Regards,
    Sudha.

  • Getting error in consuming google webservices from JspDynPage

    Hi All,
    Getting following error while consuming google webservices from JspDynPage
    An exception occurred while processing a request for :
    iView : GoogleSer.google
    Component Name : GoogleSer.google
    Could not find portal application com.company.global.enterprise.portal.wsdl.webservices.service.
    Code :
    MyGoogle googleService =
    (MyGoogle) PortalRuntime.getRuntimeResources().getService("com.company.global.enterprise.portal.wsdl.webservices.service.MyGoogle");
    GoogleSearchResult result = googleService.doGoogleSearch("google", "SAP", 0, 10, false, "", false, "", "", "");
    ResultElement[] results = result.getResultElements();          
    if(results != null) {
    response.write("<br> Search Result Size " +results.length );
    for (int i = 0; i < results.length; i++) {
    response.write((i + 1) + ": " + results);
    Thanks
    Rudra

    Hi,
    I am still having the same problem, however the scenario in which I am getting varies.
    I am getting this exception:
    "com.sap.engine.services.webservices.jaxm.soap.accessor.NestedSOAPException: IOError while working with the message."
    Some users when trying to login into the portal are getting blank screen and for some the portal launcher page is loading fine and could go to the Home Page.
    When I view the logs I am seeing the Nested Soap Exception.
    Any Ideas??? Starting the J2EE engine also did'nt help.
    Thanks in advance.
    Madhavi

  • Steps to enhance a datasource from SAP CRM

    Dear Forum,
    Could you please provide me with some document to enhance a datasource from SAP CRM. Is it any different from enhancement of datasource from ECC datasources,
    Thanks and regards,

    Hi,
    please look this:
    Business Intelligence How-to Guides for SAP NetWeaver 2004 [original link is broken]
    or here: How-to Guides for SAP NetWeaver Business Warehouse  7.0 [original link is broken]
    Creating a datasource for generic extraction
    regards
    CSM Reddy

  • How to consume WEB SERVICES from ABAP ??

    Q: How to consume WEB SERVICES from ABAP program??
         the point here is i am using SAP release 620 and the creation of proxy is out of scenario
         and also no XI.    Its only through ABAP program i need to consume one web service (its a HTTPS one ),
        Using cl_http_client... i tried it but i am totally confused of whats happening ???
    Req some senior ppl advice on the same/approach.
    any hints will suffice my way of approach...!!!
    Please do put in your valuable advices..!!
    Thanks in advance..!!!!

    Hello Srinivas,
    Following is the code for calling web service:
    data: client type ref to if_http_client,
          host   type string value 'server url',
          service type string value '8080',
          path type string value '/sap/public/ping',
          errortext type string,
          proxy_service type string,
          scheme type i value 1.
    call method cl_http_client=>create
    exporting host  = host
            service  = service
         proxy_host  = host
       proxy_service = service
       scheme        = scheme
    importing client  = client
    exceptions
        argument_not_found = 1
        internal_error     = 2
        plugin_not_active  = 3
        others             = 4.
    case sy-subrc.
      when 0.
         write 'Server reached successfully'.
      when others.
         write: 'sy-subrc =', sy-subrc.
    endcase.
    Once you got the client object you can call following methods:
    "Set the requrie URL for the web service you want to call. This is not WSDL anyway!!
    cl_http_utility=>set_request_uri( request = client->request
    uri =' url 2 be called ').
    *Then you can call send method with proper inputs for sending request to WS
    CALL METHOD client->send
    Then you can use receive method for getting the response
    CALL METHOD client->receive
    *You can get last error in case of exceptions
    CALL METHOD cl_http_client=>get_last_error
    *Close the client object
    CALL METHOD client->close
    For more information on full code refer my link in previous replay.
    Thanks,
    Augustin.
    Edited by: Augustarian on Aug 18, 2009 1:49 PM

  • How to consume REST WebService using Axis2 in Adobe CQ5.5

    Hi All,
        How to consume REST WebService using Axis2 in Adobe CQ5.5 ?
    Please help me with this.Thanks very much for your help.
    Thanks & Regards,
    Kumar

    We had enough trouble getting the "osgi compliant" Axis2 library to run in OSGI without spooky failures that we ended up re-writing everything utilizng JAX-WS. JAX-WS is present in the underlying JDK, you just need to create an OSGI fragment bundle that exposes these classes from the JDK. So basically a bundle that just exports:
    com.sun.xml.ws,
                                    com.sun.xml.ws.addressing,
                                    com.sun.xml.ws.addressing.model,
                                    com.sun.xml.ws.addressing.v200408,
                                    com.sun.xml.ws.api,
                                    com.sun.xml.ws.api.addressing,
                                    com.sun.xml.ws.api.client,
                                    com.sun.xml.ws.api.fastinfoset,
                                    com.sun.xml.ws.api.handler,
                                    com.sun.xml.ws.api.message,
                                    com.sun.xml.ws.api.message.stream,
                                    com.sun.xml.ws.api.model,
                                    com.sun.xml.ws.api.model.soap,
                                    com.sun.xml.ws.api.model.wsdl,
                                    com.sun.xml.ws.api.pipe,
                                    com.sun.xml.ws.api.pipe.helper,
                                    com.sun.xml.ws.api.server,
                                    com.sun.xml.ws.api.streaming,
                                    com.sun.xml.ws.api.wsdl.parser,
                                    com.sun.xml.ws.api.wsdl.writer,
                                    com.sun.xml.ws.binding,
                                    com.sun.xml.ws.client,
                                    com.sun.xml.ws.client.dispatch,
                                    com.sun.xml.ws.client.sei,
                                    com.sun.xml.ws.developer,
                                    com.sun.xml.ws.developer.servlet,
                                    com.sun.xml.ws.encoding,
                                    com.sun.xml.ws.encoding.fastinfoset,
                                    com.sun.xml.ws.encoding.soap,
                                    com.sun.xml.ws.encoding.soap.streaming,
                                    com.sun.xml.ws.encoding.xml,
                                    com.sun.xml.ws.fault,
                                    com.sun.xml.ws.handler,
                                    com.sun.xml.ws.message,
                                    com.sun.xml.ws.message.jaxb,
                                    com.sun.xml.ws.message.saaj,
                                    com.sun.xml.ws.message.source,
                                    com.sun.xml.ws.message.stream,
                                    com.sun.xml.ws.model,
                                    com.sun.xml.ws.model.soap,
                                    com.sun.xml.ws.model.wsdl,
                                    com.sun.xml.ws.org.objectweb.asm,
                                    com.sun.xml.ws.protocol.soap,
                                    com.sun.xml.ws.protocol.xml,
                                    com.sun.xml.ws.resources,
                                    com.sun.xml.ws.server,
                                    com.sun.xml.ws.server.provider,
                                    com.sun.xml.ws.server.sei,
                                    com.sun.xml.ws.server.servlet,
                                    com.sun.xml.ws.spi,
                                    com.sun.xml.ws.streaming,
                                    com.sun.xml.ws.transport,
                                    com.sun.xml.ws.transport.http,
                                    com.sun.xml.ws.transport.http.client,
                                    com.sun.xml.ws.transport.http.server,
                                    com.sun.xml.ws.transport.http.servlet,
                                    com.sun.xml.ws.util,
                                    com.sun.xml.ws.util.exception,
                                    com.sun.xml.ws.util.localization,
                                    com.sun.xml.ws.util.pipe,
                                    com.sun.xml.ws.util.xml,
                                    com.sun.xml.ws.wsdl.parser,
                                    com.sun.xml.ws.wsdl.writer,
                                    com.sun.xml.ws.wsdl.writer.document,
                                    com.sun.xml.ws.wsdl.writer.document.http,
                                    com.sun.xml.ws.wsdl.writer.document.soap,
                                    com.sun.xml.ws.wsdl.writer.document.soap12,
                                    com.sun.xml.ws.wsdl.writer.document.xsd,
                                    com.sun.xml.internal.bind,
                                    com.sun.xml.internal.bind.v2,
                                    com.sun.xml.internal.ws,
                                    com.sun.xml.internal.ws.addressing,
                                    com.sun.xml.internal.ws.addressing.model,
                                    com.sun.xml.internal.ws.addressing.v200408,
                                    com.sun.xml.internal.ws.api,
                                    com.sun.xml.internal.ws.api.addressing,
                                    com.sun.xml.internal.ws.api.client,
                                    com.sun.xml.internal.ws.api.fastinfoset,
                                    com.sun.xml.internal.ws.api.handler,
                                    com.sun.xml.internal.ws.api.message,
                                    com.sun.xml.internal.ws.api.message.stream,
                                    com.sun.xml.internal.ws.api.model,
                                    com.sun.xml.internal.ws.api.model.soap,
                                    com.sun.xml.internal.ws.api.model.wsdl,
                                    com.sun.xml.internal.ws.api.pipe,
                                    com.sun.xml.internal.ws.api.pipe.helper,
                                    com.sun.xml.internal.ws.api.server,
                                    com.sun.xml.internal.ws.api.streaming,
                                    com.sun.xml.internal.ws.api.wsdl.parser,
                                    com.sun.xml.internal.ws.api.wsdl.writer,
                                    com.sun.xml.internal.ws.binding,
                                    com.sun.xml.internal.ws.client,
                                    com.sun.xml.internal.ws.client.dispatch,
                                    com.sun.xml.internal.ws.client.sei,
                                    com.sun.xml.internal.ws.developer,
                                    com.sun.xml.internal.ws.encoding,
                                    com.sun.xml.internal.ws.encoding.fastinfoset,
                                    com.sun.xml.internal.ws.encoding.soap,
                                    com.sun.xml.internal.ws.encoding.soap.streaming,
                                    com.sun.xml.internal.ws.encoding.xml,
                                    com.sun.xml.internal.ws.fault,
                                    com.sun.xml.internal.ws.handler,
                                    com.sun.xml.internal.ws.message,
                                    com.sun.xml.internal.ws.message.jaxb,
                                    com.sun.xml.internal.ws.message.saaj,
                                    com.sun.xml.internal.ws.message.source,
                                    com.sun.xml.internal.ws.message.stream,
                                    com.sun.xml.internal.ws.model,
                                    com.sun.xml.internal.ws.model.soap,
                                    com.sun.xml.internal.ws.model.wsdl,
                                    com.sun.xml.internal.ws.org.objectweb.asm,
                                    com.sun.xml.internal.ws.protocol.soap,
                                    com.sun.xml.internal.ws.protocol.xml,
                                    com.sun.xml.internal.ws.resources,
                                    com.sun.xml.internal.ws.server,
                                    com.sun.xml.internal.ws.server.provider,
                                    com.sun.xml.internal.ws.server.sei,
                                    com.sun.xml.internal.ws.spi,
                                    com.sun.xml.internal.ws.streaming,
                                    com.sun.xml.internal.ws.transport,
                                    com.sun.xml.internal.ws.transport.http,
                                    com.sun.xml.internal.ws.transport.http.client,
                                    com.sun.xml.internal.ws.transport.http.server,
                                    com.sun.xml.internal.ws.util,
                                    com.sun.xml.internal.ws.util.exception,
                                    com.sun.xml.internal.ws.util.localization,
                                    com.sun.xml.internal.ws.util.pipe,
                                    com.sun.xml.internal.ws.util.xml,
                                    com.sun.xml.internal.ws.wsdl.parser,
                                    com.sun.xml.internal.ws.wsdl.writer,
                                    com.sun.xml.internal.ws.wsdl.writer.document,
                                    com.sun.xml.internal.ws.wsdl.writer.document.http,
                                    com.sun.xml.internal.ws.wsdl.writer.document,
                                    com.sun.xml.internal.ws.wsdl.writer.document.soap,
                                    com.sun.xml.internal.ws.wsdl.writer.document.soap12,
                                    com.sun.xml.internal.ws.wsdl.writer.document.xsd,
                                    com.sun.xml.internal.messaging.saaj.soap

  • How to store multiple files from SAp in to Application server?

    Hi Guys,
                 Can anybody tell me how to store multiple files from SAP into Application server.in my application i have to get the data from SAP tables BSEG , BKPF , BSAK and BSIK that to daily i have to do.
                Any Logic  or Code for how to do is welcomed.
                        plz help me urgently.
    Thanks,
    Gopi

    Hi,
      directories creates basis. If you have task to store data in application server you already should have information into which folder you have to do it. If you don't have this information because it is just for example training for next task then you can use your personal folder into which you have access. To get list of all available folders please look at attached code and form get_directories (you get the list of folders you see in transaction AL11). But don't forget: If you are using open dataset you have to have rights to access application folder!
    Here you are code which I use to upload text files from local disc into application folder
    Regards,
      Karol
    *& Report  FILE_PC_TO_SAP
    REPORT  FILE_PC_TO_SAP.
    DATA: BEGIN OF searchpoints OCCURS 100,
            DIRNAME(200)     TYPE c, " name of directory.
            sp_name(100)     TYPE c," name of entry. (may end with *)
          END OF searchpoints.
    DATA: BEGIN OF isearchpoints OCCURS 10,
            dirname(75) TYPE c,            " name of directory.
            aliass(75)  TYPE c,            " alias for directory.
            svrname(75) TYPE c,            " svr where directory is availabl
            sp_name(75) TYPE c,            " name of entry. (may end with *)
            sp_cs(10)   TYPE c,            " ContainsString pattern for name
          END OF isearchpoints.
    data: l_file type filetable.
    data: l_rc   type i.
    data: itab   type TABLE OF string.
    data: g_tmp_file_path type rlgrap-filename.
    data: wa_itab type string.
    data: h_destin(100) type c.
    data: dat      type string.
    INITIALIZATION.
    perform get_directories.
    START-OF-SELECTION.
    parameters: in_file type string OBLIGATORY LOWER CASE.
    parameters: destin(100) type c OBLIGATORY LOWER CASE.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
       FILENAME                      = in_file
       "FILETYPE                      = 'BIN'
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = ' '
       HEADER_LENGTH                 = 0
       READ_BY_LINE                  = 'X'
       DAT_MODE                      = ' '
      TABLES
        DATA_TAB                     = itab
    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: / 'Error during loading input file!'.
    ENDIF.
    if h_destin is INITIAL.
      h_destin = in_file.
    endif.
    CONCATENATE destin h_destin into dat SEPARATED BY '/'.
    *TRANSLATE dat TO UPPER CASE.
    OPEN DATASET dat FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-SUBRC = 0.
      loop at itab into wa_itab.
         TRANSFER: wa_itab TO dat.
      endloop.
      CLOSE DATASET dat.
      write: / 'File uploaded!'.
    ELSE.
      write: / 'Not possible to open dataset'.
    ENDIF.
    at selection-screen on value-request for in_file.
      perform select_input_file_name.
      loop at l_file into g_tmp_file_path.
        move g_tmp_file_path to in_file.
        h_destin = ''.
        SPLIT g_tmp_file_path at '\' into table itab.
        loop at itab into g_tmp_file_path.
          h_destin = g_tmp_file_path.
        endloop.
      endloop.
    at selection-screen on value-request for destin.
      DATA: lt_dfies    TYPE TABLE OF dfies.
      DATA: lwa_dfies   TYPE dfies.
      CALL FUNCTION 'DDIF_FIELDINFO_GET'
        EXPORTING
          tabname    = '/BI0/PCO_AREA'
          lfieldname = 'CO_AREA'
        IMPORTING
          dfies_wa   = lwa_dfies.
      lwa_dfies-tabname = 'searchpoints'.
      lwa_dfies-REPTEXT   = 'Destination directory'.
      lwa_dfies-LENG      = 100.
      lwa_dfies-INTLEN    = 100.
      lwa_dfies-OUTPUTLEN = 100.
      lwa_dfies-fieldname = 'SP_NAME'.
      APPEND lwa_dfies TO lt_dfies.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          RETFIELD = 'SP_NAME'
          DYNPPROG = SY-REPID
          DYNPNR = SY-DYNNR
          DYNPROFIELD = 'destin'
          VALUE_ORG = 'S'
        TABLES
          VALUE_TAB = searchpoints
          FIELD_TAB = lt_dfies
        EXCEPTIONS
          PARAMETER_ERROR = 1
          NO_VALUES_FOUND = 2
          OTHERS = 3.
    *&      Form  select_input_file_name
    *       text
    form select_input_file_name.
    *  call function 'F4_FILENAME'
    *       exporting
    *            program_name  = sy-repid
    *            dynpro_number = sy-dynnr
    *            field_name    = 'PATH'
    *       importing
    *            file_name     = g_tmp_file_path.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
      EXPORTING
      WINDOW_TITLE = 'Please choose a file'
      "default_extension = '*.TXT'
      "default_filename = 'C:\*.txt'
      initial_directory = 'C:\'
      file_filter = '*.*'
      CHANGING
      FILE_TABLE = l_file
      RC = l_RC
      EXCEPTIONS
      FILE_OPEN_DIALOG_FAILED = 1
      CNTL_ERROR = 2
      ERROR_NO_GUI = 3
      NOT_SUPPORTED_BY_GUI = 4
      OTHERS = 5.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    endform.                    "select_input_file_name
    *&      Form  WRITE_DB_HOME
    *       Write DB home directory
    *       no parameters
    FORM write_db_home.
      CASE sy-dbsys(3).
        WHEN 'ORA'.
          CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_ORAHOME'
                             ID 'VALUE' FIELD searchpoints-dirname.
    *--- C5056155 Start of ALV -------------------------------*
    *      PERFORM flip_flop(rsora000) USING cflag.
    *      WRITE: / 'DIR_ORAHOME',       30 searchpoints-dirname.
          MOVE: 'DIR_ORAHOME'        TO searchpoints-sp_name.
          APPEND searchpoints.
    *--- C5056155 End   of ALV -------------------------------*
        WHEN 'ADA'.
          CALL 'C_GETENV' ID 'NAME'  FIELD 'DBROOT'
                          ID 'VALUE' FIELD searchpoints-dirname.
    *--- C5056155 Start of ALV -------------------------------*
    *      PERFORM flip_flop(rsora000) USING cflag.
    *      WRITE: / 'DIR_ADA_DBROOT',    30 searchpoints-dirname.
          MOVE: 'DIR_ADA_DBROOT'     TO searchpoints-sp_name.
          APPEND searchpoints.
    *--- C5056155 End   of ALV -------------------------------*
        WHEN 'INF'.
          CALL 'C_GETENV' ID 'NAME'  FIELD 'INFORMIXDIR'
                          ID 'VALUE' FIELD searchpoints-dirname.
    *--- C5056155 Start of ALV -------------------------------*
    *      PERFORM flip_flop(rsora000) USING cflag.
    *      WRITE: / 'DIR_INF_INFORMIXDIR', 30 searchpoints-dirname.
          MOVE: 'DIR_INF_INFORMIXDIR' TO searchpoints-sp_name.
          APPEND searchpoints..
    *--- C5056155 End   of ALV -------------------------------*
        WHEN 'DB6'.
          CALL 'C_GETENV' ID 'NAME'  FIELD 'INSTHOME'
                          ID 'VALUE' FIELD searchpoints-dirname.
          IF sy-subrc = 0.
    *--- C5056155 Start of ALV -------------------------------*
    *        PERFORM flip_flop(rsora000) USING cflag.
    *        WRITE: / 'DIR_DB2_HOME',    30 searchpoints-dirname.
            MOVE: 'DIR_DB2_HOME'       TO searchpoints-sp_name.
            APPEND searchpoints.
    *--- C5056155 End   of ALV -------------------------------*
          ELSE.
            EXIT.
          ENDIF.
        WHEN OTHERS.
          EXIT.
      ENDCASE.
    ENDFORM.                    " WRITE_DB_HOME
    FORM get_directories.
    * get the name and aliases of ALL userdefined directories
      SELECT * FROM user_dir INTO isearchpoints
        WHERE svrname = sy-uname.
        MOVE isearchpoints-dirname to searchpoints-dirname.
        MOVE isearchpoints-aliass  to searchpoints-sp_name.
        APPEND searchpoints.
      ENDSELECT.
      SELECT * FROM user_dir INTO isearchpoints
        WHERE svrname = 'all'.
        MOVE isearchpoints-dirname to searchpoints-dirname.
        MOVE isearchpoints-aliass  to searchpoints-sp_name.
        APPEND searchpoints.
      ENDSELECT.
    * Get DB home
      IF sy-dbsys(3) = 'ADA'.
        PERFORM write_db_home.
      ENDIF.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_ATRA'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_ATRA'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_BINARY'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_BINARY'         TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory $DIR_CCMS
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_CCMS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_CCMS'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_CT_LOGGING'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_CT_LOGGING'     TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_CT_RUN'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_CT_RUN'         TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_DATA'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_DATA'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * Get DB home
      IF sy-dbsys(3) = 'DB6'.
        PERFORM write_db_home.
      ENDIF.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_DBMS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_DBMS'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_EXECUTABLE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_EXECUTABLE'     TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_EXE_ROOT'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_EXE_ROOT'       TO searchpoints-sp_name.
      APPEND searchpoints.
    *get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GEN'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GEN'            TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GEN_ROOT'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GEN_ROOT'       TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GLOBAL'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GLOBAL'         TO searchpoints-sp_name.
      APPEND searchpoints.
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GRAPH_EXE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GRAPH_EXE'      TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_GRAPH_LIB'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_GRAPH_LIB'      TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_HOME'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_HOME'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * Get DB home
      IF sy-dbsys(3) = 'INF'.
        PERFORM write_db_home.
      ENDIF.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_INSTALL'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_INSTALL'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_INSTANCE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_INSTANCE'       TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_LIBRARY'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_LIBRARY'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_LOGGING'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_LOGGING'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the files written by the memory inspector
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_MEMORY_INSPECTOR'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_MEMORY_INSPECTOR' TO searchpoints-sp_name.
      APPEND searchpoints.
    * Get DB home
      IF sy-dbsys(3) = 'ORA'.
        PERFORM write_db_home.
      ENDIF.
    *get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PAGING'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PAGING'         TO searchpoints-sp_name.
      APPEND searchpoints.
    *get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PUT'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PUT'            TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PERF'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PERF'           TO searchpoints-sp_name.
      APPEND searchpoints.
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PROFILE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PROFILE'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_PROTOKOLLS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_PROTOKOLLS'     TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_REORG'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_REORG'          TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_ROLL'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_ROLL'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_RSYN'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_RSYN'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * calculate directory for saphostagent (no sapparam available...)
      IF ( sy-opsys(3) = 'WIN' ) OR ( sy-opsys(3) = 'Win' ).
        DATA: windir_path(64),  programfiles_path(64).
    *   hoping that ProgramFiles is set in service user environment
        CALL 'C_GETENV' ID 'NAME'  FIELD 'ProgramFiles'
                        ID 'VALUE' FIELD programfiles_path.
        IF programfiles_path IS INITIAL.
    *     %ProgramFiles% not available. guess from windir
          CALL 'C_GETENV' ID 'NAME'  FIELD 'windir'
                          ID 'VALUE' FIELD windir_path.
    *     e.g. S:\WINDOWS ==> S:\Program Files
          CONCATENATE windir_path(3) 'Program Files' INTO programfiles_path.
        ENDIF.
        CONCATENATE programfiles_path '\SAP\hostctrl'
                                                 INTO searchpoints-dirname.
      ELSE.
    *   on UNIX, the path is hard coded
        searchpoints-dirname = '/usr/sap/hostctrl'.
      ENDIF.
      MOVE: 'DIR_SAPHOSTAGENT' TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SAPUSERS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      IF searchpoints-dirname = '.'.
        IF sy-opsys = 'Windows NT'.
          searchpoints-dirname = '.\'.
        ELSE.
          searchpoints-dirname = './'.
        ENDIF.
      ENDIF.
      MOVE: 'DIR_SAPUSERS'       TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SETUPS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_SETUPS'         TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SORTTMP'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_SORTTMP'        TO searchpoints-sp_name.
      APPEND searchpoints.
    *get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_SOURCE'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_SOURCE'         TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TEMP'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_TEMP'           TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TRANS'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_TRANS'          TO searchpoints-sp_name.
      APPEND searchpoints.
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TRFILES'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_TRFILES'        TO searchpoints-sp_name.
      APPEND searchpoints.
    * get name of directory with the error files
      CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'DIR_TRSUB'
                         ID 'VALUE' FIELD searchpoints-dirname.
      MOVE: 'DIR_TRSUB'          TO searchpoints-sp_name.
      APPEND searchpoints.
    *  get the name of the current server.
      CALL 'C_SAPGPARAM' ID 'NAME' FIELD 'rdisp/myname'
                         ID 'VALUE' FIELD searchpoints-dirname.
      data: h_ind type i.
      LOOP AT searchpoints.
        h_ind = sy-tabix.
        IF searchpoints-sp_name IS INITIAL.
          DELETE searchpoints INDEX h_ind.
        ENDIF.
      ENDLOOP.
    ENDFORM.

  • How to get purchasing data from SAP R/3 to OWB (Oracle warehouse builder).

    Hi,
    My name is Pavan Tata. I work as a SAP BW developer. Here is the situation at my client place. Client decided to retire BW system and wants to replace with OWB(Oracle warehouse). In all this currently we have purhchasing application in BW production system and wants to move this application to OWB for the same type of reporting what they are getting currently.
    Here is my question:
    How to get purchasing data from SAP R/3 to OWB(Warehouse) with initial full loads and deltas mechanism in the same way as we do in BW.
    Please help on this, also send me any documentation about this if you have.
    Thanks,
    Pavan.

    Hello,
    here is a short report which converts S012 entries to strings with separator semicolon. Perhaps this will help you?
    Regards
    Walter Habich
    REPORT habitest2 LINE-SIZE 255.
    TYPES:
      strtab_t TYPE TABLE OF string.
    CONSTANTS:
      separator VALUE ';'.
    DATA:
      it_s012 LIKE s012 OCCURS 0,
      wa_s012 LIKE s012,
      strtab TYPE strtab_t,
      strele TYPE string.
    SELECT * FROM s012 INTO TABLE it_s012 UP TO 100 ROWS.
    PERFORM data_to_string
      TABLES
        strtab
      USING
        'S012'. "requires it_s012 and wa_s012
    LOOP AT strtab INTO strele.
      WRITE: / strele.
    ENDLOOP.
    *&      Form  data_to_string
    FORM data_to_string TABLES strtab TYPE strtab_t
                        USING  ittab TYPE any.
      DATA:
        h_zaehler TYPE i,
        line_str TYPE string,
        l_tabellenname(10) TYPE c,
        l_arbeitsbereichsname(10) TYPE c,
        h_string TYPE string,
        h_char(255) TYPE c.
      FIELD-SYMBOLS: <l_tabelle> TYPE ANY TABLE,
                     <l_arbeits> TYPE ANY,
                     <feldzeiger> TYPE ANY.
      CLEAR strtab.
      CONCATENATE 'IT_' ittab INTO l_tabellenname.
      ASSIGN (l_tabellenname) TO <l_tabelle>.
      CONCATENATE 'WA_' ittab INTO l_arbeitsbereichsname.
      ASSIGN (l_arbeitsbereichsname) TO <l_arbeits>.
      LOOP AT <l_tabelle> INTO <l_arbeits>.
        CLEAR: h_zaehler, line_str.
        line_str = ittab.
        DO.
          ADD 1 TO h_zaehler.
          ASSIGN COMPONENT h_zaehler OF
            STRUCTURE <l_arbeits> TO <feldzeiger>.
          IF sy-subrc <> 0. EXIT. ENDIF.
          WRITE <feldzeiger> TO h_char LEFT-JUSTIFIED.          "#EC *
          h_string = h_char.
          CONCATENATE line_str separator h_string INTO line_str.
        ENDDO.
        APPEND line_str TO strtab.
      ENDLOOP.
    ENDFORM.                    "data_to_string

Maybe you are looking for

  • Loading data one page at a time

    I have 200 records to load in a java server page. I felt loading all these records will affect performance. So I wanted to load 15 records on each pass. However, on the second pass I obtained a nullpointerException(ResultSet -JDBC). Any suggestion on

  • Extremely low message throughput with MQ 3.6

    We performed some load tests to determine maximum throughput of the Sun JMS framework when used in conditions similar to our application. The achieved throughput is extremely low: around 10 messages / second while we expected around 100. Could you pl

  • Audio output and left USB port is not working!

    Hi! I have MacBook Air 13" late 2010, Audio output and left USB port is not working! What happened? Part No.: Z0JH000TE RS

  • Why is my safari scrolling to the bottom

    My Mac book continues to scroll to the bottom of every list, page and search engine. I have tried quitting safari, restarting the laptop. Please help.

  • Backing Up Hyper-V Virtual Machines with dynamic vhdx disks attached

    Hi folks. Can i  make an online backup for a virtual machine that has a hard drive attached  dynamic vhdx running on windows server 2012 r2? Regards