Application Development 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: 

Reg . Alv logo .

Former Member
0 Kudos

HI Experts,

Iam writing one alv program my requirement is i want to print the logo in output for that i called one F.M i.e is Reuse_alv_commentory_write but in the output it is printing in the right side, i want to print in left side

how?.

Rewards are helpful answers.

Thanks & Regards,

Narasimha Rao.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi

Splilt the header as left hand and right side areas, you add your logo in left hand side

for this check the sample code

FORM dispaly.

v_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = v_repid

i_callback_html_top_of_page = 'TOP_OF_PAGE'

I_GRID_TITLE = 'SALES REGISTER '

is_layout = gd_layout

IT_FIELDCAT = it_salesreg

I_CALLBACK_HTML_END_OF_LIST = 'END_OF_LIST_HTML'

i_save = 'X'

TABLES

T_OUTTAB = salesreg.

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.

FORM top_of_page USING document TYPE REF TO cl_dd_document.

DATA: l_text TYPE sdydo_text_element,

ld_lines type i,

ld_linesc(10) type c,

R_AREA TYPE REF TO CL_DD_AREA.

CALL METHOD document->INITIALIZE_DOCUMENT.

CALL METHOD document->VERTICAL_SPLIT

EXPORTING

SPLIT_AREA = document

SPLIT_WIDTH = '60%'

IMPORTING

RIGHT_AREA = R_AREA.

concatenate 'Ex-Stock sales from' s_fkdat-low+6(2) '.'

s_fkdat-low+4(2) '.'

s_fkdat-low(4)

'to' s_fkdat-high+6(2) '.'

s_fkdat-high+4(2) '.'

s_fkdat-high(4)

into l_text separated by space.

CALL METHOD document->add_text

EXPORTING

text = l_text

  • SAP_COLOR = CL_DD_DOCUMENT=>LIST_HEADING_INT

sap_fontsize = cl_dd_document=>large

sap_emphasis = cl_dd_document=>strong.

CALL METHOD R_AREA->ADD_PICTURE

EXPORTING

PICTURE_ID = 'GMLOGO1'

WIDTH ='75'.

CALL METHOD document->new_line.

CALL METHOD document->new_line.

l_text = 'Complete Invioce'.

CALL METHOD document->add_icon

EXPORTING

sap_icon = 'ICON_LED_GREEN'.

CALL METHOD document->add_text

EXPORTING

text = l_text

sap_emphasis = cl_dd_document=>strong.

l_text = 'Cancellation of Invoice / Credit Memo'.

CALL METHOD document->add_icon

EXPORTING

sap_icon = 'ICON_LED_RED'.

CALL METHOD document->add_text

EXPORTING

text = l_text

sap_emphasis = cl_dd_document=>strong.

CALL METHOD document->new_line.

CALL METHOD document->new_line.

describe table salesreg lines ld_lines.

ld_linesc = ld_lines.

concatenate 'Total No. of Records Selected: ' ld_linesc

into l_text separated by space.

CALL METHOD document->add_text

EXPORTING

text = l_text

sap_fontsize = cl_dd_document=>large.

ENDFORM. "top_of_page

----


  • Form Build Layout *

----


FORM bld_layout.

gd_layout-zebra = 'X'.

GD_LAYOUT-NO_INPUT = 'X'.

GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.

GD_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.

GD_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'.

GD_LAYOUT-CONFIRMATION_PROMPT = 'X'.

ENDFORM.

thanks

sitaram

3 REPLIES 3

Former Member
0 Kudos

Reward points..

Former Member
0 Kudos

Reward Points..

Former Member
0 Kudos

hi

Splilt the header as left hand and right side areas, you add your logo in left hand side

for this check the sample code

FORM dispaly.

v_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = v_repid

i_callback_html_top_of_page = 'TOP_OF_PAGE'

I_GRID_TITLE = 'SALES REGISTER '

is_layout = gd_layout

IT_FIELDCAT = it_salesreg

I_CALLBACK_HTML_END_OF_LIST = 'END_OF_LIST_HTML'

i_save = 'X'

TABLES

T_OUTTAB = salesreg.

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.

FORM top_of_page USING document TYPE REF TO cl_dd_document.

DATA: l_text TYPE sdydo_text_element,

ld_lines type i,

ld_linesc(10) type c,

R_AREA TYPE REF TO CL_DD_AREA.

CALL METHOD document->INITIALIZE_DOCUMENT.

CALL METHOD document->VERTICAL_SPLIT

EXPORTING

SPLIT_AREA = document

SPLIT_WIDTH = '60%'

IMPORTING

RIGHT_AREA = R_AREA.

concatenate 'Ex-Stock sales from' s_fkdat-low+6(2) '.'

s_fkdat-low+4(2) '.'

s_fkdat-low(4)

'to' s_fkdat-high+6(2) '.'

s_fkdat-high+4(2) '.'

s_fkdat-high(4)

into l_text separated by space.

CALL METHOD document->add_text

EXPORTING

text = l_text

  • SAP_COLOR = CL_DD_DOCUMENT=>LIST_HEADING_INT

sap_fontsize = cl_dd_document=>large

sap_emphasis = cl_dd_document=>strong.

CALL METHOD R_AREA->ADD_PICTURE

EXPORTING

PICTURE_ID = 'GMLOGO1'

WIDTH ='75'.

CALL METHOD document->new_line.

CALL METHOD document->new_line.

l_text = 'Complete Invioce'.

CALL METHOD document->add_icon

EXPORTING

sap_icon = 'ICON_LED_GREEN'.

CALL METHOD document->add_text

EXPORTING

text = l_text

sap_emphasis = cl_dd_document=>strong.

l_text = 'Cancellation of Invoice / Credit Memo'.

CALL METHOD document->add_icon

EXPORTING

sap_icon = 'ICON_LED_RED'.

CALL METHOD document->add_text

EXPORTING

text = l_text

sap_emphasis = cl_dd_document=>strong.

CALL METHOD document->new_line.

CALL METHOD document->new_line.

describe table salesreg lines ld_lines.

ld_linesc = ld_lines.

concatenate 'Total No. of Records Selected: ' ld_linesc

into l_text separated by space.

CALL METHOD document->add_text

EXPORTING

text = l_text

sap_fontsize = cl_dd_document=>large.

ENDFORM. "top_of_page

----


  • Form Build Layout *

----


FORM bld_layout.

gd_layout-zebra = 'X'.

GD_LAYOUT-NO_INPUT = 'X'.

GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.

GD_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.

GD_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'.

GD_LAYOUT-CONFIRMATION_PROMPT = 'X'.

ENDFORM.

thanks

sitaram