cancel
Showing results for 
Search instead for 
Did you mean: 

Webdynpro getvalue from Context in Custom controller

Former Member
0 Kudos

Hi All,

folloging Situation:

I have added a fileupload UI on the dynpro and mapped the following context to this control Data: ctFileContent (binary), Name ctFileName (String). Now I like to transfer the entries to the SAP System via RFC. Therfor I have created a custom controller where I like to fill the RFC parameters - but I don't know, how I can access the value ctFileContent from the view context - it seems I am blind.

I hope anyone can help

Stefan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Declare a controller usage from the view controller to the custom controller, move the attributes into the custom controller and map them from the view controller.

Armin

Former Member
0 Kudos

Hi Armin,

I think I made somthing wrong -

1. The Custom Controller is listed in the properties of the view as required controller

2. I have add to the Context of the Customcontroller a new value attribute (binary) and mapped it to the context of the view. If I start the application I get always a Contextexception (must not modify the datatype of a mapped attribute )

Thanks

Stefan

Former Member
0 Kudos

Stefan,

You must modify attribute only in "origin" controller, i.e. in Custom controller in your case

VS

Former Member
0 Kudos

Hi,

but I can't choose the attribute for the "data-property" in the control (FileUpload) on the view. I can only choose the attribute from the view context. If I create a context attribute in the view - and choose it in the data property of the fileupload - than it works - but how can I transport the data to the custom controller context. If I create a mpping - than i get the exception.

Sorry for this dummy question - but I can't understand it.

Thanks Stefan

Former Member
0 Kudos

The problem is you are trying to create a modifiable object of the attribute mapped to the upload UI element which is inturn mapped to the controller context.

Not pretty sure but instead you might use a different attribute for the UI element and copy the value to the corresponding attribute in the controller instead of mapping it or to the attribute copied to the controller.

Former Member
0 Kudos

In method wdDoInit() of the view controller, you have some lines of code that modify the DDIC type of the context attribute.

This does not work for mapped attributes, so you should move this code into the custom controller's wdDoInit() method, such that it works on the source attribute (that's what Valery explained).

Armin

Answers (0)