This website is not affiliated with, sponsored by, or approved by SAP AG.

logo in Report Not in Scripts

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

logo in Report Not in Scripts

Postby danielreaves » Tue Apr 22, 2003 6:48 am

hi all,

I need to print a company's logo on the report not in SAP Script. For
that I need to write the logo as an symbol. Can anyone tell me what is the transaction for creating symbols. or how do i go about it.


its urgent


thanx in advance

daniel
danielreaves
 

y nobody knows this !!!

Postby danielreaves » Tue Apr 22, 2003 11:13 pm

Hi all,


i had posted this query and no one has replied , is there a way to do it , or can't do it all. if yes , how do i go about it

thanx in adv
Daniel
danielreaves
 

Postby aussie fatboy » Wed Apr 23, 2003 12:28 am

Do you mean on screen or for printing purposes?

If it is for printing, why is a Smartform or Sapscript not acceptable?

Do you mean creating an ICON (which has been covered in the forum before), an ALV logo (which has been covered in the forum before) or something else?

Usually a lack of responses means that your question is not as clear as it could be.
aussie fatboy
 
Posts: 827
Joined: Sun Oct 20, 2002 11:34 pm
Location: Melbourne, Australia

Postby danielreaves » Wed Apr 23, 2003 2:20 am

hi,
this is for screen purpose, i have a picture and i want that picture as jpeg or bmp, i want this picture to be displayed as icon in the report,
how do i go abt it

thanx
dan
danielreaves
 

Postby aussie fatboy » Wed Apr 23, 2003 2:27 am

If you use ALV to do your screen output, you can have output the company logo.

Here is some basic sample code.
Also check SAP programs BALV* for more examples. Try running one that uses the FM REUSE_ALV_COMMENTARY_WRITE

Search this forum on OAOR to get the process for uploading an image for use by ALV.

Code: Select all
report  sy-repid.

type-pools : slis.

*ALV Formatting tables /structures
data: gt_fieldcat type slis_t_fieldcat_alv.
data: gt_events type slis_t_event.
data: gs_layout type slis_layout_alv.
data: gt_page   type slis_t_listheader.
data: gs_page type slis_listheader.
data: v_repid like sy-repid.

*ALV Formatting work area
data: w_fieldcat type slis_fieldcat_alv.
data: w_events type slis_alv_event.

data: gt_bsid type table of bsid with header line.

initialization.

  perform build_events.
  perform build_page_header.

start-of-selection.
*perform build_comment.     "top_of_page - in initialization at present

  select * from bsid into table gt_bsid up to 10 rows.

*perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.
*USING = Row, Column, Field name, display length, table name, heading

*OR
  perform build_fieldcat.
  gs_layout-zebra = 'X'.


*top of page event does not work without I_callback_program
  v_repid = sy-repid.
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program                = v_repid
      i_structure_name                  = 'BSID'
*    i_background_id                   = 'ALV_BACKGROUND'
      i_grid_title                      = 'This is the grid title'
*   I_GRID_SETTINGS                   =
      is_layout                         = gs_layout
      it_fieldcat                       = gt_fieldcat[]
      it_events                         = gt_events[]
    tables
      t_outtab                          = gt_bsid.

************************************************************************
* Form..............:  populate_for_fm
* Description.......:  Populates fields for function module used in ALV
************************************************************************
form populate_for_fm using    p_row
                                    p_col
                                    p_fieldname
                                    p_len
                                    p_table
                                    p_desc.
  w_fieldcat-row_pos = p_row.          "Row Position
  w_fieldcat-col_pos = p_col.          "Column Position
  w_fieldcat-fieldname = p_fieldname.  "Field name
  w_fieldcat-outputlen = p_len.        "Column Lenth
  w_fieldcat-tabname = p_table.        "Table name
  w_fieldcat-reptext_ddic = p_desc.    "Field Description
  w_fieldcat-input = '1'.
  append w_fieldcat to gt_fieldcat.
  clear w_fieldcat.

endform.                    " populate_for_fm
*&---------------------------------------------------------------------*
*&      Form  build_events
*&---------------------------------------------------------------------*
form build_events.
  data: ls_event type slis_alv_event.
  call function 'REUSE_ALV_EVENTS_GET'
       exporting
            i_list_type = 0
       importing
            et_events   = gt_events.

  read table gt_events with key name =  slis_ev_user_command
                           into ls_event.
  if sy-subrc = 0.
    move slis_ev_user_command to ls_event-form.
    append ls_event to gt_events.
  endif.
  read table gt_events with key name =  slis_ev_top_of_page
                           into ls_event.
  if sy-subrc = 0.
    move slis_ev_top_of_page to ls_event-form.
    append ls_event to gt_events.
  endif.

