cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass list as input parameter to a Web Dynpro Application

Former Member
0 Kudos

Hi

How can I pass a list as input parameter to a Web Dynpro Application? I know I can call the application with parameters, but what about a list? Is this also possible?

Thanks for helping

Many regards

Bettina Hepp

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

based on the following thread

You can give a try by putting your list as part of the value of the Map.

1) Define a an additional Suspend Plug parameter (besides 'Url' of type String) with name 'postParams' and of type Map.

2) In your controller code create a HashMap instance and put some key/value-pairs in it:

Map postParams = new HashMap();

postParams.put("Key1", "Value 1");

postParams.put("Key2", "Value2");

postParams.put("Key3", "Value 3");

wdThis.wdGetWDSuspendResumeWindowController().wdFirePlugTestSupend("http://www.sap.com", postParams);

3) RESULT: The Web Dynpro Java Runtime will then pass these parameters via a POST request to the Suspen/Resume target application like the following HTTPWatch-Log demonstrates:

Regards

Ayyapparaj

Former Member
0 Kudos

Hi Ayyapparaj and Armin,

thank you for your answers. As to Armin's suggestion: this could be a workaround, but I think it should only be done if there aren't any other options. A string might be too error-prone.

Ayyapparaj - I tried to follow your solution, but it isn't working. The parameters for a startup plug in an interface view cannot be of type map or there will be a build error with the message:

"Error. Parameter type of '<name-of-parameter>' must be a build-in type". I also tried the type com.sap.dictionary.predefined.currency, just for testing, but the build error persists.

So I am drawing the conclusion:

Input parameters to Web Dynpro Components via the interface view startup plug can only be of a built-in type.

What is the exact definition of a Web Dynpro built-in-type? I assume it is a simple type like string, binary, integer etc.

Have you got any other suggestions? Maybe I should explain my scenario in more detail:

I have two UI-interfaces, a portal application A and a Web Dynpro component B. A is calling B with a bunch of parameters. As our application will provide a solution for event management, A has to pass a table with events of unknown length, among other data.

If passing a complex structure as an input parameter is not possible in Web Dynpro, I will probably make another BAPI call and retrieve the event table from the backend by a key. From a perfomance point of view, this could however be a disadvantagous solution.

Any help on this problem is very welcome!

Many thanks and kind regards

Bettina Hepp

Former Member
0 Kudos

A possible solution is to pass the data as HTTP POST paramters, not GET - this would usually be length restricted.

You can use a key multiple times. Hence, you can send parameters eventNamesList=CoolEvent and eventNamesList=TechEvent so using the same key twice, assuming your list might be called "eventNamesList" and contain the Strings "CoolEvent" and "TechEvent" as content. The receiving WD4J app will read all two values(the HTTP parameter values is actually a string array). In case the solution suits you and you need code, contact me.

/Georg

Former Member
0 Kudos

Hi Georg

Thanks a lot for your idea, this sounds really interesting to me. How do I access, however, the array from within Web Dynpro? What type do I have to assign to the input parameter of the corresponding plug in the interface view? The check box "Array type" at the input plug parameter properties is greyed out.

Kind regards

Bettina

Former Member
0 Kudos

You mean as URL parameter? Why not just pass a string with some suitable separator?

Armin