Picture in Selection Screen
Dear Experts
My problem is when i am Putting Picture in Selection Screen I was able to change its width but not its Height,can anyone tell me How to Change its Height..
Thanks in Advance
Somesh
Hi
check this one
REPORT y_pic_show .
DATA:
docking TYPE REF TO cl_gui_docking_container,
picture_control_1 TYPE REF TO cl_gui_picture,
url(256) TYPE c .
PARAMETERS: p_dummy TYPE c .
AT SELECTION-SCREEN OUTPUT.
PERFORM show_pic.
START-OF-SELECTION.
*& Form show_pic
FORM show_pic.
DATA: repid LIKE sy-repid.
DATA: file_name LIKE sapb-sapfiles,
file_type LIKE bdn_con-mimetype.
repid = sy-repid.
IF docking IS INITIAL .
CREATE OBJECT docking
EXPORTING
repid = repid
dynnr = sy-dynnr
side = cl_gui_docking_container=>dock_at_right
extension = '200'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
CREATE OBJECT picture_control_1 EXPORTING parent = docking.
CHECK sy-subrc = 0.
CALL METHOD picture_control_1->set_3d_border
EXPORTING
border = 0.
CALL FUNCTION 'DP_PUBLISH_WWW_URL'
EXPORTING
objid = 'HTMLCNTL_TESTHTM2_SAP_AG'
lifetime = 'T'
IMPORTING
url = url
EXCEPTIONS
OTHERS = 1.
Load the picture by using the url generated by the data provider.
IF sy-subrc = 0.
CALL METHOD picture_control_1->load_picture_from_url_async
EXPORTING
url = url.
ENDIF.
ENDIF .
ENDFORM. "show_pic
More on controls demo at transaction DWDM
reward points to all helpful answers
kiran.M
Similar Messages
-
Insert picture in selection screen.
Hi,
Can some one suggest how to insert picture in selection screen?
Thanks
DeepHi,
I have inserted a picture in my classical report. According to the position where you want can be adjusted. If you know how to upload Logo in SMW0 then upload and just copy paste the code that i have shown will display the image.
DATA: docking TYPE REF TO cl_gui_docking_container,
picture_control_1 TYPE REF TO cl_gui_picture,
url(256) TYPE c .
DATA: query_table LIKE w3query OCCURS 1 WITH HEADER LINE,
html_table LIKE w3html OCCURS 1,
return_code LIKE w3param-ret_code,
content_type LIKE w3param-cont_type,
content_length LIKE w3param-cont_len,
pic_data LIKE w3mime OCCURS 0,
pic_size TYPE i.
* END OF DO NOT CHANGE----------------------*
FORMAT HOTSPOT ON.
DATA : sum(4) , num1(4) , num2(4).
PARAMETERS: A(4) DEFAULT '4' .
PARAMETERS: B(4) DEFAULT '5' .
DATA: ANSWER TYPE I.
ANSWER = A + B.
WRITE:/ ANSWER.
AT SELECTION-SCREEN OUTPUT.
PERFORM show_pic.
* PERFORM show_pic1.
START-OF-SELECTION.
*& Form show_pic
FORM show_pic.
DATA: repid LIKE sy-repid.
repid = sy-repid.
CREATE OBJECT picture_control_1 EXPORTING parent = docking.
CHECK sy-subrc = 0.
CALL METHOD picture_control_1->set_3d_border
EXPORTING
border = 5.
CALL METHOD picture_control_1->set_display_mode
EXPORTING
display_mode = cl_gui_picture=>display_mode_stretch.
CALL METHOD picture_control_1->set_position
EXPORTING
height = 90
left = 40
top = 30
width = 190.
*CHANGE POSITION AND SIZE ABOVE*****************
IF url IS INITIAL.
REFRESH query_table.
query_table-name = '_OBJECT_ID'.
*CHANGE IMAGE NAME BELOW UPLOADED IN SWO0******************
query_table-value = 'YREDDY'. "name which u have given in SMW0
APPEND query_table.
query_table-value = 'YLOGO'.
APPEND query_table.
*FORMAT HOTSPOT ON.
CALL FUNCTION 'WWW_GET_MIME_OBJECT'
TABLES
query_string = query_table
html = html_table
mime = pic_data
CHANGING
return_code = return_code
content_type = content_type
content_length = content_length
EXCEPTIONS
object_not_found = 1
parameter_not_found = 2
OTHERS = 3.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'image'
subtype = cndp_sap_tab_unknown
size = pic_size
lifetime = cndp_lifetime_transaction
TABLES
data = pic_data
CHANGING
url = url
EXCEPTIONS
OTHERS = 1.
ENDIF.
CALL METHOD picture_control_1->load_picture_from_url
EXPORTING
url = url.
FORMAT HOTSPOT OFF.
ENDFORM. -
Showing Picture At Selection screen.
Hi,
I want to show Picture from my PC hard drive at selection screen of abap program ( SAP repo. mime type i know but i want specially from my hard drive on pc ).
how it can be possible ? if possible give code.
Thanks,Hi
if you have a simple report " selection screen of abap program 1000 ".... I think it´s not possible....
but.
If you have a "handmade" dynpro 0100 > try to use a HTML Container ( its start a Internet Explorer .. ) and shows you the gif, jpeg..
But it´s easier to use a external/internal UI adress ( Webspace ) for the picture, as the dektop space fg
Best reg Robert -
Picture in selection screen (saved in clustertable) how to load?
Hi everybody,
we got an ABAP on wich a picture should be displayed.
As we want wo have the picture in a transport ( to dispatch the ABAP on several other SAP systems ), we decided to store it in a cluster table:
This is the way we store it:
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
* CODEPAGE = ' '
filename = file
filetype = 'BIN'
TABLES
data_tab = pict_tab.
EXPORT pict_tab = pict_tab TO DATABASE indx(hk) ID id.
When I now want to display the picture I (hopefully) can use:
IMPORT pict_tab = pict_tab FROM DATABASE indx(hk) ID id.
My question is: How can I convert pict_tab to an appropriate format so that it fits for the class cl_gui_picture
Thanks Regards
Mariounfortunatelly no answer :-(
-
How to attach a logo to a selection screen?
I needed to show the logo on the selection screen of a report.
So I went through several postings on this topic, created and uploaded the logo via OAER against the PICTURES object.
Per the posting, it tells to pass the value C:\logo.gif' as the url
I did so - but the logo does not appear on the screen.
So I went thorugh some demo programs - the demo programs are looking for entries in wwwparams table and are hard coding the object id while fetching these entries.
I looked for my entry in the wwwparams table, but nothing got updated into this.
Let me know if I am missing anything..
Thanks,
VenHi,
Please check this thread..
Picture in selection screen
THanks
Naren -
PHOTO UPLOAD in selection screen
Hi expert ,
I want to know can with fixed picture with SELECTION SCREEN ??. I means when i scroll the screen it must be scroll with it.Hi,
Look i write one code to generate one page in that page there is many selection screen and screen blocks. Now i want to fixed one picture with particular selection screen block so that when i scrolling picture up and down picture must be scroll with it. -
Show Picture/logo on Selection Screen from OAER
HI everybody,
I uploaded a LOGO via TA OAER.
It works fine, when I Use call function 'REUSE_ALV_GRID_DISPLAY'
But now I want wot display the logo on the selection screen using the picture_control ( TYPE REF TO cl_gui_picture)
see:
ABAP - Display LOGO On Selection Screen.</title><title>Learn ABAP Programming With Examples And Sample Progr…
Does anybody know how to read the picture uploaded in OAER for using it in the picture_control ( TYPE REF TO cl_gui_picture?
Thanks
Regards
MarioThis is possible. please try following code:
PARAMETERS:c1 TYPE vbak-vbeln.
AT SELECTION-SCREEN OUTPUT.
PERFORM show_picture.
**& Form show_picture
FORM show_picture.
DATA picture_control_1 TYPE REF TO cl_gui_picture.
DATA :
docking TYPE REF TO cl_gui_custom_container,
logical_system LIKE bapibds01-log_system,
v_class LIKE bapibds01-classname,
v_type LIKE bapibds01-classtype,
v_client LIKE bapibds01-client,
v_objkey LIKE bapibds01-objkey,
url_lifetime LIKE bapibds01-uri_life,
standard_url_only LIKE sy-datar,
data_provider_url_only LIKE sy-datar,
web_applic_server_url_only LIKE sy-datar,
url_used_at TYPE sdok_fburl,
URIS TYPE TABLE OF BAPIURI WITH HEADER LINE,
url LIKE uris-uri.
v_objkey = 'FITP_SMILE'.
v_class = 'PICTURES'.
v_type = 'OT'.
v_client = sy-mandt.
CALL FUNCTION 'BDS_BUSINESSDOCUMENT_GET_URL'
EXPORTING
classname = v_class
classtype = v_type
client = v_client
object_key = v_objkey
TABLES
uris = uris.
* Find image
LOOP AT uris.
SEARCH uris-uri FOR 'smile.gif'.
IF sy-subrc = 0.
url = uris-uri.
EXIT.
ENDIF.
ENDLOOP.
BREAK-POINT.
CREATE OBJECT picture_control_1
EXPORTING
parent = docking.
CHECK sy-subrc = 0.
CALL METHOD picture_control_1->set_3d_border
EXPORTING
border = 5.
CALL METHOD picture_control_1->set_display_mode
EXPORTING
display_mode = cl_gui_picture=>display_mode_stretch.
CALL METHOD picture_control_1->set_position
EXPORTING
height = 55
left = 750
top = 08
width = 350.
CALL METHOD picture_control_1->load_picture_from_url
EXPORTING
url = url.
ENDFORM.
Regards -
Related to Displaying picture on the selection screen
Hi ,
I had a requirement where i had to display a picture on the selection screen, so i used the methods set_position and load_picture_from_url of the class cl_gui_picture to archive this, but now my selection screen has extended to more than one page because of this if i scroll down on the selection screen the picture is not scrolling it is remaining static to the screen ( i.e. if i place it (10, 10) after scrolling also it is still remaining at (10 , 10) with respect to the new screen) is there any way i can scoll the picture also i.e. it also moves up along with the screen?There could be one option : create one screen and load your picture on that screen.
Within your selection screen, call the screen created above. -
Call Display Picture Always Full Screen (I don't want that)
There are a few discussions about this, but they all seem to be over 4 years old, and I still have the problem. (Please read the whole explanation, as I've tried several fixes already)
I am extremelly picky with my computer and phone "stuff". Ever since I've owned my iPhone I've made it a point to add a picture to every contact I have.
Early in my iPhone ownership I realized that if you add a picture directly from your iPhone (wether is taking it directly from the iPhone cam while adding the contact or choosing from the library) such picture shows FULL screen when I call that person or when that person calls me. If I simply open Address Book in my Mac and "drag" a picture (say for instance from Facebook) into the picture section of that contact and then synch, then when I make or receive a call from that person it shows small and I still see my wallpaper on the background.
Well THAT's what I want (just like in the Appple commercials), I DON'T want the full screen picture.
Now here's THE PROBLEM;
For some reason NOW, I STILL add pictures the SAME WAY (I go into Facebook, and drag the picture into Address Book) but when I make or receive a call from that person the display picture ALWAYS shows full screen!! It's annoying the heck out of me!!
The ONLY thing different is that now my contact are synched thru iCloud as opposed to synching using a USB cable in iTunes, HOWEVER, SOME contacts show how they are supposed to show (even adding them thru iCloud), but MOST others don't! I feel I should add that ALL contacts I had BEFORE I strated synching with iCloud still show fine, the ones that have a problem are MOST (but not all) of the ones I added AFTER I started synching thru iCloud. And the fact that a few worked fine leads me to believe there's got to be a way of making them all show small.
Anyone has any idea of how to keep them ALL the same?OK, that's interesting. Now, how do I get all of my contact photos into iPhoto? And do I have to do this one contact at a time, or is there a setting where I can "import all". Furthermore, once all photos are in iPhoto and I select "Import Face from iPhoto" can I do such actions for all contacts at once or do I have to do them one at a time?
-
Show attached material picture in ABAP screen object
Hello,
I'm attaching material pictures with the GOS create attachment option. Here I could attach all kind of documents including the files "*.gif, *.tif, etc." These pictures are stored on our document server. Another possibility I use is to create a url to the direct link of the picture on the vendors site.
The materials are our own stock materials. These stock materials could be ordered by the reservation system. For that we have created our own reservation screen. In one of the fields they could enter a part of a material description to search for a particular material. If more material is valid these materials are shown in a selection list. To make is easier to pick the right material I want to show the material picture in a ABAP object on the selection screen.
I'm already able to show, in the list, if there is a material picture available with the function "BAPI_REL_GETRELATIONS"
If this function returns a table I know there is a (picture) document attached.
If the clicks on the hotspot in the list I want to show the picture in the ABAP object on the screen.
Here is a part to see if there is a material picture?
CLEAR OBJECTID.
OBJECTID-OBJKEY = makt-matnr. " Long number incl. zero's
OBJECTID-OBJTYPE = 'BUS1001006'.
N_lines = 0.
clear LISTOFRELATIONS.
CALL FUNCTION 'BAPI_REL_GETRELATIONS'
EXPORTING
OBJECTID = OBJECTID
ROLE =
RELATION =
RECURSIONLEVEL = 1
IMPORTING
RETURN = B_RETURN2
TABLES
LISTOFRELATIONS = LISTOFRELATIONS
describe table LISTOFRELATIONS lines N_lines.
IF N_lines > 0.
WRITE ICON_TIF AS ICON to artikelen-pic.
ELSE.
artikelen-pic = ' '.
ENDIF.
I'm able to show a picture in the ABAP object with the following code:
IF P_CONTAINER IS INITIAL.
CREATE OBJECT: P_CONTAINER EXPORTING container_name = 'MAT_PIC',
MM_PIC1 EXPORTING parent = P_CONTAINER.
l_alignment = cl_gui_control=>align_at_left +
cl_gui_control=>align_at_right +
cl_gui_control=>align_at_top +
cl_gui_control=>align_at_bottom.
CALL METHOD mm_pic1->set_alignment
EXPORTING
alignment = l_alignment.
CALL METHOD mm_pic1->set_3d_border
EXPORTING
border = 1.
CALL METHOD mm_pic1->set_display_mode
EXPORTING
display_mode = mm_pic1->display_mode_stretch
EXCEPTIONS
error = 1.
ENDIF.
IMPORT pict_tab = pict_tab FROM DATABASE abtree(pi) ID 'ENJOY'.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
TYPE = 'IMAGE'
SUBTYPE = 'GIF'
SIZE =
DATE =
TIME =
DESCRIPTION =
LIFETIME =
CACHEABLE =
SEND_DATA_AS_STRING =
TABLES
DATA = pict_tab
FIELDS =
PROPERTIES =
CHANGING
URL = url
EXCEPTIONS
DP_INVALID_PARAMETER = 1
DP_ERROR_PUT_TABLE = 2
DP_ERROR_GENERAL = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD mm_pic1->load_picture_from_url
EXPORTING
url = url
EXCEPTIONS
others = 4.
Could any one help me further to show the picture in the ABAP object 'MAT_PIC'?
I'm using SAP release 4.7 on a Oracle database.
The document server is the SAP DMS server on a SAP-DB database.
Kind regards,
Richard MeijnRefer the following:
REPORT ZTEST12.
* Type declarations.....................
TYPES pict_line(256) TYPE c.
* data declarations......................
DATA :init,
container TYPE REF TO cl_gui_custom_container,
editor TYPE REF TO cl_gui_textedit,
picture TYPE REF TO cl_gui_picture,
pict_tab TYPE TABLE OF pict_line,
url(255) TYPE c.
CALL SCREEN 100.
* Dialog modules......................................
MODULE status_0100 OUTPUT.
SET PF-STATUS 'SCREEN100'.
IF init is initial.
init = 'X'.
CREATE OBJECT:
container EXPORTING container_name = 'PICTURE_CONTAINER',
picture EXPORTING parent = container.
ENDIF.
IMPORT pict_tab = pict_tab FROM DATABASE abtree(pi) ID 'ENJOY'.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'IMAGE'
subtype = 'GIF'
TABLES
data = pict_tab
CHANGING
url = url.
CALL METHOD picture->load_picture_from_url EXPORTING url = url.
CALL METHOD picture->set_display_mode
EXPORTING display_mode = picture->display_mode_fit_center.
ENDMODULE.
MODULE cancel INPUT.
LEAVE TO SCREEN 0.
ENDMODULE. -
To display the user login details in selection-screen( input screen )
HI Experts,
I have a requirement.
Assume there is a report on travel details. Report access has been given to all in the organization based on authorization level.
Before excecuting the report, in the selection-screen(input screen) itself I need to display the login user details.
suppose user A belongs to ITS-business unit and user B-belongs to RDS-business unit and Industry group-Multi markets.
so when User B logs into production system and try to access the report, in the selection screen, i need to display like
user-id-- XXXX Business Unit---RDS and IG -
Multi Markets
how to achieve this? User details will vary based on login.
Regards,
Praveencheck this
REPORT Z_demo.
*& Function Modules: HR_GET_EMPLOYEE_DATA
*& HR_IMAGE_EXISTS
*& SCMS_DOC_URL_READ
*& HR_IMAGE_RESET
*& Class & Methods : CL_GUI_DOCKING_CONTAINER
*& CL_GUI_PICTURE->SET_POSITION
*& CL_GUI_PICTURE->SET_DISPLAY_MODE
*& CL_GUI_PICTURE->DISPLAY_MODE_FIT
*& CL_GUI_PICTURE->LOAD_PICTURE_FROM_URL_ASYNC
*REPORT ZEMPLOYEE.
TABLES: PA0001, PERSON.
*----------------------Declaration for Image------------------------*
DATA: DOCKING_CONT TYPE REF TO CL_GUI_DOCKING_CONTAINER, " Custom Container
PICTURE TYPE REF TO CL_GUI_PICTURE.
*--------------------Declaration of Internal table------------------*
DATA: ITAB_EMPDATA LIKE TABLE OF PERSON.
DATA: ITAB_DATA LIKE TABLE OF PERSON WITH HEADER LINE.
DATA: P_CONNECT_INFO LIKE TABLE OF TOAV0 WITH HEADER LINE.
DATA: P_DOCUMENT_TYPE LIKE TOAV0-RESERVE.
DATA: URL(255) TYPE C.
DATA: HANDLE TYPE I.
DATA: PPERNR TYPE PA0001-PERNR.
*----------------------Start of Selection Screen----------------------*
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-099.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN COMMENT 40(25) TEXT-010 .
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) TEXT-002 FOR FIELD PERNR.
PARAMETERS PERNR TYPE PA0001-PERNR.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) TEXT-008 FOR FIELD ENAME.
PARAMETERS ENAME TYPE PA0001-ENAME.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) TEXT-003 FOR FIELD PERSG.
PARAMETERS PERSG TYPE PA0001-PERSG.
SELECTION-SCREEN COMMENT 45(15) TEXT-009 FOR FIELD WERKS.
PARAMETERS WERKS TYPE PA0001-WERKS.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) TEXT-004 FOR FIELD PERSK.
PARAMETERS PERSK TYPE PA0001-PERSK.
SELECTION-SCREEN COMMENT 45(15) TEXT-005 FOR FIELD KOSTL.
PARAMETERS KOSTL TYPE PA0001-KOSTL.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) TEXT-006 FOR FIELD ORGEH.
PARAMETERS ORGEH TYPE PA0001-ORGEH.
PARAMETERS ORGEHTXT TYPE PERSON-ORGEH_TXT .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) TEXT-007 FOR FIELD PLANS.
PARAMETERS PLANS TYPE PA0001-PLANS.
PARAMETERS PLANSTXT TYPE PERSON-PLANS_TXT .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN END OF BLOCK B1.
*AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN OUTPUT .
LOOP AT SCREEN.
IF SCREEN-NAME = 'ENAME'
OR SCREEN-NAME = 'PERSG'
OR SCREEN-NAME = 'PERSK'
OR SCREEN-NAME = 'KOSTL'
OR SCREEN-NAME = 'WERKS'
OR SCREEN-NAME = 'ORGEH'
OR SCREEN-NAME = 'PLANS'
OR SCREEN-NAME = 'ORGEHTXT'
OR SCREEN-NAME = 'PLANSTXT'.
SCREEN-INPUT = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF SCREEN-NAME = 'ORGEHTXT'
OR SCREEN-NAME = 'PLANSTXT'.
SCREEN-OUTPUT = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
PERFORM GET_PIC.
*AT SELECTION-SCREEN .
AT SELECTION-SCREEN .
PPERNR = PERNR.
CALL FUNCTION 'HR_GET_EMPLOYEE_DATA'
EXPORTING
PERSON_ID = PPERNR
SELECTION_BEGIN = SY-DATUM
SELECTION_END = SY-DATUM
IMPORTING
PERSONAL_DATA = ITAB_DATA
EXCEPTIONS
PERSON_NOT_FOUND = 1
NO_ACTIVE_INTEGRATION = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENAME = ITAB_DATA-ENAME.
PERSG = ITAB_DATA-PERSG.
PERSK = ITAB_DATA-PERSK.
ORGEH = ITAB_DATA-ORGEH.
PLANS = ITAB_DATA-PLANS.
KOSTL = ITAB_DATA-KOSTL.
WERKS = ITAB_DATA-WERKS.
ORGEHTXT = ITAB_DATA-ORGEH_TXT.
PLANSTXT = ITAB_DATA-PLANS_TXT.
*Function Module To check Existance of Image
CALL FUNCTION 'HR_IMAGE_EXISTS'
EXPORTING
P_PERNR = PPERNR
IMPORTING
P_CONNECT_INFO = P_CONNECT_INFO
EXCEPTIONS
OTHERS = 2.
P_DOCUMENT_TYPE = P_CONNECT_INFO-RESERVE.
*Function Module To Get the URL of Image
CALL FUNCTION 'SCMS_DOC_URL_READ'
EXPORTING
STOR_CAT = SPACE
CREP_ID = P_CONNECT_INFO-ARCHIV_ID
DOC_ID = P_CONNECT_INFO-ARC_DOC_ID
COMP_ID = 'DATA'
DP_URL_ONLY = 'X'
IMPORTING
URL = URL
EXCEPTIONS
OTHERS = 10.
IF SY-SUBRC <> 0.
ENDIF.
*Method To load Image from URL
CALL METHOD PICTURE->LOAD_PICTURE_FROM_URL_ASYNC
EXPORTING
URL = URL.
IF SY-SUBRC NE 0.
ENDIF.
IF PPERNR NE PERNR.
*Function Module To Reset Image
CALL FUNCTION 'HR_IMAGE_RESET'
EXPORTING
HANDLE = HANDLE
EXCEPTIONS
INVALID_HANDLE = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
ENDIF.
ENDIF.
*& Form Get_Pic
FORM GET_PIC.
DATA: REPID LIKE SY-REPID.
REPID = SY-REPID.
IF PICTURE IS INITIAL.
*Object To Create the Custom Container
CREATE OBJECT PICTURE
EXPORTING
PARENT = DOCKING_CONT.
CHECK SY-SUBRC = 0.
*Method To Set Position of Image
CALL METHOD PICTURE->SET_POSITION
EXPORTING
HEIGHT = 47
LEFT = 610
TOP = 25
WIDTH = 70.
*Method To Set Display Mode Fit to Container
CALL METHOD PICTURE->SET_DISPLAY_MODE
EXPORTING
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT.
ELSE.
*Function Module To Reset Image
CALL FUNCTION 'HR_IMAGE_RESET'
EXPORTING
HANDLE = HANDLE
EXCEPTIONS
INVALID_HANDLE = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
ENDIF.
ENDIF.
ENDFORM. "Get_pic -
How to create Option Boxes IN A SELECTION SCREEN
How to create Option Boxes IN A SELECTION SCREEN.
Thanks!Hi Rajesh,
The following explanation gives clear picture of what is mean of check box and radio button with coding.....................
<b>CHECK BOX :</b>
AS CHECKBOX [USER-COMMAND fcode]
Effect:
This addition specifies that the input field in the first position of the selection screen is displayed as a checkbox, with the corresponding description next to it on the right. The checkbox is selected if the value of para is "X" or r "x". Otherwise, it is not selected.
The parameter must be created with the type c and length 1. An explicit length len is not permitted. If the addition TYPE is used, this can only be followed by the generic type c or a non-generic data type of type c and length 1.
The addition USER-COMMAND can be used to assign a function code fcode to the parameter. The function code fcode must be directly specified and may have a maximum length of 20 characters. To evaluate the function code, an interface work area of the structure SSCRFIELDS from the ABAP Dictionary must be declared using the statement TABLES. When the user selects the checkbox on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and transfers the function code fcode to the component ucomm of the interface work area sscrfields.
Notes
If the TYPE addition is used to make a reference to a data type in the ABAP Dictionary of type CHAR and length 1, and for which t the valid values in the domain are defined as "X" and " ", the parameter is automatically displayed as a checkbox on the selection screen.
If the addition USER-COMMAND is specified without the addition AS CHECKBOX, and the parameter is of type c with length 1, it is also displayed as a checkbox.
The addition USER-COMMAND can, for example, be used for screen modifications with the addition MODIF ID (see example).
<b>Coding :</b>
PARAMETERS show_all AS CHECKBOX USER-COMMAND flag.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p1(10) TYPE c,
p2(10) TYPE c,
p3(10) TYPE c.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS: p4(10) TYPE c MODIF ID bl2,
p5(10) TYPE c MODIF ID bl2,
p6(10) TYPE c MODIF ID bl2.
SELECTION-SCREEN END OF BLOCK b2.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF show_all <> 'X' AND
screen-group1 = 'BL2'.
screen-active = '0'.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
<b>RADIO BUTTON COMMAND :</b>
RADIOBUTTON GROUP group [USER-COMMAND fcode]
Effect:
This addition specifies that the input field is displayed as a radio button in the first position on the selection screen, and the output field is displayed next to it on the right. The radio button is selected if the value of para is "X" or "x". Otherwise, it is not selected.
group is used to define the radio button group for the parameter. The name group is entered directly as a character string with a maximum of 4 characters. Within a selection screen, there must be a minimum of two parameters in the same radio button group. There cannot be more than one radio button group with the same name in one program, even if they are defined in different selection screens.
The parameter must be specified with the type c and length 1. Explicit length specification using len is not permitted. If the addition TYPE is used, it can only be followed by the generic type c or a non-generic data type of type c and length 1.
In a radio button group, only one parameter can be defined with the addition DEFAULT, and the specified value must be "X". By default, the first parameter in a radio button group is set to the value "X", and the rest are set to " ".
The addition USER-COMMAND can be used to assign a function code fcode to the first parameter in a radio button group. The function code fcode must be specified directly, and have a maximum length of 20 characters. To evaluate the function code, an interface work area of the structure SSCRFIELDS from the ABAP Dictionary must be declared using the statement TABLES. When the user selects any radio button of the radio button group on the selection screen, the runtime environment triggers the event AT SELECTION-SCREEN and transfers the function code fcode to the component ucomm of the interface work area sscrfields.
Note:
It is recommended to define the radio buttons of a radio button group directly underneath each other. If the selection screen also contains other elements, it is recommended to define each radio button group within a block surrounded by a frame.
<b>CODING :</b>
tables : mkpf,mseg,ekko.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETER : P_WERKS LIKE MARC-WERKS MODIF ID S1,
c as checkbox.
SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN NO INTERVALS MODIF ID S2.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X' USER-COMMAND UC1.
SELECTION-SCREEN COMMENT 5(20) TEXT-002 FOR FIELD R1.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : R2 RADIOBUTTON GROUP G1.
SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B2.
write :/ p_werks,
/ s_ebeln.
AT SELECTION-SCREEN OUTPUT .
LOOP AT SCREEN .
IF R1 EQ 'X' AND SCREEN-GROUP1 EQ 'S2'.
SCREEN-INPUT = 0.
SCREEN-REQUIRED = 1.
clear s_ebeln[].
clear p_werks.
MODIFY SCREEN.
ENDIF.
IF R2 EQ 'X' AND SCREEN-GROUP1 EQ 'S1'.
SCREEN-INPUT = 0.
SCREEN-REQUIRED = 1.
clear s_ebeln[].
clear p_werks.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Let me knwo if any doubts.
<b>Reward with points if it helpful</b>
Regards,
Vijay -
How can I take pictures of my screen?
How can I take pictures of my screen and then save it?
I need help.
Thankyou.You mean take a screencapture?
Here are some useful keyboard shorcuts:
Screen Capture to disk:
command Shift Key 3 Screen to jpeg file on desktop
command Shift Key 4 + Drag: Selection to jpeg file on desktop
command Shift Key 4 + Spacebar: Window (click camera) to jpeg file
There is also SnapNDrag Pro, it was free yesterday on App Store.
Hope this helps, -
hi experts ,
can we add logo in selection screen .
if yes the how it can be possible .
Thanks And Regards .
PriyankTo create a logo u have to remember one thing is u have to upload that logo through OAER or SE78
for uploading logo in OAER
Enter class name as PICTURES
Class type as OT
Object key the name of ur logo want to upload
then press F8 or execute
Then it will automatically creates a folder for ur LOGO and upload ur logo in that folder
After that In the left side bottom of the page u can c the following options
1)Detail
2)Document Info
3)Keywords
4)Create
goto Detail in which u can find the Object Id
which u have to paste in the function module of this program
Check this program1
REPORT YMS_LOGOSEL.
*REPORT ZREPORT_LOGO.
DATA:
docking TYPE REF TO cl_gui_docking_container,
picture_control_1 TYPE REF TO cl_gui_picture,
url(256) TYPE c .
DATA : sum(4) , num1(4) , num2(4).
PARAMETERS: p_dummy(4) DEFAULT '4' .
PARAMETERS: p_dummy1(4) DEFAULT '5' .
AT SELECTION-SCREEN OUTPUT.
PERFORM show_pic.
START-OF-SELECTION.
num1 = p_dummy.
num2 = p_dummy1.
sum = num1 + num2.
WRITE : / sum.
*& Form show_pic
FORM show_pic.
DATA: repid LIKE sy-repid.
repid = sy-repid.
CREATE OBJECT picture_control_1 EXPORTING parent = docking.
CHECK sy-subrc = 0.
CALL METHOD picture_control_1->set_3d_border
EXPORTING
border = 5.
CALL METHOD picture_control_1->set_display_mode
EXPORTING
display_mode = cl_gui_picture=>display_mode_stretch.
CALL METHOD picture_control_1->set_position
EXPORTING
height = 100
left = 500
top = 10
width = 300.
CALL METHOD picture_control_1->load_picture_from_url
EXPORTING
url = 'c:/pic.bmp'.
IF sy-subrc NE 0.
ENDIF.
ENDFORM. "show_pic -
Adding logo/image on selection screen
How can I add logo or image on my selection screen??? or else use a picture as a background on the selection screen??
P.S : I have already searched the forum and have not got any suitable answer..most of them are about adding image on module pool screen..but I want it in my selection screen???Hi ,
Try like this
AT SELECTION-SCREEN OUTPUT.
PERFORM show_pic.
**& Form show_pic
FORM show_pic.
CREATE OBJECT picture_control_1 EXPORTING parent = docking.
CHECK sy-subrc = 0.
CALL METHOD picture_control_1->set_3d_border
EXPORTING
border = 5.
CALL METHOD picture_control_1->set_display_mode
EXPORTING
display_mode = cl_gui_picture=>display_mode_stretch.
CALL METHOD picture_control_1->set_position
EXPORTING
height = 55
left = 750
top = 08
width = 350.
CALL METHOD picture_control_1->load_picture_from_url
EXPORTING
url = 'C:\zpic.gif'.
*here you give the path where your pic is stored on the desktop
IF sy-subrc NE 0.
ENDIF.
ENDFORM.
Regards,
Nandha
Maybe you are looking for
-
Home Sharing iTunes to Apple TV, Songs Buffer Slowly
Hello, I need help I'm stuck in a dead end right now. Whenever I try to play music from my iTunes to my Apple TV (I believe it's the newest one in a small black box) through Home Sharing, the songs tend to buffer for a pretty long time. Even when I p
-
Can't copy an image from a smart album to normal album
I created a few smart albums that just show images from October, November, etc. Now I'm trying to pull a few images from each of those albums into a regular (not-smart) album (it will be of highlighted images, one from each month). When I drag the im
-
In Leopard, Character Viewer displayed the names of the radicals of Japanese characters in Japanese. Now I have Lion, the radicals all have English names which are totally different and impossible to search phonetically. I can't find a way to choose
-
10g doing VIEW type join even when no view in SQL - and performing poorly
Using 10.2.0.2.0 Every once in a while I see CBO deciding to use VIEW type join even when there is no view in the SQL and whenever it does that the performance just sucks. Example – SQL- SELECT a.emplid, a.empl_rcd, TO_CHAR (((a.dur) + (:"SYS_B_00"))
-
Help using Java to retrieve XMLType returned from PL/SQL stored object
Hi, Please bear with me if this is a trivial question. I'm brand new to Java, JDBC, and XML DB. I've been spinning my wheels on this for a few hours now. I have a table: XMLDB_USER@xmldb64> desc my_test_table Name