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)





Wednesday, February 15, 2017

Value mapping reverse engineering without KT available

Om

Value mapping reverse engineering.

How to identify the group name
value map entries in mapping, understanding client requirement by quick mapping code



source and lookfor valuemap, agency1 as shown




Mail send options delivery options more delay

Om

Some time, we are working few hours before the US time zone, ( from offshore)

we are not supposed to send mails to onsite team in odd time until it is very important. 


In our daily routine, we do send mails, updating status of the work, this mails is not supposed to reach them, before their work time.
( all general low,medium important mails are to be sent in office regular time (onsite team is available))


send mails with delay, without holding the information from offshore and proceed for next work




Saturday, February 11, 2017

Failed idoc in sap pi, reprocess again

Message failed in sap pi due to data error, asked sap functional team to reprocess again, they reprocessed again with bd87, again idoc checked in idoc monitoring of sap pi, message with different message id and success , cancelled old message id. Thus fixed error

Monday, February 6, 2017

Message id format in SAP ECC and SAP PI

Om


SAP ECC message id and SAP PI message converstion


String st1="4043A88EEA4511E683DF000001121BAE",st2;
System.out.println(st1);
st1=st1.toLowerCase();
System.out.println(st1.substring(0,8)+"-"+st1.substring(8,12)+"-"+st1.substring(12,16)+"-"+st1.substring(16,20)+"-"+st1.substring(20));

ECC to SAP PI



SAP PI to SAP ECC            

   st2=st1.toUpperCase();
st2.replace("-","");
System.out.println(st2);

Friday, February 3, 2017

context of the element before mapwithdefault

Om

check element context before mapwithdefalut, 

but consant map target works for all instances.


before code does not work, when target has more occurences.

ZCODM  then mapwithDefault works in all cases, when target has multiple occurences.


replace any alphabet in input string

Om

some time, we are not supposed to get alphabet in inputstring, later we would like to use this for arithematic operation, in that case make sure, you input string does not have alphabets.

always keep nwds, in your system, to test various java code and place this code in UDF of sap pi system.


Thursday, February 2, 2017

SAP to WareHouse system test data replication

Om

Identifying right customer for target in SAP Quality system and retrigger idoc again, to check modified mapping properly working, desired resuts in warehouse label.


SAP(delivery idoc) -> SAP PI -> Warehouse ( info used in label)

issue: expecting labe name name, which was mentioned in customer name2 option, but it is not displaying properly as expected.

Reason for this error: streen2 is mapped to warehouse target filed( map for) , which was supposed to be mapped from NAME2

Reason for this blog: the way I have identified the test data in Quality system , where customer has name2 value exists and checking if any idoc exists already in we02 or not ( that specific warehouse)

Retriggering the same idoc in we19 and checking status in warehouse lable in quality system.

capturing both SAP screen shots( customer master datail, where name2 is highlighted) and also warehouse labe name is same or not ,
(which is used in my test results document to make understand to move my change to production, who are not technically good )

------------------------------------------------------------------------------------------

(sap customer data name2 highlighted<----> warehouse lable name2 display )


idoc details in SAP PI, ( Identify the segment and filed name, initially it was mapped from Street2)




Now check the customer, where customer with name2 option exits


My intention is name2 should not be empty


Found some records


with out this condition, found some records, with name2 does not contain some values


Customer master data KNA1  in se16 tcode



------------------------------------------------------------------------------
finding similar idoc in q,( with same idoc extension, target port is PI quality),target partner  (PRDB in my case), segment name for last 3 
months in we02; List of idoc search; 

Search for my required records Ex: JM, partner has Name2 values.
and checking idoc number if exits




Retrigged the same idoc in we19, replicated the testdata in SAP PI, asked to WM to verify lable for this delivery ,( seen expected target xml file, where this filed has name2 option)


Also capture the screens shots in XD03(Customer master data) and warehouse lable,


The reason for entire test is, to move the transport from quality to production for layman understanding format, application point of view.



Wednesday, February 1, 2017

special char in message causes routing exception in SAP PI

Om

2/1/2017 11:25:48.310 AM Error Transmitting the message to endpoint {2} using connection JMS_http://sap.com/xi/XI/System failed, due to: com.sap.aii.adapter.xi.routing.RoutingException: Can't determine receivers because condition evaluation failed


Example : 
IRREGU�AR


Searching specific idoc details based on its values but not segment


Om

In one of my requirement, I have identified specific idoc segment element is negetive,
which was not supposed to be negetive.

I have informed functional team and given the idoc number also.

For them , it was difficult to identify that segment ,based on idoc number and value (8.60-)
(note: they used edid4 table view, 1024(width), but it was not found in this width)


this procedure help for abaper or functional consultant to view details of idoc based on the value search with navigating through segment

we can search in two ways, in we02, using table view (edid4)