cancel
Showing results for 
Search instead for 
Did you mean: 

ORDERS05 idoc to file

Former Member
0 Kudos

Hello everyone,

Dealing with PI for a few days and wasn't ready for this task: iDoc to structure scenario. Seemed simple until I found out that mapping a single multiline document to a structure is anything but easy... My target ("fed" from ORDRSP.ORDERS05) structure should look like this:

FieldBELNR = E1EDK01/BELNR always

FieldDATUM = E1EDK03/DATUM for QUALF=002 always

FieldPARTN1 = E1EDKA1/PARTN for PARVW=ZY always

FieldPARTN2 = E1EDKA1/PARTN for PARVW=ZS always

FieldMATNR = E1EDP01/E1EDP19/IDTNR for QUALF=002 one for every line

FieldMYCODE = value based on E1EDK14/ORGID for QUALF=012 always

FieldNETVALUE = E1EDP01/E1EDP05/BETRG for ALCKZ=+ one for every line

FieldFLAG = constant ("0") always

After a few efforts I have ended up either with empty XML or a mapping error. This is happening due to my complete awareness on the cardinality of the target structure and of the node functions that I was just introduced to thanks to the forum here. To make a long story short:

a) My structure looks like this - all fields have to be populated - is the structure OK?

TARGET_DT

Complex Type

   Statement1

Element

1..unbounded

       dbTableName

Element

1

          Action

Attribute

xsd:string

required

          Table

Element

xsd:string

1

            Access

Element

1

                ID (DISABLED)

Element

xsd:string

1

                   hasQuot

Attribute

xsd:string

optional

                FieldBELNR

Element

xsd:string

1

                   hasQuot

Attribute

xsd:string

optional

                FieldDATUM

Element

xsd:string

1

                    hasQuot

Attribute

xsd:string

optional

                 FieldPARTN1

Element

xsd:string

1

                    hasQuot

Attribute

xsd:string

optional

                 FieldPARTN2

Element

xsd:string

1

                    hasQuot

Attribute

xsd:string

optional

                 FieldMATNR

Element

xsd:string

1

                    hasQuot

Attribute

xsd:string

optional

                 FieldMYCODE

Element

xsd:string

1

                    hasQuot

Attribute

xsd:string

optional

                 FieldNETVALUE

Element

xsd:string

1

                    hasQuot

Attribute

xsd:string

optional

                 FieldFLAG

Element

xsd:string

1

                    hasQuot

Attribute

xsd:string

optional

             key

Element

1

                 FieldBELNR

Element

xsd:string

1

                    hasQuot

Attribute

xsd:string

optional

                 FieldMATNR

Element

xsd:string

1

                    hasQuot

Attribute

xsd:string

optional

b) IF my target structure is OK, the problem must be my node functions - WHICH node functions I should use and WHERE? My guess is that I have to use some combination of "UseOneAsMany" for the "always" fields and a mix of "removeContexts", "SplitByValue" and maybe some aditional similar spicy stuff for the "one for every line" fields.

Any help would be appreciated since I don't know if I'm inches or miles away from the truth - thanks in advance 🙂

Accepted Solutions (1)

Accepted Solutions (1)

former_member208404
Participant
0 Kudos
Former Member
0 Kudos

The target structure is for JDBC adapter. You can’t use it as file. What you mapped with Action ( store procedure) and Table ( target DB table ) field ?  any why receiver need a JDBC structure as File?

Former Member
0 Kudos

Indeed is - it will update an SQL server table. Good enough to know that my structure is OK so I can concentrate on the node functions - now, I have to do some reading on the links provided above before coming back on the issue. Thanks to everybody for posting the relevant links above '-)

Answers (3)

Answers (3)

Former Member
0 Kudos

It was actually all about basic understanding of the node functions - everything's working fine - thanks everybody for helping out

Former Member
0 Kudos

Let me get this straight, are you writing to a File as in your title, or to JDBC as mentioned further on? Maybe you are just writing to file so that you know your XML structure is OK before dealing with the database?

In any case, if you want to create an output for when a segment QUALF=??? then set something like:

So in this case, you can see it found 4 E1EDK segments, but only 1 with QUALF=011

Is this what you are asking? Sorry if I misunderstood, but maybe you could break your question down to smaller parts.

Also, Riyaz made a nice tutorial on Node Functions / Context handling

http://www.riyaz.net/sap/xipi-introduction-to-context-handling-in-message-mapping/5/

Good luck!

Aaron

Former Member
0 Kudos

Hello,

It's actually a JDBC output - a typing mistake upon creating the thread. Actually, after knowing that my structure is OK, in terms of cardinality, Riyaz's article is (along with the links posted by the people above) is exactly what I'm looking for. Read a lot of his articles regarding other PI concepts but missed this one 🙂

Have what I need. Hope I will return to the thread just to close the issue - thanks!

nabendu_sen
Active Contributor
0 Kudos

Hi Gregory,

I hope you are using the below Receiver JDBC Structure provided by SAP.

http://help.sap.com/saphelp_nw04/helpdata/en/4d/8c103e05df2e4b95cbcc68fed61705/frameset.htm

If Attributes are optional, then the Structure seems OK. For the Node Functions it is very difficult to describe. May be you can do some hands on with the below docs and let us know if you want to achieve any critical functionality for any specific field:

http://wiki.sdn.sap.com/wiki/display/XI/Standard+Functions+in+PI+7.0

http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm