Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Complex Sync receiver JDBC scenario

Hi everyone,

Scenario - Web Service (async) -> PI -> JDBC (sync)

Request structure (not typing the standard format, but I am following that)-

<MT_req>

<Statement1> SELECT # 1

<access>

<filenumber/>

<segment1>

<field2>

.

.

</segment1>

<segment2>

<field2>

.

.

</segment2>

</Statement1>

<Statement2> SELECT # 2

<access>

<filenumber/>

<segment1>

<field2>

.

.

</segment1>

<segment2>

<field2>

.

.

</segment2>

</Statement2>

</MT_req>

Select # 1 will return FILENUMBER and SEGMENT1 (In this case, segment2 will be blank?). Select # 2 will return FILENUMBER and SEGMENT2 (In this case segment1 will be blank).

There can be multiple occurrences of segment 1 & 2. Not always segment 1 & 2 will share same FILENUMBER.

The target payload should look like -

<MT_resp>

<row>

<FILENUMBER> (if seg1 & 2 share the same FILENUMBER)

<segment1> fields with values </segment1>

<segment2> fields with values </segment2>

</row>

<row>

<FILENUMBER> (if seg1 & 2 don't share the same FILENUMBER)

<segment1> fields with values </segment1>

<segment2> fields with NO values </segment2>

</row>

</MT_resp>

Briefly it means that if FILENUMBER is same, then "merge" the 2 segments in the same message row.

Can this be handled in the message mapping? If yes, how? If no, then what can be done?

I hope I am able to explain it properly. Any help will be highly appreciated.

Thanks for your time and efforts.

Abhi

replied

Hi Abhi,

What I understand from your requirement is -

1. Select # 1 will return FILENUMBER and SEGMENT1 and Select #2 will return FILENUMBER and SEGMENT 2.

2. SEG1 and SEG2 are in the same node (in DT), but in the response, either SEG1 will be populated or SEG2, but both won't be populated at the same time (as these are responses from 2 different SELECTs).

3. There can be multiple "access" nodes for Statement 1 & 2.

4. Once you get the response back, you have to merge them as per the same FILENUMBER.

If my understanding is correct, then either you can use Java codes in Graphical map or use XSL Map. You will have to check for 1st FILENUMBER and scan the whole payload and create the message accordingly ... same for FILENUMBER 2 and so on.

Else you can use BPM. Use 2 containers, get response back from Select 1 and hold it in Container 1 and similarly for Select 2 in Container 2. Then merge them.

If you plan to use BPM, then you might have to check the volume of data that will be coming back as response.

Hope this helps.

Regards,

Neetesh

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question