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

Regarding modulepool

Former Member
0 Likes
479

I wnt to do background settings ( like colors, pictures) for modulepool screens, is it possible?

Thanks in advance

1 ACCEPTED SOLUTION
Read only

ashok_kumar24
Contributor
0 Likes
447

hi Lakshmi,

Example for a Picture control

----


Steps:

Create a screen

Place a custom container for the picture on the screen. Name the container GO_PICTURE_CONTAINER.

  • Type pool for using SAP icons

TYPE-POOLS: icon.

  • Declarations

DATA:

go_picture TYPE REF TO cl_gui_picture,

go_picture_container TYPE REF TO cl_gui_custom_container.

MODULE status_0100 OUTPUT.

IF go_picture_container IS INITIAL.

  • Create obejcts for picture and container and

  • setup picture control

CREATE OBJECT go_picture_container

EXPORTING

container_name = 'PICTURE_CONTAINER'.

CREATE OBJECT go_picture

EXPORTING

parent = go_picture_container.

  • Set display mode (Stretching, original size etc.)

CALL METHOD go_picture->set_display_mode

EXPORTING

DISPLAY_MODE = CL_GUI_PICTURE=>display_mode_fit_center

EXCEPTIONS = 1.

  • Load picture from SAP Icons. To oad a picture from an URL use method

  • load_picture_from_url

CALL METHOD go_picture->load_picture_from_sap_icons

EXPORTING

icon = icon_delete

EXCEPTIONS error = 1.

ENDIF.

ENDMODULE.

Example for calling a list with colors displaying the text in List processing

----


REPORT demo_leave_to_list_processing .

TABLES sdyn_conn.

DATA: wa_spfli TYPE spfli,

flightdate TYPE sflight-fldate.

CALL SCREEN 100.

MODULE status_0100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE user_command_0100.

CALL SCREEN 500.

SET SCREEN 100.

ENDMODULE.

MODULE call_list_500 OUTPUT.

LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.

SET PF-STATUS space.

SUPPRESS DIALOG.

SELECT carrid connid cityfrom cityto

FROM spfli

INTO CORRESPONDING FIELDS OF wa_spfli

WHERE carrid = sdyn_conn-carrid.

WRITE: / wa_spfli-carrid, wa_spfli-connid,

wa_spfli-cityfrom, wa_spfli-cityto.

HIDE: wa_spfli-carrid, wa_spfli-connid.

ENDSELECT.

CLEAR: wa_spfli-carrid.

ENDMODULE.

TOP-OF-PAGE.

WRITE text-001 COLOR COL_HEADING.

ULINE.

TOP-OF-PAGE DURING LINE-SELECTION.

WRITE sy-lisel COLOR COL_HEADING.

ULINE.

AT LINE-SELECTION.

CHECK not wa_spfli-carrid is initial.

SELECT fldate

FROM sflight

INTO flightdate

WHERE carrid = wa_spfli-carrid AND

connid = wa_spfli-connid.

WRITE / flightdate.

ENDSELECT.

CLEAR: wa_spfli-carrid.

This example switches to list processing during the screen processing for screen 100. Screen 100 has a single input field - the component CARRID from the ABAP Dictionary structure SDYN_CONN.

The flow logic of screen 100 is:

PROCESS BEFORE OUTPUT.

MODULE status_0100.

PROCESS AFTER INPUT.

MODULE cancel AT EXIT-COMMAND.

MODULE user_command_0100.

The PAI module user_command_0100 calls screen 500 using the CALL SCREEN statement. This screen encapsulates a basic list. It has the following flow logic:

PROCESS BEFORE OUTPUT.

MODULE call_list_500.

PROCESS AFTER INPUT.

The module call_list_500 defines the basic list and switches to list processing. Since the next screen after list processing is screen 0, screen 500 is a one-screen screen chain. After list processing, control returns to the position in user_command_0100 from which screen 500 was called.

If the user selects a line on the basic list, a detail list appears. This is achieved through the event block AT LINE-SELECTION. The program also contains event blocks for TOP-OF-PAGE and TOP-OF-PAGE DURING LINE-SELECTION, which define page headers for both the basic list and detail list.

Since there is only one list system in this program, there is no need for case distinctions within the list events.

Good Luck and thanks

2 REPLIES 2
Read only

ashok_kumar24
Contributor
0 Likes
448