endform.                    " build_events
*&---------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&---------------------------------------------------------------------*
* When user command is called it uses 2 parameters. The itab
* passed to the ALV is in whatever order it currently is on screen.
* Therefore, you can read table itab index rs_selfield-tabindex to get
* all data from the table. You can also check r_ucomm and code
* accordingly.
*&---------------------------------------------------------------------*
form user_command using  r_ucomm      like sy-ucomm
                         rs_selfield type slis_selfield.

  read table gt_bsid index rs_selfield-tabindex.
* error checking etc.
  set parameter id 'KUN' field gt_bsid-kunnr.
  call transaction 'XD03' and skip first screen.
endform.
*&---------------------------------------------------------------------*
*&      Form  top_of_page
*&---------------------------------------------------------------------*
* Your own company logo can go here if it has been saved (OAOR)
* If the logo is larger than the size of the headings in gt_page,
* the window will not show full logo and will have a scroll bar. Thus,
* it is a good idea to have a standard ALV header if you are going to
* use logos in your top of page.
*&---------------------------------------------------------------------*
form top_of_page.

  call function 'REUSE_ALV_COMMENTARY_WRITE'
       exporting
            it_list_commentary = gt_page
            i_logo             = 'ENJOYSAP_LOGO'.
endform.
*&---------------------------------------------------------------------*
*&      Form  build_fieldcat
*&---------------------------------------------------------------------*
*Many and varied fields are available here. Have a look at documentation
*for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE
*----------------------------------------------------------------------*
form build_fieldcat.
  w_fieldcat-fieldname = 'BUDAT'.
  w_fieldcat-seltext_m = 'Dte pst'.
  w_fieldcat-ddictxt(1) = 'M'.
* Can change the position of fields if you do not want them in order
* of the DDIC or itab

*  w_fieldcat-row_pos = '1'.
*  w_fieldcat-col_pos = '10'.
  append w_fieldcat to gt_fieldcat.
  clear w_fieldcat.

endform.                    " build_fieldcat
*&---------------------------------------------------------------------*
*&      Form  build_page_header
*&---------------------------------------------------------------------*
*       gt_page is used in top of page (ALV subroutine - NOT event)
*       *H = Header, S = Selection, A = Action
*----------------------------------------------------------------------*
form build_page_header.
* For Headers, Key is not printed and is irrelevant. Will not cause
* a syntax error, but is not used.
  gs_page-typ = 'H'.
  gs_page-info = 'Header 1'.
  append gs_page to gt_page.

  gs_page-typ = 'H'.
  gs_page-info = 'Header 2'.
  append gs_page to gt_page.

* For Selections, the Key is printed (bold). It can be anything up to 20
* bytes. It gets printed in order of code here, not by key value.
  gs_page-typ = 'S'.
  gs_page-key = 'And the winner is:'.
  gs_page-info = 'Selection 1'.
  append gs_page to gt_page.

  gs_page-typ = 'S'.
  gs_page-key = 'Runner up:'.
  gs_page-info = 'Selection 2'.
  append gs_page to gt_page.

* For Action, Key is also irrelevant.
  gs_page-typ = 'A'.
  gs_page-info = 'Action goes here'.
  append gs_page to gt_page.

endform.                    " build_page_header
aussie fatboy
 
Posts: 827
Joined: Sun Oct 20, 2002 11:34 pm
Location: Melbourne, Australia

THANX AUSSIE BOY

Postby DANIELreaves » Wed Apr 23, 2003 3:33 am

hI,

THANX for the piece of code .it was of geat help for me , but the prob is if i want to put my company logo , im not able to do it. i tried OAOR, BUT COULDN'T KNOW HOW TO GO ABT IT , i even checked balv* sample pgms , but couldn't find the image one.

can u plz let me know this


dan
DANIELreaves
 

