cancel
Showing results for 
Search instead for 
Did you mean: 

Flat file to RFC need help

Former Member
0 Kudos

Hello , i have a flat file scenario : XML to RFC and response back to xml , in which case i have a more complex scenario.

Instead of calling RFC multiple times i need to call RFC multiple times through a BPM loop through one xml with duplicated strcutures how is it possible please help me

Krishna

Accepted Solutions (1)

Accepted Solutions (1)

moorthy
Active Contributor
0 Kudos

Hi

To know more about Par For Each Loop in BPM - go thru following Flight Example-

http://help.sap.com/saphelp_nw2004s/helpdata/en/3c/831620a4f1044dba38b370f77835cc/frameset.htm

Hope this helps..

Regards,

Moorthy

Former Member
0 Kudos

Thanks Michal,

with sending as file and receiving as RFc

>>hi,

>>no loop

>>1. use a message mapping 1:N

>>that will create as many messages as calls

New to this Multimapping , is the DT on file side should be 0.. unbounded ? and RFC DT only 1..1 ?

Please comment.

Krishna

bhavesh_kantilal
Active Contributor
0 Kudos

hi Krishna,

As you are doing a file to RFC, where you will be calling your RFC multiple times, the RFC occurence has to be made 0 to unbounded.

Regards,

Bhavesh

Former Member
0 Kudos

Hello Bhavesh ,

I dont really get you , RFC is imported in to IR how can i change its occurence ? the only option that can be addressed is DT that we create?

Krishna

bhavesh_kantilal
Active Contributor
0 Kudos

hi Krishna,

in your message mapping, when after you drag the RFC as your destination message type , change the occurence of the message type to to 0 to unbounded.

Likewise, change the occurence of your RFC Message Interface to 0 to unbounded.

Now, your mapping is doing a 1:N mapping.

In your BPM, make sure that the container element pointing to your RFC interface is a multiline.

Then put your send (for RFC request message ) in a block using either for each or par for each.

Regards,

Bhavesh

Former Member
0 Kudos

Sorry for my ignorance,

well to be more specific , i am expecting my source message XML will be having multiple structures repeated hence i assume that 0..unbounded .

Now as you suggest i have to make RFC Destination as also unbounded i.e. for ex i am using RFC_CUSTOMER_GET , by default its 1..1 i have to change it to 0..unbounded

i think i only define Messg interface for xml message and i directly use RFC from imported objects in message mapping of Destination message , where would i define MI for RFC

Please suggest

Thanks for your valuable replies

Krishna

moorthy
Active Contributor
0 Kudos

Hi,

RFC itself acts as an Message Interface. SO you need to have one Outbound Interfce of type File and inbound Interface of type RFC - here RFC itself acts as a Interface.

To change the occurence, go to Message Mapping Editor->Messages Tab->Target Message->Occurence( Chnage the ocurence here)

To change in the interface mapping, go to Interface Mapping->Target Interface(change the occurence column)

Regards,

Moorthy

Former Member
0 Kudos

Thanks moorthy for your valued replies :

i think i am missing in the concept of this : for calling RFC through multiple times through one xml message having duplicated structures ,i was suggested earlier through 1:n mapping in which case i am defining Source XML occurence as 1 and target rfc as unbounded. if i am defnining souce as 1 will it allow mutliple values ?

moorthy
Active Contributor
0 Kudos

Hello,

Quick Example here it goes-

Case : Have one xml file and having many RFC structurues of same RFC type ( i.e header and Line items are repeating)and I need to post one RFC for each structure(i.e one header and corresponding line items), then you can do like this-

1) Create a Message Mapping ( file to RFC not changing any occurence)

2) Create a interface Mapping for this.( No need of changing any occurence)

3) Receive the file xml data in the BPM

4) start Par For Each Block

5) Execute Transformation Step

6) Send the Mapped RFC data to R/3

In this case you will be calling RFC multiple times.

Is your scenario is similar like this ?

Regd. 1:N mapping-

in the source, you have one message ( irrespective of inside structure) and in the target side you have multiple messages.

For e.g SOurce message occurence is 1 here

<Source>

<Header> </Header> (1..1)

<Line> </Line> (1..n)

</Source>

For the same message occurence N means-and it will be wrapped by a message1 node once you change the occurence.

<Message1>

<Source>

<Header> </Header> (1..1)

<Line> </Line> (1..n)

</Source>

<Source>

<Header> </Header> (1..1)

<Line> </Line> (1..n)

</Source>

</Message1>

Hope this helps..

Regards,

Moorthy

Former Member
0 Kudos

Thanks Moorthy for your valued reply,

well with your input i can compare what is my scenario. i have an source XML file of type

Message1>

<Source>

<Header> </Header> (1..1)

<Line> </Line> (1..1)

</Source>

<Source>

<Header> </Header> (1..1)

<Line> </Line> (1..1)

</Source>

</Message1>

Now the destination RFC strcuture is (with out changing occurence ) is 1..1 , i changed it to 0..unbounded. and RFC structure is not identical to xml.