hi Lakshmi,

Example for a Picture control

----


Steps:

Create a screen

Place a custom container for the picture on the screen. Name the container GO_PICTURE_CONTAINER.

  • Type pool for using SAP icons

TYPE-POOLS: icon.

  • Declarations

DATA:

go_picture TYPE REF TO cl_gui_picture,

go_picture_container TYPE REF TO cl_gui_custom_container.

MODULE status_0100 OUTPUT.

IF go_picture_container IS INITIAL.

  • Create obejcts for picture and container and

  • setup picture control

CREATE OBJECT go_picture_container

EXPORTING

container_name = 'PICTURE_CONTAINER'.

CREATE OBJECT go_picture

EXPORTING

parent = go_picture_container.

  • Set display mode (Stretching, original size etc.)

CALL METHOD go_picture->set_display_mode

EXPORTING

DISPLAY_MODE = CL_GUI_PICTURE=>display_mode_fit_center

EXCEPTIONS = 1.

  • Load picture from SAP Icons. To oad a picture from an URL use method

  • load_picture_from_url

CALL METHOD go_picture->load_picture_from_sap_icons

EXPORTING

icon = icon_delete

EXCEPTIONS error = 1.

ENDIF.

ENDMODULE.

Example for calling a list with colors displaying the text in List processing

----


REPORT demo_leave_to_list_processing .

TABLES sdyn_conn.

DATA: wa_spfli TYPE spfli,

flightdate TYPE sflight-fldate.

CALL SCREEN 100.

MODULE status_0100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE user_command_0100.

CALL SCREEN 500.

SET SCREEN 100.

ENDMODULE.

MODULE call_list_500 OUTPUT.

LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.

SET PF-STATUS space.

SUPPRESS DIALOG.

SELECT carrid connid cityfrom cityto

FROM spfli

INTO CORRESPONDING FIELDS OF wa_spfli

WHERE carrid = sdyn_conn-carrid.

WRITE: / wa_spfli-carrid, wa_spfli-connid,

wa_spfli-cityfrom, wa_spfli-cityto.

HIDE: wa_spfli-carrid, wa_spfli-connid.

ENDSELECT.

CLEAR: wa_spfli-carrid.

ENDMODULE.

TOP-OF-PAGE.

WRITE text-001 COLOR COL_HEADING.

ULINE.

TOP-OF-PAGE DURING LINE-SELECTION.

WRITE sy-lisel COLOR COL_HEADING.

ULINE.

AT LINE-SELECTION.

CHECK not wa_spfli-carrid is initial.

SELECT fldate

FROM sflight

INTO flightdate

WHERE carrid = wa_spfli-carrid AND

connid = wa_spfli-connid.

WRITE / flightdate.

ENDSELECT.

CLEAR: wa_spfli-carrid.

This example switches to list processing during the screen processing for screen 100. Screen 100 has a single input field - the component CARRID from the ABAP Dictionary structure SDYN_CONN.

The flow logic of screen 100 is:

PROCESS BEFORE OUTPUT.

MODULE status_0100.

PROCESS AFTER INPUT.

MODULE cancel AT EXIT-COMMAND.

MODULE user_command_0100.

The PAI module user_command_0100 calls screen 500 using the CALL SCREEN statement. This screen encapsulates a basic list. It has the following flow logic:

PROCESS BEFORE OUTPUT.

MODULE call_list_500.

PROCESS AFTER INPUT.

The module call_list_500 defines the basic list and switches to list processing. Since the next screen after list processing is screen 0, screen 500 is a one-screen screen chain. After list processing, control returns to the position in user_command_0100 from which screen 500 was called.

If the user selects a line on the basic list, a detail list appears. This is achieved through the event block AT LINE-SELECTION. The program also contains event blocks for TOP-OF-PAGE and TOP-OF-PAGE DURING LINE-SELECTION, which define page headers for both the basic list and detail list.

Since there is only one list system in this program, there is no need for case distinctions within the list events.

Good Luck and thanks

Read only

Former Member
0 Likes
447

Hi,

Yes you can do that using Pictue Control.

Here some Sample Program:

  • SAP_PICTURE_DEMO

  • SAP_PICTURE_DEMO_DRAG_DROP

  • SAP_PICTURE_DEMO_ICON

  • RSDEMO_PICTURE_CONTROL

Regards,