Generating alphabets in Message Mapping
Hi,
Can someone please suggest how can I generate alphabets in message mapping during runtime.
Regards
John
Hi John - I don't think we have a standard way but you can define UDF.
Declare an array with alphabets and return them as per your needs.
something like this
"Auto increment" alphabet in java? - Stack Overflow
collections - Generating an alphabetic sequence in Java - Stack Overflow
Similar Messages
-
Problem with message mapping ...
Hello,
I have problem with message mapping. I implemented SOAP-to-RFC scenario. The source message is of type http://sntcz.cz/xmlns/holidays:MT_Holiday, the target message of type urn:sap-com:document:sap:rfc:functions:Z_GET_SUPERIOR. But some error is still generated in Request Message Mapping step:
com.sap.aii.utilxi.misc.api.BaseRuntimeException: RuntimeException in Message-Mapping transformation: Cannot produce target element /ns1:Z_GET_SUPERIOR/USR. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:403) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:142) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102) at .....
This is XSD definition of source message:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sntcz.cz/xmlns/holidays" targetNamespace="http://sntcz.cz/xmlns/holidays">
<xsd:element name="MT_Holiday" type="DT_Holiday" />
<xsd:complexType name="DT_Holiday">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
030495e1742f11dd963600301875333b
</xsd:appinfo>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="SinceDay" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
fba049b067aa11dd8be6eee20abb2a3f
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="SinceMounth" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
fba293a067aa11dda311eee20abb2a3f
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="SinceYear" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
fba293a167aa11dd9b4eeee20abb2a3f
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="UntilDay" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
fba293a267aa11ddc352eee20abb2a3f
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="UntilMounth" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
fba293a367aa11ddc33aeee20abb2a3f
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="UntilYear" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
fba293a467aa11dda8cfeee20abb2a3f
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="UserId" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="http://sap.com/xi/TextID">
fba293a567aa11dd9698eee20abb2a3f
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
This is XSD definition of target message:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:sap-com:document:sap:rfc:functions" targetNamespace="urn:sap-com:document:sap:rfc:functions">
<xsd:element name="Z_GET_SUPERIOR">
<xsd:complexType>
<xsd:all>
<xsd:element name="USR" type="xsd:string" minOccurs="0" />
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:schema>
It's strange that if I use Message Mapping Test it works fine. But in pipeline not.
Do you have any idea where could be the problem?
Thank you in advance!
Best regard,
ZbynekHi,
To know the correct error Take the Inbound Payload from MONI and Test it in Mapping Test TAB. then u will come to know the exact error.
Procedure to take the Payload
goto MONI-Double click on MessageInbound Message ( CENTRAL ) --Payloads ---Double click on MainDocument ( application/xml ) -Just Right Click on the second window-View Source
then now Copy this and paste it in Mapping Test and Execute.
REgards
Seshagiri -
Message mapping not generating target fields
hi
iam doing jdbc--->rfc (bpm) created a one2one message mapping to import rfc table.
thanks in advance
sriHi Sri Rao,
Since you have created a one to one mapping, it would be required to map all the fields in your target message to ur source fields. In case there r some target fields which do not relate to your source field, map it onto a constant. This is all that is required to be done from what i understand from your query. In case there r further problems send the source n target data structure n i will be able to help you out better.
Cheers,
Christina -
Attempts to open Outlook calendar files (apparently located) on iCloud result in the error message "MAPI was unable to load the information service C:\PROGRA~2\COMMON~1\Apple\Internet Services\APLZOD.dll". Be sure the service is correctly installed and configured."
I am running Outlook 2010 on Windows 7. I have uninstalled and reinstalled iTunes with no apparent effect. Is this a problem with iTunes or Outlook, how do I resolve it?That's part of my problem - I was getting the error message when I tried to click on iCloud in the Calendar portion of Outlook 2010. I don't know where it was generated (iCloud, iTunes, or as an add-in to Outlook).
After my original post I tried restoring my computer to a date when I knew this worked, the restoration worked, and I can access my calendar. So that problem resolved itself.
I do have another question, but I'll post it separately. Thanks for your response. -
Additional message mapping in the operation mapping-use
Hi Friends,
I could find the option for adding more than one message mappings in the operation mapping(Interface mapping). What is the actual purpose of it. when it is used. If there is any blogs regarding the same. refer any link for the same.
Regards
PremHi Prem
Refer the blog provided by Sarvesh
What is the actual purpose of it. when it is used. If there is any blogs regarding the same
You can use more than one mapping programs for requirement where your message mapping cannot generate the desired structure you want or you want to do some transformations in a sequence for meeting your requirement.
Example: You want to generate a excel sheet as a mail attachment but you have to read a flat file. What you can do here is you can read the Flat file in a single string variable itself. Use XSLT mapping1. Now in a sequence using XSLT Map2/Java mapping program to convert to excel and send as attachment over email
Thanks
Gaurav -
How to validate a date in message mapping
Hi experts,
how to validate a date in message mapping. For ex: if date comes as 2008/02/31, then file it shold not get processed.how to achieve this in message mapping. Please help .
Thanks&Regards,
Reyaz HussainHi,
There are few simple ways for date validation as follow,
1.If you would like to handle it in XI only, then in message mapping you could verify about it with the help of generating smart exception.
For e.g in mapping there is one Date conversion API i.e. somthing DateTransformation It converts the incoming date format to required format. Here give the date format i.e expected from Sender File.
If in case the format miss-matched then it will create the exception.
You could handle this exception with the use of [Alert notification|http://help.sap.com/saphelp_nw04/helpdata/en/2c/abb2e7ff6311d194c000a0c93033f7/frameset.htm] and could be even able to notify to sender system about it.
2. The another solution is easy for SAP synchornous communication --If you are passing the file data to SAP, then you could use below function modules to verify date format in receiver RFC/BAPI or inbound IDOC program. If the sy-subrc is not 0 then don't process further.
CONVERT_DATE_FORMAT
ISU_DATE_FORMAT_CHECK
Thanks
Swarup -
RuntimeException in Message-Mapping transformatio
Hi all,
My XI server is successfully picking up a comma separated file from an FTP server and generating the corresponding XML:
<?xml version="1.0" encoding="utf-8" ?>
<ns:CondRec_MT xmlns:ns="http://namespace-ConditionRecords">
<Recordset>
<ConditionRecord>
<Usage>A</Usage>
<Table>018</Table>
<Application>M</Application>
<ConditionType>PB00</ConditionType>
<VarKey>00000039301300-340 2 0</VarKey>
<Material>1300-340</Material>
<Vendor>3930</Vendor>
<PurchasingOrg>2</PurchasingOrg>
<Infotype>0</Infotype>
<InfoRecord>5300003218</InfoRecord>
<CondRecordNo>0000020727</CondRecordNo>
<ValidFrom>30.05.2006</ValidFrom>
<ValidTo>31.12.9999</ValidTo>
<ScaleType>A</ScaleType>
<CalculatType>C</CalculatType>
<KBETR>15.00</KBETR>
<CondCurrency>USD</CondCurrency>
<CondItemIndex>01</CondItemIndex>
<RelToPricing>X</RelToPricing>
</ConditionRecord>
</Recordset>
</ns:CondRec_MT>
But nothing is getting submitted to the receiver adapter.
The error in SXMB_MONI reads as follows:
<?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="">
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
<SAP:P1>com/sap/xi/tf/_file2file_mm_</SAP:P1>
<SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
<SAP:P3>RuntimeException in Message-Mapping transformatio~</SAP:P3>
<SAP:P4 />
<SAP:AdditionalText />
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack>During the application mapping com/sap/xi/tf/_file2file_mm_ a com.sap.aii.utilxi.misc.api.BaseRuntimeException was thrown: RuntimeException in Message-Mapping transformatio~</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
I am using a simple one to one mapping(i.e the same msg type is being used for both the outbound and inbound interface).
Pls can anybody guide me as to what can be the probable error.
Thanks in advance
Regards
NeetuHi all,
Thanks for ur prompt responses.
I followed the blog and performed testing of the mapping.
The XML with which i tried was as follows:
<?xml version="1.0" encoding="utf-8"?>
<ns:CondRec_MT xmlns:ns="http://namespace-ConditionRecords">
<Recordset>
<ConditionRecord>
<Usage>A</Usage>
<Table>018</Table>
<Application>M</Application>
<ConditionType>PB00</ConditionType>
<VarKey>00000039301300-340 2 0</VarKey>
<Material>1300-340</Material>
<Vendor>3930</Vendor>
<PurchasingOrg>2</PurchasingOrg>
<Infotype>0</Infotype>
<InfoRecord>5300003218</InfoRecord>
<CondRecordNo>0000020727</CondRecordNo>
<ValidFrom>30.05.2006</ValidFrom>
<ValidTo>31.12.9999</ValidTo>
<ScaleType>A</ScaleType>
<CalculatType>C</CalculatType>
<KBETR>15.00</KBETR>
<CondCurrency>USD</CondCurrency>
<CondItemIndex>01</CondItemIndex>
<RelToPricing>X</RelToPricing>
</ConditionRecord>
</Recordset>
</ns:CondRec_MT>
this gave the following error:
Cannot produce target element /ns:CondRec_MT/ConditionRecord. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd
But when i removed the tag 'RECORDSET', it works fine and output gets genersted.
My datatype has no such field called recordset.
The adapter generates it on its on.
How do i solve this issue.
Regards
Neetu -
Exception in Message mapping for JDBC - XI- file
Hi,
In the above scenario, Sender JDBC adapter has processed the message but when i checked the processed XML messages, its giving an error message with details
<i>During the application mapping
com/sap/xi/tf/_MM_XXXX_a
com.sap.aii.utilxi.misc.api.BaseRuntimeException
was thrown: RuntimeException in Message-Mapping
transformatio~</i>
how to make the source structure so that it gets correctly populated with the result set of sender JDBC adapter? Are there any constraints while making the Data type for the source structure?
Regards,
Nitin Aggarwal.Hi,
The problem is solved...
Actually, the runtime system was not able to map the result set generated by the Sender JDBC adapter to the source structure of message mapping. This was because the result set has a particular structure and its like
<resultset>
<row>
<column1>value1</column1>
<column2>value2<column2>
</row>
</resultset>
To map this kind of structure to the source structure, a <b>row</b> element should always be there below the root node and the structure fields should be placed as sub elements to row. One more thing the root node of the source structure should be same as the document name specified in the sender JDBC adapter config.
Anyways, Thanks to all for the valuable efforts.
Regards,
Nitin. -
Hi All.
I created a message mapping from a custom message type towards MATMAS_BAPI01.
I disabled the EDI_DC40 field and in the idoc communication channel I disabled "Apply control record values from payload".
When I check the final idoc message created, I noticed that some EDI_DC40 parameters were wrong.
<SAP:TABNAM>EDI_DC40</SAP:TABNAM>
<SAP:MANDT>200</SAP:MANDT>
<SAP:DOCREL>640</SAP:DOCREL>
<SAP:DOCNUM>0000000000037246</SAP:DOCNUM>
<SAP:DIRECT>2</SAP:DIRECT>
<SAP:IDOCTYP>MATMAS_BAPI01</SAP:IDOCTYP>
<SAP:CIMTYP />
<SAP:MESTYP>MATMAS_BAPI</SAP:MESTYP>
<SAP:MESCOD />
<SAP:MESFCT />
<SAP:SNDPOR>SAPCX1</SAP:SNDPOR>
<SAP:SNDPRN>host01</SAP:SNDPRN>
<SAP:SNDPRT>LS</SAP:SNDPRT>
<SAP:SNDPFC />
<SAP:RCVPOR>CFDCLNT200</SAP:RCVPOR>
<SAP:RCVPRN>CFDCLNT200</SAP:RCVPRN>
<SAP:RCVPRT>LS</SAP:RCVPRT>
<SAP:RCVPFC />
<SAP:TEST />
<SAP:SERIAL />
<SAP:EXPRSS />
<SAP:STD />
<SAP:STDVRS />
<SAP:STATUS>03</SAP:STATUS>
<SAP:OUTMOD />
<SAP:SNDSAD />
<SAP:SNDLAD />
<SAP:RCVSAD />
<SAP:RCVLAD />
<SAP:STDMES />
<SAP:REFINT />
<SAP:REFGRP />
<SAP:REFMES />
<SAP:CREDAT>2005-09-12</SAP:CREDAT>
<SAP:CRETIM>23:21:31</SAP:CRETIM>
<SAP:ARCKEY>2FE85D8023D311DA9BDB000D56B9D8A6</SAP:ARCKEY> </SAP:IDocOutbound>
In concrete
<SAP:SNDPRN>host01</SAP:SNDPRN> had to be changed into <SAP:SNDPRN>hostXX</SAP:SNDPRN>. I thought the value host01 came from the sld (logical system name of the technical system attached to the business system), so I changed that towards hostXX.
<SAP:RCVPOR>CFDCLNT200</SAP:RCVPOR> had to be changed into <SAP:RCVPOR>SAPCDD</SAP:RCVPOR>. I thought this value came from the rfc destination in the xi sytem, so I created a new one called SAPCDD and configured it into the idoc adapter.
However, this change in the sld/XI system did not affect the generated idoc (no, I did not forget to activate ).
I decided to do some more drastic changes:
- enable EDI_DC40 field in the message mapping
- enable "Apply control record values from payload" in the idoc communication channel
I now hardcode the wanted values.
After activating the changes, still the same idoc is send towards the R/3 system.
Can anyone tell me what I am doing wrong.
Is it a caching problem or am I doing something wrong.
Kind regardshi Geert,
take a look at my weblog:
/people/michal.krawczyk2/blog/2005/09/01/xi-idoc-adapter--edidc40--demystified
it may answer some of your questions:)
Regards,
michal -
HI I am calling a Java Mapping Prog from My message Mapping . I get A strange Message when i pass special characters like '?' or '*' through my message mapping to the java mapping .
The Message is <b>"For input string : ???". </b> when i pass ??? as a parameter to the java mapping. I am bit confused. Is This message a standard message that XI gives or is it getting generated from somewhere else.
regards
Nilesh .Hi Nilesh ,
Test the java mapping program using a seperate main class in some editor ( eg. Eclipse or NWDS) ,
Try to debug the program and u will get to know the cause , as to whr the message is getting generated ,
Regards ,
Sushil -
Hello Expert
I am woking in IS retail Outbound Scenario for article master where enhancement segment E1WXX01 repeat multiple time and contain different -2 value and I want to collect that different value in different Target filed
Suppose
When first time segment E1WXX01 come contain
fldname Zcolor
Fldvalue red
Target field Color
In second time segment E1WXX01 contain value
fldname ZSIZE
Fldvalue 40
Target filed SIZE
And so on
I want configure that scenario with the help of graphical message mapping
Thanks
Amit ShivhareHi Shakif,
<b>CONTEXT CHANGE</b>
Please go through these links which clearly explains context and context changes in mapping.....
http://help.sap.com/saphelp_nw04/helpdata/en/40/7b8e40496f6f1de10000000a1550b0/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/35/fb8c4057d5701de10000000a1550b0/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/42/f7293b2dbe1a71e10000000a422035/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/79/2835b7848c458bb42cf8de0bcc1ace/frameset.htm
Go thru this guide~good source
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
<b>REMOVE CONTEXT</b>
Remove context removes all the higher-level contexts of a source field thereby delete all hierarchy levels and generate a list.In simple form
removes all top hierarchy levels, so that all elements of the target queue are assigned to a root element of the source queue
<b>SPLIT BY VALUE</b>
The SplitByValue () function is the counterpart to removeContexts(): Instead of deleting a context, we can insert a context change in the source value queue. We then receive this element for each inserted context change instead of a top node element. However, for this to be possible, the top node source field must be assigned a top node target field and minOccurs must be >0. A maximum of minOccurs top node target fields can be inserted here.
We can insert a context change in the queue after each value, after each change to the value, or after each tag without a value.
refer this for node functions
http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/2d8c4024d26e1de10000000a1550b0/content.htm
Cheers...
Vasu
<b>** REward POints if found useful **</b> -
Regarding Message Mapping in JDBC Scenario
Hello Experts,
I got struct up in message mapping. In message mapping we can able to see different types of Functions. So I need some clarifications on it. Functions are available like...
Conversions
Boolean
Node Functions
Constants
Date
Text
Static
Arithmetic
So please explain in simple for each functions.
Points will be rewarded.
Thank youHi
*Boolean*:-
And -- checks for 2condition, return a true value if both condition are satisfied
Or --checks for 2condition, return a true value if one condition is true.
Not - checks if the condition is not equal to.
Equals - Check whether 2 Boolean values are equal
NotEquals
If u2013 Returns second value if the first argument is true. otherwise returns third argument
If WithoutElse u2013 Returns value of second argument, if first argument is true.
Node Functions:-
createIf - Produces empty value if argument is true; Resultlist.SUPPRESS otherwise
removeContexts u2013 Produces plain stream of values with No context changes
replaceValue u2013 replaces value of source field to value specified in Function Properties.
Exists u2013 Returns true, if Node exists otherwise false
SplitByValue u2013 inserts context changes after event specified
collapseContexts u2013 Produces one empty string value out of each arguments context. All arguments are in one context
useOneAsMany u2013 Use First Argument as IS on same level as third argument. second argument defines when next value of first argument is used
sort u2013 sorts values in each context
sortByKey u2013 Sorts values in second queue by keys from first queue
mapwithDefault u2013 Inserts default values specified in the function properties into empty contexts
formatByExample u2013 Takes values from the first queue and inserts them in the structure of second queue.
Constants:-
Constant u2013 Generates constant value
CopyValue u2013 Takes specified value in argument stream and copies it an infinite number of times
Sender u2013 Sender System
Receiver u2013 Receiver System
Date:-
CurrentDate u2013 Return current date in specified format
DateTrans u2013 Transforms date from input format to output format
Dateafter u2013 Returns True if first date is after second otherwise false
DAteBefore - Returns True if first date is before second otherwise false
CompareDates u2013 Compares two dates
Text:-
Substring u2013 Returns substring depending upon the given parameters
Concat u2013 concatenates 2 strings inserting delimiter string parameter between them
Equals u2013 Check whether Strings are equal
indexOf2 u2013 returns the index where the second string is found for the first time in the first string
indexOf3 u2013 As with indexOf with 2 parameters, But starting search at the specified position
lastindexOf2 u2013 Returns the index where the second string is found for the last time in the first string
lastIndexOf3 u2013 As with lastIndexOf with 2 parameters starting search at the specified position
compare u2013 compares 2 strings lexicographically
replaceString u2013 Replaces each occurrence of pattern(2nd argument ) of source string(1st arg). By third string
length u2013 returns length of string
endsWith u2013 Tests whether string ends with specified suffix
startsWith2 u2013 Tests whether string starts with specified prefix
startsWith3 u2013 Tests whether string starts with specified prefix beginning at specified location
toUpperCase u2013 Converts all characters in string to upper case
trim u2013 Removes white space from both ends of string
toLowerCase u2013 Converts all characters in String to Lower case
Statistic:-
sum u2013 calculates sum of all numbers in each context
average u2013 calculates the average of all numbers in each context
count u2013 Counts number of values in each context
Index u2013 For each incoming value, this Function returns the index number of the incoming value in the context, String from the initial index and increasing by the increment defined in the parameters.
Arithmetic:-
Add u2013 add two values
Subtract u2013 subtracts second value from the first value
equalsA u2013 Returns true; If float numbers represented by argument strings are equal otherwise returns false
abs u2013 returns Absolute value of argument
sqrt u2013 Returns square root of the number
sqr u2013 Returns square of the number
sign u2013 Returns -1 if number is negative, +1 if positive, 0 if 0
neg u2013 Multiplies number to -1
1/x u2013 calculates 1/x
Power u2013 Returns value of the first argument to the power of the second argument
Less u2013 Returns true if the first number is less than the second number otherwise false
Greater - Returns true if the first number is greater than the second number otherwise false
Multiply u2013 Multiplies 2 values
Divide u2013 Divides first value by the second value
Max u2013 Returns maximum of 2 numbers
Min u2013 Returns Minimum of the 2 numbers
Ceil u2013 Returns the smallest (closest to the negative infinity) initial value that is not less than the argument and it is equal to the mathematical integer.
Floor - Returns the largest (closest to the negative infinity) initial value that is not Greater than the argument and it is equal to the mathematical integer.
Round u2013 Returns closest initial value to the argument
Counter u2013 Counts number of invocations. Initial value and increment defined by Parameters.
FormatNum u2013 Formats Number with given pattern.
Conversions:-
FixValues u2013 Creates a Local Table to perform a value Mapping
ValueMapping u2013 Define jump to Value Mapping table of Integration Directory.
Message Mapping(Node Function) Part-1
Message Mapping Simplified - Part I
Sravaya Talanki- Message Mapping(Node Function) Part-2
/people/sravya.talanki2/blog/2005/12/08/message-mapping-simplified-150-part-ii
Standard Functions
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/frameset.htm
Advanced mapping function(mapwithdefault,formatbyexample,sort,sortbykey)
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9202d890-0201-0010-1588-adb5e89a6638
Hope this is useful
Saiyog
Edited by: Saiyog Gonsalves on Jul 11, 2008 1:14 PM -
Require a Message mapping for this Logic.
Hi Experts,
I require a Message mapping for this Logic.
In the Source there are 4 fields and, the Target side, the fields should appear like this.
Source Structure- File
Record
|-> Header
Order_No
Date
|-> Item
Mat_No
Quantity
Target Structure-IDoc
IDoc
|-> Header
|-> Segment
Delivery_Order_No
Recv_Date
|-> Item
|-> Segment
Delivery_Order_No
Material_Num
Recv_Quantity.
The Logic is for every Order number an IDOC is generated.And if the Material num matches then the quantity should be added. and important note is that the material numbers are different for every order number. That means if a material number is 2 in the order number A. Then the material number can never be 2 in any of the order numbers.Here is the following with an example for the above scenario.
For example:-
we have
Source Structure- File
Order-no Date Mat_No Quantity
1 01/02/2011 A 10
1 01/02/2011 B 15
1 01/02/2011 A 10
2 01/02/2011 C 10
2 01/02/2011 C 10
3 01/02/2011 D 20
3 01/02/2011 D 10
3 01/02/2011 E 25
Target Structure-IDoc
Delivery_Order_No Recv_Date Material_Num Recv_Quantity
1 01/02/2011 A 20
1 01/02/2011 B 15
2 01/02/2011 C 20
3 01/02/2011 D 30
3 01/02/2011 E 25
So for this example total of 5-Idocs created. That means for this example if Order_No is 1 When the Mat_No is A the quantity gets added. For this Scenario 1 IDoc with four Fields 2 in Header(Delivery_Order_No, Recv_Date) and 2 in Item(Material_Num, Recv_Quantity) is generated by adding the quantity field in the Target Side. Similarly if Order_No is 1 when the Mat_No is B then separate IDoc is generated with four Fields 2 in Header(Delivery_Order_No, Recv_Date) and 2 in Item(Material_Num, Recv_Quantity) in the Target Side. Similarly, if Order_No is 2 when the Mat_No is C, an IDoc is generated with four Fields 2 in Header(Delivery_Order_No, Recv_Date) and 2 in Item(Material_Num, Recv_Quantity) by adding the quantity field in the Target Side. ike wise the process goes on upto 3.Kindly do the needy..
Thanq very much in advance..
Edited by: Prashanth Bharadwaj on Oct 17, 2011 1:29 PMHi Prashanth,
Concatinate the two fields OrderNo and MaterialNo and follow the below logic which will resolve your problem.
concatinationOfOrderNo&MaterialNo>removecontext>sort>splitByValueChange>collapseContext-->IDOC
concatinationOfOrderNo&MaterialNo>removecontext>sort>splitByValueChange>collapseContext>splitByEachValue>subString(0,1)-->Delivery_Order_No
formatByExample>collapseContext>SplitByEachValue-->Recv_Date
FormatByExample:
input1:resulrOfSortByKey
input2:concatination>removecontext>sort-->SplitByValuChange
sortByKey:
input1:concatination-->removecontext
input2:date-->removecontext
concatinationOfOrderNo&MaterialNo>removecontext>sort>splitByValueChange>collapseContext>splitByEachValue>subString(1,1)-->Material_Num
formatByExample>sum>Recv_Quantity
FormatByExample:
input1:sortByKey
input2:concatination>removecontext>sort-->SplitByValueChange
SortByKey:
input1:concatination-->removecontext
input2:Quantity-->removeContext
Regards,
Priyanka. -
Get source FileName - RuntimeException during test of Message Mapping
Hi,
Inside a graphical mapping, I want to get the source file name, and then use it.
For that I use Michal's post inside a UdF: The specified item was not found.
And that works perfectly during the treatment (File -> Mapping -> IDoc)...
But my problem is when I try to test my Message Mapping inside the I.R (see tab "Test"), I have a RuntimeException due to the fact that DynamicConfiguration does not exist (obviously!) in the SOAP.
So I tryed to encapsulate the line "String ourSourceFileName = conf.get(key);" by a try/catch or by using the method "containsKey", but I have always the same RuntimeException...
is there someone who know how to catch this exception ?
Regards
Mickael
Note: JavaDoc is: http://help.sap.com/javadocs/NW04S/current/pi/com/sap/aii/mapping/api/DynamicConfigurationKey.htmlHi Progirl
yes... but it will be not really pratical for the maintenance to think everytimes that this "error" is not an error and to think to delete the link in order to realize a test and then to not forget to add (again) this link.
the risk is too important.
Hi Varun,
yes... but with the Test of Interface Mapping, I don't have the possibilty to see the Queue and all options than we have inside the Message Mapping... So it's will be not really practical for the maintenance.
The solution is really to catch this exception directly inside the UdF which generates this Exception.
I'm sure there is a Java solution for that, but not yet found the good syntax... I continue.
Regards.
Mickael -
Runtime Exception in Message mapping
Hi Experts,
I have a scenario of IDoc to <third party adapter> cXML.
The message caught the below error
RuntimeException in Message-Mapping transformation : Runtime exception during processing target field mapping ......./ShipTo[2]/Address/PostalAddress/DeliverTo (suppressed field). The message is: Exception:[java.lang.ArrayIndexOutOfBoundsException: 7] in class com.sap.xi.tf._M_IDOC_to_cXML_ method getShipToContact$[, , com.sap.aii.mappingtool.tf3.rt.Q2QFunctionWrapper@253fdd8a]
Please suggest on what went wrong, as everything is working fine before.
Thanks in advance.
MKMk:
Please check if the source fields which are mapped to the target are all generated by the SAP Script and make sure that they have data so that when they are mapped to the target. If they are mapped and source fields don't have data then it may error out. Sometimes SAP Script might not generate a node if there is not data for it, make sure you handle that condition also.
RuntimeException in Message-Mapping transformation is
due to the missing TEXT_LINE element in the segment Z1VOBTH for the TEXT_ID 'INVOICE_TO_LOCATION'
I am not able to understand this. is Text_ID subelement of Text_Line?? Could you please post the complete error message as it is.
Maybe you are looking for
-
Flash & XML Photo Gallery with Categories
Hello friends i am trying but i want to create Flash & XML Photo Gallery with Different Categories please help me
-
I changed my appleID but iCloud is still using the old one and no place to change it. How do I get iCloud to update to the new ID?
-
Hi guys, I am doing a BDC and i got an excel file that i need to upload into an internal table before i process it. I am defining an internal table as text and using GUI_UPLOAD with delimiter as '|' but i guess its not working. Can i try something el
-
Screensaver random photo order is not random?
Hi - in addition to removing a lot of the screensaver options (eg in Classic Mode the "stretch to fill screen" and "keep photos centered" options) that I posted about yesterday, I have also noticed that since my upgrade from Lion to Mountain Lion th
-
Retry count JMS message on Proxy Service
I have a proxy service listening to a JMS Queue. It is a task service. I need to try some functionality. If an error occurs (probably because of an offline external service/ business service) I need to rollback and retry). I want to do this for examp