on 2023 Jul 30 2:48 PM
I am creating MAG using Integration advisor for a mapping scenario where my target structure is an EDIFACT D.93A and source structure is IDOC.
The mapping requirement is to generate sequence number for LIN_1082 field. For example, if there are 3 LIN segments, LIN_1082 should be 1,2,3 and so on.
Using the below code but getting this error during simulation "Failed to simulate MAG: The context item for axis step xsl:document/element() is absent"
<xsl:value-of select="count(preceding-sibling::LIN)+1"/>
Please advise on how do we address this issue.
Hi Chandana,
You are using a target field in your determination, but your mapping needs to be based on the source data. Additionally, you should be able to use index functions or @position capabilities for your needs, but I should note that it would be unusual to not simply map POSEX directly from source to target in this context.
Regards,
Ryan Crosby
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the information Ryan, Just wanted to elaborate more on the issue. Mapping has been given from POSEX to LIN_1082 just to enable the target field but there is no source field value mapping required to target field. There is nothing to do with input source field (POSEX) to map the value in Target field (LIN_1082)
Requirement is to generate the unique sequence value and map it to Target. When I use this code (<xsl:value-of select="count(preceding-sibling::LIN)+1"/>) ,getting the error. Is there any way to generate unique sequence number to LIN_1082 field, please advise.
chandana_357 if the source field has no value then the mapping won't execute anything. You need to use a mandatory source field, and then you can use the @position attribute to assign a value that will be in sequence. Map the group level E1EDP01 to your target field and use the following XSLT code:
<xsl:sequence select="$nodes_in/E1EDP01/@position"/>
Hi Ryan,
Thank you for sharing your suggestions for using @position function. I tried using this function, and it works fine when you have a sequence of items from the source side. However, I have another scenario where a few of the materials have zero quantity. For example:
- Item1: 0 qty
- Item2: 10 qty
- Item3: 0 qty
- Item4: 20 qty
Expected output: IT101 = 1, 2 (because there are only two valid items in the source file)
The @position function gives the result: 2, 4.
Please let me know your thoughts on this.
Also, how do you handle this sequence in 856 hierarchical loops? I have not tried it yet, but it looks complicated.
Thanks,
Shafi
User | Count |
---|---|
71 | |
11 | |
10 | |
10 | |
10 | |
8 | |
7 | |
7 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.