cancel
Showing results for 
Search instead for 
Did you mean: 

need to generate 2 idoc"mapping issue"

Former Member
0 Kudos

Hi Experts,

When the Purchase_order_type is coming like HIGH,REGULAR,NEW,BOUNCED. In this case i need to generate 2 idoc, based on HIGH is one and Other than HIGH is one, even though if it's REGULAR,NEW,BOUNCED.

I can't generate. pl suggest

rgds

selvam

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Try to apply the below logic..

Purchase_order_typeremovecontextfixvaluesSplitbyValue(ValueChange)collapsecontext--Target

FixValue:

REGULAR -


> C

NEW -


> C

BOUNCED -


> C

Regards,

Prakasu.M

Former Member
0 Kudos

Refer my last ans from this thread..

Former Member
0 Kudos

Hi,

i already mentioned. I got 4 idoc when 4 different Purchase_order_type,it's working fine. Here the problem is i need only 2 idoc based on Purchase_order_type=HIGH for one. Remaining 3 category of Purchase_order_type i want only one idoc.

Here already set occurrence for unbounded. please suggest.

rgds

selvam

Former Member
0 Kudos

Well then in this case best solution could be just duplicating the IDOC in mapping. And in this case can use the std IDOC rather using the external definition.

Right click on the IDOC select "Duplicate Subtree", by this way there will be two IDOCs.

Now on first IDOC use condition if Purchase_order_type=HIGH then create the IDOC.

Similarly put conditions on second IDOC and check if Purchase_order_type NE HIGH then create the second IDOC.

And do rest of the mappings in each IDOC as per your need.

Regards,

Sarvesh

Former Member
0 Kudos

Hi Sarvesh,

Thanks for ur reply...

When Purchase_order_type=HIGH there is no problem. But Purchase_order_type NOTEQ to HIGH it's creating 3 idoc.

Bcoz i have 3 different category like Regular,New and Bounced. For this case also i want only one idoc, under i have to repeat the line items. Line item repeating i don't have problem.

Other than HIGH i need to make a group then i'll get single idoc... how can i do?

please suggest...

rgds

selvam

Former Member
0 Kudos

If you are using duplicate substring method, as I mentioned my previous reply then on second IDOC put conditions with simple "ifWithoutElse" and check PO type not equal to HING then map a constant 1 to IDOC segment, so that every time it generate only single IDOC (second IDOC).

IF----> Purchase_order_type NOTEQ to HIGH---> THEN--->(Constant "1")---->Second IDOC

Former Member
0 Kudos

Hi Sarvesh,

I was tried this method also it's generate 3 idoc's. please suggest any other method.

rgds

selvam

Former Member
0 Kudos

check if you are getting value "1" more than in diff contexts as output from your if condition.

use removeContexts function after if.

Suresh

Former Member
0 Kudos

Hi,

i tried this method also... but no use...pl suggest

rgds

selvam

Former Member
0 Kudos

What is the logic being used in your If condition? Could you put that here?

Former Member
0 Kudos

Hi

if purchase_order_type--->equal to HIGH--->then--->purchase_order_type---->idoc1

if purchase_order_type--->Notequal to HIGH--->then--->constant"1"---->removecontext----->idoc2

rgds

selvam

Former Member
0 Kudos

Try using Colapse Context after remove context for IDOC 2.

-Gouri

Former Member
0 Kudos

>

if purchase_order_type--->equal to HIGH--->then--->purchase_order_type---->idoc1

In above mapping also just use constant 1 instead of using purchase order type e.g.

if purchase_order_type->equal to HIGH->then->constant 1-->idoc1

Mapping for second IDOC looks ok.

Just correct the mapping for IDOC 1 and it will work.

Former Member
0 Kudos

Hi,

sender Database input like this:

cq_no     Purchase_order_type           Line_no
 1            High		            1
 1            High                          2
 1            New                           3
 1            Bounced                       4
 1            Regular                       5
 2            High                          1
 2            New                           2
 3            High		            1
 3            Bounced   		    2

