cancel
Showing results for 
Search instead for 
Did you mean: 

BPM: How to return the total number of lines in Multiline Container Element

0 Kudos

Hi all:

I am trying to follow the following blog to do message splitting:

/people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi

In the blog, total number of messages for Message1 was returned to Count in Message 2.

If I do not want to create message 2, if there any way to return total number lines in multiline elements ? Because this number need to be used to specify in loop condition:

While Indxe != TotalNumberOfLines

...

Thanks

Liang

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Liang !

Where/How are you planning to use the total number of lines in multiline container ?

Regards,

Matias.

Former Member
0 Kudos

Hi, Mitias:

I would like use the number as the loop condition, it can be set up to stop loop, and all the lines in multi line elements are processed in subsequent block.

If you take look at the blog, this number is passed by another mapping element in different message structure.

The other option is to use block of ForEach or ParForEach, I also have something unclear:

the properties for ForEach block could be look like following:

Step Name: Block1

Mode: ForEach

Multiline Elemement: Var_Dest (it reference to abstract interface after msg split - Multiline checked)

Current Line: Var_Cur (it also reference to abstract interface after msg split)

End Condition: I do not believe I need to fill out this property, since ForEach block automatically process

each elements in the multiline elements.

Current line property confuse me: since the block will automatically process each line, why we need current line here ?

Liang

Former Member
0 Kudos

Hi Liang !

The blog you read, uses the message mapping process to count the amount of messages. I think that to output the message count as a different message type is the best solution. Another option could be to create a UDF that uses java code to store the count of messages in a file in the XI file system or that sends the count number via JCO to a table in XI ABAP stack. But those methods are far more complex because you will need to maintain some kind of correlation because multiple mappings can occurs at the same time. And then you will need another process to retrieve that value after the multimapping or transformation step.

About the "Current Line" in the steps you mentioned, this parameter refers the a container element that will store temporarily the current item of the loop.

Regards,

Matias

pS: please award points if helpful.

0 Kudos

Hi, Matias:

For the loop block option, your answer is passing message count in different message type is best option !

I really do not know why SAP does not deliver a build-in function to return the number of items in multiline element at run time ?

Now the question for the second option: ForEach block:

  • When I leave current line of block properties empty, the compile does not pass

  • I have to input a another element (Var_Cur) in current line

  • Inside my block, I have one send step, it will send Var_Dest[Index], followed by a container operation step to increment Index by 1.

With above setup, I compile it, compile passed, but it says:

"Container Element Var_Cur in Step Block1 is initialized but not used"

then I added another containter operation step in block:

Var_Cur = Var_Dest[Index]

I modified send step to send Var_Cur rather than Var_Dest.

Up to now, I can compile it without any warnings.

But when I send message to IE, the message pass pipe line, but it seems does not pass the BPE.

When I go to SXI_CACHE, to check the return code for my Integration process is 0, means no error.

But my message does not reach my target system.

Where do you think I made wrong ?

Thanks

Liang

Former Member
0 Kudos

Hi Liang !

First you need to see if the message enters the BPM, if the message leaves the BPM and then if the message arrives at destination.

If you go to sxmb_moni, do you receive any error? can you see the graphic log of the workflow (BPM) ? Do you have a Receiver Determination object for each receiver (one for the BPM itself, one for each receiver called inside the BPM via send steps, one for the final receiver of the BPM if there is one).

Regards,

Matias.

0 Kudos

Hi,Matias

Thanks for the message again.

I have changed a little bit Integration process:

I removed the two container operation steps, then send step just send Var_Cur.

As you mentioned Var_Cur has assigned as Current Line in block property, so its value will reflect current line of my multiline element Var_Dest.

I tested:

Message successful passing IE to IP:

Receive Step is successful (Green Line)

Tranformation Step is successful (Green Line)

Message Arrived in Block (Green Line)

But after send step, the line stay black, I believe there is a problem for Send Step:

On the property of my send step, I put following values:

Step Name: Send0

Mode: Asychronous

Message: Var_Cur

Aknowledgment: No

Receiver From: Send Context

...

Send Context: BS_SERVICE_RECEIVER

On configuration, I have all the necessary steps done.

Do not know why send step has problem, do you have any idea ?

Thanks

Liang

Former Member
0 Kudos

Hi Liang !

There should be some info in the sxmb_moni and/or the technical view of the BPM in BPE.

Regards,

Matias.