Rfc to Procedure exceptions

AM doing a synchronous process using rfc-procedure.When it runs,i see the error
'Error when executing statement for table/stored proc. 'ZRPOPUR' (structure 'Statement'): java.lang.NumberFormatException: High-order nibble of the byte at array offset 540 is not valid. Byte value: 40'  in the message monitor.I defined all the rfc parameters with type 'char' and some fields which the procedure returns is type dec like 'DEC(10,2)'. I think i need not to convert it.But what made the error happend?Can anybody help me?
Thx.

Hi, I found the solution to my problem!
It wasn't really an XI configuration, some one told my that in synchronous RFCs the programmer has to erase the line run in BACKGROUND, and catch the errors that XI could throw.
I search for any kind of documentation regarding this but I couldn't find any thing? Does somebody have anything?
Regards.

Similar Messages

  • Get Attribute values from a page and procedure exception handling?

    Hi All,
    I have created new page with two input attributes not based on any VO. This page is created to capture two values and pass these to an AM method upon pressing OK button. The method in AM will call a procedure with two in parameter expecting the two values captured from the above said page.
    I have two questions, first one how to capture the values entered by the page in the controller class and advises me how to handle exceptions when my procedure fails.
    I can not use something like this since this page is not based on a VO
    String fromName = (String)vo.getCurrentRow().getAttribute("FromName");
    Do I have to create a dummy VO like select '' name1, '' name2 from dual?
    Thanks for the help.

    Hi,
    Actually you can capture the parameters on the page like this way
    String test = (String)pageContext.getParameter("id of the text input bean");
    Now in procedure you can take an out parameter which stores the error messages on exception
    and return that out parameter in java.
    and then you can throw exception on page using OAException class.
    Thanks
    Gaurav Sharma

  • Call RFC from procedure

    Hi
    Is possible call a RFC (R3 SAP) from procedure/package ?
    Tia

    Hi,
    Yeah, it is possible to call a RFC from Oracle Procedures with the user
    of proper supplied packages rfcsdk or by use of Java Connector.

  • RFC error communication  exception

    Hi all,
    My scenario is Jdbc -- XI -- RFC(Z_BAPISALESORDER with two BAPI's 1.BAPI_SALESORDER_CREATEFROMDAT  2.BAPI_TRANSACTION COMMIT).
    I am using RFC reciever adapter.While configuring the RFC adapter I have two options.
    1.SAP system  2.External RFC server
             If i select SAP system , I did not get any errors.It is showing successful message in SXMB_MONI and also in RWB. But Sales order is not created.
    Message in RWB ...
    .>RFC adapter received an asynchronous message. Attempting to send tRFC for Z_SALESORDERCREATEFROMDAT_XI with TID XIWVaSqBlY4TccBW0GtFmRhW
    .>The message status set to DLVD.
    .>The message was successfully delivered to the application using connection AFW.
             But If i use External RFC system, I am getting excepion.In RWB it is showing following excetion.
    ...>Exception caught by adapter framework: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: could not get a client from JCO.Pool: com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: CPIC-CALL: CMRCV LOCATION CPIC (TCP/IP) on host sapx
    ...>Delivery of the message to the application using connection AFW failed, due to: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: could not get a client from JCO.Pool: com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: CPIC-CALL: CMRCV LOCATION CPIC (TCP/IP) on host sapx.
    which option is used for calling the BAPI to create the sales order?
    Could anybody help me out...?
    Thanks,
    sekhar.

    Try this code. This works perfectly for us:
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
    EXPORTING
    SALESDOCUMENTIN = SALESDOCUMENTIN
    ORDER_HEADER_IN = ORDER_HEADER_IN
    ORDER_HEADER_INX = ORDER_HEADER_INX
    SENDER = SENDER
    BINARY_RELATIONSHIPTYPE = BINARY_RELATIONSHIPTYPE
    INT_NUMBER_ASSIGNMENT = INT_NUMBER_ASSIGNMENT
    BEHAVE_WHEN_ERROR = BEHAVE_WHEN_ERROR
    LOGIC_SWITCH = LOGIC_SWITCH
    TESTRUN = TESTRUN
    CONVERT = CONVERT
    IMPORTING
    SALESDOCUMENT = SALESDOCUMENT
    TABLES
    RETURN = RETURN
    ORDER_ITEMS_IN = ORDER_ITEMS_IN
    ORDER_ITEMS_INX = ORDER_ITEMS_INX
    ORDER_PARTNERS = ORDER_PARTNERS
    ORDER_SCHEDULES_IN = ORDER_SCHEDULES_IN
    ORDER_SCHEDULES_INX = ORDER_SCHEDULES_INX
    ORDER_CONDITIONS_IN = ORDER_CONDITIONS_IN
    ORDER_CONDITIONS_INX = ORDER_CONDITIONS_INX
    ORDER_CFGS_REF = ORDER_CFGS_REF
    ORDER_CFGS_INST = ORDER_CFGS_INST
    ORDER_CFGS_PART_OF = ORDER_CFGS_PART_OF
    ORDER_CFGS_VALUE = ORDER_CFGS_VALUE
    ORDER_CFGS_BLOB = ORDER_CFGS_BLOB
    ORDER_CFGS_VK = ORDER_CFGS_VK
    ORDER_CFGS_REFINST = ORDER_CFGS_REFINST
    ORDER_CCARD = ORDER_CCARD
    ORDER_TEXT = ORDER_TEXT
    ORDER_KEYS = ORDER_KEYS
    EXTENSIONIN = EXTENSIONIN
    PARTNERADDRESSES = PARTNERADDRESSES
    **checking if the BAPI returned some errors*****
    LOOP AT return ASSIGNING <bapiret>.
    IF <bapiret>-type = 'E' OR <bapiret>-type = 'A'.
    success = space.
    EXIT.
    ENDIF.
    ENDLOOP.
    IF success = 'X'.
    ****in case of success commit the BAPI*********
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'
    IMPORTING
    return = wa_bapiret.
    ELSE.
    ROLLBACK WORK.
    ENDIF.
    Also you need to pass on the information for "inx" structures. What I mean is , if you are sending data to field REF_1 in header_in, then ref_1 in header_inx needs to be passed witha value of 'X'.
    The update flag in inx structure needs to be 'C' for create.
    If have items in your sales order, then you have to pass the values for item_in and item_inx. Additionally you need to pass values for schedule lines also.
    Hope this helps.
    Thanks,
    Bhaskar

  • RFC Adapter - JCO Exception - Please Urgent

    I am developing a scenario from File--RFC integration.  I am using File and RFC adapter to perform this transaction.
    The File Adapter is picking the file properly and the trnaformation (Mapping Program) is also happening properly.  But the RFC is throwing the following error.  I got this error info from the Runtime Workbench.
    Exception caught by adapter framework: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: JCO.Exception while calling ZPS_XI_ACTIVITY_CREATE in remote system (RfcClient[BAPI_CreateActivity_Receiver]):com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR
    Error Delivery of the message to the application using connection AFW failed, due to: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: JCO.Exception while calling ZPS_XI_ACTIVITY_CREATE in remote system (RfcClient[BAPI_CreateActivity_Receiver]):com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR.
    The RFC is executing without any problem when I execute this from the transaction SE37.
    I have created communication channel in Integration Directory in appropriate manner. 
    I also created RFC destination in the XI system (TCODE SM59) and the same is using in the "Receiver Determiiation - Service".
    I have not done any configuration at SAP R/3 side.  Is any config required at R/3 end for this scenario - please let me know.
    Please throw some light on this.  I will greatly appreciate your help.

    Friends,
      Please suggest on this vague problem that I am facing.  Your help would be greatly appreciated.
    1. I am using SAP-PS (Projects & Systems) BAPI 'BAPI_BUS2002_ACT_CREATE_MULTI' to create the activities for a project.  According to this BAPI documentation,
    - First call 'BAPI_PS_INITIALIZATION' before make this BAPI call
    - After BAPI call, we should use 'BAPI_PS_PRECOMMIT' and 'BAPI_TRANSACTION_COMMIT'.
    2. Hence, I have developed Z-Func Module with Initialize, BAPI call - then Pre Commit and Commit.
    3. This is executing from SE37 without any issues.  Other parameters to make a remote call is also set properly.
    4. To make sure that, I made a JCO call from Java Program using PDK for Java.  This is also working fine.
    5. But when I used this in the XI scenario (File-XI-RFC) this is showing ABAP dump and this is invoking from Pre-Commit module.
    I couldn't figure it out why it's happening like this.
    I did lot of troubleshooting and the details are as follows for your reference.
    1. The mapping program is working fine without any issues.  I confirmed this by writing these input values to the file (ofcourse lot of pain) inside the function module.  All the values have been parsed by XI and coming to Func Module as expected.
    2. No issues with logical destinations (SM59).
    3. I have tried other options such as clearing the Cache...etc.
    Hence, please throw up some light.  If any body tried with these kind of BAPI (needs initialize, pre-commit and commit) I really appreciate your effort.
    <b>Can we enable the debugging of func module when the XI makes a call...?</b>  - I tried with Standard options that seems doesn't work.

  • Problem with RFC adapter (JCO Exception RFC logon failure)

    Hi ,
    I have SOAP to RFC scenario.
    Scenario with same configuration (RFC adapter) is working in QA system.but when I have transported to PRODUCTION system
    it is showing
    com.sap.aii.af.ra.ms.api.DeliveryException: RfcAdapter: receiver channel has static errors: can not instantiate RfcPool caused by: com.sap.aii.af.rfc.RfcAdapterException: error initializing RfcClientPool:com.sap.aii.af.rfc.core.repository.RfcRepositoryException: can not connect to destination system due to: com.sap.mw.jco.JCO$Exception: (103) RFC_ERROR_LOGON_FAILURE:
    I have gievn max conn=10 ;Refresh the cache also
    and checked Roles and authorization also but still I am getting the same error.
    Regards

    Hi ,
    I have created all the objects manually. and it is working.
    now it is showing other error when I am sending the messages from SOAP side it is showing
    MAPPING">NO_MAPPINGPROGRAM_FOUND</SAP:Code>
      <SAP:P1>Object ID DF2C6D6E40E935CB970DEE3A71049BF9 Software Component C3D5E1D1C75311DDB94DE33C0A1E01B6</SAP:P1>
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Interface mapping Object ID DF2C6D6E40E935CB970DEE3A71049BF9 Software Component C3D5E1D1C75311DDB94DE33C0A1E01B6 does not exist in runtime cache</SAP:Stack>
    for this I checked the Interface determination step and receiver determination ,mapping program all looks correct.
    I have refershed cache also both Complete and SLD.
    but nothing is wroking
    Please advice.
    Regards

  • ODI Procedure exception

    Hi
    I formed following procedure in ODI (it will fetch only first record) and getting following exception.
    Please let me know the procedure syntax is correct or not.
    same format design with declear variable in SQL and it is working fine.
    Procedure:
    begin
    SELECT
         a.lot_number,
         a.organization_code,
         a.parent_lot_number,
         a.origination_date,
         a.expiration_date,
         a.best_by_date,
         a.retest_date,
         a.item_number,
         a.primary_uom_code
    INTO
         '#PVV_LOT_NUMBER',
         '#PVV_ORGANIZATION_CODE',
         '#PVV_PARENT_LOT_NUMBER',
         '#PVV_ORIGINATION_DATE',
         '#PVV_EXPIRATION_DATE',
         '#PVV_BEST_BY_DATE',
         '#PVV_RETEST_DATE',
         '#PVV_ITEM_NUMBER',
         #PVV_PRIMARY_UOM_CODE
    FROM
         (SELECT rownum r,b.* FROM (SELECT * FROM apps.MTL_OPSM_LOT_EXPORT_V ORDER BY lot_number, item_number,organization_id
    ) b
    ) a
    WHERE
         a.r=1;
    end;
    Exception:
    6550 : 65000 : java.sql.SQLException: ORA-06550: line 1, column 193:
    PLS-00308: this construct is not allowed as the origin of an assignment
    ORA-06550: line 1, column 265:
    PL/SQL: ORA-00904: : invalid identifier
    ORA-06550: line 1, column 9:
    PL/SQL: SQL Statement ignored
    java.sql.SQLException: ORA-06550: line 1, column 193:
    PLS-00308: this construct is not allowed as the origin of an assignment
    ORA-06550: line 1, column 265:
    PL/SQL: ORA-00904: : invalid identifier
    ORA-06550: line 1, column 9:
    PL/SQL: SQL Statement ignored
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execSrcOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)
    Please help me on it.
    Thanks
    Phani
    Edited by: Phanikanth on Jul 15, 2010 10:26 PM

    Hi
    I got solution from Cezar Santos
    ODI doesn't work like this....
    The easiest way is to use a one column select into each ODI variable.
    I mean, in the variable tab "Refreshing" for ODI Variable use the command:
    SELECT
    a.lot_number,
    FROM
    (SELECT rownum r,b.* FROM
    (SELECT * FROM apps.MTL_OPSM_LOT_EXPORT_V ORDER BY lot_number, item_number,organization_id
    ) b
    ) a
    WHERE
    a.r=6
    and repeat it to each variable....
    To get the variable refreshed, just add it into a ODI package.
    Reason: Because ODI variable aren't in the database where the PL/SQL is... it's means that DB doesn't know those variables....
    Thanks a lot Cezar
    Regards
    Phani

  • Send error text to PI when inbound asyncrhonous RFC raises an exception

    Hello,
    I've been developing a File 2 RFC asynchronous scenario. I'm an ABAP developer too so I'm who programmed the inbound RFC.
    This RFC is updating materials, so for example if the material is blocked by some user in the system the RFC raises an error and PI knows that something had happened because the RFC response to PI is like this:
    <SAP:Code area="RFC_ADAPTER">APPLICATION_ERROR</SAP:Code>
    If I go to the RFC imported definition at PI, I can see that the fault message structure has fields to add text and parameters like an standard message. I've tried to use this sentence to raise the message in the RFC instead of simple RAISE EXCEPTION:
        MESSAGE ID ls_return-id
              TYPE ls_return-type
            NUMBER ls_return-number
              WITH ls_return-message_v1 ls_return-message_v2
                   ls_return-message_v3 ls_return-message_v4
           RAISING EXCEPTION.
    But I still get only the APPLICATION_ERROR as fault response message in PI...
    How do I fill the fault message correctly?

    Hello,
    I've been developing a File 2 RFC asynchronous scenario. I'm an ABAP developer too so I'm who programmed the inbound RFC.
    This RFC is updating materials, so for example if the material is blocked by some user in the system the RFC raises an error and PI knows that something had happened because the RFC response to PI is like this:
    <SAP:Code area="RFC_ADAPTER">APPLICATION_ERROR</SAP:Code>
    If I go to the RFC imported definition at PI, I can see that the fault message structure has fields to add text and parameters like an standard message. I've tried to use this sentence to raise the message in the RFC instead of simple RAISE EXCEPTION:
        MESSAGE ID ls_return-id
              TYPE ls_return-type
            NUMBER ls_return-number
              WITH ls_return-message_v1 ls_return-message_v2
                   ls_return-message_v3 ls_return-message_v4
           RAISING EXCEPTION.
    But I still get only the APPLICATION_ERROR as fault response message in PI...
    How do I fill the fault message correctly?

  • No line numbers in stack trace from Java Stored Procedure exception

    I have a Java Stored Procedure which can generate an exception. In one database (11.1.0.6) the Java stack trace contains line numbers for my code, but not for the classes loaded by default with the JVM. In another database (same version) the Java stack trace does NOT contain line numbers for my code, but does contain them for some of the classes loaded by default with the JVM!
    Neither of the schemas where I am running the the Java stored procedure has a JAVA$OPTIONS tables as described here:
    http://download.oracle.com/docs/cd/B28359_01/java.111/b31225/chtwo.htm#BABIGFGA
    So the Java should have been compile "-debug" by default in both schemas. I specifically set the debug option to true using:
    exec dbms_java.set_compiler_option('', 'debug', 'true');
    but this had no effect.
    Can anyone explain this behavior or tell me how to always get line number in the Java stack trace?

    Hi,
    Try using java.util.logging package. Using these packages you can configure your logging information to include context down to the class name. Then each log message would be unique enough to know where it came from.
    -Priyanka

  • Need help interpreting an RFC Web dynpro exception

    Hi,
    The following code shows how I set the content of a wdp model:
    Z_Zmm_Tax_Calc2_Input TaxCode2 = new Z_Zmm_Tax_Calc2_Input();
    wdContext.nodeZ_ZMM_TAX_CALC2().bind(TaxCode2);
    TaxCode2.addItems(new Zzz_Tax_Calc());
    It's the last line of the code that causes the exception
    When executing the model I get the following.
    Error stacktrace:
    java.lang.ClassCastException: com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCException: The Relation must reference ModelClass instances of Type , not of !
         at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.checkRelatedModelObject(DynamicRFCModelClass.java:727)
         at com.sap.tc.webdynpro.modelimpl.dynamicrfc.DynamicRFCModelClass.addRelatedModelObject(DynamicRFCModelClass.java:802)
         at com.alum.miromodel.Z_Zmm_Tax_Calc2_Input.addItems(Z_Zmm_Tax_Calc2_Input.java:170)
         at com.alum.miro.Cust.initTaxCalc2(Cust.java:911)
    Can anyone tell me what it means?
    BR
    Olof Tronnberg

    Hi Olof,
    Z_Zmm_Tax_Calc2_Input TaxCode2 = new Z_Zmm_Tax_Calc2_Input();
    wdContext.nodeZ_ZMM_TAX_CALC2().bind(TaxCode2);
    These two lines of code will first create a object of the model node and bind it to the present view s context node.
    I thnk this node Z_Zmm_Tax_Calc2_Input() has structures in it. When ur rfc needs inputs we hav to set them as
    say
    TaxCode2.set<some attribute in the model node>(its value);
    If there is a structure
    TaxCode2.set<structure name>(new <structure name>);
    This is the correct way.
    When u say TaxCode2.addItem(); the argument needed is of type Item . IS zzz_tax_calc of that type..
    If its not of the type it will throw the classcast exception
    AddItem is usually used when we have to add more than instance.
    Bind creates one instance of the node and binds it.
    I think its a gud practice to stick with bind and set rather than add when it comes to RFC s
    Regards
    Bharathwaj

  • RFC Destination Catch Exceptions

    Hello,
    I've a program with call to RFC destination 'XI' , i want to know if it is possible catch exceptions when in the other system (XI) a fault occurs, for example, the database table in which I want to insert the data is not created. Now, if this happens a dump occurs
    thanks very much,

    Hello,
    You can try this way with your RFC function module:
    CALL FUNCTION 'RFC_WRITE_FILE'
        DESTINATION FP_P_DEST
        EXPORTING
          FILE                  = L_V_NAME
          FORMAT                = L_C_BIN
          SIZE                  = L_V_SIZE
          LANGUAGE              = SY-LANGU
        IMPORTING
          SIZE                  = L_V_SIZE
        TABLES
          FILEDATA              = L_IT_FILE
        EXCEPTIONS
          SYSTEM_FAILURE        = 1  MESSAGE L_V_RFC_MESS
          COMMUNICATION_FAILURE = 2  MESSAGE L_V_RFC_MESS
          ILLEGALNAME           = 3
          OTHERS                = 6.
      CASE SY-SUBRC.
        WHEN 0.
        WHEN 1.
        WHEN 2.
        WHEN 3.
        WHEN 6.
      ENDCASE.
    The SY-SUBRC value can be captured this way. Hope this helps.
    BR,
    Suhas
    Edited by: Suhas Saha on Mar 24, 2009 4:14 PM

  • Exception Handling in RFC lookup

    Hi Experts,
    I have a query in RFC Lookup function working with PI 7.1,  file to Idoc scenario.
    I am using Enhance Receiver Determination to find the dynamic recivers.Here we have used a Functional Module which gives an output according to the the input parameter (which comes from input file). thus i have used RFC lookup to the remote system to fetch this info from FM.
    Problem -
    When the remote system is down or if the RFC lookup attemped & exceptions raised for some reason (RFC user authority has been changed & it was not able to perform the intended Job at remote system) , the message stuck in queue and block the several other messages from another interfaces which belongs to teh same queue.
    Queries-
    This is not allowed in production as it affects other services.
    1>how can we handle the RFC lookup exception (in case of remote system is down or if the RFC lookup exception)
    2>how can we perform Local lookup at PI box rather then remote lookup (the FM fetches the data from remote system)
    3>Is Value mapping is relevant in this case raher the RFC lookup ? I am not sure as the values are dynamic & selected as per the FM's output.
    Please provide your valuable insight .
    Thanks in advance !
    -Jyoti

    Hi Jyoti,
    Answer for your 3 question.
    1. RFC lookup will get execute on R/3 so if R/3 is down there no way that your RFC lookup will work as expected.
    2. So if R/3 is down or RFC not able to get receiver system due to some problem.. then in that case.
              On your Receiver determination at bottom
              Configure  u201Cif no receiver found proceed as followingu201D
               In this you can have 3 option.
                        a. Error message u2013 if you select this the transaction will end with error message in SXMB_MONI
                        b. Ignore: if you select this execution will get ignored and there will not be any entry in SXMB_MONI
                        c. Select the following receiver. You can select this and can configured default receiver system in case if RFC not able to determine receiver then interface will get route to receiver system configured here.
    3. As you mentioned values are dynamic  then Value mapping doesnu2019t make any sense here. RFCl ookup is the right option and above are few other option in case you RFC lookup flailed.
    Thanks,
    Bhupesh

  • How to get short text of a exception thrown by abap rfc

    Hi buddy,
    I use jco to communicate with backend, an abap function module will raise a exception. I can catch that exception,
    The example exception is:
    <b>Exception</b>     <b>Short text</b>
    Test                   This is exception test.
    e.getKey()
    will return TEST.
    Does any know how to get that short text "This is exception test." from the exception I caught?
    Thanks
    Austin

    Hi Austin,
    There are 2 methods to raise errors in function modules.
    1) Using the raise Exception statement
    2) Using a return structure like BAPIRET to populate the message details like type, error number, error text etc.
    Generally method 1 is not recommended for any RFC/BAPI function modules because it causes the calling program to crash if the function raises an exception. Method 2 is the recommended way and is used in all standard BAPI's. ABAP programmers are advised to code RFC's as per method 2, but some times it would not be possible as the function would already be used and could be barred from changes.
    But whatever method the RFC uses to raise an exception, web dynpro can handle it in the following ways,
    Method 1) If the RFC raises an exception using RAISE EXCEPTION,
    Dont catch Exception class in your code, instead do the following,
    catch (WDDynamicRFCExecuteException e) {
                      wdComponentAPI.getMessageManager().reportException(
                            e.getLocalizedMessage(),
                            true);
    Method 2) If the function returns the errors in the standard bapi return structure, you can do the following
                IWDMessageManager MsgMgr = wdComponentAPI.getMessageManager();
                for (int i = 0; i < ReturnNode.size(); i++) {
                      if (Types.indexOf("S") != -1
                            && ReturnNode.getElementAt(i).getAttributeAsText("Type").equals(
                                  "S"))
                            MsgMgr.reportSuccess(
                                  ReturnNode.getElementAt(i).getAttributeAsText("Message"));
                      if (Types.indexOf("W") != -1
                            && ReturnNode.getElementAt(i).getAttributeAsText("Type").equals(
                                  "W"))
                            MsgMgr.reportWarning(
                                  ReturnNode.getElementAt(i).getAttributeAsText("Message"));
                      if (Types.indexOf("E") != -1
                            && ReturnNode.getElementAt(i).getAttributeAsText("Type").equals(
                                  "E"))
                            MsgMgr.reportWarning(
                                  ReturnNode.getElementAt(i).getAttributeAsText("Message"));

  • How to implement Exception Handling for soap to RFC sync interface...

    Dear Experts,
    we have an interface like soap to Rfc sync, already develepment is done and moved to production. but we are getting some quatitity is greater than item then it is throwing an error below. i want to handle that exception in XI level.
    please guide i am not found any document for this type of interface.
    Please suggest what can i do for this. Please share me the screen shot for this.
    Error Log:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Request Message Mapping
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>Application</SAP:Category>
      <SAP:Code area="RFC_ADAPTER">APPLICATION_ERROR</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="urn:sap-com:document:sap:rfc:functions">Z_DEPOT_DISPATCH.Exception</SAP:ApplicationFaultMessage>
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    <rfc:Z_DEPOT_DISPATCH.Exception xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><Name>RFC_ERROR_SYSTEM_FAILURE</Name><Text>Delivery quantity is greater than target quantity 10.000 MT</Text><Message><ID>VL</ID><Number>363</Number></Message><Attributes><V1>10.000</V1><V2>MT</V2></Attributes></rfc:Z_DEPOT_DISPATCH.Exception>
    Regards,
    Kiran Polani

    Dear All,
    This is clearly soap to rfc interface and we are using currently PI 7.0. This is a validation of BAPI, BAPI is not accepting the field of "Quantity is some value". The quatity is greater than the amount BAPI is throwing an error like "APPLICATION_ERROR". Is it possbile to validate in XI Level.
    Soap --> XI--> BAPI(Request)
    BAPI--> XI-->Soap(Response)( in this step what ever message return by bapi those error message not getting 3 rd party application).
    here by catching that error and i should throw to 3rd party application.
    is it possible to handle this or not.?
    If it is possible in Fault Mapping/Fault message type please give me the steps or document for me.
    I am new for fault mapping?
    Please help me on this.
    Regards,
    Kiran Polani

  • How to use the exceptions in a RFC ?

    I can use XI (through BPM) to call a RFC and get response from the "Export" of a RFC. But could I get the exception from the "exception" of a RFC ?
    I tried to write a RFC which will generate a exception and I found it in the XI monitor, but how to use it ? i.e. sometimes I need to get the "export", but sometimes I need to get "exception". Is there any documents or examples for it ? thanks.

    Hi,
    <i>But for fault message, I don't know how to send it to a receiver.</i>
    There is no other configurations that you need to do with respect to fault messages.
    If the rfc returns an exception, this message, is passed on to the receiver instead of the response message.
    The receiver of the fault message will be the system that sent the request.
    <i>(If I can use a transformation to mapping it to other message, I think it's ok too.)</i>
    You need not use a BPM, for this, in case you are using it only for fault message handling.
    All you need to do is, create a message mapping, with source and target message types as RFC exceptions and carry out a one to one mapping.This would display the exception coming from the RFC as the fault response st the sender.
    In case, the exception returned from the RFC is not self-explanatory, you could map constants to the target message type(in message mapping) which would explain the reason for the fault.
    Regards,
    Smitha.

Maybe you are looking for

  • How to create a primary key by 2 columns in sql??

    as title thx a lot.

  • Java 1.5.0 fix for Snow Leopard 10.6.5 broken in 10.6.6 -- Work around?

    Hello, I, unfortunately, rely on several Java 1.5 programs still, and up until the 10.6.6 update, using the Leopard Java 1.5 worked just fine. However, I suspect the kernel was updated, and broke support, as now when I try to run Java 1.5 from the co

  • ADDING CONTACTS TO ADDRESS BOOK SERVER!!!!!!!!!

    Can someone please help me figure out how to add contacts to the address book server. I tried to drag my contacts but it doesn't work. There is no "+" button for me to add new contacts. I've been trying for a couple days and nothing. Thank you in adv

  • Time Capsule and Windows Vista

    Hi there i have a Macbook Pro and my flat mate has windows vista on his note book. So i am thinking of getting Time capsule 500gb to back up my Mac pro and use it for the internet (going to replace my old wireless modem with time capsule) and my flat

  • -xO3 and above have problems with bswap

    Hey, I am trying to build a library which uses -xarch=sse2. Using -xO2 it compiles fine. With -xO3 and -xO4 it has a problem with bswap. Doug jdsbuild@prae> cc -V cc: Sun C 5.9 SunOS_i386 Build40_1 2007/02/08 usage: cc [ options] files. Use 'cc -flag