cancel
Showing results for 
Search instead for 
Did you mean: 

create multiple idoc with multiple receivers based on value mapping table

Former Member
0 Kudos

Hi,

Scenario:

Step1 : sender sends a finance doc iin the form of an idoc. This idoc will have multiple line items based on profit center. Do determine the value of receiving comp code(header field) n receiving system(logical sys name) value mapping table has to be used.

Solution so far: I can put an rfc lookup for fetching receiving comp code from mapping table with i/p paraameter as profit center . And split the incoming idoc based on comp code value by using split by value. Now I need your advise 2 take this further.

Issue 1 : say the incoming idoc has 4 line seg wid 4 diff profit center

Profit center. Rec comp code. Recv sys

P1. C1. R1

P2. C2. R1

PS. C2. R1

P3. C3. R2

Nw using this info, I want 3 diff idocs to be created for each unique comp code.

Idoc 1 : for C1 wid one line item + 1 for reconsilation ( to be generated additionally)

Idoc2 : for C2 wid 2 line items + 1 for reconsilation

Idoc 3: for C3 wid 1 line item + 1 for reconsilation

Idoc 1 and idoc 2 shud be sent to R1.

Idoc 3 shud be sent to R2.

Kindly advise on this

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Prateek,

Yes, having the receiver determined at sender side and it being a part of the payload would ease d scenario. But business wants all value mapping tables 2 be maintained in PI to avoid customization at d sender end. That's whr we are facing d challenge now n need ur expertise.

Former Member
0 Kudos

Hi experts,

U all r pretty close, but let me put this more clearly.

Step1: create multiple idocs based on unique comp code - I'm able to do this using rfc lookup n split by value. So I get 3 idocs each for c1, c2 n c3.

Nw as per the values from value mapping table.

Idoc for c1 contains 1 line seg.

Idoc for c2 contains 2 line segs.

N idoc for c3 contains 1 line seg.

steps2 n 3, where I do not have a confirmed solution yet n need ur advise.

Step 2 : for each idoc generated I need 2 create n additional segment, mapping 4 which will be based on the values in the original segments for that idoc.

In d above scenario, idoc for c1 contains 1 line seg, nw I want 2 add one more seg to it. The amount and pisting key values in this segment wud be calculated based on the values of the amount and posting key belonging to the original segment in this idoc.

Similarly for idoc for c2 there are 2 segs, nw I need one more, means 3 in allm

Hence for idoc for c3, 1 orig already present + 1 more. = total 2.

Nw I need ur advise on how 2 generate this additional seg in each idocm

Step 3: when all dese 3 idocs are generated, ( in this case itz 3, in real time it can be n), I need to find their respective receivers using rfc lookup n then based on the receiver send 2 resp recvng systm

Nw how do I do this?

Please explain with examples if possible 4 bettr understanding.

u2020ђąu03B7kўu03C3u03C5 in advance.

prateek
Active Contributor
0 Kudos

Step 2: It appears that you need just one additional segment in all the segment. You may add one segment in the target side of mapping using Duplicate Subtree. As your mapping remaing same for all segments, this should be able to solve your purpose (if I understood it correctly).

Do you have possibility to determine the receiver (or at least receiver code) R1 at sender side and send as part of payload? You already have that information with you at sender, so shouldn't be a problem. This would simplify your scenario to a great extent.

Regards,

Prateek Raj Srivastava

former_member184681
Active Contributor
0 Kudos

Hi Faria,

As far as I understood, only after you have made the RFC Lookup in your mapping, do you know to which system you should send your message. Is that correct? Or does your message always have to be delivered to each receiver system, just splitting the content? In case of the latter, use extended (conditional) receiver determination to have your message duplicated for each receiver system, and use a separate mapping for each receiver system to deliver only required items. The only problem arises if you determine a receiver in receiver determination, and then in the mapping you get to know that some particlar receiver is not interested in that particular message. You would have to cancel this message from Message Mapping, preferably without raising an error. But I'm afraid I do not know any way of achieving this.

Hope this helps,

Greg

Former Member
0 Kudos

Please advise on this.

Former Member
0 Kudos

Hi,

First. I would recommend that you create an extended receiver determination. In the mapping for the ext. rec. det. you will create based on the company code all the receivers needed for your idoc.

Second. In the interface determination the receiver is already known, so what you need to make sure is that the mapping is only selecting the company codes for the receiver already found.

prateek
Active Contributor
0 Kudos

I am not sure if I completely understood what your actual doubt is. I guess the value mapping or RFC lookup thing is already working for you.

You mentioned "Nw using this info, I want 3 diff idocs to be created for each unique comp code." You can achieve this by using split byvalue with Value Change option. Have you already done that?

As per last 2 statements, you have to send Idocs to R1 and R2. As you are retrieving these values in mapping, you have to use enhanced receiver determination. This option uses a mapping to identify the receiver it should use.

Did any of this help? Am I even close to your real doubt?

Regards,

Prateek Raj Srivastava