in this case based on cq_no category if the purchase_order_type is equal to High for one idoc, and not equal to High for one idoc.In this same case purchase_order_type get repeated with different line_no,so for that time line itms should get repeated under the same idoc based on line_no.As well as non-High category all details comes under single idoc.

when cq_no is changed again the same above conditions should applied...

now i got two idoc's but line item's are not getting repeated properly...even am bit confused how to apply the logic with cq_no...

pl suggest...

rgds

selvam

Former Member
0 Kudos

Can you give an example of your desired result for your above input.

Former Member
0 Kudos

Hi Sarvesh,

my expected output like this:

cq_no               purchase_order_type            line_no             output(idoc)
  1                                 HIGH             1         ||
  1                                 HIGH             2         ||        1st idoc with two line items

  1                                New               3         ||
  1                                Bounced           4         ||        2nd idoc with three line items
  1                                Regular           5         ||

  2                                 HIGH             1         ||       3rd idoc

  2                                 New              2         ||       4th idoc

  3                                 HIGH             1         ||        5th idoc

  3                                 Bounced          2         ||         6th idoc

please suggest....

rgds

selvam

Former Member
0 Kudos

Hi,

Please make sure you will sort the data in your select query.

Now, you need to have two idocs in mapping. Click on Duplicate Subtree to have second IDOC. Now lets assume, your first IDOC represents mapping when ORDER TYPE is HIGH and your second IDOC represents mapping when your ORDER TYPE is not equal to HIGH that is NEW, BOUNCED, REGULAR etc.

I have defined Source and Target data type as follows.

Source Data Type:

SDN

<Row>

<CQ_NO/>

<ORDER_TYPE/>

<LINE_NO/>

</Row>

Target Data Type:

SDNTarget

<IDOC>

<Node>

<CQ_NO/>

<ORDER_TYPE/>

<ItemNode>

<LINENO/>

</ItemNode>

</Node>

</IDOC>

Mapping for IDOC 1:

IDOC:

Order Type -->Fix Values --> remove context

Fix Values (This should have default u201Cfalseu201D and HIGH = true)

Concatenate Output of point 1 with CQ_NO (Context of CQ_NO should be at SDN)

Output of point 3 --> Split by value (value changed) -->collapse context

Output of point 4 will be first input to u201CStart withu201D function and second input will be constant u201Ctrueu201D

Output of Point 5 --> create if --> IDOC

Node:

Map with constant

CQ_NO:

Order Type --> Fix Values --> remove context

Fix Values (This should have default u201Cfalseu201D and HIGH = true)

Concatenate Output of point 1 with CQ_NO (Context of CQ_NO should be at SDN)

Output of point 3 --> Split by value (value changed)

User Format By example. Pass CQ_NO (Context of CQ_NO should be at Row) as first input and second input should be output of point 4.

Pass Output of format by example that is point no 5, to collapse context --> Split by value (Each Value) --> CQ_NO

ORDER_TYPE

Order Type --> Fix Values --> remove context

Fix Values (This should have default u201Cfalseu201D and HIGH = true)

Concatenate Output of point 1 with CQ_NO (Context of CQ_NO should be at SDN)

Output of point 3 --> Split by value (value changed)

User Format By example. Pass ORDER_TYPE (Context of CQ_NO should be at Row) as first input and second input should be output of point 4.

Item Node:

Order Type --> Fix Values --> remove context

Fix Values (This should have default u201Cfalseu201D and HIGH = true)

Concatenate Output of point 1 with CQ_NO (Context of CQ_NO should be at SDN)

Output of point 3 --> Split by value (value changed)

Output of point 4 will be first input to u201CStart withu201D function and second input will be constant u201Ctrueu201D

Output of Point 5 --> create if --> IDOC

Former Member
0 Kudos

Node:

Order Type --> Fix Values --> remove context

Fix Values (This should have default u201Ctrueu201D and HIGH = false)

