cancel
Showing results for 
Search instead for 
Did you mean: 

How to split a table in messages

samantha_nez
Participant
0 Kudos

Hi,

I've made a BPM which consumes 2 BAPIs. The first BAPI returns a table like this:

<?xml version="1.0" encoding="UTF-8" ?> 
- <ns1:MT_Search xmlns:ns1="http://www.prueba">
- <E_COMP_TAB>
  <IBASE>1</IBASE> 
  <INSTANCE>1</INSTANCE> 
  </E_COMP_TAB>
- <E_COMP_TAB>
  <IBASE>2</IBASE> 
  <INSTANCE>2</INSTANCE> 
  </E_COMP_TAB>
-</ns1:MT_Search>

My problem is when I try to split this table in 2 messages to send them to next BAPI, like this:

Message 1:

<E_COMP_TAB>
  <IBASE>1</IBASE> 
  <INSTANCE>1</INSTANCE> 
  </E_COMP_TAB>

Message 2:

<E_COMP_TAB>
  <IBASE>2</IBASE> 
  <INSTANCE>2</INSTANCE> 
  </E_COMP_TAB>

The table size is variable. I have a transformation step within a loop to try to split the table in 'n' messages, but I get this error when the workflow arrives to this step:

com.sap.aii.af.ra.ms.api.DeliveryException: Received HTTP response code 500 : Timeout

at com.sap.aii.af.ra.ms.impl.core.queue.CallConsumer.onMessage(CallConsumer.java:146)

at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:832)

at com.sap.aii.af.ra.ms.runtime.MSWorkWrapper.run(MSWorkWrapper.java:56)

at com.sap.engine.frame.core.thread.Task.run(Task.java:64)

at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:79)

at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:150)

How can I split a table with 'n' rows in 'n' messages to send them the next BAPI?

Thanks in advance,

Samantha.

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Use a maping in your BPM,

This will be a 1: N mapping where the source is your RFC response and the target is the seconds BAPI's Request message.

The steps for 1:N mapping are,

1. In your message mapping make the target message type as 1 to unbounded.

2. In your Interface mapping make the target interface as 1 to unbounded.

In your BPM after the transformation step, use a Block with For Each and use the mapping output Multiline variable as the Block's For Each variable.

Inside the block do the needful.

Regards

Bhavesh

samantha_nez
Participant
0 Kudos

Hi,

I've made the BPM like you've told me. I use a block with forEeach after the transformation step and a 1:N mapping in it.

In the SXMB_MONI workflow never arrives to the transformation step and I get the same error.

Thanks again,

Samantha.

Former Member
0 Kudos

Hi Samantha,

<In the SXMB_MONI workflow never arrives to the transformation step and I get the same error.>

--> could you explain that? Which step (type) is in front of the transformation step?

Is the transformation step in deed not reached or did the transformation step throw an error?

Regards Mario

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

The 1: N mapping should be outside the Block. It should not be inside the block.

Regards

Bhavesh

Former Member
0 Kudos

Hi Samantha,

have you tried my solution which i have given above......apply my solution.....hope this will solve your query.......

Thanks,

Rajeev Gupta

samantha_nez
Participant
0 Kudos

Thanks!!

That works yet!! The problem was in the block properties...

Now, I send to second BAPI several messages. For each message that it receives, it returns a response to the BPM.

In the BPM I want to do the inverse process, that's to say, to bundle several messages in a table. For it, I make a multi-mapping N:1 and I assign it to another transformation step.

Have I to use a multiline container to bundle them before the transformation step?

Thanks again,

Samantha.

bhavesh_kantilal
Active Contributor
0 Kudos

hi,

In your block after the Send Synch Step, have a Container Operation that will Append the Response into a Multline Element.

Outside the block have the N:1 mapping, where the multiline element of the block is used as the source message interface.

Regards

Bhavesh

samantha_nez
Participant
0 Kudos

Thanks Bhavesh,

It works like you say.

Samantha

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Samantha,

why do you use a loop.

Normal "multi-mapping" should be enough!

After the split you need to design a block where you send the single messages.

In your integration repository goto SWC: SAP BASIS.

SAP delivers samples for your special problem.

Regards Mario

Former Member
0 Kudos

Hi Samantha,

the problem is HTTP conn timed out.......

go to transaction SMICM.......go to Goto -> Services-> select HTTP......Then from menu, choose service->change......change the max processing time to 1500.. then save and activate this service...... then your this problem may be solved.

Thanks,

Rajeev Gupta