Please advise.

Krishna

moorthy
Active Contributor
0 Kudos

Hi ,

Just More info-

Actually if you do the occurence as 0-n then you will be having structure like this-

<Messages>

<Message1>

<Source>

<Header> </Header> (1..1)

<Line> </Line> (1..1)

</Source>

<Source>

<Header> </Header> (1..1)

<Line> </Line> (1..1)

</Source>

</Message1>

<Message1>

<Source>

<Header> </Header> (1..1)

<Line> </Line> (1..1)

</Source>

<Source>

<Header> </Header> (1..1)

<Line> </Line> (1..1)

</Source>

</Message1>

</Messages>

In this case you have multiple Message1 under Messages node. So now it is N number of messages under one tag.

For your scenario, you can try like this-

1) No need of changing any occurence anywhere.

2) Use BPM -mentioned in my earlier reply

I think it will work without 1:N or N:1 mapping Because in your case there is no multiple messages, but you have multiple occurences of each set. So I think you can easily handle with parForEach loop.

For eg. on ParForEach -

http://help.sap.com/saphelp_nw2004s/helpdata/en/27/db283fd0ca8443e10000000a114084/frameset.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/27/db283fd0ca8443e10000000a114084/frameset.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/27/db283fd0ca8443e10000000a114084/frameset.htm

Also check in BPM Patterns for ParForEach.

Regards,

Moorthy

Just check it

Former Member
0 Kudos

Thanks for your message:

well i checked the source message is its like this

<messages> 1..1

<Message 1> 1..1

<Message_type>

.

.

.

</Message_type>

<Message_type>

.

.

.

</Message_type>

</Message 1>

</Messages>

Now RFC its { AFTER CHANGING OCCRENCE TO 0..UNBOUNDED}

<messages> 1..1

<Message 1> 1..1

<RFC_type>

.

.

.

</RFC_type>

<RFC_type>

.

.

.

</RFC_type>

</Message 1>

</Messages>

Thank you very much for your valued replies.

Krishna

Former Member
0 Kudos

Hello Moorthy,

As per your message , i hope steps 5,6 after 4 should be part of 4 ? i.e. should be in the block ?

3) Receive the file xml data in the BPM

4) start Par For Each Block

5) Execute Transformation Step

6) Send the Mapped RFC data to R/3

Please confirm.

Krishna

Former Member
0 Kudos

i am stuck with these.. some one please comment

Best regards

Krishna

bhavesh_kantilal
Active Contributor
0 Kudos

hi krishna,

this is how your BPM steps should be,

1. Recive

2. Transformation

3. Par for each block

4.Send Step.

Only step 4 will come inside the block.

Regards,

Bhavesh

Answers (3)

Answers (3)

former_member91687
Active Contributor
0 Kudos

Hi,

This link should help you understand multimappings better:

http://help.sap.com/saphelp_nw04/helpdata/en/21/6faf35c2d74295a3cb97f6f3ccf43c/content.htm

Chandra

Former Member
0 Kudos

If you are on SP14+, you can accomplish the same using the extended configuration in Interface Determination using the same multi-mapping you developed for BPM.

This will not require BPM and, therefore, less resources.

Regards,

Bill

Former Member
0 Kudos

Hello all,

Is there anywhere i can find any demo kind of walk in regarding any of these steps involved..

Thanks for all your responses

Krishna

bhavesh_kantilal
Active Contributor
0 Kudos

hi Krishna,

To convert your flat file, into XML, you will have to perform content conversion on your Sender File Adapter.

Refer this blog for the same,

/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30

To call an RFC in a BPM,

/people/arpit.seth/blog/2005/06/27/rfc-scenario-using-bpm--starter-kit

Regards,

Bhavesh

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>> i need to call RFC multiple times through a BPM loop through one xml with duplicated s

1. create a multimapping that will create as many xml messages

as calls that you need

2.add those messages to a multiline container

3. use a block step with foreach on this multiline

container and the send step will execute

the rfc at each new message occurance

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions">XI FAQ - Frequently Asked Questions</a>

Former Member
0 Kudos

Thanks,

Can you give me more picture new to this sorry about that. with the BPM is it possible that as many times the structure is repeated the RFC is called as such instead of a fixed no ?

Please suggest.

Krishna

MichalKrawczyk
Active Contributor
0 Kudos

hi,

>>>is it possible that as many times the structure is repeated the RFC is called as such instead

yes of course

Regards,

michal

Former Member
0 Kudos

Thanks Michal,

really appreciated of your help , can you please give me a better idea of how to incorporate this as such w.r.t BPM ?

Like on what basis can i do this loop ?

best regards

Krishna

MichalKrawczyk
Active Contributor
0 Kudos

hi,

no loop

1. use a message mapping 1:N

that will create as many messages as calls

2. put it in the transformation step in BPM

3. use block and a send step inside

and in block specify the use of foreach

on the multiline container that you will fill

inside the transformation step

Regards,

michal