cancel
Showing results for 
Search instead for 
Did you mean: 

RFC -> many files scenario

Sharadha1
Active Contributor
0 Kudos

Hi,

I have a RFC sender which sends an internal table which has data for all owners.

But i have to create seperate files for each owner and FTP them seperately.

How can i achieve this?

Regards,

Sharadha

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Shradha,

in your RFC struc, you will have a RECORD with occurance 0..unbounded which will contain data for all owners triggered from r/3 system...........now in target msg, create a data type REC with occurance 0..1 and have all subfields of your RFC struc in it...............now in msg mapping, in messages tab change the occurance of the target msg type to 0..unbounded and then in the design tab do the mapping from source to target............in ID create the Reciever file comm channel with FTP transport protocol and use add Timestamp parameter....so for all your owners you will get different files FTPed to your target system.

Regards,

Rajeev Gupta

Sharadha1
Active Contributor
0 Kudos

Thanks Rajeev.

but please tell me where are we configuring that the split must happen on the 'owner' field.

Regards,

Sharadha

Former Member
0 Kudos

Hi Shradha,

The split at owner will happen in the msg mapping step because your input RFC struc will be 0..unbounded and your output msg struc is 0..1 so basically at your msg mapping you will do a 1:N mapping..........so for one rfc input you will get multiple target msgs for different owners as i have said in the above post.

Regards,

Rajeev Gupta

Sharadha1
Active Contributor
0 Kudos

thanks Rajeev,

But i do not understand the mapping logiv you have explained.

I have the following output from RFC

Owner matnr

own1 1234

own1 6474

own1 7595

own2 5859

own2 7585

own3 7587

I want three files

own1 1234

own1 6474

own1 7595

own2 5859

own2 7585

own3 7587

If i do it as you have mentioned RFC -> 0..unbounded and the output msg stru will be 0..1 how will it be 1:N mapping? wont it be N:1 mapping.

Regards,

Sharadha

santhosh_kumarv
Active Contributor
0 Kudos

Hi Saradha,

You need to use 1:N multimapping.

These Blog might help you as well..

<a href="/people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible without BPM - Yes, it’s possible!</a> By Jin Shin

<a href="/people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi Mapping implementation in BPM</a> By Piyush Gangwal

Thanks

SaNv..

Former Member
0 Kudos

Hi,

But I have to create separate files for each owner

Suppose field1 represents each owner.

In the receiver file name mention as %var%.xml or %var%.txt

In advance properties

Variable Name = var

Reference = payload:MessageType,1,RS,1,DATA ,1,Field1,1.

http://help.sap.com/saphelp_nw04/helpdata/en/42/ed364cf8593eebe10000000a1553f7/frameset.htm

Variable Substitution (Target Directory/File Name Scheme)

If you set the Enable indicator, you can enter variables for the Target Directory and File Name Scheme. Enter the names of the variables and references in the table.

&#9679; Enter each variable that you reference in the Target Directory and File Name Scheme fields without the surrounding percentage sign under Name of Variables in the table.

The variables can refer to attributes of the message header or elements of the message payload.

&#9675; If the variables are to refer to an attribute of the message header, add the prefix message: to the name of the variable under Reference. You can specify the following attributes of the message header:

sender_party, sender_service, receiver_party, receiver_service, interface_name, interface_namespace,

message_id (message ID with hyphens, for example 9fbe1ff1-9a0d-11d9-8665-cbf10a126331)

message_id_hex (message ID in hexadecimal format, for example 9fbe1ff19a0d11d98665cbf10a126331)

For example, if you want to specify the interface name from the message header in the target directory or in the file name scheme, enter message:interface_name as the reference.

If one of the message attributes contains characters that are not permitted in a file name, for example \, /, :, *, ?, ", <, >, |, then these characters are replaced by an underscore ("_").

&#9675; If the variable refers to an element in XML schema, add the prefix payload: to the information under Reference. The reference then comprises a pseudo path description in the form of a comma-separated list with the schema namea,na,nameb,nb,....

namea,nameb,...corresponds to the element name and na,nb,... corresponds to the occurrence of the element name at the respective level in the document.

The description begins at the root of the document and ends at the respective element.

To reference the element that is in bold in the example, the following expression is used: payload:root,1,e1,1,e2,2

The parser searches for the first occurrence of the root element at the first level. It then searches for the first occurrence of e1 at the second level and for the second occurrence of e2 at the third level. The content of the last element (“Example Value”) is set as the value for a specified variable.

<?xml version="1.0" encoding="UTF-8" ?>

<root>

<dummy>

<e1>

<e2>Data_1</e2>

<f/>

<g attr="abc">text</g>

<e2>Data_2</e2>

</e1>

</dummy>

<e1>

<e2>illegal/value</e2>

<f/>

<g attr="abc">text</g>

<e2 attr="fghij">Example Value</e2>

</e1>

</root>

Regards,

Pradeep A.

Edited by: Pradeep Amisagadda on May 12, 2008 12:08 PM

prateek
Active Contributor
0 Kudos

Use multimapping and then enhanced interface determination

http://help.sap.com/saphelp_nw04/helpdata/en/42/ed364cf8593eebe10000000a1553f7/frameset.htm

Regards,

Prateek

Former Member
0 Kudos

Hi,

you can do it by adding conditions in the receiver determination and specifying the different receivers.

Thanks,

Indira D

Sharadha1
Active Contributor
0 Kudos

Hi Indira,

Thanks for the reply.

But i don know how many receivers will be there. it want it to be dynamic.is it possible?

Regards,

Sharadha