cancel
Showing results for 
Search instead for 
Did you mean: 

Switch operator - how does it work?

Former Member
0 Kudos

Hi Experts,

the switch-operator is available in VC 7.0 since the last service pack, too. Unfortunately, I don't really understand how it works.

Can somebody give a detailed example on how it works? I couldn't find any useful hints in the other forum, so I post it here.

I have the following requirement:

Query A deliveres prices in currency A, Query B deliveres the same prices, but converted to currency B.

Depending on the user that logs on, I want to "pour" the data from Query A into my model or the data from Query B.

Is this a possible scenario for the use of the switch-operator? How would I do it?

Thanks in advance and best regards,

Benni

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Benni,

did you read the [SAP Help page about the Switch Operator|http://help.sap.com/saphelp_nwce10/helpdata/en/54/b516c954884f4685295569efcdfa95/content.htm]?

Regards,

Shai

Former Member
0 Kudos

Hallo Shai,

thanks for your reply! Yes, I did take a look at that page. I simply cannot get a model to work.

When I have Data Source X, delivering Field 1 and Data Source Y Delivering Field 2, I will never get both values in a table. It seems that Field 2 overwrites Field 1.

Might be me, not modelling correctly. Could somebody who uses the switch operator, send a screenshot with an explanation what is done (i.e. what data comes from what service and what's the result)?

Best regards,

Benni

Former Member
0 Kudos

Hi ,

I worked with switch operator ,

I am getting the data fro both data services .

Swith opeartor is used for different work flows .

Regards,

Govindu

Former Member
0 Kudos

Hi Govindu,

how exactly do the data look like? Are the data services delivering a table or just a single line?

How is the data merged?

Example:

Service A delivers:

-


1

2

3

Service B delivers:

-


X

Y

Z

Switch Operator delivers:

-


X 1

Y 2

Z 3

Or does the switch operator deliver

-


X

Y

Z

1

2

3

In my case, I only get this:

-


1

2

3

When I delete Service A, I get:

-


A

B

C

Pretty strange!

Former Member
0 Kudos

Hi Benjimin,

Sorry first ,i am alos getting One data service data now i am surpriced:-)

I will discuss with ny tean leads and let u know.

Regards,

Govindu

Former Member
0 Kudos

Hi guys,

The switch operator doesn't attempt to merge the data from its different in ports. What it does is pass the data onwards - each time it receives data from one of its in ports, it overwrites the data it had before. So in Benjamin's example, the switch will either pass XYZ or 123. If it receives both of them at the same time - say after a single user action - then one of them will definitely be overwritten.

If the two data sources have the same field names, then you need to match them up in the Define Switch dialog - for example, when you pick field X from the first data source, the Switch will automatically place X as the Field Name. Then pick X from the drop down (on the same row) from the second data source. Now, no matter which flow is chosen, X will be in the result.

Does this help? If my answer isn't clear, please tell me which parts and I'll try again

Eyal

Former Member
0 Kudos

Hi Eyal,

your explanation is perfect. With the switch operator, I expected something completely different. The way you described it, it might solve an issue I face here. I will try that.

Thank you very much for your support!

Best Regards,

Benni

Former Member
0 Kudos

Hi Everybody,

I finally found time to test the switch operator with this explanation, again.

Now, I remember what the problem is:

*The switch operator has two inputs. Only when both inputs receive data, the switch delivers data (the latter one in this case).

If one input port is not supplied with data, the switch does not deliver a single table line.*

Thus, I don't understand, how to use this switch or how to define these two data flows.

Is this a bug in VC 7.0 SP15, that both input ports have to be supplied with data?

I opened a new thread [here|;, so I can assign points.

Thanks in advance and kind regards,

Benni

Answers (0)