Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Method, parameters and attributes

Former Member
0 Likes
1,016

Dear SAP friends!

Could anybody explain me how to find possible values of a parameter?

Here is an example:

CALL METHOD o_picture->set_display_mode

EXPORTING

display_mode = cl_gui_picture=>display_fit_center.

Parameter "display_mode" has 4 possible values. The parameter values could be found in Attributes Tab.

But how I can identify that these 4 values are related to "display_mode" parameter?

Let's say I want to use method "set_display_mode" of class "cl_gui_picture".

I go to SE84 and display the class. Then I find the method I want to use and click "parameters". Then I see the parameter "display_mode".

I know that possible values of the parameter could be found in Attributes Tab. But there so many of them...

How do I know which is which? Clicking on "display_mode" doesn't give any information and there is no documentation available in English...

Thanks,

Tatyana

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
726

Hello Tatyana

In many cases you will find the appropriate values defined as constant attribute of the class or its superclass. Class CL_GUI_PICTURE has the following constant attributes:


DISPLAY_MODE_NORMAL	Constant	Public
DISPLAY_MODE_STRETCH	Constant	Public
DISPLAY_MODE_FIT	Constant	Public
DISPLAY_MODE_NORMAL_CENTER	Constant	Public
DISPLAY_MODE_FIT_CENTER	Constant	Public

Regards

Uwe

3 REPLIES 3
Read only

uwe_schieferstein
Active Contributor
0 Likes
727

Hello Tatyana

In many cases you will find the appropriate values defined as constant attribute of the class or its superclass. Class CL_GUI_PICTURE has the following constant attributes:


DISPLAY_MODE_NORMAL	Constant	Public
DISPLAY_MODE_STRETCH	Constant	Public
DISPLAY_MODE_FIT	Constant	Public
DISPLAY_MODE_NORMAL_CENTER	Constant	Public
DISPLAY_MODE_FIT_CENTER	Constant	Public

Regards

Uwe

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
726

Yes, this is a little bit tricky at times. But the class, method, attributes are designed to be intuitive, meaning that the wording of the methods and and attributes are described in such a way that it is easy to recoginize what contansts can be used to pass to method calls. Lets take the class CL_GUI_DOCKING_CONTAINER for example. Lets look at the CONSTRUCTOR method and its parameter SIDE. You will see that this parameter is of TYPE I and that it is actually using on of the constants as its default, DOCK_AT_LEFT. So if you go to the attributes tab and look for DOCK_AT_LEFT, you will find other contants that are available to pass to this parameter.

If you are looking for a hard list of values(or constants in attributes tabs) which can be passed to any given parameter of any given method, I do not believe that this functionality exists.

REgards,

Rich Heilman

Regards,

Rich Heilman

Read only

Former Member
0 Likes
726

Got you.

1. Go SE84. Find class "cl_gui_picture". Click Method "set_alignment". Click Parameters. There is parameter "alignment". Go "Attributes" and search for alignment constants: Align_at_bottom, align_at_left, align_at_right, align_at_top

2. Go SE84. Find class "cl_gui_picture". Click Method "set_metric". Click Parameters. There is parameter "metric". Go "Attributes" and search for metric constants: metric_mm and metric_pixel

Thank you Uwe.

Tatyana.

.