Message mapping challenge in IDOC to EDI scenario
Dear PI message mapping experts,
I'm a newbie in PI and facing a mapping problem using graphical message mapping.
I'm in an IDOC (INVOIC.INVOICE02) to FILE (EDI) scenario.
Here after is the mapping i need to perform :
Source structure IDOC :
<E1EDKA1> (0..99)
<NAME1> A </NAME1> (0..1)
<NAME2> B </NAME2> (0..1)
<NAME3> C </NAME3> (0..1)
<NAME4> D </NAME4> (0..1)
</E1EDKA1>
Target structure :
<AccountingCustomerParty> (1..1)
<Party> (0..1)
<PartyName> (0..unbounded)
<Name>A</Name> (1..1)
</PartyName>
<PartyName>
<Name>B</Name>
</PartyName>
<PartyName>
<Name>C</Name>
</PartyName>
<PartyName>
<Name>D</Name>
</PartyName>
</Party>
</AccountingCustomerParty>
I know i have to play with context and queues with stanard function or UDF but cannot succeed to do it.
Could you please help me ?
Thanks in advance,
Alysee
One approach out of available few ways to implement this:
NAME1 - Exists - CreateIf - PartyName[0]
NAME2 - Exists - CreateIf - PartyName[1] (Create deuplicate segment)
NAME3 - Exists - CreateIf - PartyName[2] (Create deuplicate segment)
NAME4 - Exists - CreateIf - PartyName[3] (Create deuplicate segment)
Srikanth Srinivasan
Similar Messages
-
Context handling in message mapping for an IDoc to File Scenario
Hi,
Can somebody help me with this issue. I have an Idoc to file scenario. heres my idoc structure. Its a custom Idoc
Header (1..1)
Detail (0..Unbounded)
DependentDetail (0...Unbounded) Note: This dependentdetail is a subelement of Detail
Trailer(1...1)
I created my target structrure the same way as the Idoc structure.
My output is a simple text file. I need the output in this format
Header
Detail1
Dependentdetail1
DependentDetail2
DependentDetail3
Detail2
DependentDetail1
Dependentdetail2
Detail3
Detail4
Trailer
Since the Detail and Dependent Detail records are unbounded .
But right now i m getting my output like this:
Header
Detail1
Detail2
Detail3
Detail4
Trailer
But the DependentDetail record in not showing up in the output file. I didnot do any context change in my mapping. So do I need to do any context handling??...If so can somebody explain me with this.
Thanks,
Adam
Edited by: hymanroth on Apr 29, 2011 11:11 PMThanks Kenneth foryour quick reply,
Yes, I see the payload for Dependent detail in SXMB_MONI. So as you said earlier there's a problem with my content conversion.
my content conversion is as follows:
Header.fieldNames
Header.fieldFixedLengths
Header.endSeparator
Detail.fieldNames
Detail.fieldFixedLengths
Detail.endSeparator
DependentDetail.fieldNames
DependentDetail.fieldFixedLengths
DependentDetail.endSeparator
Trailer.fieldNames
Trailer.fieldFixedLengths
Trailer.endSeparator
So As I told earlier. With the above content conversion. I am not able to get the Dependent detail record in my output file. So If there is a change in my content conversion can u check it and tell me where I went wrong.
Thanks,
Harsh
Edited by: hymanroth on May 2, 2011 7:03 PM -
Message mapping issue in idoc to jdbc scenario
We have a scenario of idoc->XI-JDBC
the below given segment may get repeated , as shown below ,
E1EDP19[2]--idoc segment
QUALF---003
IDTNR---01000123(Bar Code No)
E1EDP19[3]--idoc segment
QUALF---003
IDTNR---20500000000034(EAN No)
Reqd mapping
if QUALF=003
THEN IDTNR----->Bar_code_Number_EAN
Now IDTNR has to be mapped with Bar_code_Number_EAN for the segment which comes last
Pl suggest how to map using graphical mapping for the above scenario.Hi Raj ,
The current mapping works fine if the parent segment E1EDP01 is only one but if that gets repeated then the last value of IDTNR is getting populated in the target side, very clearly i m giving the source and target structure and the mapping done using the UDF
Source structure
E1EDP01
E1EDP19[1]--idoc segment
QUALF---002
IDTNR---01000123(Bar Code No)
E1EDP19[2]--idoc segment
QUALF---003
IDTNR---01000123(Bar Code No)
E1EDP19[3]--idoc segment
QUALF---003
IDTNR---20500000000030(EAN No)
E1EDP01
E1EDP19[1]--idoc segment
QUALF---002
IDTNR---01000123(Bar Code No)
E1EDP19[2]--idoc segment
QUALF---003
IDTNR---01000123(Bar Code No)
E1EDP19[3]--idoc segment
QUALF---003
IDTNR---20500000000031(EAN No)
E1EDP01
E1EDP19[1]--idoc segment
QUALF---002
IDTNR---01000123(Bar Code No)
E1EDP19[2]--idoc segment
QUALF---003
IDTNR---01000123(Bar Code No)
E1EDP19[3]--idoc segment
QUALF---003
IDTNR---20500000000032(EAN No)
Target mapping
if QUALF=002
THEN IDTNR--->Article_No this is the direct mapping so , no issues
if QUALF=003
THEN IDTNR----->Bar_code_Number_EAN, now this IDTNR should get repeated every time the segment E1EDP01 gets repeated , currently only the last value form all the IDTNR is coming to the target side.
The current mapping works fine if the parent segment E1EDP01 is only one
Target structure
Access1
IDTNR--> Bar_code_Number_EAN( value is 20500000000030)
Access2
IDTNR--> Bar_code_Number_EAN( value is 20500000000031)
Access3
IDTNR--> Bar_code_Number_EAN( value is 20500000000032)
Current mapping
If QUALF = 003
Then QUALF ---->
mapBarCodeEAN---->Bar_code_Num_EAN
If QUALF = 003
Then IDTNR ---->
Context of QUALF is set to E1EDP01
Context of IDTNR is set to E1EDP01
thanks for your personalised help
rgds
mojib
Edited by: mohammad mojib ur rahman on Apr 9, 2010 1:30 PM -
Idoc to edi scenarios (mapping help is required)
hi expects ,
i am working on idoc to edi scenarios in which i am using seeburger abapter.and i have to use java mapping with using some standard function.
INPUT IDOC :
Name M/C Min Use Max Use Description
INPUT* M 1 1
Record EDI_DC40* C 0 1 Control Record
Record E2EDK01* C 0 1 Document Header General Data
Record E2EDK14* C 0 12 Header Organizational Data
Record E2EDK03* C 0 10 Header Date Segment
Record TEMP_DATE* C 0 1 Temporary Date Segment
Record DEL_DATE* C 0 1 Temporary Date Segment
Record E2EDK04* C 0 10 Header Taxes
Record E2EDK05* C 0 16 Header Conditions
Record E2EDKA1* C 0 99999 Header Partner Info
Record TEMP_SHIP_TO* C 0 1 Ship-to Info
Record TEMP_SOLD_TO* C 0 1 Sold-to Info
Record TEMP_PAYER* C 0 1 Payer Info
Record TEMP_CARRIER* C 0 1 Carrier Info
Record TEMP_DISCHARGE_PORT* C 0 1 Port of Discharge info
Record TEMP_NOTIFY* C 0 1 Notify Info
Record TEMP_NOTIFY_ALSO* C 0 1 Notify Also Info
Record TEMP_EXIT_PORT* C 0 1 Port of Exit Info
Record TEMP_CONSIGNEE* C 0 1 Consignee
Record TEMP_SHIPPER_INFO* C 0 1
Record E2EDK02* C 0 10 Header Reference Data
Record TEMP_E2EDK02* C 0 1 Temp E2EDK02
Record TEMP_PO_STRING* C 0 1 TEMP PO STRING
Record E2EDK17* C 0 999 Header Terms of Delivery
Record TEMP_E2EDK17* C 0 1 Temp transportation terms
Record E2EDK18* C 0 99 Header Terms of Payment
Record TEMP_TERMS* C 0 1
Record E2EDK35* C 0 10 Additional Data
Group E2EDKT1:2*
OUTPUT FIELD:
Segment B2* M 1 1 BEGINNING SEGMENT FOR SHIPMENT INFORMATION TRANSACTION
Segment B2A* C 0 1 SET PURPOSE
Segment N9:6* C 0 1 REFERENCE IDENTIFICATION
Segment N9:7* C 0 1 REFERENCE IDENTIFICATION
Segment N9:8* C 0 99 REFERENCE IDENTIFICATION
Segment N9:9* C 0 99 REFERENCE IDENTIFICATION
Segment N9:10* C 0 99 REFERENCE IDENTIFICATION
Segment N9:11* C 0 99 REFERENCE IDENTIFICATION
Segment CUR* C 0 1 CURRENCY
Segment ITD* C 0 1 TERMS OF SALE/DEFERRED TERMS OF SALE
Group DTM_GROUP* C 0 1
Segment DTM* C 0 1 DATE/TIME REFERENCE
Segment DTM:2* C 0 1 DATE/TIME REFERENCE
Segment DTM:3*Hi,
To do the mapping,,,,even you can go for graphical mapping....
But some of the context handling issues you need to deal with,
like....
1.Never map set context of source fields to element level but Segment level.
2. Always you need to check for qualifiers while mapping it to Traget field.
Thanks & Regards
Akshay.
Dont Forget TO Give Points. -
Mapping issue in idoc to JDBC scenario
mapping issue in idoc to JDBC scenario
source structure
E1KNB1M
BUKRS = 1000
E1KNB1M
BUKRS= 9000
E1KNB1M
BUKRS= 2000
THE NODE E1KNB1M is repeated many times and the field BUKRS is also repeated with E1KNB1M as above
TARGET field : ISFRANCHISE
if any where value of BUKRS =9000 we have to pass Y to the target filed, else N
if BUKRS = 9000 THEN ISFRANCHISE= Y
ELSE
ISFRANCHISE=N
I've done the mapping as below
BUKRS = 9000--> IF THEN Y ELSE N--
> ISFRANCHISE
BUT everry time the target value is N only
pl suggest
rgds
mojibmapped like this
BUKRS--->SORT---->
EQUALS --------IF---THEN Y
9000------------------------> ----------------->ISFRANCHISE
ELSE N
context of BUKRS set to parent node
its worked
thanks to all for valuable suggestions
rgds
mojib -
Dear All,
need your help on how to configure and deploy a scenario for a IDOC to EDI (856) . I believe this is like "IDoc to X12 - > X12 to EDI" using AS2 adapter. BASIS has configured the B2B addon installation and I am not sure about the EDI part in this scenario..
can you please inform what that the steps (A to Z) needs to be followed and would be great if example scenarios can be uploaded .
Thanks
FernandoHi Fernando,
I guess you're referring to this thread: IDOC to EDI scenario
For that reason, please do close this one.
Thank you.
Dimitri -
Doubt in fields - message mapping (file 2 idoc scenario)
while doing message mapping in file 2 idoc scenario, i could not able find the values for some field names
( i am following this wiki help
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/profile/2007/05/11/fileToIDOC& )
cremas04 idoc
vendorNo LIFNR
vendor name Name1
Pur_org ? ( I could not able locate field with the similar desc in idoc MT side)
Company code ?
Acc_Grp ?
Search term MCOD1
Address ADRNR
City ORT01
Pin_code PSLTZ
could you help me out with this?
Message was edited by: praba
prabahi,
I got the answer. -
Message mapping challenge for a newbie
Dear PI message mapping experts,
I'm a newbie in PI and facing a mapping problem using graphical message mapping.
I'm in an IDOC (INVOIC.INVOICE02) to FILE (EDI) scenario.
Here after is the mapping i need to perform :
Source structure IDOC :
<E1EDKA1> (0..99)
<NAME1> A </NAME1> (0..1)
<NAME2> B </NAME2> (0..1)
<NAME3> C </NAME3> (0..1)
<NAME4> D </NAME4> (0..1)
</E1EDKA1>
Target structure :
<AccountingCustomerParty> (1..1)
<Party> (0..1)
<PartyName> (0..unbounded)
<Name>A</Name> (1..1)
</PartyName>
<PartyName>
<Name>B</Name>
</PartyName>
<PartyName>
<Name>C</Name>
</PartyName>
<PartyName>
<Name>D</Name>
</PartyName>
</Party>
</AccountingCustomerParty>
I know i have to play with context and queues with stanard function or UDF but cannot succeed to do it.
Could you please help me ?
Thanks in advance,
AlyseeHi,
Please try as below:
1. Create a source structure
<AccountingCustomerParty> (1..1)
<Party> (0..1)
<PartyName> (0..unbounded)
<Name>A</Name> (1..1)
</PartyName>
</Party>
</AccountingCustomerParty>
2. When in message mapping, duplicate the node 'PartyName' 4 times. Right click on the 'PartyName' Node and you would find Duplicate Subtree.
3. Map 'Name1' field in the source to the first 'PartyName' node in the target. Similarly, map Name2, Name3 and Name4 fields to their respective 'PartyName' nodes.
4. Map the 'Name1' field in the source structure to first 'Name' field in the first 'PartyName' Node. Similarly, follow the same process for Name2, Name3 and Name4 fields. By doing so, your requirement would be met.
Thank you.
Regards,
Subbu -
Mapping from PEXR2002 iDoc to EDI 820
We are planning to use XI to map from the payment advice (PEXR2002) iDoc to EDI 820.
We have 2 options: (1) Use XI and an EDI adapter (e.g. Seeburger); or (2) Use XI's own mapping functionality.
If you have done iDoc to EDI mapping with either of the above 2 options, please briefly advise about your experiences and how much efforts it took to develop the mapping.
Thank-you
Bac QuanHi Bac,
Although it is possible to create an EDI message in an XI mapping (or XSLT), this is not very nice. The use of an EDI adapter (iWay or SeeBurger) is strongly recommended.
The other way around (rom EDI to XML) is hardly feasiable without an EDI adapter. Although I haven't worked the SeeBurger adapter, it looks quite nice.
Kind regards, Guy Crets -
IDOC to EDI Scenario using Seeburger....
Hi Experts,
On the Scenario IDOC to EDI when will I use As2 adapters or SFTP adapters of seeburger or just a simple FIle adapter?
and any idea what are the modules I need to import on my comm channel using file adapter?
Thanks.Hello
Check this blog: /people/rajeshkumar.pasupula/blog/2009/08/05/wanna-implement-seeburger-for-edi-find-the-booster
Regards
Mark -
Message Mapping - JDBC to IDoc
Hi,
I trying to map the resultset from a JDBC adapter (sender) to Inbound IDoc into SAP. I have problems with message mapping and after reading through a number of threads, I followed the following steps:
1. Download the IDoc definition as XSD.
2. Change occurrence of node IDOC to 1..unbounded.
3. Upload changed XSD as external definition and
4. use the external definition in the mapping.
After importing the external XSD definition the IDOC node turned red. How do I map this node, now that it is unbounded?
Example from Message mapping:
MT_ETA_RMX................ZSDETA01
..EtaNode........................IDOC (unbounded = RED)
....CARID.................................BEGIN
...............................................EDI_DC40
...............................................Z1RETA
.................................................SEGMENT
.................................................CARID
Thanks,
HenkHendrik,
whichever data record is occuring multiple on your sender JDBC message should be mapped to IDoc segment. It really depends on your JDBC message structure.
If EtaNode is occuring multiple times, and if based on EtaNode an IDoc has to be created, map that to IDOC and if per every CARID one idoc needs to be created, then use CreateIf and exists node functions to IDoc.
regards
SKM -
Multiple Message Mapping with same Idoc, Sender and Receiver
Hi,
We have one Interface sending INVOIC02 Idoc from SAP R3 4.6C to SAP R3 4.6C through XI 3.0.
On Inbound side we are using SAP standard configuring one Partner Profile with inbound INVOIC MM process code INVL.
In customizing, we have defined one invoic type for the EDI partner.
Now we have to integrate another type of inbound invoic, but in customizing it's not possible to assign more than one invoic type to the same Partner EDI.
So, we have a restriction in SAP 4.6C inbound standard. On the other hand, we can't desing two Integration Scenarios in XI 3.0 with the same idoc INVOIC02, for the same sender service and receiver service because Integration Directory doesn't allow to create two interface determination for them.
We are thinking on using header mapping in XI (receiver agreement to avoid use the same EDI partner profile for the inbound invoic, but we can't assign the same client and technical system with the same ALE Logical System in SLD for two different business systems.
Does anybody have any solution for this problem, SAP side or XI side?.
Thank you
Best regards
LuisHi!
In XI configuration - interface determination, you can specify more than one Inbound interface. If you identify more than one, you get a new column where you specify condition (xpath) for selecting between the different inbound interfaces.
In 4.6c, you can have more than one inbound invoic for the same EDI partner profile, if you separate between them using message function. Just add a new inbound parameter with a different message function, or copy the one you have and specify another message function, i,e. "DIFF".
Hope this helps.
Regards,
Oeystein -
Message Mapping - To Retrieve IDoc No. using Meesage ID
Hi Experts,
In a scenario where in File will be sent from Third Party to SAP which contains a Message ID, which is in reference to the acknowledgement of IDOC sent from SAP to Third Party.
Now what I need to find out is using this Message ID I need to Retrieve IDOC no. from the payload which was sent to third party in order to update the status of IDOC in SAP. So I suppose I need to write some user defined function and which will fetch the information from SAP PI tables.
So can you please guide me on what are the tables I can refer to have the IDoc No. from the payload and as I am not aware of writing UDF, it will be very useful if you provide me sample code for the same which I can refer in similar kind of case.
Please let me know if you need any clarification
Regards,
Nitin PatilHi Nitin,
You can create a UDF with following code.Pass Msgid as an input to this UDF.
Channel channel = LookupService.getChannel("ABCCLNT020","CC_RFC_Receiver");
RfcAccessor accessor = LookupService.getRfcAccessor(channel);
String rfcxml ="<ns0:Z_ZBXI_GET_IDOC_NUM xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\">" +
"<I_MSGID>"+ MSGID + "</I_MSGID>" +
"</ns0:Z_ZBXI_GET_IDOC_NUM> " ;
InputStream inputStream =new ByteArrayInputStream(rfcxml.getBytes());
XmlPayload payload = LookupService.getXmlPayload(inputStream);
Payload rfcOutPayload = accessor.call(payload);
InputStream in = rfcOutPayload.getContent();
ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
byte[] buffer = new byte[1024];
for (int read = in.read(buffer); read > 0; read = in.read(buffer)) {
out.write(buffer, 0, read);
String content = out.toString();
int Start_Index , End_Index ;
Start_Index = out.toString().indexOf("<E_DOCNUM>") + 10;
End_Index = out.toString().indexOf("</E_DOCNUM>") ;
String DOCNUM = out.toString().substring(Start_Index , End_Index);
return DOCNUM;
catch(Exception e)
throw new RuntimeException("Exception : "+e);
This FM has to be created in R/3:
FUNCTION Z_ZBXI_GET_IDOC_NUM.
""Local Interface:
*" IMPORTING
*" VALUE(I_MSGID) TYPE IDOCCARKEY
*" EXPORTING
*" VALUE(E_DOCNUM) TYPE EDI_DOCNUM
DATA: lv_arckey(52) type c,
lv_docnum TYPE EDI_DOCNUM,
lv_key like edidc-arckey,
lv_sys_id like sy-sysid,
lv_des_id type char10.
lv_sys_id = sy-sysid.
lv_arckey = i_msgid.
if lv_sys_id = 'ABCDev'.
lv_des_id = 'DEVCLNT010'.
elseif lv_sys_id = 'ABCTest'.
lv_des_id = 'TSTCLNT010'.
elseif lv_sys_id = 'ABCPrd'.
lv_des_id = 'PRDCLNT010'.
Endif.
shift lv_arckey by 20 places right.
select single DOCNUM from EDIDC into lv_docnum where ARCKEY = lv_arckey.
if sy-subrc = 0.
e_docnum = 0.
else.
e_docnum = 1.
endif.
ENDFUNCTION.
Let us know if it works.
Thanks.
Regards,
Shweta -
Mapping Error- In IDoc to File scenario
Hi Experts,
Got the Mapping error for one interface (IDoc to file). After comparing with successful message found that the field value (TDLINE) is not availbale in first segment (E1EDT10) in idoc for this failed one.
Mapping is :
TDLINE -- Exists --- Creatif --- Receiver field(in the file)
But here due to the the empty value in first segment the message is failed in XI system, next segment values is not trasmitted to the recever end(maping is the same above). To overcome this issue please suggest the suitable mapping design in IR.
Regards
MaheshHi,
After your CreateIf, use a "IfWithoutElse" by selecting the properties "Keep SUPPRESS Values". To do that, do a right click on IfWithoutElse, choose "Properties".
With this option, you will keep the fact that you have nothing in the source, and so the target context will have a "SUPPRESS" line. I have not THE solution, so do your own test.
If it's not enough, see also about the "mapWithDefault" (but that depends of your real rule).
Regards.
Mickael -
Mapping Problem in IDOC to XML scenario
hi,
In the target i have a tag which says:
Extrinsic 0..unbounded
name required
I have to map the above target to a source which comes from different IDOC segments.
E.g.
if E1EDP17.Qualf = '002' then map the E1EDP17.lktext to the "name"
if E1EDP17.Qualf = '001' then map the E1EDP17.lktext to the Extrinisc.
If data resides in other segments, how would i map those segments to the same output in xml.
Example:
<Extrinsic name="a">test</Extrinsic> -> this comes from E1EDP17 segment
<Extrinsic name="a">test</Extrinsic> -> comes from segment A
<Extrinsic name="a">test</Extrinsic> -> comes from segment B
How can i use a single Target to map from different sources if they are in different segments?
Any tips?
Thanks,
KP
Message was edited by: Tirumal Kumar PappuTirumal,
U will have to use comination of node functions like <b>exists</b> and <b>mapWithDefault</b>.
Are you sure that, E1EDP17.Qualf will have the value '002' or '001'.
There are some very good blogs on mapping by Sravya. Go through them and also go through the following link.
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm">sap help for Mapping</a>
Please reward if helpful
Maybe you are looking for
-
How to set a new DocumentBuilderFactory in my application?
Hello Suners, I really need some help to set a new DocumentBuilderFactory in my application. I have a new instance of DocumentBuilderFactory with my settings and i need to set it in the application so that it use it to show some special DOM elements.
-
How can I keep left- and right-aligned paragraphs together on the same line?
I am currently trying to typeset a menu. Basically, I want the Dish Title to be left-aligned and the Price right-aligned - but on the same line. I can achieve the effect by typing in a shift+tab after the Dish Title text and then inserting the price,
-
Problems downloading Flash Player for Wii
I've been having trouble downloading flashplayer for my wii. The wii's OS is Opera.... or at least what runs its internet browser. I'm constantly getting and error 240020... I don't understand what else to do
-
Does IBR support to extract text from office files
hi Experts, Can we use IBR to extract word/excel/ppt content to a text file? where is doc for this function? Best regards
-
New hard drive not showing on MacBook Start Up or Disk Utilities
Hi there, I have read a lot of forum information in the last hour and I am not sure what direction to take. I have a 2007 MacBook and my hardrive died so I have had a brand new Hitachi 5400rpm 1TB installed. i am unable to format it as it is not appe