Postby aussie fatboy » Wed Apr 23, 2003 4:00 am

    01) GOTO - OAOR (Business Document Navigator)
    02) Give Class Name - PICTURES
    Class Type - OT
    Object type - whatever you want to call your area EG: OURCOMP.... then Execute
    03) Top left will say PICTURES. Bottom left will have multi tab. Select Create and double-click on Screen.
    04) Select your image from the appropriate directory.
    05) Give the image an appropriate name (not Screen)
    06) It will tell you document stored successfully.
    07) You can now find your logo under the heading OURCOMP in top left window.
    08) You can reference the logo in things like FM REUSE_ALV_COMMENTARY_WRITE or any other area which may reference these things. EG: I_LOGO = 'OURCOMP'. You can preview image by double-clicking it.
aussie fatboy
 
Posts: 827
Joined: Sun Oct 20, 2002 11:34 pm
Location: Melbourne, Australia

You are amazing!

Postby Indiana boy » Tue Aug 12, 2003 9:51 am

Aussie fatboy,

Thanks for your replies. This helped me a lot...couldn't stop thaking you!
Indiana boy
 

simple metd.

Postby chetanphate » Wed Aug 13, 2003 3:53 am

get ur logo converted to .tif and then
simply run sap std. report RSTXLDMC
there give the path and
in se71 which ever window u want to put the logo
just
:/ include <path>
lets see if its work.
chetan
chetanphate
 
Posts: 17
Joined: Sat Aug 09, 2003 3:06 am

Re: logo in Report Not in Scripts

Postby aussie fatboy » Wed Aug 13, 2003 4:34 am

danielreaves wrote:hi all,

I need to print a company's logo on the report not in SAP Script.

Amazing. First someone resurrects a really old post.
Then someone replies incorrectly to it.

If you really feel the need to reply to an issue that has already been solved, try reading the question properly first.
aussie fatboy
 
Posts: 827
Joined: Sun Oct 20, 2002 11:34 pm
Location: Melbourne, Australia

What I do to print logo in ALV ????

Postby mtamborlin » Thu Jun 09, 2005 10:16 am

Hi,

I copy and paste this program in the SAP, the logo print in screen but no print in paper.

What I do to print ????


aussie fatboy wrote:If you use ALV to do your screen output, you can have output the company logo.

Here is some basic sample code.
Also check SAP programs BALV* for more examples. Try running one that uses the FM REUSE_ALV_COMMENTARY_WRITE

Search this forum on OAOR to get the process for uploading an image for use by ALV.

Code: Select all
report  sy-repid.

type-pools : slis.

*ALV Formatting tables /structures
data: gt_fieldcat type slis_t_fieldcat_alv.
data: gt_events type slis_t_event.
data: gs_layout type slis_layout_alv.
data: gt_page   type slis_t_listheader.
data: gs_page type slis_listheader.
data: v_repid like sy-repid.

*ALV Formatting work area
data: w_fieldcat type slis_fieldcat_alv.
data: w_events type slis_alv_event.

data: gt_bsid type table of bsid with header line.

initialization.

  perform build_events.
  perform build_page_header.

start-of-selection.
*perform build_comment.     "top_of_page - in initialization at present

  select * from bsid into table gt_bsid up to 10 rows.

*perform populate_for_fm using '1' '3' 'BUKRS' '8' 'GT_BSID' 'Whee'.
*USING = Row, Column, Field name, display length, table name, heading

*OR
  perform build_fieldcat.
  gs_layout-zebra = 'X'.


*top of page event does not work without I_callback_program
  v_repid = sy-repid.
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program                = v_repid
      i_structure_name                  = 'BSID'
*    i_background_id                   = 'ALV_BACKGROUND'
      i_grid_title                      = 'This is the grid title'
*   I_GRID_SETTINGS                   =
      is_layout                         = gs_layout
      it_fieldcat                       = gt_fieldcat[]
      it_events                         = gt_events[]
    tables
      t_outtab                          = gt_bsid.

************************************************************************
* Form..............:  populate_for_fm
* Description.......:  Populates fields for function module used in ALV
************************************************************************
form populate_for_fm using    p_row
                                    p_col
                                    p_fieldname
                                    p_len
                                    p_table
                                    p_desc.
  w_fieldcat-row_pos = p_row.          "Row Position
  w_fieldcat-col_pos = p_col.          "Column Position
  w_fieldcat-fieldname = p_fieldname.  "Field name
  w_fieldcat-outputlen = p_len.        "Column Lenth
  w_fieldcat-tabname = p_table.        "Table name
  w_fieldcat-reptext_ddic = p_desc.    "Field Description
  w_fieldcat-input = '1'.
  append w_fieldcat to gt_fieldcat.
  clear w_fieldcat.

