Blog Archive

Tuesday, February 21, 2017

Handling useOneasMany errors for huge messages with notepad++ trick

Om



copy the xpath of source filed. ( from useoneasmany UDF )
/wXML/Message/InvoiceBridge/Invoice/ListOfCartons/Carton/ListOfCartonDetails/CartonDetail/CartonLineNbr


Error :
com/sap/xi/tf/_MM_WM2013_InvoiceBridge_to_WHSCON_; Details: com.sap.aii.mappingtool.tf7.MessageMappingException; Runtime exception when processing target-field mapping /_-AFS_-DELVRY03/IDOC/E1EDL20/E1EDL37/E1EDL44/VBELN; root message: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Too many 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[[Ljava.lang.String;@1e59867f, [Ljava.lang.String;@78d0b6a, [Ljava.lang.String;@3ce86005, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@3bf80780, com.sap.aii.mappingtool.tf7.rt.Context@18b48342], ApplicationRuntimeException: Runtime Exception when executing application mapping program com/sap/xi/tf/_MM_WM2013_InvoiceBridge_to_WHSCON_; Details: com.sap.aii.mappingtool.tf7.MessageMappingException; Runtime exception when processing target-field mapping /_-AFS_-DELVRY03/IDOC/E1EDL20/E1EDL37/E1EDL44/VBELN; root message: Exception:[com.sap.aii.mappingtool.tf7.FunctionException: Too many 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[[Ljava.lang.String;@1e59867f, [Ljava.lang.String;@78d0b6a, [Ljava.lang.String;@3ce86005, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@3bf80780, com.sap.aii.mappingtool.tf7.rt.Context@18b48342], MessageMappingException: Runtime exception when processing target-field mapping /_-AFS_-DELVRY03/IDOC/E1EDL20/E1EDL37/E1EDL44/VBELN;


solution: Notepad++ trick to find the missed segments of source filed.






Near 36022 lines of xml file, 
if you do unit test in SAP ESR mapping section, you get java heap memory errors.

1. we see how to find the error error.
   by seeing this error, cartoon line details has been use for 2 or 3 inputs for useoneasmany function.

 first find the xpath for this.

 /wXML/Message/InvoiceBridge/Invoice/ListOfCartons/Carton/ListOfCartonDetails/CartonDetail/CartonLineNbr

 (some where, root element might be missed. this causes, useoneasmany function error.)

 let's find in this way
1. first undersand the xml structure. 
   find the cartonLinenbr.
   collect all necessary tags
   i need to identify where, is misssed, under in which invoice tag it is missed.
   Important: I am searching, carton with immediate tag.
   ( my intention is carton tags, without immediate tage, )
   cut this
   Now find, again carton tag,
   I have identified, list of root tags,invoice number, where cartonLinenbr are not found.
   
now, remove, these invoice tags from source, test in mapping, it will work,
( but , you could not test,
by splitting invoices, you can test)

Thus , we could find the errors for huge message from source with useoneasmany errors.

:-)







Search for below patton, book mark, cut, then find only pickticketCtlNbr ( to find wrong Invoice numbers)





No comments:

Post a Comment