Add Picture to a Module pool screen
Any anyone know how to load a picture,im module pool
I have already uploaded a BMP file in se78.
After that do anyone know how to upload the picture
in the Module pool screen.
ok. first create a container then place this picture in ur container.
For detail.
go through this program......
create object cust_container
exporting
container_name = 'MYCONTAINER1'
create object picture
exporting
parent = cust_container
clear url.
path = 'Zex'.
perform get_url using path.
CALL METHOD picture->set_display_mode
EXPORTING
display_mode = cl_gui_picture=>display_mode_fit
EXCEPTIONS
ERROR = 1
others = 2
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 picture->load_picture_from_url
EXPORTING
url = url
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
form get_url using p_path.
DATA query_table LIKE w3query OCCURS 1 WITH HEADER LINE.
DATA html_table LIKE w3html OCCURS 1.
DATA return_code LIKE w3param-ret_code.
DATA content_type LIKE w3param-cont_type.
DATA content_length LIKE w3param-cont_len.
DATA pic_data LIKE w3mime OCCURS 0.
DATA pic_size TYPE i.
REFRESH query_table.
query_table-name = '_OBJECT_ID'.
query_table-value = p_path.
APPEND query_table.
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.
pic_size = content_length.
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.
endform. " get_url
Regards
Abhishek
Similar Messages
-
PICTURE ON A MODULE POOL SCREEN
Hi All.
I have an issue in module pool program.
I designed a screen with number 100.
on this screen they want to put some picture...like some logo.
Is it possible to put the picture on this screen 0100.
Please can any body ,help me to solve this issue.
Thanks in advance,
Regards,
Eswar.Hello,
You can use picture control to attach a picture to your screen.The sample code is below:
The custom container in the screen layout is named as 'CONTAINER'.
REPORT SAMPLE.
DATA: picture type ref to cl_gui_picture,
cont type ref to cl_gui_custom_container.
DATA: I_EVENTS TYPE CNTL_SIMPLE_EVENTS,
WA_EVENTS TYPE CNTL_SIMPLE_EVENT,
OK_CODE TYPE SY-UCOMM,
p_url type cndp_url.
Class click definition.
PUBLIC SECTION.
METHODS: click_handle for event picture_click of cl_gui_picture
importing MOUSE_POS_X MOUSE_POS_Y.
endclass.
DATA: click_variable type ref to click.
class click implementation.
method click_handle.
DATA: X_POS(5),Y_POS(5).
X_POS = MOUSE_POS_X.
Y_POS = MOUSE_POS_Y.
MESSAGE I000(OK) WITH 'Picture Click' X_POS Y_POS.
endmethod.
endclass.
START-OF-SELECTION.
call screen 100.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'GUI'.
SET TITLEBAR 'xxx'.
if cont is initial.
CREATE OBJECT CONT
EXPORTING
CONTAINER_NAME = 'CONTAINER'.
CREATE OBJECT PICTURE
EXPORTING
LIFETIME =
SHELLSTYLE =
PARENT = cont
NAME =
EXCEPTIONS
ERROR = 1
others = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
wa_events-EVENTID = picture->EVENTID_PICTURE_CLICK.
wa_events-APPL_EVENT = 'X'.
append wa_events to i_events.
CALL METHOD PICTURE->SET_REGISTERED_EVENTS
EXPORTING
EVENTS = i_events.
create object click_variable.
set handler click_variable->click_handle for picture.
CALL METHOD PICTURE->SET_3D_BORDER
EXPORTING
BORDER = 1.
CALL FUNCTION 'DP_PUBLISH_WWW_URL'
EXPORTING
OBJID = 'HTMLCNTL_TESTHTM2_SAP_AG'
LIFETIME = cndp_lifetime_transaction
IMPORTING
URL = p_url
IF SY-SUBRC = 0.
CALL METHOD PICTURE->LOAD_PICTURE_FROM_URL_ASYNC
EXPORTING
URL = p_url.
ENDIF.
endif.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'BACK'.
LEAVE PROGRAM.
WHEN 'NORMAL'.
CALL METHOD PICTURE->SET_DISPLAY_MODE
EXPORTING
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL.
WHEN 'FIT'.
CALL METHOD PICTURE->SET_DISPLAY_MODE
EXPORTING
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT.
WHEN 'NORMAL_C'.
CALL METHOD PICTURE->SET_DISPLAY_MODE
EXPORTING
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_NORMAL_CENTER.
WHEN 'FIT_C'.
CALL METHOD PICTURE->SET_DISPLAY_MODE
EXPORTING
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_FIT_CENTER.
WHEN 'STRETCH'.
CALL METHOD PICTURE->SET_DISPLAY_MODE
EXPORTING
DISPLAY_MODE = CL_GUI_PICTURE=>DISPLAY_MODE_STRETCH.
WHEN 'CLEAR'.
CALL METHOD PICTURE->CLEAR_PICTURE.
WHEN SPACE.
CALL METHOD PICTURE->LOAD_PICTURE_FROM_URL
EXPORTING
URL = P_URL.
IMPORTING
RESULT = RETURN.
CALL METHOD CL_GUI_CFW=>FLUSH.
endcase.
endmodule.
Also check demo program:RSDEMO_PICTURE_CONTROL
<b>TO GET DIFFERENT PICTURES</b>:
(The following is <b>Judith Jessie Selvi's</b> reply for a similar query.Unfortunately I'm not able to track the URL of that thread).
Refer this link
1... create a logo using paint shop and save it as tifffile then using RSTXLDMC (is a program name) used to upload logo
2.....create a logo using paint shop and save it as bmpfile then using SE78 you can do this.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCCIIMAGE/BCCIIMAGE.pdf
http://www.sap-img.com/human/linking-employee-photos-using-sap-archive-link.htm
Transaction OAOR,
- OAOR (Business Document Navigator)
Give Class Name - PICTURES Class Type - OT..... then Execute
It will show you the list, then select ENJOYSAP_LOGO.
On that list, you will find one control with a "create" tab.
Click std. doc types.
Select SCREEN and double-click.
It will push FILE selection screen.
Select your company logo (.gif) and press OK.
It will ask for a description- for instance: "company logo".
It will let you know your doc has been stored successfully.
You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
Regards,
Beejal
**Reward if this helps -
How to add TAB functionality in module pool screen
Hi,
I have created a screen with two fields(input/output).My requirement is generally cursor is in the first field when user pressed TAB key then cursor has to move to second field.How can i fulfil this requirment.
Thanks,
shylaHi,
If u have created your input filed (Input/Output-Se51) field in screen layout then it will automatically jump to next input field when u press enter.
Chk it out. -
How to add help documentation in a module pool screen?
Hi ,
I have to add documentation for a module pool screen. I have added the documentation for the program in se38 but what can I do to make it visible on the screen I have designed.
Since I am new to module pool, kindly explain me step by step.
Thanks,
NidhiHello Nidhi,
if you want at field level you use
PROCESS ON HELP-REQUEST. in flow logic of screen.
one mre thing you can add one text edit control on screen and put your text in screen -
How to add logo in module pool screen
Hi Expert,
I need to display company logo in the module pool screen
how this can be added ?
Regards
BikasHi,
create a custom control called 'CUSTOM_CONTROL'
CONSTANTS: CNTL_TRUE TYPE I VALUE 1,
CNTL_FALSE type i value 0.
data:h_picture type ref to cl_gui_picture,
h_pic_container type ref to cl_gui_custom_container.
data: graphic_url(255),
graphic_refresh(1),
g_result like cntl_true.
data: begin of graphic_table occurs 0,
line(255) type x,
end of graphic_table.
data: graphic_size type i.
data: g_stxbmaps type STXBITMAPS,
l_bytecnt type i,
l_content TYPE standard table of bapiconten initial size 0.
g_stxbmaps-tdobject = 'GRAPHICS'.
g_stxbmaps-tdname = 'ENJOY'.
g_stxbmaps-tdid = 'BMAP'.
g_stxbmaps-tdbtype = 'BMON'.
call function 'SAPSCRIPT_GET_GRAPHIC_BDS'
exporting
i_object = g_stxbmaps-tdobject
i_name = g_stxbmaps-tdname
i_id = g_stxbmaps-tdid
i_btype = g_stxbmaps-tdbtype
importing
e_bytecount = l_bytecnt
tables
content = l_content
exceptions
not_found = 1
bds_get_failed = 2
bds_no_content = 3
others = 4.
call function 'SAPSCRIPT_CONVERT_BITMAP'
exporting
old_format = 'BDS'
new_format = 'BMP'
bitmap_file_bytecount_in = l_bytecnt
importing
bitmap_file_bytecount = graphic_size
tables
bds_bitmap_file = l_content
bitmap_file = graphic_table
exceptions
others = 1.
call function 'DP_CREATE_URL'
exporting
type = 'image'
subtype = cndp_sap_tab_unknown
size = graphic_size
lifetime = cndp_lifetime_transaction
tables
data = graphic_table
changing
url = graphic_url
exceptions
others = 4 .
create object h_pic_container
exporting container_name = 'CUSTOM_CONTROL'.
create object h_picture exporting parent = h_pic_container.
call method h_picture->set_display_mode
exporting
display_mode = cl_gui_picture=>display_mode_normal.
call method h_picture->load_picture_from_url
exporting url = graphic_url
importing result = g_result.
or you can check the program RSDEMO_CUSTOM_CONTROL
check link :
How to insert Image on Screen
thanks
Parvathi -
Icon display in Module pool screen not visible to some users
Hi,
I have added an icon in one of the module pool screen with dynamic quick info. The page is rendered fine and the info is also displayed well for most users except some. I can't figure out why the icon is not being displayed for some users.
Do someone has any solution for this?
Thanks,
SumithAs I recall, the icons are actually stored in a file on each PC so some users may have a corrupted or out-of-date file with the icons. You can look for posting on "how to add an icon" to see a discussion on this topic.
I found some useful info at:
Create and Add Icons to table ICON?
Message was edited by: Charles Folwell -
Problem in creating a Select-option im a module pool screen
I've been searching how to do a select option in a module pool screen, I've found this neat tutorial http://sample-code-abap.blogspot.com/2008/06/select-option-in-module-pool-screen.html
but I'm having trouble to replicate it...
I've created this conde in my TOP include
SELECTION-SCREEN BEGIN OF SCREEN 201 AS SUBSCREEN.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN END OF SCREEN 201.
and this is my screen flow code
PROCESS BEFORE OUTPUT.
MODULE status_0100.
MODULE pbo_200.
PROCESS AFTER INPUT.
MODULE pai.
MODULE user_command_0200.
in the screen 200 I have a subscreen area named subs
but when I do this:
MODULE pbo_200 OUTPUT.
CALL subscreen subs including sy-repid '0201'.
ENDMODULE. " pbo_200 OUTPUT
it doesn't "compile"
it gives me this error:
""." or "ID ... FIELD ..." expected after "SUBSCREEN"."
what am I missing? it seems its not recognising the "CALL SUBSCREEN" command...you can't use CALL SUBSCREEN... in any ABAP section. It is reserved to dynpro flow logic. Just add it after PROCESS BEFORE OUTPUT (and also after PROCESS AFTER INPUT).
-
Trigger a workflow from module pool screen at save button
Hi,
I am new to workflow.Please help me.My requirement is trigger a custom workflow from module pool screen at save button.
Scenario is: Create a Z screen for material creation and after pressing save button workflow should trigger to approver and approver emailid should be fetch from Z table and have to provide a link in work flow for Z t-code which displays a report of material pending for approval..
Please suggest me process how i can acheive this..
ThanksHi,
If you're using standard bapi's to save the material, you can then use either the standard events which are already triggered or you coul add a change document for material changes or creation.
Then this event can be the trigger of your custom workflow.
Kind regards, Rob Dielemans -
Variants for module pool screena
Hi,
I tried creating a variant for module pool screen by using the FM : RS_CREATE_VARIANT.
For this i created a dummy report which has the same parameters as the fields in the screen.
CALL FUNCTION 'RS_VARIANT_CONTENTS'
EXPORTING
report = gc_dummy_rep
variant = 'variant5'
MOVE_OR_WRITE = 'W'
NO_IMPORT = ' '
EXECUTE_DIRECT = ' '
IMPORTING
SP =
tables
L_PARAMS =
L_PARAMS_NONV =
L_SELOP =
L_SELOP_NONV =
valutab = lt_params
OBJECTS =
FREE_SELECTIONS_DESC =
FREE_SELECTIONS_VALUE =
EXCEPTIONS
VARIANT_NON_EXISTENT = 1
VARIANT_OBSOLETE = 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.
but when i try to retrieve the values stored in the variant using FM : RS_VARIANT_CONTENTS.
CALL FUNCTION 'RS_VARIANT_CONTENTS'
EXPORTING
report = gc_dummy_rep
variant = 'variant5'
MOVE_OR_WRITE = 'W'
NO_IMPORT = ' '
EXECUTE_DIRECT = ' '
IMPORTING
SP =
tables
L_PARAMS =
L_PARAMS_NONV =
L_SELOP =
L_SELOP_NONV =
valutab = lt_params
OBJECTS =
FREE_SELECTIONS_DESC =
FREE_SELECTIONS_VALUE =
EXCEPTIONS
VARIANT_NON_EXISTENT = 1
VARIANT_OBSOLETE = 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.
I get an error message : variant5 not found.
is there anything that i miss here?
or is the way i use to create variant for module pool screen not right?
Regards,
KaminiHi,
To avail save variant option in module pool screen,
1. You need to create a data base table similar to INDX table with the fields RELID, VARI_NAME
PROG_NAME
UNAME
SRTF2, MEMORYID, CLUSTR, CLUSID. And the remaining fields can be anything.
2. Enable the Save button in the Function keys part of GUI Status. And Add a push button for Get variant.
3. When Save button clicked call a screen with a single field for variant (let us say g_var). After g_var entered, in the PAI of the initial screen export all the screen values to the created database index using the statement .
EXPORT: g_characteristics_tab TO DATABASE zav0257(ch) ID g_var,
s_auart TO DATABASE zav0257(au) ID g_var.
So that the values will be exported to database.
Then update the fields(VARI_NAME,PROG_NAME,UNAME) of the database table using modify from work area.
So that you will have the history of variance existence.
4. Next time , when the user clicks on Get Variant option, call another screen to enter the variant name. Then import the values for that variant from the memory id in the database table.
It worked for me. -
How to use table maintenance view in module pool screen
hi ,
want to use table maintenance view in a module pool screen so that i can edit, insert, delete and update date in to the ztable.please help.You can simply call it via SM30. Or you can call the table maintence view from any program(report or module pool) using a function module.
call function 'VIEW_MAINTENANCE_CALL'
exporting
action = 'U'
view_name = 'Z_Table_Name'
exceptions
client_reference = 1
foreign_lock = 2
invalid_action = 3
no_clientindependent_auth = 4
no_database_function = 5
no_editor_function = 6
no_show_auth = 7
no_tvdir_entry = 8
no_upd_auth = 9
only_show_allowed = 10
system_failure = 11
unknown_field_in_dba_sellist = 12
view_not_found = 13
others = 14.
Regards,
RIch Heilman -
How to handle The Back button on Module Pool screen
Hi Gurus,
I have created a module pool screen. In that screen I have used some input/output fields(text box) which i have marked mandatory by making the input field as "required" under program tab.
now when running the screen if no data is entered into these mandatory input field then BACK button does not work. First I have to enter some data into the input filed only then the BACK button works. How should i code so that the back button works even without entering the data into these mandatory fields.hi,
use AT EXIT-COMMAND with the module.
eg. module user_command at exit command.
then there will be no problem. -
How to display image and data in module pool screen?
Hi,
I want to display image and relevant data besides the image in module pool screen, I am using docking container to display the image.
Actually I am able to display image or data any one but not both.
one more thing I want to display multiple images and their data.
Please suggest some one if you have any idea.
Regards,
Dileep.You can try below way, I have used in report.
DATA: gc_docking TYPE REF TO cl_gui_docking_container, "#EC NEEDED "Docking Container
gc_split TYPE REF TO cl_gui_easy_splitter_container, "#EC NEEDED "Splitter
gc_top_container TYPE REF TO cl_gui_container, "#EC NEEDED "Top Container
gc_bottom_container TYPE REF TO cl_gui_container, "#EC NEEDED "Bottom Container
gc_document TYPE REF TO cl_dd_document, "#EC NEEDED "Document
gc_events TYPE REF TO lcl_event_class, "#EC NEEDED " Local Event Class
gc_grid TYPE REF TO cl_gui_alv_grid, "#EC NEEDED " ALV Class
" Creating Docking
CREATE OBJECT gc_docking
EXPORTING
ratio = c_95.
IF sy-subrc EQ 0.
* Splitting the Docking container
CREATE OBJECT gc_split
EXPORTING
parent = gc_docking
sash_position = c_10 "Position of Splitter Bar (in Percent)
with_border = c_1. "With Border = 1 Without Border = 0
ENDIF.
* Placing the containers in the splitter
gc_top_container = gc_split->top_left_container .
gc_bottom_container = gc_split->bottom_right_container .
* Creating Grid
CREATE OBJECT gc_grid
EXPORTING
i_parent = gc_bottom_container.
ELSE.
* Background job handling
CREATE OBJECT gc_grid
EXPORTING
i_parent = gc_docking.
ENDIF.
* Creating the document
CREATE OBJECT gc_document
EXPORTING
style = 'ALV_GRID'.
Regards,
Sameer -
How to get the Grand Total in Module pool Screen
Hi Frds.
How to get the Grand Total in Module pool Screen
Example i have 10 different materials
for each matarial has different moving . But in my case matarials is doesnt matter here
10 material Moving Average price to do Frand total and display in one column...
Please Help me out Frds.
Regards,
KabilHi
You need to calculate the total in a module of PAI (or PBO) event:
PROCESS PAI.
LOOP.....
ENDLOOP.
MODULE CALCULATE_TOTAL.
MODULE CALCULATE_TOTAL.
GRAND_TOTAL = 0.
LOOP AT ITAB,
GRAND_TOTAL = GRAND_TOTAL + ITAB-PWB.
ENDLOOP.
ENDMODULE.
In this way the grand total will be calculated as soon as the user presses enter or another command.
You can't insert the calculation in the loop of table control, because this loop runs the visible lines only, so it's better to calculate the total out of those loop, -
Assigning 2 fields of same table in Module pool screen
Hi,
I want to assign similar fields of table in module pool screen.
In one case i directly use the tablename-fieldname and in other case when i try doing the same i get error. I know that this is not possible.
Is there any way to get around this. The field i am referring to is attached to a custom domain which is having defined fields. In the second assignment i need to retreive the values of the domain and display it in dropdown mode so that the users are able to select it.
Regards,
ImranThe domain only attached with this field?check the same domain attached to any other field and insert that field in the screen.
shibu
reward if helpful -
How to do ICON_EXPAND and ICON_COLLAPSE input fields in module pool screen?
hi frnds.
My problem is in module pool screen how to do ICON_EXPAND and ICON_COLLAPSE input fields in module pool screen?And how to do GUI STATUS and GUI TITLE? IN SE80.
ITS URGENT.POINTS WILL BE REWADED.THANKS IN ADVANCE.Hi,
Go through this thread.
[expand and collapse|expand and collapse]
Cheers,
Simha.
Maybe you are looking for
-
Creative Cloud for Teams (Non-Profit) Renewal Loop
Every time I open any Creative Cloud app I get this window: When I click "Try Again" I get this window: When I click "Continue" I get the previous window (above) again. If I click on "Have a different Adobe ID?" and input my password via that window
-
How do I get my eye dropper tool to show up?
Somehow, my eye dropper disappeared. I can't find it in my tool bar. I've searched for at least an hour now, and I really need it. Can someone PULEEEEZ help me get it back?
-
Scrollbar Component - how to set the arrows to invisible
Hello Forum I'm trying to save some coding time by using the flash component scrollbar. Is there a way to tun off the visibility of the arrows. The designer wants only the scroll thumb (is that the right term?)... I've imported the component assets i
-
I am looking to see if there is a good source of information about how to use the 3 way color correction in premier Pro CS6? It's very complex and daunting when I first look at it, and I would like to figure out how to use it effectively for my unde
-
How to play MPEG 4 (h.264 / AVC) videos that were encoded for the PSP
Hello, I am trying to play a video in MPEG 4 (h.264 / AVC) format (file extension .mp4) that was encoded to play on the Sony PlayStationPortable (480x272) via QuickTime. The video plays perfectly via VideoLAN, mplayer or the PSP, but QuickTime only o