endform.                    " populate_for_fm
*&---------------------------------------------------------------------*
*&      Form  build_events
*&---------------------------------------------------------------------*
form build_events.
  data: ls_event type slis_alv_event.
  call function 'REUSE_ALV_EVENTS_GET'
       exporting
            i_list_type = 0
       importing
            et_events   = gt_events.

  read table gt_events with key name =  slis_ev_user_command
                           into ls_event.
  if sy-subrc = 0.
    move slis_ev_user_command to ls_event-form.
    append ls_event to gt_events.
  endif.
  read table gt_events with key name =  slis_ev_top_of_page
                           into ls_event.
  if sy-subrc = 0.
    move slis_ev_top_of_page to ls_event-form.
    append ls_event to gt_events.
  endif.

endform.                    " build_events
*&---------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&---------------------------------------------------------------------*
* When user command is called it uses 2 parameters. The itab
* passed to the ALV is in whatever order it currently is on screen.
* Therefore, you can read table itab index rs_selfield-tabindex to get
* all data from the table. You can also check r_ucomm and code
* accordingly.
*&---------------------------------------------------------------------*
form user_command using  r_ucomm      like sy-ucomm
                         rs_selfield type slis_selfield.

  read table gt_bsid index rs_selfield-tabindex.
* error checking etc.
  set parameter id 'KUN' field gt_bsid-kunnr.
  call transaction 'XD03' and skip first screen.
endform.
*&---------------------------------------------------------------------*
*&      Form  top_of_page
*&---------------------------------------------------------------------*
* Your own company logo can go here if it has been saved (OAOR)
* If the logo is larger than the size of the headings in gt_page,
* the window will not show full logo and will have a scroll bar. Thus,
* it is a good idea to have a standard ALV header if you are going to
* use logos in your top of page.
*&---------------------------------------------------------------------*
form top_of_page.

  call function 'REUSE_ALV_COMMENTARY_WRITE'
       exporting
            it_list_commentary = gt_page
            i_logo             = 'ENJOYSAP_LOGO'.
endform.
*&---------------------------------------------------------------------*
*&      Form  build_fieldcat
*&---------------------------------------------------------------------*
*Many and varied fields are available here. Have a look at documentation
*for FM REUSE_ALV_LIST_DISPLAY and REUSE_ALV_FIELDCATALOG_MERGE
*----------------------------------------------------------------------*
form build_fieldcat.
  w_fieldcat-fieldname = 'BUDAT'.
  w_fieldcat-seltext_m = 'Dte pst'.
  w_fieldcat-ddictxt(1) = 'M'.
* Can change the position of fields if you do not want them in order
* of the DDIC or itab

*  w_fieldcat-row_pos = '1'.
*  w_fieldcat-col_pos = '10'.
  append w_fieldcat to gt_fieldcat.
  clear w_fieldcat.

endform.                    " build_fieldcat
*&---------------------------------------------------------------------*
*&      Form  build_page_header
*&---------------------------------------------------------------------*
*       gt_page is used in top of page (ALV subroutine - NOT event)
*       *H = Header, S = Selection, A = Action
*----------------------------------------------------------------------*
form build_page_header.
* For Headers, Key is not printed and is irrelevant. Will not cause
* a syntax error, but is not used.
  gs_page-typ = 'H'.
  gs_page-info = 'Header 1'.
  append gs_page to gt_page.

  gs_page-typ = 'H'.
  gs_page-info = 'Header 2'.
  append gs_page to gt_page.

* For Selections, the Key is printed (bold). It can be anything up to 20
* bytes. It gets printed in order of code here, not by key value.
  gs_page-typ = 'S'.
  gs_page-key = 'And the winner is:'.
  gs_page-info = 'Selection 1'.
  append gs_page to gt_page.

  gs_page-typ = 'S'.
  gs_page-key = 'Runner up:'.
  gs_page-info = 'Selection 2'.
  append gs_page to gt_page.

* For Action, Key is also irrelevant.
  gs_page-typ = 'A'.
  gs_page-info = 'Action goes here'.
  append gs_page to gt_page.

endform.                    " build_page_header
mtamborlin
 
Posts: 3
Joined: Thu Jun 09, 2005 9:54 am


Return to ABAP

Who is online

Users browsing this forum: Google Adsense [Bot] and 10 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.