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

CV program

Former Member
0 Likes
637

I need a customized program to generate CV ( resume )

which i have a question regarding retrieve employee photo.

appreciate any advice on how to retrieve employee photo into CV program which is likely to be mail merge in MS word.

Thanks

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
569

Hi,

For display photos


1.   Create Object Pc_Main_Container 
       Exporting 
         container_name = 'G_MAIN_JPG_CONTAINER' 
       Exceptions 
        cntl_error                  = 1 
        cntl_system_error           = 2 
        create_error                = 3 
        lifetime_error              = 4 
        lifetime_dynpro_dynpro_link = 5. 
 
2.   Create Object G_Jpg_Viewer 
       Exporting 
          Parent = pc_Main_Container 
       Exceptions 
          Error  = 1 
          Others = 2. 
 
3.   Call Method pc_Jpg_Viewer->Load_Picture_From_Url 
         Exporting 
           Url    = w_FileName 
         Importing 
           Result = w_Error_Code 
         Exceptions 
          Error  = 1 
          Others = 2. 
 
4.   Call Method pc_Jpg_Viewer->Set_Visible 
          Exporting 
           Visible           = 'X' 
          Exceptions 
           Cntl_Error        = 1 
           Cntl_System_Error = 2 
           Others            = 3. 
 

You can do a mail merge using OLE.

The following is sample OLE, it will give you some basic idea related to OLE


report ztest MESSAGE-ID sy.

*Working directory such as SapWorkDir
PARAMETERS : p_file LIKE rlgrap-filename.

INCLUDE ole2incl.
INCLUDE docsincl.

DATA: h_word  TYPE ole2_object,
      h_docs  TYPE ole2_object,
      h_doc   TYPE ole2_object,
      h_merge TYPE ole2_object.

INITIALIZATION.
  CALL FUNCTION 'WS_QUERY'
       EXPORTING
            query  = 'CD'
       IMPORTING
            return = p_file.
  CONCATENATE p_file 'Merge.DOC' INTO p_file.

START-OF-SELECTION.

* Create Word Application object
  IF h_word-header = space OR h_word-handle EQ -1.
    CREATE OBJECT h_word  'WORD.APPLICATION'.
    IF sy-subrc NE 0.
      MESSAGE i002 WITH sy-msgli.
    ELSE.
      SET PROPERTY OF  h_word  'VISIBLE' = 1.
    ENDIF.
  ENDIF.
* Get Documsnts collection as property of Application object
  GET PROPERTY OF h_word 'DOCUMENTS'  = h_docs.
* Open a word file
  CALL METHOD OF h_docs 'OPEN' = h_doc
                        EXPORTING  #1 = p_file.
* Invoke mail merge
* The Word windows will be visible
  GET PROPERTY OF h_doc 'MAILMERGE' = h_merge.
  SET PROPERTY OF h_merge 'DESTINATION' = 1.
  CALL METHOD OF h_merge 'EXECUTE'.
* Terminate Word
  CALL METHOD OF h_word 'QUIT' EXPORTING #1 = 0.
* Free objects
  FREE OBJECT : h_merge,
                h_doc,
                h_docs,

aRs

2 REPLIES 2
Read only

former_member194669
Active Contributor
0 Likes
570

Hi,

For display photos


1.   Create Object Pc_Main_Container 
       Exporting 
         container_name = 'G_MAIN_JPG_CONTAINER' 
       Exceptions 
        cntl_error                  = 1 
        cntl_system_error           = 2 
        create_error                = 3 
        lifetime_error              = 4 
        lifetime_dynpro_dynpro_link = 5. 
 
2.   Create Object G_Jpg_Viewer 
       Exporting 
          Parent = pc_Main_Container 
       Exceptions 
          Error  = 1 
          Others = 2. 
 
3.   Call Method pc_Jpg_Viewer->Load_Picture_From_Url 
         Exporting 
           Url    = w_FileName 
         Importing 
           Result = w_Error_Code 
         Exceptions 
          Error  = 1 
          Others = 2. 
 
4.   Call Method pc_Jpg_Viewer->Set_Visible 
          Exporting 
           Visible           = 'X' 
          Exceptions 
           Cntl_Error        = 1 
           Cntl_System_Error = 2 
           Others            = 3. 
 

You can do a mail merge using OLE.

The following is sample OLE, it will give you some basic idea related to OLE


report ztest MESSAGE-ID sy.

*Working directory such as SapWorkDir
PARAMETERS : p_file LIKE rlgrap-filename.

INCLUDE ole2incl.
INCLUDE docsincl.

DATA: h_word  TYPE ole2_object,
      h_docs  TYPE ole2_object,
      h_doc   TYPE ole2_object,
      h_merge TYPE ole2_object.

INITIALIZATION.
  CALL FUNCTION 'WS_QUERY'
       EXPORTING
            query  = 'CD'
       IMPORTING
            return = p_file.
  CONCATENATE p_file 'Merge.DOC' INTO p_file.

START-OF-SELECTION.

* Create Word Application object
  IF h_word-header = space OR h_word-handle EQ -1.
    CREATE OBJECT h_word  'WORD.APPLICATION'.
    IF sy-subrc NE 0.
      MESSAGE i002 WITH sy-msgli.
    ELSE.
      SET PROPERTY OF  h_word  'VISIBLE' = 1.
    ENDIF.
  ENDIF.
* Get Documsnts collection as property of Application object
  GET PROPERTY OF h_word 'DOCUMENTS'  = h_docs.
* Open a word file
  CALL METHOD OF h_docs 'OPEN' = h_doc
                        EXPORTING  #1 = p_file.
* Invoke mail merge
* The Word windows will be visible
  GET PROPERTY OF h_doc 'MAILMERGE' = h_merge.
  SET PROPERTY OF h_merge 'DESTINATION' = 1.
  CALL METHOD OF h_merge 'EXECUTE'.
* Terminate Word
  CALL METHOD OF h_word 'QUIT' EXPORTING #1 = 0.
* Free objects
  FREE OBJECT : h_merge,
                h_doc,
                h_docs,

aRs

Read only

Former Member
0 Likes
569

There is standard CV program for ECC