Exception in  useOneAsMany function

Hi Experts,
I have a scenario IDoc (ORDERS05) to cXML.
to map the E1CUCFG (SO configuration data) to CXML.I have used the below mapping
Please click the link: [http://www.flickr.com/photos/25429360@N07/2466275133/]
Everything works fine, but if a IDoc comes without the E1CUCFG segment, it throws exception as below
Runtime exception during processing target field mapping /cXML/Req/OrderR/Item/It/Ext. The message is: Exception:[com.sap.aii.mappingtool.tf3.IllegalInstanceException: Too many values in first queue in function useOneAsMany. It must have the same number of contexts as second queue .] in class com.sap.aii.mappingtool.flib3.NodeFunctions method useOneAsMany[, , ]
Please help to resolve the issue.
Thanks in advance,
MK

Hi,
Suppress field in target xml
Mapping problem on different levels. (IDOC) to SQL
/people/riyaz.sayyad/blog/2006/04/23/introduction-to-context-handling-in-message-mapping
hope this may help you.
regards,
pradeep A.

Similar Messages

  • Customer 9000AAAE : Exception 7 in function module VIEW_KUAG2

    Hi,
    Hi all,
    When I do the intercompany billing for STO (vf01), I got the system message attached below. The customer 9000AAAE is a ship to party and assigned to the ordering plant. It has the partner function SH. So can anybody kindly tell me where is wrong in the custmer master data or somewhere else according to the following message? Or where to find the VIEW_KUAG2? What does it mean?
    Customer 9000AAAE: Exception 7 in function module VIEW_KUAG2
    Diagnosis
    During the attempt to read customer master record 9000AAAE,
    an error occured which is not handled separately.
    System Response
    The billing document for this business transaction was not
    created.
    Procedure
    If the error occured during a background job, you should try
    to create the billing document online. If the error occured
    online, the billing document can be created online. In any
    case, you should check the customer master record. If you
    cannot find any error in the master data, contact SAP.
    Technical data
    Tech. data details
    Client                                                002
    Group Number
    Sales Document Number                  0080100090
    Item Number of the SD Document      000000
    Schedule Line Number                      0083
    Counter in Control Tables                  00
    Message Identification                      VF
    System Message Number                 083
    Output Type                                     E
    Message Variable 01                        9900AAAE
    Message Variable 02
    Message Variable 03                        VIEW_KUAG2
    Message Variable 04
    Group Type                                      F
    In our Intercompany, our ship to party is different from the Sold to, bill to and Payer.  The configuration done as follows -
    a.  Defined Ship to Party as 9000AAAE
    b.  Define Sold to, Bill to, Payer as 9000AAAA
    c.  Assignd Ship to Sold to
    d.  Assigned Ship to customer to plant assignment in STO configuration in MM
    e.  Assigned internal customer of sales organization as 9000AAAA
    Please help in this
    Best Regards
    Goutham

    Hi,
    Thanks for ur reply
    I check the partner determination and the settings are as below -
    a.  Defined new account group for Sold to, Bill to and Payer
    b.  Defined new account group for Ship to
    c.  In the Ship to party account group, system only determine the ship to partner function
    d.  Customer defined in Sold to is assined as interneal customer to sales org
    e.  Customer defined in Ship to is assigned as customer for plant in Shipping data configure for STO in MM Configuration
    Please provide more insights
    Best Regards
    Goutham

  • Regardin handling exception in a function, while using that function in sql

    Hi gurus,
    I have a question regarding logging exceptions while using functions.
    I wrote a separate package to handle errors, where i have a procedure.
    In this proc i'm logging my error into a table and then raise the error to the front end.
    Ex:
    proc_log_and_raise    -- this proc... inserts my error into a table and then raisenow i included this error procedure in all functions and procedures.
    consider an example with a sample procedure and function.
    function func_1(( v_var   varchar2) return varchar2 is
    begin
         select   column2
         from     table2
        where col1 = v_var;
    exception
        when others then
             proc_log_and_raise;
    end;  
    procedure proc_1( v_var   varchar2) is
    begin
        select   func_1(v_var)  -- error occurs here..
        from     table_a
        where   col1 = v_var;
    exception
        when others then
             proc_log_and_raise;
    end;    now i do
    exec  proc_1( v_var );but now my problem is, when an error occurs in func_1, i'm getting an error with DML operation ( as we are inserting into error table)
    ORA-14551: cannot perform a DML operation inside a query.
    so what i want to do is, log both function and procedure where error occured.
    So is there any other better way, we can write our exception handling, so that i can log error and use function in a select statement.
    thank you.

    I changed my procedure a little, to make it simple.
    FUNCTION        PKG_WEEKLY.FUNC_1
                RETURN NUMBER IS 
                exc exception;
    BEGIN                         
                raise exc;
                RETURN           v_provr_rcoupt;
    EXCEPTION
                when exc then
                            PKG.PKG_ERROR.USP_LOG_AND_RAISE(
                                        'batch_1',
                                        'func_1',
                                        SQLCODE,
                                        DBMS_UTILITY.FORMAT_ERROR_STACK || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE()); 
    END FUNC_1;     
    PROCEDURE    PKG_WEEKLY.PROC_1(
                cur_details                                OUT      sys_refcursor) IS
    BEGIN
                OPEN cur_details FOR
                SELECT            NVL(PKG.PKG_WEEKLY.FUNC_1,0))    FROM DUAL;
    EXCEPTION
                WHEN OTHERS THEN
                            REPORT_APP_PKG.PKG_REPORT_ERROR.USP_LOG_AND_RAISE(
                                        'batch_1',
                                        'PROC_1',
                                        SQLCODE,
                                        DBMS_UTILITY.FORMAT_ERROR_STACK || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE());  
    END PROC_1; Now i execute it.
    exec PKG_WEEKLY.PROC_1(:cursor); Error logged into the table:
    242 batch_1 func_1 ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "REPORT_APP_PKG.PKG_REPORT_WEEKLY_CAO", line 230
    04/14/2009 16:09:25
    ERRORS displayed to the front end:
    ORA-20156: ORA-06510: PL/SQL: unhandled user-defined exception
    ORA-06512: at "PKG.PKG_WEEKLY", line 230
    ORA-06512: at "PKG.PKG_ERROR", line 48
    ORA-06512: at "PKG.PKG_ERROR", line 226
    ORA-06512: at "PKG.PKG_WEEKLY", line 261
    thank you

  • How to use Exceptions for a function module

    Hi folks,
            I have created  a new function module.Its working fine, but i am not aware of using exceptions for a function module. I hav just declared an exception in the 'exception' tab. Could any body explain me how to use that in my FM source code....Thanks...

    Hi Shyam,
    Have a look at this,
    START-OF-SELECTION.
      gd_file = p_infile.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = gd_file
          has_field_separator     = 'X'  "file is TAB delimited
        TABLES
          data_tab                = it_record
        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 NE 0.
          write: 'Error ', sy-subrc, 'returned from GUI_UPLOAD FM'.
          skip.
        endif.
    Regards,
    Sai

  • Error in UseOneAsMany Function Error in SAP XI

    Error in UseOneAsMany Function Error in SAP XI
    Hi Experts,
    I am trying the Example of function UseOneAsMany. My Input and Output XML Files are provided below:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_MM4 xmlns:ns0="http://test/mapping.test">
       <Header>
          <MatNo>MatNo</MatNo>
          <MatDesc>MatDesc</MatDesc>
       </Header>
       <Item>
          <MatNo>MatNo1</MatNo>
          <ItemNo>ItemNo1</ItemNo>
          <MatGroup>MatGroup1</MatGroup>
          <Mattype>Mattype1</Mattype>
          <Plant>Plant1</Plant>
       </Item>
       <Item>
          <MatNo>MatNo2</MatNo>
          <ItemNo>ItemNo2</ItemNo>
          <MatGroup>MatGroup2</MatGroup>
          <Mattype>Mattype2</Mattype>
          <Plant>Plant2</Plant>
       </Item>
    </ns0:MT_MM4>
    My Expected Output should be :
    <?xml version="1.0" encoding="UTF-8"?>
    -<ns0:MT_MM4R xmlns:ns0="http://test/mapping.test">
    -<Header>
    <MatNo>MatNo</MatNo>
    <MatDesc>MatDesc</MatDesc>
    <MatGroup>MatGroup1</MatGroup>
    </Header>
    -<Item>
    <MatNo>MatNo1</MatNo>
    <ItemNo>ItemNo1</ItemNo>
    <Mattype>Mattype1</Mattype>
    <Plant>Plant1</Plant>
    </Item>
    -<Header>
    <MatNo>MatNo</MatNo>
    <MatDesc>MatDesc</MatDesc>
    <MatGroup>MatGroup2</MatGroup>
    </Header>
    -<Item>
    <MatNo>MatNo2</MatNo>
    <ItemNo>ItemNo2</ItemNo>
    <Mattype>Mattype2</Mattype>
    <Plant>Plant2</Plant>
    </Item>
    </ns0:MT_MM4R>
    But for me Headers are coming first and then followed by two items. Please let me know how to solve the issue and also please provide the explanation.
    Thanks,
    GIRIDHAR

    Hello,
    Change ur structure little bit (add parent node "Record") and then use java mapping pasted in below blog to remove Record node to get ur desired structure.
    File Conversion using 'Nodeception'
    <?xml version="1.0" encoding="UTF-8"?>
    -<ns0:MT_MM4R xmlns:ns0="http://test/mapping.test">
    <Record> --- 0..Unbounded
    -<Header>
    <MatNo>MatNo</MatNo>
    <MatDesc>MatDesc</MatDesc>
    <MatGroup>MatGroup1</MatGroup>
    </Header>
    -<Item>  
    <MatNo>MatNo1</MatNo>
    <ItemNo>ItemNo1</ItemNo>
    <Mattype>Mattype1</Mattype>
    <Plant>Plant1</Plant>
    </Item>
    </Record>
    <Record>
    -<Header>
    <MatNo>MatNo</MatNo>
    <MatDesc>MatDesc</MatDesc>
    <MatGroup>MatGroup2</MatGroup>
    </Header>
    -<Item>
    <MatNo>MatNo2</MatNo>
    <ItemNo>ItemNo2</ItemNo>
    <Mattype>Mattype2</Mattype>
    <Plant>Plant2</Plant>
    </Item>
    </Record>
    </ns0:MT_MM4R>
    Thanks
    Amit Srivastava

  • Using useOneAsMany function in Message Mapping if subtree is optional

    Hi,
    I am trying to develop a message mapping for the following case:
    In the source message, there is a value "Value1" which is on the same level as a subtree "Struct2" which can occur 0..unbound times
    In the target message the value "Value1" has to be part of that subtree, so it has to be copied for each occurence of "Struct2" in the source message
    For the case that the subtree has cardinality 1..n there are some examples on the web, e.g. useOneAsMany (SAP-Bibliothek - Partner Connectivity Kit). But that does not fit my case. The subtree in the source message is optional here.
    See a screenshot of the message mapping and my solution for the mapping of "Value1" below:
    All other values are mapped 1:1.
    Sadly, this solution does not work when "Struct2" has cardinality 0..unbound, for 1..unbound it works perfectly. Here is my example:
    When I try the mapping, I get the following error message:
    That is true. The first queue of the useOneAsMany function has more values than the second. But I don't know how I can fix it, so that it works for my example. Can anyone give me a hint please?
    Setup is AEX 7.31.

    Hi Stefan,
    You can use this mapping.
    And for Struct2-Value1
    Result:
    Hope this helps,
    Mark

  • Exceptions in the function module

    Hi,
      I declared exceptions in the function module. But those exceptions not trigger in the abap editor.
    Regards
    Srinu

    Hi
    use RAISE EXCEPTION...
    RAISE KEY WORD IT WILL DEFENETELY RAISE THE EXCEPTION..
    REWARD IF IT USE FUL

  • TREX Error : Exception condition "UNKNOWN FUNCTION" raised.

    Hi All,
    When i try to search for a product in the SAP CCM catalog, i am getting a dump "Exception condition "UNKNOWN FUNCTION" raised. ".
    If anyone has faced similar error before, please help me resolve it.
    Thanks
    NishKel

    Hi
    Which TREX / CCM Version are you using ?
    What is the detailed Dump message ? Please paste the details using ST22 Transaction.
    <b>Other related SAP OSS Notes to check out -></b>
    Note 969660 6.20/6.40 Patch Collection Installation : Unix
    Note 1019227 DBM Package archivation
    Note 1017750 DBM Order Archiving
    Note 846657 TREX 6.1 XML attribute extractor doesn't work
    Note 1006014 Lock of SINGLE_TABLE_INDEX 
    Note 932771 BIA: Change run, locks and initial indexing
    Note 712341 ISA-R/3: No configuration possible when TREX is used
    Note 733873 Publication of individual catalog items
    Note 572940 Reduction of the number of index tables for area attributes
    Do let me know.
    Regards
    - Atul

  • Customer : Exception 7 in function module VIEW_KUxxV

    Hi,
    While Billing facing this problem
    00 Customer : Exception 7 in function module VIEW_KUxxV
    10 The bill-to party could not be determined
    10 The payer could not be determined
    tx in advance
    Bhushan Kolte

    Hello Colleague;
    Please check the account group assignment to the partner functions in   
    transaction VOPA click on partner function button then environment      
    then Account group assignment. Please ensure that this is all configured
    correctly for the partners.                                                                               
    Please also review the note                                    
    -> 80233   Debit-side settlement: Customizing, error messages                                                                               
    In particular the section:                                              
    VF083: 'Customer &: Exception & in function module VIEW_KUAGV'                                                                               
    The error message is generated because of a program error that          
    has since been corrected. The correct error message is VP304,           
    'Customer belongs to customer group & and thus cannot be the            
    sold-to party'.                                                                               
    The partner roles in the customer master are incorrectly set, see       
    below.                                                                               
    Recommendation: Assign the customer an account group which              
    already fulfills these criteria. (In the standard system, this is       
    Account group '0001).                                                                               
    I hope this helps resolve the error.
    Regards
    Ruy Castro

  • Exception 7 in function module VIEW_KUAG2

    Hi all,
    When I try to process a Billing document in transaction VF04, has an error message "Customer 12334: Exception 7 in function module VIEW_KUAG2".
    Could you advise me why I receive this message?
    Is it possible that Customer master data it is not maintained propertly?

    Hi,
    When I checked there are only 5 exceptions for this functional module.  By the way which version are you in?  If you want to find out what the exception 7 is then go to SE37 and display this functional module.  There you can find a tab for exceptions.  Based on that you can proceed with changes in the customer master. 
    Its definitely the possibility of not maintaining the customer properly.
    Hope this helps.
    Thanks
    Krishna.

  • Define our own Exceptions in th function builder

    hi
    how to define our own Exceptions in th function builder in the Exception tab and how to use them in functon definiton.
    regards
    ravish

    Hi,
    <b>Exceptions</b>
    The exception of a function module are defined on the Exceptions tab page in the Function Builder. Here you can select exception classes to define whether class-based exceptions are declared or non-class-based exception are defined. Class-based exceptions are represented in the above syntax by RAISING, and non-class-based exceptions are represented by EXCEPTIONS.
    The addition RAISING is used to declare class-based exceptions that can be propagated from the function module to the caller. Exceptions in the categories CX_STATIC_CHECK and CX_DYNAMIC_CHECK must be explicitly declared, otherwise a propagation can lead to an interface violation. A violation of the interface leads to the treatable exception CX_SY_NO_HANDLER. Exceptions of the category CX_NO_CHECK are implicitly always declared. The declaration of exceptions of the category CX_STATIC_CHECK is statically checked in the syntax check. For exceptions of the category CX_DYNAMIC_CHECK, the check is not performed until runtime. In a function module in which class-based exceptions are declared with the RAISING addition, the statement CATCH SYSTEM-EXCEPTIONS cannot be used. Instead, the relevant treatable exceptions should be handled in a TRY control structure.
    The addition EXCEPTIONS is used to define a list of non-class-based exceptions that can be triggered in the function module using the statements RAISE or MESSAGE RAISING. Exceptions defined in this way - as with formal parameters - are bound to the function module and cannot be propagated. If an exception of this type is triggered in a function module, and no return value has been assigned to it with the homonymous addition EXCEPTIONS of the CALL FUNCTION statement when the call was made, this leads to a runtime error.
    <b>Note</b>
    For new developments after release 6.10, SAP recommends that you work with class-based exceptions that are independent of the function module.
    Regards,
    Padmam.<b></b>

  • *Fatal Error: Unexpected exception processing text functions*

    Hi All,
    Could anyone provide guidance on the error below? when I tried to run particular report and I get the error below. We are using 11.1.1.3
    "*Fatal Error: Unexpected exception processing text functions*"
    Thanks in Advance.

    Which product are we specifically talking about?
    Please let me know.
    Thank you,
    Todd Rebner

  • How do we trap exception inside the function module?

    How do we trap exception inside the function module?

    Use ABAP Help - CATCH, RAISE for starters. Or take a look at an existing function module, for example.

  • Error in UseOneAsMany function

    Hello,
    My scenario is File to IDoc and we are using RFC lookup in message mapping also.
    While executing this interface I am getting below error in quality system environment.
    Please find attached trace file.
    RuntimeException during appliction Java mapping com/sap/xi/tf/_ARTransactions_to_ACC_DOCUMENT03_ Thrown: com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-field mapping /Z1ACCOUNTS/IDOC/E1BPACKEC9/CHARACTER; root message: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Too few values in the first queue in function useOneAsMany. It must have the same number of contexts as the second queue] in class com.sap.aii.mappingtool.flib7.NodeFunctions method useOneAsMany
    But while testing in Development environment, I am not getting any error. In dev system messages are processed successfully.
    In Both environment design and configuration objects are same expect some server credentials.
    Could you please help me?

    Hi Rohan
    From your trace, looks like the RFC connection is having some problem
    Caused by: com.sap.aii.adapter.rfc.afcommunication.RfcAFWException: error while processing message to remote system:com.sap.aii.adapter.rfc.core.client.RfcClientException: resource error: could not get a client from JCO.Pool: com.sap.mw.jco.JCO$Exception: (106) JCO_ERROR_RESOURCE: Connection pool RfcClient[RFCLookUpGLTransactionsData]c63e54cc41083352af06556d6dd4d9d4 is exhausted. The current pool size limit (max connections) is 1 connections.
      at com.sap.aii.adapter.rfc.afcommunication.from.FromAF.callClientChannel(FromAF.java:229)
      at com.sap.aii.adapter.rfc.afcommunication.ejb.RfcAFBean.process(RfcAFBean.java:270)
    Can you check your RFC receiver comm channel?
    Rgds
    Eng Swee

  • Uncatchable exception: BSP calling Function Module

    Hi all,
    currently i'm facing a very weird problem. My application class calls function module
    HR_INFOTYPE_OPERATION. Normally, in case of an error, the function module gives you back a return parameter. But if i call it from my BSP, the processing doesn't leave the function module. It directly throws an exception ERROR_MESSAGE_STATE instead of writing the message into parameter return.
    If i call the function module with the same parameters from a report, it works fine and the error message is written to return parameter without throwing an exception.
    What am i doing wrong? I don't want that exception and need to go on with filled parameter result.
    Regards
    Mark-André

    Hi MA,
    try using ERROR_MESSAGE in the exceptions list, like this.
    CALL FUNCTION 'func_name'
         EXPORTING
              string            = text
              pos               = position
         IMPORTING
              string1           = text1
              string2           = text2
         EXCEPTIONS
              string1_too_small = 1
              string2_too_small = 2
              ERROR_MESSAGE     = 3
              OTHERS            = 4.
    Cheers
    Graham Robbo

Maybe you are looking for

  • Today's Date within Date Range

    I have a BeginDate and EndDate in a database.  I want to be able to list those records if todays date is within the date range of BeginDate and EndDate.  I am unsure of the coding on this.  Has anyone done this and can give me some help? Thanks.

  • Is anyone having a problem pairing with a BMW?

    Does anyone have any advice for pairing with a 2011 BMW? Ever since I updated my 4S to IOS6.0 I can't seem to pair with my car.  At first it couldn't load phone book data. Now it won't pair at all.  I had BMW look at the problem but their diagnostics

  • What is a stacked switch?

    Hi, Can anyone explain what is a stacked switch and what kind of switches can be stacked and why the switched need to be stacked and how they work. Any links that I can go through to get the details. Thanks in Advance, Shyam

  • Help! I just got it, is it broke

    I just got mine today and plugged it in for its first charge. I want to import music from other folders, but when I click on any of the folders in the import wizard, nothing happens. I cant "ADD" anything!!! What is going on? Can you not do this whil

  • TS2771 Ipod touch setting changed and now it is unable to use. HELP

    My son changed the accessibilities settings on his ipod touch.  He turned the triple-click home ON and turned the inverted colors ON and did something that makes it say everything you touch.  Now that he has changed this, I can not get his Ipod touch