BAPI_CUSTOMER_FIND

Hi all!
When I execute that function, the values in SELOPT_TAB are added... I mean, if I indicate TELF - 93* and NAME1 - A, the function gives the sum of the two conditions. How can I do to exclude the results?? I mean, that only gives me that customers that have 93* AND A.
Thanks!
Miguel angel.

Hi,
Select ...
          from .....
          into .....
          where telfx in so_telfx
          and name1 in so_name1.
You could write a select statement on your own instead of using the BAPI.
Select adress number from KNA1.
Based on the address numbers select data from ADRC with the select options that you want to restrict.
Regards,
Srilatha.

Similar Messages

  • Error while calling "BAPI_CUSTOMER_FIND" in BPM

    Hi everyone,
    we have a problem while calling a BAPI "BAPI_CUSTOMER_FIND" on an ECC backend system from a BPM. This automatic activity works very well if we just search some customers, which really exist in the ECC system. If we search any customers, which don't exist, we get a runtime exception on the CE server. But what really wired is, we can call this BAPI in the WS Navi on the CE successfully with any input parameters. This BAPI gives back a result_tab in the response message. In the result_tab, we can find the TYPE field indicating whether any customers are found or not. Actually this BAPI will not generate any exceptions. In order to exclude mapping errors, we delete the output mapping for this step. Could anyone give us some help? Thanks a lot in advance.
    The error trace is following:
    An error occurred while executing transition AUTOMATED_ACTIVITY_Debitor_suchen
    com.sap.glx.adapter.BPMNAdapter:Token_0_ShowCase_Handwerkerparkausweis_0f40fca3e9c74b4385726b3cd6a3245d token,
    com.sap.glx.adapter.BPMNAdapter:Instance_0_ShowCase_Handwerkerparkausweis_0f40fca3e9c74b4385726b3cd6a3245d parent,
    com.sap.glx.adapter.internal.ContainerAdapter:Context_2_Antrag_Kontext_0f40fca3e9c74b4385726b3cd6a3245d context_3){
    exit=new com.sap.glx.adapter.BPMNAdapter:Exit();
    Caused by: com.sap.glx.adapter.api.AdapterException: RuntimeException occured with not AbapException
    at com.sap.glx.adapter.app.ucon.SCADASWrapperImpl.invoke(SCADASWrapperImpl.java:162)
    at com.sap.glx.adapter.app.ucon.UnifiedWebServiceCallObject.invokeWebServiceOperation(UnifiedWebServiceCallObject.java:100)
    at com.sap.glx.adapter.app.ucon.UnifiedWebServiceCallClass.invoke(UnifiedWebServiceCallClass.java:174)
    at com.sap.glx.core.dock.impl.DockObjectImpl.invokeMethod(DockObjectImpl.java:530)
    ... 14 more
    Caused by: java.lang.RuntimeException: Es sind Warnungen aufgetreten
    at com.sap.sdo.das.jco.JCoInvoker.checkReturnStructure(JCoInvoker.java:350)
    at com.sap.sdo.das.jco.JCoInvoker.accept(JCoInvoker.java:257)
    at com.sap.engine.services.sca.plugins.jco.JCoImplementationInstance.accept(JCoImplementationInstance.java:56)
    at com.sap.engine.services.sca.das.SCADASImpl.invokeReference(SCADASImpl.java:335)
    at com.sap.glx.adapter.app.ucon.SCADASWrapperImpl.invoke(SCADASWrapperImpl.java:116)
    regards
    Xiang
    Edited by: Xiang Zhang on Jun 14, 2010 2:48 PM
    Edited by: Xiang Zhang on Jun 14, 2010 2:57 PM

    Hi Xiang,
    You may need to check if the JCo settings are fine and connectivity is proper.
    Regards,
    Arafat

  • BAPI_CUSTOMER_FIND search by KNA1-KUNNR

    Hi all,
    I'm experiencing strange behavior of BAPI_CUSTOMER_FIND while I base my search by KNA1-KUNNR. I provide following input parameters to the BAPI:
    SELOPT_TAB-TABNAME       =                  KNA1
    SELOPT_TAB-FIELDNAME    =                 KUNNR
    SELOPT_TAB-FIELDVALUE   =                 1900
    1900 is my customer number. I would expect that such a call as per parameters above should return all data about that customer.
    Instead I'm getting message: No customer found for this selection in RESULT_TAB-MESSAGE field.
    I'm able to see all the data in TA XD03 and also in table KNA1.
    Can you advise how to use BAPI_CUSTOMER_FIND in order ot search by customer number?
    thanks a lot!
    m./

    Try to pass values in internal format 1900 -> 0000001900, remenber SAP transactions, SE37 test and SE16(n) byt defualt use conversion-exit of the domain associated to field (here ALPHA, try to call CONVERSION_EXIT_ALPHA_INPUT).
    COMP
    TABNAME
    FIELDNAME
    FIELDVALUE
    CUSTOMER
    P
    P
    D
    D
    T
    ID
    NUM
    KNA1
    KUNNR
    0000101562
    101562
    S
    FN
    800
    found
    KNA1
    KUNNR
    101560
    W
    FN
    65
    Not found
    Regards,
    Raymond

  • XML parsing in UDF

    Hi everyone!
    First, I must say that I don't know anything about java/XML programming(I'm sorry)!
    I'm just looking for some guiding lights for the following;
    In the Message Mapping (IB), I'm trying to do a RFC Lookup to R/3 using a BAPI call.  I followed Michal Krawczyk's "Mapping lookups - RFC API:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    And now I need to parse the XML response and retrieve a value from it!
    I would like to know if the following portion of code is ok and wheere should I put it?
    Code:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    // Create DOM structure
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(content);
    // Lets find my tag
    NodeList list = document.getElementsByTagName("Number");
              Node node = list.item(0);
              if (node != null) {
                   node = node.getFirstChild();
              if (node != null) {
                   tagValue = node.getNodeValue();
    Thanks a lot for your help!

    Thank you for the links!!!
    I've consulted all of them and when I try to run the code, I'm getting the following message:
    unreported exception org.xml.sax.SAXException; must be caught or declared to be thrown document = builder.parse(result.getContent());
    Could you help me fix that issue?
    Here's the code in question
    String m = "<?xml version="+"1.0" "encoding=""UTF-8""?>"
    "<ns0:BAPI_CUSTOMER_FIND""xmlns:ns0=""urn:sap-com:document:sap:rfc:functions>"+"<RESULT_TAB></RESULT_TAB><SELOPT_TAB><item><COMP_CODE>1000</COMP_CODE><TABNAME>KNA1</TABNAME><FIELDNAME>SORTL</FIELDNAME><FIELDVALUE>004258</FIELDVALUE></item></SELOPT_TAB></ns0:BAPI_CUSTOMER_FIND>";
    RfcAccessor accessor = null;
    ByteArrayOutputStream out = null;
    importanttrace = null;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = null;
    factory.setNamespaceAware(false);
    factory.setValidating(false);
    Document document = null;
    try
              builder = factory.newDocumentBuilder();
              } catch (Exception e) {
                   importanttrace.addWarning("Error creating DocumentBuilder -" + e.getMessage());
                   return null;
    try
              //1. Determine a channel (Business system, Communication channel).
              Channel channel = LookupService.getChannel ("BS_FSCM_AR_CLNT100","CC_RFC_TEST");
              //2. Get a RFC accessor for a channel.
              accessor = LookupService.getRfcAccessor(channel);
              //3. Create a xml input stream representing the function module request message.
              InputStream inputStream = new ByteArrayInputStream(document.toString().getBytes());     
              //4. Create xml payload.
              XmlPayload payload = LookupService.getXmlPayload(inputStream);
              //5. Execute lookup.
              Payload result = accessor.call(payload);
              document = builder.parse(result.getContent());
              //InputStream in = result.getContent();
              out = new ByteArrayOutputStream(1024);
              byte [] buffer = new byte[1024];
              for (int read = inputStream.read(buffer); read > 0; read = inputStream.read(buffer)) {
                   out.write(buffer, 0, read);
              content = out.toString();
    Thanks for your help!

  • 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)

  • ALE-BAPI-Scenario to XI with several BAPIs

    Hello
    <b>Descritpion of the current situation:</b>
    I configured an ALE Distribution model to transfer the HR payroll accounting data from an single SAP 4.7 system (WebAS 6.20) into 8 different SAP-Accounting-Systems (SAP R/3 4.6C). The model contains 14 BAPIs-Calls which are sent to SAP XI (3.0 SP17) and forwarded to the corresponding SAP-R/3-System, depending on the company-code.
    SAP XI demands for each BAPI an RFC-Sender-Adapter which contains a programID. For each programID I have to configure an TCP/IP-RFC destination in the sender system which contains the corresponding programID. The ALE distribution model configuration (BD64) allows only to use logical systems as receiver. So I have to create 14 logical systems with the same identification as the 14 TCP/IP-RFC destinations. In addition I was only allowed to create TCP/IP-RFC destinations with a length of 10 characters, because the field for the logical system isn't longer.
    <b>My questions are the following</b>:
    1) Is there a possibility to avoid the creation of 14 logical systems in this situation?
    2) Are there User-Exits or BADIs to map a different RFC-Destination in ALE before executing the BAPI-Call (i.e. depending on the logical system AND the BAPI)?
    3) Does anybody have a similar model and what are the experiences?
    Thanks
    Beat Mueller

    Hi
    Here's the List of the Object-Methots and BAPIs for Checking:
    CompanyCode.GetPeriod:
    - BAPI_COMPANYCODE_GET_PERIOD
    CostType.GetFixaccountList:
    - BAPI_FIXACCOUNT_GETLIST
    GeneralLedgerAccount.GetDetail:
    - BAPI_GL_ACC_GETDETAIL
    AcctngServices.DocumentDisplay:
    - BAPI_ACC_DOCUMENT_DISPLAY
    AcctngServices.PreCheckPayrollAccountAssign:
    - BAPI_CODINGBLOCK_PRECHECK_HR
    AcctngEmplyeeExpnses.Check:
    - BAPI_ACC_EMPLOYEE_EXP_CHECK
    AcctngEmplyeeExpnses.Post:
    - BAPI_ACC_EMPLOYEE_EXP_POST
    AcctngEmplyeeRcvbles.Check:
    - BAPI_ACC_EMPLOYEE_REC_CHECK
    AcctngEmplyeeRcvbles.Post:
    - BAPI_ACC_EMPLOYEE_REC_POST
    AcctngEmplyeePaybles.Check:
    - BAPI_ACC_EMPLOYEE_PAY_CHECK
    AcctngEmplyeePaybles.Post:
    - BAPI_ACC_EMPLOYEE_PAY_POST
    Customer.Find:
    - BAPI_CUSTOMER_FIND
    Customer.GetDetail2:
    - BAPI_CUSTOMER_GETDETAIL2
    Vendor.Find:
    - BAPI_VENDOR_FIND
    Vendor.GetDetail:
    - BAPI_VENDOR_GETDETAIL
    and here are the IDocs for Posting the Documents:
    ACC_EMPLOYEE_EXP.ACC_EMPLOYEE_EXP02
    ACC_EMPLOYEE_PAY.ACC_EMPLOYEE_PAY02
    ACC_EMPLOYEE_REC.ACC_EMPLOYEE_REC02
    Documentation:
    4.6c:
    http://help.sap.com/saphelp_46c/helpdata/en/ae/1c4b6e5733d1118b3f0060b03ca329/frameset.htm
    Our project had been stopped until now and will be reactivated in April. Have you been successfull posting the payroll form HR to FI/CO via SAP XI? How did you solve it?
    Greetings
    Beat Muller

  • Http- XI- rfc message mapping question

    Hi!
    I want to map the 3 fields (type: xsd:string) of xml message to the 3 fields of the table parameter (type: xsd:anyType)of the remote function.
    But I can't see the fields of the table parameter just only the name of it, and that is why I can't match 3 fields with this one in the graphical mapping editor.
    Can you help how to solve this problem?
    I import the metadata of the function modul from the R/3 backend system properly.
    Thanks.

    Gerg,
    I have imported this RFC into XI.  When you open it there is the <b>RESULT_TAB</b> and the <b>SELOPT_TAB</b>
    Both of these have the subelement named <b>item</b>
    Expand item to see the available elements, each of which you can map to
    I do not know what your initial three fields represent but lets say that you want to map them to the SELOPT_TAB component
    Your XI design will then pass this information via RFC to an R3 system to retrieve Customer data
    You could also simulate your mapping and send steps by testing BAPI_CUSTOMER_FIND in your R3 system
    Enter your initial three fields and then execute
    You will see the results in the table RESULT_TAB
    I hope this helps,
    Mike

  • Bapi to search customers

    Hi,
    I'm looking for a BAPI to search for customers by name. I have tried BAPI_CUSTOMER_FIND but can't get it to work.
    Best Regards
    Mattias

    Mattias i've test the BAPI and works find, let me tell you how i filled the tables:
    In the Import Parameters:
    MAX_CNT         =                <b>100</b>
    PL_HOLD         =                <b>X</b>  
    In the Tables
    SELOPT_TAB-COMP        = <b>THE KNA1-BURKS</b>
    SELOPT_TAB-TABNAME  = <b>KNA1</b>
    FIELDNAME  = <b>NAME1</b>
    FIELDVALUE = <b>A</b> (with the '* char').
    The result was the table "RESULT_TAB" with all the customer that had an "A" in the Name, also, you can use the char '+' to search another value, just like you use it in a web search.
    =)
    Regards
    Carlos

  • Same customer entry exists already in the system?

    Hello
    I am creating a new customer from my Z prog.
    But, i need to check for duplications upon (legal) name, address, bank details, VAT number, is there any standard SAP function module/BAPI/Class?
    Thank yop

    Did you try the BAPI "BAPI_CUSTOMER_FIND". Fill in the SELOPT_TAB with required table name and field names, and if your result tab returns null value then there is no duplicate customer.
    Edited by: Suresh Karri on Oct 13, 2011 4:03 PM

  • BAPI for searching a customer?

    Hi all,
    I have to search for customers in the KNA1 table, e.g. using name, customer number... (all optional, multiple search parameters count as "AND" search), incl. wildcards (--> potentially multiple customers as result).
    As the search is initiated from a Java-based web application, I need a BAPI or at least an RFC FM.
    Unfortunately, I found no fitting one so far. The next best is BAPI_CUSTOMER_FIND, but it seems to work on individiual fields only, and it only supports OR searches, no AND searches.
    Is there a function module already in the system, or do I have to write it myself?
    Thanks in advance!
    Kind regards,
    Dennis

    I realized that BAPI_CUSTOMER_FIND returns the customer number as well, so I can use it in general.
    But there is still some problems remaining, such as the missing AND operator and the need to afterwards get some details about each customer via JCo calls...
    I guess it's best when I develop a custom range selection BAPI.
    Kind regards,
    Dennis

