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

how to use the custom control ?

Former Member
4,998

Hi Friends,

plz help to use of custom control in screen painter ?

and how to use the custom control ?

Thanking you.

Regards,

Subash.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,229
5 REPLIES 5
Read only

Former Member
0 Likes
2,229

Custom Control is the area defined on the screen .... For output ...

Goto SE51 ... Layout ... Click on Custom control ... draw it .... Give it a name ....say ... CC_AREA ...

Goto SE38 ...

*--- Name of the custom control added on the screen

DATA GC_CUSTOM_CONTROL_NAME TYPE SCRFNAME VALUE 'CC_AREA' .

*--- Custom container instance reference

DATA GR_CCONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER .

**********************************

IF GR_CCONTAINER IS INITIAL .

*----Creating custom container instance

CREATE OBJECT GR_CCONTAINER

EXPORTING

CONTAINER_NAME = GC_CUSTOM_CONTROL_NAME

EXCEPTIONS

CNTL_ERROR = 1

CNTL_SYSTEM_ERROR = 2

CREATE_ERROR = 3

LIFETIME_ERROR = 4

LIFETIME_DYNPRO_DYNPRO_LINK = 5

OTHERS = 6.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Read only

Former Member
0 Likes
2,229

HI,

Screen Elements

A screen can contain a wide variety of elements, either for displaying field contents, or for allowing the user to interact with the program (for example, filling out input fields or choosing pushbutton functions). You use the Screen Painter to arrange elements on the screen.

You can use the following elements:

· Text fields

Display elements, which cannot be changed either by the user or by the ABAP program.

· Input/output fields and templates

Used to display data from the ABAP program or for entering data on the screen. Linked to screen fields.

· Dropdown list boxes

Special input/output fields that allow users to choose one entry from a fixed list of possible entries.

· Checkbox elements

Special input/output fields that the user can either select (value ‘X’) or deselect (value SPACE). Checkbox elements can be linked with function codes.

· Radio button elements

Special input/output fields that are combined into groups. Within a radio button group, only a single button can be selected at any one time. When the user selects one button, all of the others are automatically deselected. Radio button elements can be linked with function codes.

· Pushbuttons

Elements on the screen that trigger the PAI event of the screen flow logic when chosen by the user. There is a function code attached to each pushbutton, which is passed to the ABAP program when it is chosen.

· Frame

Pure display elements that group together elements on the screen, such as radio button groups.

· Subscreens

Area on the screen in which you can place another screen.

· Table controls

Tabular input/output fields.

· Tabstrip controls

Areas on the screen in which you can switch between various pages.

· Custom Controls

Areas on the screen in which you can display controls. Controls are software components of the presentation server.

· Status icons

Display elements, indicating the status of the application program.

· OK field

Every screen has a twenty-character OK_CODE field (also known as the function code field) that is not displayed directly on the screen. User actions that trigger the PAI event also place the corresponding function code into this field, from where it is passed to the ABAP program. You can also use the command field in the standard toolbar to enter the OK field. To be able to use the OK field, you need to assign a name to it.

All screen elements have a set of attributes, some of which are set automatically, others of which have to be specified in the Screen Painter. They determine things such as the layout of the screen elements on the screen. You can set the attributes of screen elements in the Screen Painter - either for a single element, or using the element list, which lists all of the elements belonging to the current screen. Some of the attributes that you set statically in the Screen Painter can be overwritten dynamically in the ABAP program.

with regards,

sowjanyagosala

Read only

Former Member
0 Likes
2,230
Read only

Former Member
0 Likes
2,229

Hi,

Custom Controls

A custom control is an area on a screen. You create them in the Screen Painter, and, like all other screen objects, they have a unique name. You use custom controls to embed controls. A control is a software component on the presentation server, which can be either an ActiveX control or a JavaBean, depending on the SAPgui you are using. They allow you to perform tasks, such as editing texts, locally on the presentation server. The control is driven by the application logic, which still runs on the application server.

The SAP Control Framework

The controls on the presentation server and the ABAP application programs on the application server communicate using the Structure link SAP Control Framework. This is programmed in ABAP Objects, and contains a set of global classes that you can find in the Class Browser under Basis ® Frontend services. These classes encapsulate the communication between the application server and presentation server, which is implemented using Remote Function Call.

All application controls are encapsulated in a global class. You can find the SAP Basis controls in the Class Browser under Basis ® Frontend Services or Basis ® Component Integration. Programs that use controls on a screen work with the methods and events of the global classes that encapsulates them.

go through these link

http://help.sap.com/saphelp_47x200/helpdata/en/e4/6013361d5af835e10000009b38f839/frameset.htm

/people/ravikumar.allampallam/blog/2005/06/01/alv-reporting-using-controls--part-i

/people/ravikumar.allampallam/blog/2005/06/01/alv-reporting-using-controls-control-layouts--part-ii

also check report.

DEMO_CUSTOM_CONTROL

reward if useful