cancel
Showing results for 
Search instead for 
Did you mean: 

Get a group of records from File and send each one in an RFC function

dimitris_galanis
Explorer
0 Kudos

Hi all,

My scenario is the following:

I am getting a file from a file adapter, but I want some of the records to be sent to R/3 through an RFC function.

I used the 'createIf' on the header of the function (1st node).

The RFC function's occurences are 0 to Unbounted.

The problem is that if test my mapping, I send 4 records that should be seen as RFC calls but I am seing only 1.

Can anyone help me?

Accepted Solutions (1)

Accepted Solutions (1)

dimitris_galanis
Explorer
0 Kudos

I think that this is better:

The file Message type:

M_FILE

___|__ Record

_________|__ Date

____________ Sign

____________ Account

____________ Amount

____________ Contract

The RFC message type:

Z_XI_PAYMENTS

___|__ Amount

______ Contract

______ Date

My 'createIf' mapping:

___________<Account> -


|

<Constant: 0123456789> -


|---> equalS ---> createIf ---> <Z_XI_PAYMENTS>

Thanks

Message was edited by:

Dimitris Galanis

Former Member
0 Kudos

Hi,

Remove context from <Account> (change context to top node).

Regards,

Wojciech

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Mapping looks good to me.

Just a few pointers,

1. Did you change the occurence of the target message type in Message Mapping to 0 to unbounded?

2. Did you change the occurence of the Target message Interface in interface mapping to 0 to unbounded?

Make these 2 changes, activate your messae and interafce mapping and test the same. it should work.

Regards,

Bhavesh

dimitris_galanis
Explorer
0 Kudos

Can you explain it? I didn't get it...

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

In your mapping, Right Click on ACCOUNT ( your source element ).it will be pointing to RECORD. Change the Context to the root node M_FILE.

Regards,

Bhavesh

dimitris_galanis
Explorer
0 Kudos

Yes I did it...

The message mapping is not working. I get only one message in the test of the Mapping.

stefan_grube
Active Contributor
0 Kudos

As <Z_XI_PAYMENTS> is the root node, it cannot occur more than once.

It is not possible to have several RFC calls from one single message. You need BPM to do the split or a split mapping.

In your case I strictly recommend to rewrite your RFC in a way that it is able to handle multiple records, otherwise you would increase the number of messages which might lead to perfomance problems.

Regards

Stefam

Former Member
0 Kudos

hi,

First of all you need to create multimapping ( you need SP14 or higher).

It will be 1:N. Change occurency in message mapping and interface mapping, then you can have many RFC calls.

Later in the mapping you need to either change context of <account> element or remove context after your if statement. It has to be done in order to create as many RFC functions as you want. You cannot have inside target (last) queue any context changes.

Queue should look like that:

[something]

[something]

[something]

[something]

not like that (in such case you will genertate only one RFC call):

[something]

CC

[something]

CC

[something]

CC

[something]

Regards,

Wojciehc

Former Member
0 Kudos

Stefan is right if it's Z* RFC is better to pass a table then to create many RFC calls ;).

Regards,

Wojciech

stefan_grube
Active Contributor
0 Kudos

> Stefan is right if it's Z* RFC is better to pass a

> table then to create many RFC calls ;).

If it is not Z* RFC then create a wrapper to pass tables and call the individual RFCs in the application system

Stefan

dimitris_galanis
Explorer
0 Kudos

Thanks a lot all of you...

Bhavesh Kantilal's solution solved my problem

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Actually it was Wojciech who pointed out the issue with the Context.

Just adding to the discussion , if you cannot create a custom RFC and want to continue with the current approach, this blog should help,

/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible

Regards,

Bhavesh

Former Member
0 Kudos

Hi,

Check on this:

http://help.sap.com/saphelp_nw04/helpdata/en/42/f3b31d48fb1bc8e10000000a11466f/content.htm

the ideal would be to make a zRFC from perfromance perspective. But if the Business requires it for u to send it one at a time have a look at the link above.

Regards

Vijaya

Answers (1)

Answers (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Can you give the source and target strcuture so that we can help you with the mapping.

Regards,

Bhavesh

dimitris_galanis
Explorer
0 Kudos

The file Message type:

Message was edited by:

Dimitris Galanis