cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a Counter

Former Member
0 Kudos

Hi all,

My scenario receives xml documents from different organisms. The objective is creating a counter in a message who can handle organism/number of message. (Note: We have an interface per organism) I’m only need one counter per interface.

The xml file is sent without counter, this counter must be created/inserted in XI on an new xml field message to be sent to R/3 sys.

How is the simple way to create this counter? (Like a message-id)

Any suggestions?

Thanks in advance,

Ricardo.

Accepted Solutions (0)

Answers (1)

Answers (1)

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>>How is the simple way to create this counter? (Like a message-id)

use abap mapping at your mapping

this way you'd be able to

update a table with an update statement for example

every time the mapping gets executed

you can do the same with XSLT mapping on the abap engine

(if you use abap extensions)

Regards,

michal

Former Member
0 Kudos

Michal,

Can I do in IR with message mapping program?

In mapping program functions I have a function "Counter" I'm only need to link this function to a field in target message. Tell me if I'm correct.

Thanks a lot,

Ricardo.

MichalKrawczyk
Active Contributor
0 Kudos

hi,

if you'd like to count <b>many message</b> that flow

through one mapping program

then no - you cannot do it with a message mapping program

if you want to count tags from just <b>one message</b>

then you can do it with one mapping program

Regards,

michal

Former Member
0 Kudos

Hi

could you give how to count tags from just one message with the help of counter.

any link to Weblog

Thanking you in advance.

Piyush

Former Member
0 Kudos

Ok Michal,

Suppose I choose ABAP Mapping to make a Counter.

My xml file has 3 node tags, which node has 20 fields. My question is: I need to map all the fields in ABAP method? It’s not possible do the mapping with XI mapping program and after that enhancement with a counter made it in a new mapping (ABAP mapping)?

I don’t know how it uses XSLT Mapping! It’s like ABAP Mapping? What are the XSLT advantages or what is the objective of this technique?

Thanks in advance,

Ricardo.

Former Member
0 Kudos

Hi Ricardo,

If you are using ABAP mapping use a number range object in the ABAP stack of your XI server so that the counter can be incremented and the previous value also will be retained.

In case of message mapping you cannot use the standard function counter as when the interface is executed the next time you wont be able to retain the previous value.

In this case you can use a RFC function module in your ABAP stack of XI server and connect it using JCo connection and triggered from your user-defined function in message mapping. This can be done in the case of XSLT mapping also.

This is provided in the following weblogs:

For Message Mapping:

/people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i

For XSLT Mapping:

/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii

Cheers

JK