Maybe you are looking for

  • Use JDBC to query data for JSP Report

    Hi all, I met a trouble when use JDBC to query data, it can show data in report builder, but get error when call from url for exxample: http://localhost:8889/reports/TestJDBCReport.jsp found error message: javax.servlet.jsp.JspException: rwlib-1: REP

  • How to find out if I am using a 32 bits or 64 bits version of JRE?

    How to find out if I am using a 32 bits or 64 bits version of JRE? If I have 2 instances of Java installed in 2 seperate directories, one 32 bits and other 64 bits on Linux. How do I identify which directory holds which version? Is there any command

  • Need advice (tutorials)

    hi      I am new to photoshop.I am interested in learning and doing stuff with images like editing in images by myself.I am a Java Programmer and i would like to go into the field of web designing.i have tried many tutorials and none have seen explai

  • Prepping SD footage for a HD project

    Hello everyone, I have some SD footage that I need to place in a HD project.  I was  hoping to give you the details and see how you would prep the footage. The source of this SD footage is a PAL DVD, and it's interlaced.  The  project time line I'm h

  • Creative Suite Installation problems

    If anyone is running into any problems installing Creative Suite, try running the 'Adobe Creative Suite Cleaner Tool' it resolved the problem I was having trying to download Photoshop CS6 from the Adobe Application Manager. Here's the download page l