Concatenate Output of point 1 with CQ_NO (Context of CQ_NO should be at SDN)

Output of point 3 --> Split by value (value changed)

Output of point 4 will be first input to u201CStart withu201D function and second input will be constant u201Ctrueu201D

Output of Point 5 --> create if --> Node

CQ_NO:

Order Type --> Fix Values --> remove context

Fix Values (This should have default u201Ctrueu201D and HIGH = false)

Concatenate Output of point 1 with CQ_NO (Context of CQ_NO should be at SDN)

Output of point 3 --> Split by value (value changed)

User Format By example. Pass CQ_NO (Context of CQ_NO should be at Row) as first input and second input should be output of point 4.

Pass Output of format by example that is point no 5 --> Split by value (Each Value) --> CQ_NO

ORDER_TYPE

Order Type --> Fix Values --> remove context

Fix Values (This should have default u201Ctrueu201D and HIGH = false)

Concatenate Output of point 1 with CQ_NO (Context of CQ_NO should be at SDN)

Output of point 3 --> Split by value (value changed)

User Format By example. Pass ORDER_TYPE (Context of CQ_NO should be at Row) as first input and second input should be output of point 4.

Pass Output of format by example that is point no 5 --> Split by value (Each Value) -> ORDER_TYPE

Item Node

Map with constant

LINE_NO:

Order Type --> Fix Values --> remove context

Fix Values (This should have default u201Ctrueu201D and HIGH = false)

Concatenate Output of point 1 with CQ_NO (Context of CQ_NO should be at SDN)

Output of point 3 --> Split by value (value changed)

Output of point 4 will be first input to u201CStart withu201D function and second input will be constant u201Ctrueu201D

Output of point 5 --> Split by value (each value)

Output of point 6 should be passed to if condition of u201CIf without elseu201D and in then pass LINE_NO with context Row

Output of Point 7 --> Split by value (Each Value) --> Line No.

This will give desired output.

Let me know if you need screen shots.

Warm Regards,

Gouri

Former Member
0 Kudos

In first IDOC:

Line No:

Ordertype--> Fix Values --> remove context

Fix Values (This should have default u201Ctrueu201D and HIGH = false)

Concatenate Output of point 1 with CQ_NO (Context of CQ_NO should be at SDN)

Output of point 3 --> Split by value (value changed)

User Format By example. Pass Line_no (Context of Line_NO should be at Row) as first input and second input should be output of point 4.

Pass Output of format by example that is point no 5 collapse context --> Split by value (Each Value) --> LINE_NO

Former Member
0 Kudos

Hi.

How did you map the IDOC?

Former Member
0 Kudos

hi,

i was used like this,

Purchase_order_type-->removecontext-->splitbyvalue-->idoc

in this case am getting 4 idoc.But i want to get only 2 idoc, As per my question.

This is jdbc2idoc scenario.

rgds

selvam

Former Member
0 Kudos

The idoc can't generate multiple ocurrence , please change the ocurrence on XSD File and map again.

for more information please read the following link.

former_member187339
Active Contributor
0 Kudos

Hi Selvam,

Do a mapping like this

UPDATE just saw that you need only two IDocs


Purchase_order_type-->removecontext-->FixValues-->splitbyvalue(ValueChange)-->collapseContext-->splitbyValue-->doc

FixValues will have these entries
High                0
REGULAR       1
NEW                1
BOUNCED       1

Regards

Suraj

Former Member
0 Kudos

Hi Suraj,

thanks for ur reply...we got 2 idoc but in the second idoc it's carrying only Regular(purchase_order_type) records. We r not getting any records for type New and Bounced.

please suggest...

rgds

selvam

former_member187339
Active Contributor
0 Kudos

Hi Selvam.

The mapping which I suggested above is good to make 2 Idocs, but the mapping for all further fields should be done in such a way that records belonging to High stay in one context and all the remaining record (for the other three values) should stay in another context.

Regards

Suraj