cancel
Showing results for 
Search instead for 
Did you mean: 

ORDERS05 IDOC to flat file - mapping question

Former Member
0 Kudos

I have a requirement to convert an ORDERS05 IDOC to a "flat" structure for one of our vendors.

When the IDOC has the following data, the mapping works well

Input

=====

ORDERS05
   - E1EDP01
      POSEX        00010
      - E1EDPT1
          -E1EDPT2
             TDLINE   line 1 text
  - E1EDP01
      POSEX        00020
      - E1EDPT1
          -E1EDPT2
             TDLINE   line 2 text

Output

======

GWC
  - GWC08-RECORD
      GWC08-SEQNO      0010
      GWC08-TXT        line 1 text
  - GWC08-RECORD
      GWC08-SEQNO      0020
      GWC08-TXT        line 2 text

However when the IDOC has the following data

ORDERS05
  - E1EDP01
      POSEX        00010
  - E1EDP01
      POSEX        00020
      - E1EDPT1
          -E1EDPT2
             TDLINE   line 2 text

the mapping yields wrong results as below

GWC
  - GWC08-RECORD
      GWC08-SEQNO      0010
      GWC08-TXT        line 2 text

The vendor has a requirement that the GWC08-RECORD should only be sent if TDLINE exists in the IDOC - so that part works. However, Text on Line 2 is being associated with Line 1.

If I am not mistaken, this has to do with the Input queues for POSEX and that for TDLINE having differing number of entries. However, I have no idea how to go about fixing this

Appreciate any help on this

thanks

anil

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

That is really difficult.

The queues have to be aligned carefully:

E1EDP01 - exists - createIf - removeContexts - GWC08-RECORD

POSEX - GWC08-SEQNO

TDLINE(context=E1EDP01) - GWC08-TXT

Look in this Weblog, how the createIf keeps the order:

/people/stefan.grube/blog/2006/01/09/the-use-of-suppress-in-the-xi-30-graphical-mapping-tool

Regards

Stefan

Former Member
0 Kudos

Thank you for all the answers. The problem turned out to be even more complicated than I thought. We could have had

POSEX   0010
  Missing TDLINE
POSEX   0020
  TDLINE  line 2 text in English
  TDLINE  line 2 text in French

with a required output of

GWC08-RECORD
  GWC08-SEQNO  0020
  GWC08-TEXT   line 2 text in English
GWC08-RECORD
  GWC08-SEQNO  0020
  GWC08-TEXT   line 2 text in French

We couldn't do this with the standard functions in the graphical mapping tool - one of the guys in the team wrote a function to do this - basically align the messages on the TDLINE and POSEX queues, as you suggested Stefan

thanks

anil

Former Member
0 Kudos

Hi Anil,

Im doing a project where I'm facing the same problem with converting the IDOC ORDERS05 to a 'flat' structure. I have tried every possible option with graphical mapping tool, but it’s not possible to do this with graphical mapping tool and as you mentioned you solved this problem by writing a function.

Would you then be so kind to share this function with me. I really would appreciate this.

Kind regards,

Kamran

Former Member
0 Kudos

Hi, this can be done with the Function "useoneasmany"

POSEX 0010

Missing TDLINE

POSEX 0020

TDLINE line 2 text in English

TDLINE line 2 text in French

add the TDLINE as the third parameter in the function and use POSEX as the first parameter this will solve your issue.

thankx,

Shree

Former Member
0 Kudos

This problem couldn't indeed be done with a standard graphical mapping tool. You have to write a User Defined Function to solve this problem. We did write a Function to solve our problem as well.

Thanks,

Kamran

markangelo_dihiansan
Active Contributor
0 Kudos

Hi,

This is possible without UDF:

Please see mapping below:

For the node GWC08-RECORD


TDLINE --> removeContext --> GWC08-RECORD

For the node GWC08-SEQNO


TDLINE (set context to E1EDP01) --> exists --> ifWithoutElse --> removeContext --> SplitByValue:EachValue --> GWC08-SEQNO
POSEX ------------------------------------------>/

For the node GWC08-TXT


TDLINE (set context to E1EDP01) --> exists --> ifWithoutElse --> removeContext --> SplitByValue:EachValue --> GWC08-SEQNO
TDLINE (set context to E1EDP01)----------------->/

Hope this helps,

Regards

Former Member
0 Kudos

Hi,

Using Standard functions you can able to achive this.Try the below mapping.

1.TDLINEExitsCreateIfRemoveContextGWC08-RECORD

2. POSEX-UseOneAsMany-GWC08-SEQNO

E 1EDPT2----

TDLINEMapWithDefault--

3.TDLINEMapWithDefault--GWC08-TEXT

Regards,

Prakasu.M

Answers (8)

Answers (8)

Former Member
0 Kudos

I had the same problem.

You can use the PI standard function "Node Functions -> mapWithDefault"

please refer to http://help.sap.com/saphelp_nw04/helpdata/en/2c/2d8c4024d26e1de10000000a1550b0/frameset.htm

if TDLINE is null, a default is setted to TDLINE,then you can continue the following process.

I hope it helps.

Edited by: YONGHE ZHOU on Mar 17, 2009 11:11 AM

sridharreddy_kondam
Active Contributor
0 Kudos

Hi Anil,

We also faced same situation and we solved it by using this

Just Mapp like this

TDLINE> Exists> true ><b>if</b>> <b>then</b>

<b>if</b> tdline> length> greater than 0 <b>then</b> TDLine

now use remove context and map to GWC(target node)

this will definitely work...

If you are confused then give me your mail id..

I will send you the snap shot...

Thanks and Regards,

sridhar reddy

laurent_touillaud
Contributor
0 Kudos

Hi sridhar,

I'm facing the same problem.

Could you send me the snapshot?

Thanks,

Laurent.

(id : ltouillaud@yahoo.fr)

Message was edited by:

laurent touillaud

former_member181955
Contributor
0 Kudos

Hi Anil

In the first case: POSEX and TDLINE are filled with data.

ORDERS05

- E1EDP01

<b>POSEX</b> 00010

- E1EDPT1

-E1EDPT2

<b>TDLINE</b> line 1 text

- E1EDP01

<b>POSEX</b> 00020

- E1EDPT1

-E1EDPT2

<b>TDLINE</b> line 2 text

In Second case : TDLINE is missing in the first record.

ORDERS05

- E1EDP01

POSEX 00010

- E1EDP01

POSEX 00020

- E1EDPT1

-E1EDPT2

TDLINE line 2 text

Note: What i am suggesting is <b>if TDLINE is blant take some constant value.</b>.That means here you just use if-else condition .If TDLINE is blank take some constant else send actual data to this field.

If it is helped please let me know and assign points.

Thanks

N.Prasad Babu

iGATE Global Solutions Hyderabad ( 098490 65377)

Former Member
0 Kudos

Hi Anil,

Please go thru this thread.shud help u out..

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1...

cheers,

Prashanth

former_member91687
Active Contributor
0 Kudos
former_member187339
Active Contributor
0 Kudos

Hi Anil,

Try this :

TDLINE(context E1EDP01) ---> GWC08-RECORD

POSEX(context E1EDP01) ---> GWC08-SEQNO

TDLINE(context E1EDPT2) ---> GWC08-TXT

Regards

Suraj

bhavesh_kantilal
Active Contributor
0 Kudos

Hi Anil,

I think the following problem is coming because of a Context Change.

Check out the following links to understand better the functions available for handling contexts in XI,

http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm

Hope this helps,

Regards,

Bhavesh

Former Member
0 Kudos

Hi,

take a look at this how to document of converting idoc to file.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1...

cheers,

naveen