cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a byte[] as parameter for a Method inside the Controller

Former Member
0 Kudos

Hi Experts,

I want to create a method getCachedWebResource inside the component controller which has a parameter file which is of type byte[].

But in Netweaver Developer Studio I am not able to create this parameter with type byte[] .

When I try creating a parameter of this type (byte[]) . I get only byte from drop down and below Array type checkbox is disabled.

Please help me in this regards.

I am already highly obliged to his forum with lots of useful answers. Hoping the same this time too

Best Regards,

Roby..

Accepted Solutions (1)

Accepted Solutions (1)

ThatSAPGuy
Advisor
Advisor
0 Kudos

Robert-

There are two ways of achieving this:

1. Create a private getCachedWebResource() method inside your component controller's others section. i.e. do not create a method on the Methods tab, but instead code the method directly into the controller.

2. Create a parameter of type java.lang.Byte[ ] instead of byte[ ]. This can be done by clicking on the Browse button next to the Type and then choosing the Java Native Type radio button. In the Java Native Type input field provide java.lang.Byte. Click on Ok and you should see the Array Type option getting enabled. Check it, and in the method you should convert from java.lang.Byte to byte.

I would stick to option (1)

Cheers-

Atul

Former Member
0 Kudos

Hi Atul,

I already tried the second option but w/o conversion . So it was not working fine.

Well the first solution works fine . But I would like to understand why do we not get this option with Methods created inside the Method Tab of the Controller.

Best Regards,

Roby..

Answers (0)