2016 Photos Conference Photos ......2016 Photos Conference Photos ...
Employee Photos
-
Upload
deepthi-edison -
Category
Documents
-
view
224 -
download
0
Transcript of Employee Photos
-
8/2/2019 Employee Photos
1/25
The following code adds an icon (exclamation) to the ALV grid/list. It also includes the code for adding hot-spot to ALV
column.
Program Code
REPORT ZICON_IN_ALV.
************************************************************************
* Include Programs
************************************************************************
*INCLUDE .
************************************************************************
* Database Tables
************************************************************************
TABLES: kna1. "Customer Master
************************************************************************
* Types
************************************************************************
TYPE-POOLS: kkblo.
************************************************************************
* Structures
-
8/2/2019 Employee Photos
2/25
************************************************************************
* Structure to hold the Color Information
DATA: BEGIN OF st_color,
color(3) TYPE c,
END OF st_color.
* Structure to hold the Icon Information
DATA: BEGIN OF st_icon,
icon(4) TYPE c,
END OF st_icon.
* ALV Field Catalog Structure
DATA: st_fieldcat TYPE slis_fieldcat_alv.
* ALV Layout Structure
DATA: st_layout TYPE slis_layout_alv.
************************************************************************
* Internal Tables
************************************************************************
* Output Table
DATA: BEGIN OF tbl_kna1 OCCURS 0.
INCLUDE STRUCTURE st_icon. "Icon Structure
INCLUDE STRUCTURE kna1. "Customer Master Structure
INCLUDE STRUCTURE st_color. "Color Structure
DATA: END OF tbl_kna1.
* ALV Field Catalog Table
DATA: tbl_fieldcat TYPE slis_t_fieldcat_alv.
************************************************************************
-
8/2/2019 Employee Photos
3/25
* Variables
************************************************************************
DATA: fieldname(30) TYPE c,
g_repid LIKE sy-repid.
************************************************************************
* Start of Selection
************************************************************************
START-OF-SELECTION.
g_repid = sy-repid.
PERFORM get_data.
************************************************************************
* End of Selection
************************************************************************
END-OF-SELECTION.
PERFORM do_fancy_stuff.
PERFORM get_layout.
PERFORM get_fieldcat.
PERFORM create_report.
*&---------------------------------------------------------------------*
*& Form CREATE_REPORT
*&---------------------------------------------------------------------*
* Learn to read the subroutine name!
*----------------------------------------------------------------------*
FORM create_report.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
-
8/2/2019 Employee Photos
4/25
EXPORTING
i_interface_check = ' '
i_callback_program = g_repid
i_callback_user_command = 'PROCESS_USER_COMMANDS'
it_fieldcat = tbl_fieldcat
i_default = 'X'
i_save = ' '
is_layout = st_layout
TABLES
t_outtab = tbl_kna1
EXCEPTIONS
program_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.
ENDFORM. " CREATE_REPORT
*&---------------------------------------------------------------------*
*& Form GET_FIELDCAT
*&---------------------------------------------------------------------*
* Build the Field Catalog
*----------------------------------------------------------------------*
FORM get_fieldcat.
* Here the field catalog is created. To display more fields simply
-
8/2/2019 Employee Photos
5/25
* 'uncomment' the additional lines and add the field name. Also note
* that the field catalog is much more powerful than this. You can
* intensify fields, change the colour, assign reference fields, etc.
* Look at type slis_fieldcat_alv for more options.
PERFORM write_fieldcat USING 'ICON' 'TBL_KNA1' ' ' 'X' 1 '2' 'X'
' '.
PERFORM write_fieldcat USING 'KUNNR' 'TBL_KNA1' 'KNA1' 'X' 2 ' ' ' '
' '.
PERFORM write_fieldcat USING 'NAME1' 'TBL_KNA1' 'KNA1' ' ' 3 '10' ' '
'X'.
PERFORM write_fieldcat USING 'STRAS' 'TBL_KNA1' 'KNA1' ' ' 4 ' ' ' '
' '.
PERFORM write_fieldcat USING 'TELF1' 'TBL_KNA1' 'KNA1' ' ' 5 ' ' ' '
' '.
PERFORM write_fieldcat USING 'ORT01' 'TBL_KNA1' 'KNA1' ' ' 6 ' ' ' '
' '.
PERFORM write_fieldcat USING 'PSTLZ' 'TBL_KNA1' 'KNA1' ' ' 7 ' ' ' '
' '.
PERFORM write_fieldcat USING 'SORTL' 'TBL_KNA1' 'KNA1' ' ' 8 ' ' ' '
' '.
PERFORM write_fieldcat USING 'ERNAM' 'TBL_KNA1' 'KNA1' ' ' 9 ' ' ' '
' '.
PERFORM write_fieldcat USING 'SPRAS' 'TBL_KNA1' 'KNA1' ' ' 10 ' ' ' '
' '.
* perform write_fieldcat using ' ' 'TBL_KNA1' 'KNA1' ' ' 10 ' '.
-
8/2/2019 Employee Photos
6/25
* perform write_fieldcat using ' ' 'TBL_KNA1' 'KNA1' ' ' 11 ' '.
* perform write_fieldcat using ' ' 'TBL_KNA1' 'KNA1' ' ' 12 ' '.
ENDFORM. " GET_FIELDCAT
*&---------------------------------------------------------------------*
*& Form WRITE_FIELDCAT
*&---------------------------------------------------------------------*
* Write the Field Catalog data to the Field Catalog Table
*----------------------------------------------------------------------*
* -->name Field name
* -->tab Table name
* -->st Structure Name
* -->key Is this field a Key?
* -->pos Position Number
* -->length Field Length
* -->icon Display as Icon
* -->hot Hotspot
*----------------------------------------------------------------------*
FORM write_fieldcat USING name tab st key pos length icon hot.
st_fieldcat-fieldname = name.
st_fieldcat-tabname = tab.
st_fieldcat-ref_tabname = st.
st_fieldcat-key = key.
st_fieldcat-col_pos = pos.
st_fieldcat-outputlen = length.
st_fieldcat-icon = icon.
-
8/2/2019 Employee Photos
7/25
st_fieldcat-hotspot = hot.
APPEND st_fieldcat TO tbl_fieldcat.
CLEAR st_fieldcat.
ENDFORM. " WRITE_FIELDCAT
*&---------------------------------------------------------------------*
*& Form PROCESS_USER_COMMANDS
*&---------------------------------------------------------------------*
* Interactive Reporting Commands
*----------------------------------------------------------------------*
FORM process_user_commands USING syst-ucomm LIKE syst-ucomm
selfield TYPE slis_selfield.
* This subroutine is called when there is user interaction in the output
* In this case if the user double clicks the Customer Number then the
* program will call transaction XD03 and display the Customer Master
* Data
CASE syst-ucomm.
WHEN '&IC1'.
* get cursor field fieldname.
READ TABLE tbl_kna1 INDEX selfield-tabindex.
SET PARAMETER ID 'KUN' FIELD tbl_kna1-kunnr.
CALL TRANSACTION 'XD03' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM. " PROCESS_USER_COMMANDS
*&---------------------------------------------------------------------*
*& Form GET_LAYOUT
-
8/2/2019 Employee Photos
8/25
*&---------------------------------------------------------------------*
* set the layout of the ALV.
* add color to the row?
*----------------------------------------------------------------------*
FORM get_layout.
st_layout-info_fieldname = 'COLOR'.
st_layout-colwidth_optimize = 'X'.
st_layout-get_selinfos = 'X'.
ENDFORM. " GET_LAYOUT
*&---------------------------------------------------------------------*
*& Form get_data
*&---------------------------------------------------------------------*
* Get some data to play with
*----------------------------------------------------------------------*
FORM get_data.
SELECT * FROM kna1 INTO CORRESPONDING FIELDS OF TABLE tbl_kna1
UP TO 30 ROWS.
ENDFORM. " get_data
*&---------------------------------------------------------------------*
*& Form do_fancy_stuff
*&---------------------------------------------------------------------*
* Do some fancy pants stuff for example changing the color of
* lines and adding icons
*----------------------------------------------------------------------*
FORM do_fancy_stuff.
-
8/2/2019 Employee Photos
9/25
* Here we will demonstrate changing the color of ALV Record lines as
* well as displaying Icons
LOOP AT tbl_kna1.
* All records where NAME1 begins with 'M', will be displayed in Bluish
* Green
IF tbl_kna1-name1(1) EQ 'M'.
tbl_kna1-color = 'C41'. "Bluish Green
MODIFY tbl_kna1 TRANSPORTING color.
ENDIF.
* All records with no TELF1 will be displayed in White and have a
* Warning Icon
IF tbl_kna1-telf1 IS INITIAL.
tbl_kna1-color = 'C00'. "White
tbl_kna1-icon = '@AH@'. "Warning Icon
MODIFY tbl_kna1 TRANSPORTING icon color.
ENDIF.
ENDLOOP.
ENDFORM. " do_fancy_stuff
How to put Logo or photo in ALV Report
Logo should be uploaded into application server using transaction 'OAER'.
1. Go to Transaction OAER,
-
8/2/2019 Employee Photos
10/25
2. Give Class Name as PICTURES
3. Class type as OT
4. Object Key is the name you want to search or you want to upload.
5. Then select the Document from below after double click on it .Choose in screen for logos.
6. Upon execution you would be prompted to give the file path details. Just upload which ever logo u
want to display
7. Now you can use the same name in your ALV FM.
In your ALV program, you need to have event for TOP_OF_PAGE, and also this works only in case of Grid
not in ALV LIST.
Look at the sample code to display LOGO.
**********************
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = i_repid
it_fieldcat = header
is_layout = gt_layout
i_callback_top_of_page = 'TOP-OF-PAGE1'
i_grid_title = xyz
it_sort = gt_sort[]
i_default = 'X'
i_save = 'U'
is_variant = gt_variant
-
8/2/2019 Employee Photos
11/25
it_events = gt_events
tables
t_outtab = t_output.
*****************
*-------------------------------------------------------------------*
* Form TOP-OF-PAGE1
*-------------------------------------------------------------------*
form top-of-page1.
data: header type slis_t_listheader,
wa type slis_listheader.
* TITLE AREA
wa-typ = 'S'.
wa-info = text-h04.
append wa to header.
wa-typ = 'S'.
write sy-datum to wa-info mm/dd/yyyy.
-
8/2/2019 Employee Photos
12/25
concatenate text-h03 wa-info into wa-info separated by space.
append wa to header.
wa-typ = 'S'.
concatenate text-h02 sy-uname into wa-info separated by space.
append wa to header.
wa-typ = 'S'.
concatenate text-h01 sy-repid into wa-info separated by space.
append wa to header.
********" LOGO
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = header
i_logo = 'ENJOYSAP_LOGO'.
*********" LOGO
endform.
-
8/2/2019 Employee Photos
13/25
Here in TOP-OF-PAGE form it will show you the Prog name,Date, User Name
o
Have you solved your issue regarding the employee picture? I'm having exactly the same problem.
As far as I found out during my Internet and SDN research is, that the picture of TCODE OAAD cannot be printed in SmartForm directly.
SmartForm can only read graphics from the 'Graphics store' using SE78.
As we also store our employee picture using OAAD, we will run the following steps to include the picture into the SmartForm (The following
steps are done during printing):
1. Get image document id with function 'HR_IMAGE_EXISTS'
2. Read the image in JPG format using function 'ALINK_RFC_TABLE_GET'
3. Convert the image from JPG to BMP (this is done by calling a VisualBasic.NET command line function returning the image in BMP format(l_bitmap(255) type x))
4. Convert the BMP into BDS with 'SAPSCRIPT_CONVERT_BITMAP_BDS'
5. Store the BDS with method 'l_bds_object->create_with_table' and the employee number is being used as ID
Note: step 4 and 5 are copied out of 'IMPORT_BITMAP_BDS' of main program 'SAPLSTXBITMAPS'
6. Use 'dynamic' bitmap in SmartForm as described inAdding images dynamically to SAPScript
We have tested the steps individually and it seems to work. However, the program hasn't been completed yet. Nevertheless, we expect this to
work, even if it is not efficient from a performance point of view. Hence, my question: is it possible to print a BMP (stored in a ABAP table)directly in the SmartForm without having to store it in the 'Graphics storage' SE78?
Any help on this topic is highly appreciated.
cu, Adrian
Report Abuse
Like (0) Re: Employee Picture Upload in SmartForm
Herbert StcklOct 2, 2006 8:27 AM (in response to Adrian Buenter)We have got similar problems in other situations.
It is hard to believe that it isn't possible to use documents stored in KPRO or some other places.
It is hard to believe that standard file fomats as gif, jpeg are not useable in the BDS.
At least one compress file format should be useable (at least input format in the upload case to the BDS).
This area is in my eyes puts shame on SAP.
Report Abuse
http://scn.sap.com/thread/26778http://scn.sap.com/thread/26778http://scn.sap.com/thread/26778http://scn.sap.com/message-abuse!input.jspa?objectID=1141435&objectType=2http://scn.sap.com/message-abuse!input.jspa?objectID=1141435&objectType=2http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/message/2490744#2490744http://scn.sap.com/message/2490744#2490744http://scn.sap.com/people/herbert.stcklhttp://scn.sap.com/people/herbert.stcklhttp://scn.sap.com/thread/95823#1141435http://scn.sap.com/message-abuse!input.jspa?objectID=2490744&objectType=2http://scn.sap.com/message-abuse!input.jspa?objectID=2490744&objectType=2http://scn.sap.com/people/herbert.stcklhttp://scn.sap.com/people/herbert.stcklhttp://scn.sap.com/message-abuse!input.jspa?objectID=2490744&objectType=2http://scn.sap.com/thread/95823#1141435http://scn.sap.com/people/herbert.stcklhttp://scn.sap.com/message/2490744#2490744http://scn.sap.com/thread/95823http://scn.sap.com/message-abuse!input.jspa?objectID=1141435&objectType=2http://scn.sap.com/thread/26778 -
8/2/2019 Employee Photos
14/25
Like (0) Re: Employee Picture Upload in SmartForm
Faina FridmanJan 1, 2007 11:02 AM (in response to Herbert Stckl)Hi
My name is Faina.
I also have the same problem.
Did somebody find solution?
Report Abuse
Like (0) Re: Employee Picture Upload in SmartForm
Jens GuntenhnerAug 21, 2008 2:28 PM (in response to Herbert Stckl)Did you found a solution for the problem?
I have the same problem at the moment
Kind regards
Jens
Report Abuse
Like (0) Re: Employee Picture Upload in SmartForm
Omer GFeb 22, 2007 10:54 AM (in response to Adrian Buenter)did anyone do that?its working?
i tried but i don't know how to operate 'SAPSCRIPT_CONVERT_BITMAP_BDS'
please help me.
Report Abuse
Like (0) Re: Employee Picture Upload in SmartForm
balakumar ganesanSep 11, 2007 11:40 AM (in response to Adrian Buenter)Hi Adrian ,
http://scn.sap.com/message-abuse!input.jspa?objectID=2490744&objectType=2http://scn.sap.com/message-abuse!input.jspa?objectID=2490744&objectType=2http://scn.sap.com/message-abuse!input.jspa?objectID=2490744&objectType=2http://scn.sap.com/message-abuse!input.jspa?objectID=2490744&objectType=2http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/message/2896315#2896315http://scn.sap.com/message/2896315#2896315http://scn.sap.com/people/faina.fridmanhttp://scn.sap.com/people/faina.fridmanhttp://scn.sap.com/thread/95823#2490744http://scn.sap.com/message-abuse!input.jspa?objectID=2896315&objectType=2http://scn.sap.com/message-abuse!input.jspa?objectID=2896315&objectType=2http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/message/6031124#6031124http://scn.sap.com/message/6031124#6031124http://scn.sap.com/people/jens.guntenhnerhttp://scn.sap.com/people/jens.guntenhnerhttp://scn.sap.com/thread/95823#2490744http://scn.sap.com/message-abuse!input.jspa?objectID=6031124&objectType=2http://scn.sap.com/message-abuse!input.jspa?objectID=6031124&objectType=2http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/message/3081264#3081264http://scn.sap.com/message/3081264#3081264http://scn.sap.com/people/omer.ghttp://scn.sap.com/people/omer.ghttp://scn.sap.com/thread/95823#1141435http://scn.sap.com/message-abuse!input.jspa?objectID=3081264&objectType=2http://scn.sap.com/message-abuse!input.jspa?objectID=3081264&objectType=2http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/message/4093486#4093486http://scn.sap.com/message/4093486#4093486http://scn.sap.com/people/balakumar.ganesanhttp://scn.sap.com/people/balakumar.ganesanhttp://scn.sap.com/thread/95823#1141435http://scn.sap.com/people/balakumar.ganesanhttp://scn.sap.com/people/omer.ghttp://scn.sap.com/people/jens.guntenhnerhttp://scn.sap.com/people/faina.fridmanhttp://scn.sap.com/people/balakumar.ganesanhttp://scn.sap.com/people/omer.ghttp://scn.sap.com/people/jens.guntenhnerhttp://scn.sap.com/people/faina.fridmanhttp://scn.sap.com/people/balakumar.ganesanhttp://scn.sap.com/people/omer.ghttp://scn.sap.com/people/jens.guntenhnerhttp://scn.sap.com/people/faina.fridmanhttp://scn.sap.com/people/balakumar.ganesanhttp://scn.sap.com/people/omer.ghttp://scn.sap.com/people/jens.guntenhnerhttp://scn.sap.com/people/faina.fridmanhttp://scn.sap.com/people/balakumar.ganesanhttp://scn.sap.com/people/omer.ghttp://scn.sap.com/people/jens.guntenhnerhttp://scn.sap.com/people/faina.fridmanhttp://scn.sap.com/people/balakumar.ganesanhttp://scn.sap.com/people/omer.ghttp://scn.sap.com/people/jens.guntenhnerhttp://scn.sap.com/people/faina.fridmanhttp://scn.sap.com/people/balakumar.ganesanhttp://scn.sap.com/people/omer.ghttp://scn.sap.com/people/jens.guntenhnerhttp://scn.sap.com/people/faina.fridmanhttp://scn.sap.com/people/balakumar.ganesanhttp://scn.sap.com/people/omer.ghttp://scn.sap.com/people/jens.guntenhnerhttp://scn.sap.com/people/faina.fridmanhttp://scn.sap.com/thread/95823#1141435http://scn.sap.com/people/balakumar.ganesanhttp://scn.sap.com/message/4093486#4093486http://scn.sap.com/thread/95823http://scn.sap.com/message-abuse!input.jspa?objectID=3081264&objectType=2http://scn.sap.com/thread/95823#1141435http://scn.sap.com/people/omer.ghttp://scn.sap.com/message/3081264#3081264http://scn.sap.com/thread/95823http://scn.sap.com/message-abuse!input.jspa?objectID=6031124&objectType=2http://scn.sap.com/thread/95823#2490744http://scn.sap.com/people/jens.guntenhnerhttp://scn.sap.com/message/6031124#6031124http://scn.sap.com/thread/95823http://scn.sap.com/message-abuse!input.jspa?objectID=2896315&objectType=2http://scn.sap.com/thread/95823#2490744http://scn.sap.com/people/faina.fridmanhttp://scn.sap.com/message/2896315#2896315http://scn.sap.com/thread/95823 -
8/2/2019 Employee Photos
15/25
The steps u Provided to Display Employee Picture in Smartforms seems to be helpful.I need a Clarification explain me about the Visual
Basic.Net Command Line conversion.What is that ?Is that requires some sort of software need to be installed,if so Could u Pls explain the stepinvolved in CONVERSION...
waiting for ur reply.
Thank You,
G.Balakumar.
Report Abuse
Like (0) Re: Employee Picture Upload in SmartForm
Jen BarberJan 23, 2008 12:15 PM (in response to Adrian Buenter)Did anyone solve this problem? I can't read the image using ALINK_RFC_TABLE_GET, is there any other module function?
Thank you very much.
Jen
Report Abuse
Like (0) Re: Employee Picture Upload in SmartForm
Bhaskar Pani KakanurJan 4, 2006 2:17 PM (in response to Sachin Shirke)Hi Sachin,
Can you please help Jennie regarding Archiveline with Smartform. He asked a similar question like this.
Please go thru the link:
Formatting an excel
Thanks,
Bhaskar.
o Report Abuse
o Like (0) Re: Employee Picture Upload in SmartForm
http://scn.sap.com/message-abuse!input.jspa?objectID=4093486&objectType=2http://scn.sap.com/message-abuse!input.jspa?objectID=4093486&objectType=2http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/message/4765295#4765295http://scn.sap.com/message/4765295#4765295http://scn.sap.com/people/jen.barberhttp://scn.sap.com/people/jen.barberhttp://scn.sap.com/thread/95823#1141435http://scn.sap.com/message-abuse!input.jspa?objectID=4765295&objectType=2http://scn.sap.com/message-abuse!input.jspa?objectID=4765295&objectType=2http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/message/1056683#1056683http://scn.sap.com/message/1056683#1056683http://scn.sap.com/people/bhaskarpani.kakanurhttp://scn.sap.com/people/bhaskarpani.kakanurhttp://scn.sap.com/thread/95823#1056600http://scn.sap.com/message/440812#440812http://scn.sap.com/message/440812#440812http://scn.sap.com/message-abuse!input.jspa?objectID=1056683&objectType=2http://scn.sap.com/message-abuse!input.jspa?objectID=1056683&objectType=2http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/message/4190993#4190993http://scn.sap.com/message/4190993#4190993http://scn.sap.com/people/elena.millanhttp://scn.sap.com/people/bhaskarpani.kakanurhttp://scn.sap.com/people/jen.barberhttp://scn.sap.com/people/elena.millanhttp://scn.sap.com/people/bhaskarpani.kakanurhttp://scn.sap.com/people/jen.barberhttp://scn.sap.com/people/elena.millanhttp://scn.sap.com/people/bhaskarpani.kakanurhttp://scn.sap.com/people/jen.barberhttp://scn.sap.com/people/elena.millanhttp://scn.sap.com/people/bhaskarpani.kakanurhttp://scn.sap.com/people/jen.barberhttp://scn.sap.com/people/elena.millanhttp://scn.sap.com/people/bhaskarpani.kakanurhttp://scn.sap.com/people/jen.barberhttp://scn.sap.com/people/elena.millanhttp://scn.sap.com/people/bhaskarpani.kakanurhttp://scn.sap.com/people/jen.barberhttp://scn.sap.com/message/4190993#4190993http://scn.sap.com/thread/95823http://scn.sap.com/message-abuse!input.jspa?objectID=1056683&objectType=2http://scn.sap.com/message/440812#440812http://scn.sap.com/thread/95823#1056600http://scn.sap.com/people/bhaskarpani.kakanurhttp://scn.sap.com/message/1056683#1056683http://scn.sap.com/thread/95823http://scn.sap.com/message-abuse!input.jspa?objectID=4765295&objectType=2http://scn.sap.com/thread/95823#1141435http://scn.sap.com/people/jen.barberhttp://scn.sap.com/message/4765295#4765295http://scn.sap.com/thread/95823http://scn.sap.com/message-abuse!input.jspa?objectID=4093486&objectType=2 -
8/2/2019 Employee Photos
16/25
Elena MillanSep 28, 2007 2:50 PM (in response to Sachin Shirke)Hello,
Did anyone find a solution? I have the same problem. My program follows similar steps as described by Adrian Buenter, but I don't know how to
perform step 3
"Convert the image from JPG to BMP (this is done by calling a VisualBasic.NET command line function returning the image in BMP format(l_bitmap(255) type x))"
Is there any example of this?
Thank you very much in advance.
Elena.
o Report Abuse
o Like (0) Re: Employee Picture Upload in SmartForm
Lai Min SamDec 11, 2007 9:08 AM (in response to Sachin Shirke)Hi...anyone has the solution of this?
o Report Abuse
o Like (0) Re: Employee Picture Upload in SmartForm
Nitesh JainDec 26, 2007 10:22 AM (in response to Sachin Shirke)Dear all,
In ECC 5.0 onwards there is a new form builder which can be accessed using transaction SFP.
Does anyone know whether we can directly use the SAP link of Employee photo in forms developed using this new tool??
Cheers
Nitesh
Step 1)Check what extensions are allowed in table "MIMITYPES".
http://scn.sap.com/people/elena.millanhttp://scn.sap.com/people/elena.millanhttp://scn.sap.com/thread/95823#1056600http://scn.sap.com/message-abuse!input.jspa?objectID=4190993&objectType=2http://scn.sap.com/message-abuse!input.jspa?objectID=4190993&objectType=2http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/message/4566795#4566795http://scn.sap.com/message/4566795#4566795http://scn.sap.com/people/laimin.samhttp://scn.sap.com/people/laimin.samhttp://scn.sap.com/thread/95823#1056600http://scn.sap.com/message-abuse!input.jspa?objectID=4566795&objectType=2http://scn.sap.com/message-abuse!input.jspa?objectID=4566795&objectType=2http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/thread/95823http://scn.sap.com/message/4635878#4635878http://scn.sap.com/message/4635878#4635878http://scn.sap.com/people/nitesh.jain3http://scn.sap.com/people/nitesh.jain3http://scn.sap.com/thread/95823#1056600http://scn.sap.com/people/nitesh.jain3http://scn.sap.com/people/laimin.samhttp://scn.sap.com/people/nitesh.jain3http://scn.sap.com/people/laimin.samhttp://scn.sap.com/people/nitesh.jain3http://scn.sap.com/people/laimin.samhttp://scn.sap.com/people/nitesh.jain3http://scn.sap.com/people/laimin.samhttp://scn.sap.com/thread/95823#1056600http://scn.sap.com/people/nitesh.jain3http://scn.sap.com/message/4635878#4635878http://scn.sap.com/thread/95823http://scn.sap.com/message-abuse!input.jspa?objectID=4566795&objectType=2http://scn.sap.com/thread/95823#1056600http://scn.sap.com/people/laimin.samhttp://scn.sap.com/message/4566795#4566795http://scn.sap.com/thread/95823http://scn.sap.com/message-abuse!input.jspa?objectID=4190993&objectType=2http://scn.sap.com/thread/95823#1056600http://scn.sap.com/people/elena.millan -
8/2/2019 Employee Photos
17/25
Step 2)Modify the file extension of the picture from ".jpg" etc. to ".html"(any of the allowed MIME types from the
previous step).
http://4.bp.blogspot.com/_8onpjr5ReHU/SONw_6fzCrI/AAAAAAAAALA/vGtZyKS_zec/s1600-h/4.JPGhttp://3.bp.blogspot.com/_8onpjr5ReHU/SONuIoKXJLI/AAAAAAAAAKw/rPbfuUQ7GSU/s1600-h/1.JPGhttp://4.bp.blogspot.com/_8onpjr5ReHU/SONw_6fzCrI/AAAAAAAAALA/vGtZyKS_zec/s1600-h/4.JPGhttp://3.bp.blogspot.com/_8onpjr5ReHU/SONuIoKXJLI/AAAAAAAAAKw/rPbfuUQ7GSU/s1600-h/1.JPG -
8/2/2019 Employee Photos
18/25
Step 3)Upload a picture through transaction SMW0 by creating a new "Z" object (you can save it in a transport if you
want):
http://2.bp.blogspot.com/_8onpjr5ReHU/SON9J305gHI/AAAAAAAAALo/WLfuNpZEOOA/s1600-h/8.JPGhttp://1.bp.blogspot.com/_8onpjr5ReHU/SONw_zugGyI/AAAAAAAAALI/IP_5smrM-bc/s1600-h/5.JPGhttp://2.bp.blogspot.com/_8onpjr5ReHU/SON9J305gHI/AAAAAAAAALo/WLfuNpZEOOA/s1600-h/8.JPGhttp://1.bp.blogspot.com/_8onpjr5ReHU/SONw_zugGyI/AAAAAAAAALI/IP_5smrM-bc/s1600-h/5.JPG -
8/2/2019 Employee Photos
19/25
http://1.bp.blogspot.com/_8onpjr5ReHU/SONy0N0j9AI/AAAAAAAAALY/tvU3CJ_1zRs/s1600-h/6.JPGhttp://3.bp.blogspot.com/_8onpjr5ReHU/SONxjbcgX5I/AAAAAAAAALQ/j8nVE01ifG4/s1600-h/2.JPGhttp://1.bp.blogspot.com/_8onpjr5ReHU/SONy0N0j9AI/AAAAAAAAALY/tvU3CJ_1zRs/s1600-h/6.JPGhttp://3.bp.blogspot.com/_8onpjr5ReHU/SONxjbcgX5I/AAAAAAAAALQ/j8nVE01ifG4/s1600-h/2.JPG -
8/2/2019 Employee Photos
20/25
Step 4) Create a program as shown below with a Screen 0100, PF-STATUS "S0100" and Custom Container "CONT" .
This program can be used to display any of the pictures uploaded through SMW0.
1234567
89101112131415161718192021
222324252627282930
*&---------------------------------------------------------------------* *& Report ZTEST_PICTURE*&*&---------------------------------------------------------------------* *&*&*&---------------------------------------------------------------------*
REPORT ztest_picture.TYPE-POOLS: cndp.DATA: ok_code TYPE syucomm,container TYPE REF TO cl_gui_custom_container,picture TYPE REF TO cl_gui_picture,url TYPE cndp_url.
PARAMETERS: p_objid TYPE w3objid OBLIGATORY.
AT SELECTION-SCREEN.SELECTCOUNT(*) FROM wwwparamsWHERE objid = p_objid.
IF sy-subrc 0.MESSAGE e001(00)WITH'MIME Object not found'.
ENDIF.
START-OF-SELECTION.
IF container IS INITIAL.
http://4.bp.blogspot.com/_8onpjr5ReHU/SONy0RvFTRI/AAAAAAAAALg/igoUyORrpc0/s1600-h/7.JPG -
8/2/2019 Employee Photos
21/25
313233343536
3738394041424344454647484950
51525354555657585960616263
6465666768697071727374757677
787980818283848586
CREATEOBJECT containerEXPORTINGcontainer_name = 'CONT'repid = 'ZTEST_PICTURE'dynnr = '0100'
EXCEPTIONS
cntl_error = 1cntl_system_error = 2create_error = 3lifetime_error = 4lifetime_dynpro_dynpro_link = 5OTHERS = 6.
IF sy-subrc 0.MESSAGE i001(00)WITH'Error while creating container'.LEAVE LIST-PROCESSING.
ENDIF.ENDIF.IF picture IS INITIAL.CREATEOBJECT picture
EXPORTING
parent = containerEXCEPTIONSerror = 1OTHERS = 2.
IF sy-subrc 0.MESSAGE i001(00)WITH'Error while displaying picture'.LEAVE LIST-PROCESSING.
ENDIF.ENDIF.IF picture IS NOT INITIAL.
CALLFUNCTION'DP_PUBLISH_WWW_URL'EXPORTING
objid = p_objidlifetime = cndp_lifetime_transactionIMPORTINGurl = url
EXCEPTIONSOTHERS = 1.
IF sy-subrc = 0.CALLMETHOD picture->load_picture_from_url_asyncEXPORTINGurl = url.
CALLMETHOD picture->set_display_modeEXPORTING
display_mode = cl_gui_picture=>display_mode_fit.ELSE.
MESSAGE i001(00)WITH'Error while load picture'.LEAVE LIST-PROCESSING.
ENDIF.ENDIF.
CALLSCREEN0100.*&---------------------------------------------------------------------*
-
8/2/2019 Employee Photos
22/25
878889909192
93949596979899100101102103104105106
107
*& Module STATUS_0100 OUTPUT*&---------------------------------------------------------------------* * text*----------------------------------------------------------------------* MODULE status_0100 OUTPUT.
SET PF-STATUS 'S0100'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT*&---------------------------------------------------------------------* *& Module USER_COMMAND_0100 INPUT*&---------------------------------------------------------------------* * text*----------------------------------------------------------------------* MODULE user_command_0100 INPUT.
CASE ok_code.WHEN'BACK'.
SETSCREEN00.LEAVESCREEN.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
Test it :
http://1.bp.blogspot.com/_8onpjr5ReHU/SON92NlHA6I/AAAAAAAAALw/C_K8TblxWMc/s1600-h/9.JPG -
8/2/2019 Employee Photos
23/25
Displaying Graphics using an ABAP Program
By Raghava Vakada, Mouri Tech Solutions
I would like to explain about a simple report program to display graphics. The SAP Graphics can be used
for various business purposes.
In this article I am explaining about a simple Sales analysis on a yearly basis.
*&---------------------------------------------------------------------**& Report ZGRAPH_TEST*&*&---------------------------------------------------------------------*REPORT ZGRAPH_TEST.DATA: BEGIN OF TAB OCCURS 5,
CLASS(5) TYPE C,VAL1(2) TYPE I,VAL2(2) TYPE I,VAL3(2) TYPE I,END OF TAB.
DATA: BEGIN OF OPTTAB OCCURS 1,C(20),END OF OPTTAB.
MOVE: 'fan' TO TAB-CLASS,12 TO TAB-VAL1, 8 TO TAB-VAL2, 15 TO TAB-VAL3.
APPEND TAB.CLEAR TAB.MOVE: 'cool' TO TAB-CLASS,
15 TO TAB-VAL1, 10 TO TAB-VAL2, 18 TO TAB-VAL3.APPEND TAB.
http://1.bp.blogspot.com/_8onpjr5ReHU/SON92WOmHjI/AAAAAAAAAL4/eZHevGXu7Ck/s1600-h/10.JPGhttp://1.bp.blogspot.com/_8onpjr5ReHU/SON92WOmHjI/AAAAAAAAAL4/eZHevGXu7Ck/s1600-h/10.JPG -
8/2/2019 Employee Photos
24/25
CLEAR TAB.MOVE: 'DA' TO TAB-CLASS,
17 TO TAB-VAL1, 11 TO TAB-VAL2, 20 TO TAB-VAL3.APPEND TAB.CLEAR TAB.OPTTAB = 'FIFRST = 3D'. APPEND OPTTAB. "// Grafik-TypOPTTAB = 'P3TYPE = TO'. APPEND OPTTAB. "// ObjektartOPTTAB = 'P3CTYP = RO'. APPEND OPTTAB. "// Farben der ObjekteOPTTAB = 'TISIZE = 2'. APPEND OPTTAB. "// HaupttitelgreOPTTAB = 'CLBACK = X'. APPEND OPTTAB. "// Background ColorCALL FUNCTION 'GRAPH_MATRIX_3D'
EXPORTINGCOL1 = '1997'COL2 = '1998'COL3 = '1999'DIM2 = 'Products'DIM1 = 'Years'TITL = 'Sales In Rs. Crores'
TABLESDATA = TAB
OPTS = OPTTABEXCEPTIONS
OTHERS = 1.
LEAVE PROGRAM.
Results :
Execute the report program for an output shown below.
Click on Overview for detailed view.
-
8/2/2019 Employee Photos
25/25
To display more detailed view.