1) CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = gcf_prog_name
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
i_callback_top_of_page = lcf_top_of_page
lcf_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
FORM top_of_page.
DATA: lcf_text LIKE gds_listheader-info VALUE 'Multi Plant MRP Report',
lcf_s TYPE c VALUE 'S',
lcf_h TYPE c VALUE 'H',
lcf_program(8) TYPE c VALUE 'Program:',
lcf_user(10) TYPE c VALUE 'User Name:',
lcf_execdat(12) TYPE c VALUE 'Executed On:',
lcf_pgno(5) TYPE c VALUE 'Page:',
lcf_material(9) TYPE c VALUE 'Material:',
lcf_mrpcontoller(15) TYPE c VALUE 'MRP Controller:',
lcf_mrpprofile(12) TYPE c VALUE 'MRP Profile:',
lcf_stockplant(12) TYPE c VALUE 'Stock Plant:',
lcf_supplyplant(16) TYPE c VALUE 'Supplying plant:',
lcf_to(2) TYPE c VALUE 'TO'.
DATA: ldf_matnr TYPE matnr,
ldf_matnr1 TYPE matnr,
ldf_dispo TYPE dispo,
ldf_dispo1 TYPE dispo,
ldf_dispr TYPE dispr,
ldf_dispr1 TYPE dispr,
ldf_werks TYPE werks,
ldf_werks1 TYPE werks.
MOVE: s_matnr-low TO ldf_matnr,
s_matnr-high TO ldf_matnr1,
s_dispo-low TO ldf_dispo,
s_dispo-high TO ldf_dispo1,
s_dispr-low TO ldf_dispr,
s_dispr-high TO ldf_dispr1,
s_werks-low TO ldf_werks,
s_werks-high TO ldf_werks1.
CLEAR: gds_listheader.
gds_listheader-typ = lcf_h.
gds_listheader-info = lcf_text.
APPEND gds_listheader TO gdt_listheader.
CLEAR gds_listheader.
gds_listheader-typ = lcf_s.
gds_listheader-key = lcf_program.
WRITE sy-cprog TO gds_listheader-info.
APPEND gds_listheader TO gdt_listheader.
CLEAR gds_listheader.
gds_listheader-typ = lcf_s.
gds_listheader-key = lcf_user.
WRITE gdf_name_text TO gds_listheader-info.
APPEND gds_listheader TO gdt_listheader.
CLEAR gds_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gdt_listheader."it_listheader.
* I_LOGO = 'ENJOYSAP_LOGO'.
REFRESH gdt_listheader. "it_listheader.
ENDFORM. "TOP_OF_PAGE
******************************************************************
2) CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = gcf_prog_name
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* i_callback_top_of_page = lcf_top_of_page
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE1'
to display heading top left side and right side.
FORM html_top_of_page1 USING top TYPE REF TO cl_dd_document.
DATA: ldf_text(255) TYPE c.
DATA: ldf_date(10),
ldf_time(8),
ldf_name TYPE ad_namtext.
CREATE OBJECT top.
* heading of Report
ldf_text = text-005. "'Sales UoM Report'.
* Add gap
CALL METHOD top->add_gap
EXPORTING
width = 140.
*Dispaly heading
CALL METHOD top->add_text
EXPORTING
text = ldf_text
sap_fontsize = 'LARGE'
sap_emphasis = cl_dd_document=>strong.
*New line
CALL METHOD top->new_line.
CLEAR ldf_text.
* Program Name
CONCATENATE text-006 "'Program:'(006)
sy-repid
INTO ldf_text SEPARATED BY space.
CALL METHOD top->add_text
EXPORTING
text = ldf_text.
CALL METHOD top->add_gap
EXPORTING
width = 186.
* Execution Date and Time
WRITE sy-datum TO ldf_date DD/MM/YYYY.
WRITE sy-uzeit TO ldf_time ENVIRONMENT TIME FORMAT.
CONCATENATE text-003 "'Executed on'(003)
ldf_date
text-004 "'at'(004)
' '
ldf_time
INTO ldf_text SEPARATED BY space.
CALL METHOD top->add_text
EXPORTING
text = ldf_text.
CALL METHOD top->new_line.
* Display user and logon details on report
SELECT SINGLE name_text
INTO ldf_name
FROM v_username
WHERE bname = sy-uname.
CONCATENATE text-007 "'User Name:'(007)
ldf_name
INTO ldf_text SEPARATED BY space.
CALL METHOD top->add_text
EXPORTING
text = ldf_text.
CALL METHOD top->add_gap
EXPORTING
width = 180.
* Display page numbers
ldf_text = text-009. "'Page: 1 of 1'(009).
CALL METHOD top->add_text
EXPORTING
text = ldf_text.
CALL METHOD top->new_line.
Print input selection criteria
PERFORM print_selections.
LOOP AT gdt_list_comments INTO gds_list_comments.
*Adding Line
CALL METHOD top->new_line.
ldf_text = gds_list_comments-info.
CALL METHOD top->add_text
EXPORTING
text = ldf_text.
CLEAR gds_list_comments.
ENDLOOP.
ENDFORM. "top_of_page
********************************************************************
3)IN list top of page
* it_events = gdt_events
**FORM build_events .
**
** CLEAR gdt_events.
**
** gds_events-form = 'TOP_OF_PAGE'.
** gds_events-name = 'TOP_OF_PAGE1'.
** APPEND gds_events TO gdt_events.
** CLEAR gds_events.
**
**ENDFORM. " BUILD_EVENTS
*&---------------------------------------------------------------------*
*& Form TOP_OF_PAGE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
**FORM top_of_page1.
**
** DATA: ldt_headings TYPE slis_t_listheader,
** lds_headings LIKE LINE OF ldt_headings,
** ldf_text(255) TYPE c,
** ldf_uname(80) TYPE c,
** ldf_lines TYPE i,
** ldf_pagno TYPE cfcount,
** ldf_tot_pages TYPE cfcount,
** ldf_date(10),
** ldf_uzeit(8).
**
** CONSTANTS : lcf_lines_per_page TYPE i VALUE 30.
**
*** Date
** WRITE sy-datum TO ldf_date DD/MM/YYYY.
*** Time
** WRITE sy-uzeit TO ldf_uzeit ENVIRONMENT TIME FORMAT.
*** Executed on (SY-datum) at (sy-uzeit)
** CONCATENATE text-003 "'Executed on'(003)
** ldf_date
** text-004 "'at'(004)
** ' '
** ldf_uzeit
** INTO ldf_text SEPARATED BY space.
**
*** Select name of current user
** SELECT SINGLE name_text
** INTO ldf_uname
** FROM v_username
** WHERE bname = sy-uname.
**
*** Heading of the report
** WRITE : 55 text-005. "'Multi Plant MRP Report'(005).
*** Program Name
** WRITE :/ text-006, sy-repid.
*** Executed on (SY-datum) at (sy-uzeit)
** WRITE : 100 ldf_text.
*** User Name
** WRITE : / text-007, ldf_uname.
**
****************** To Discribe current page of total No of pages*********
**
*** calculate No of pages
** DESCRIBE TABLE gdt_output_list LINES ldf_lines.
** ldf_tot_pages = ldf_lines / lcf_lines_per_page.
**
** IF ldf_tot_pages LE 1.
** WRITE: 100 text-009.
** ELSE.
** CLEAR : ldf_text.
** WRITE: ldf_tot_pages TO ldf_text NO-ZERO.
** CONDENSE ldf_text.
** WRITE: sy-pagno TO ldf_pagno NO-ZERO.
**
** CONCATENATE text-008 " 'Page :'(038)
** ldf_pagno
** text-010 "'Of'(039)
** ldf_text
** INTO ldf_text SEPARATED BY space.
**
*** Display current page of total No of pages
** WRITE: 100 ldf_text.
** ENDIF.
** SKIP 1.
**
*** print input selection criteria
** PERFORM print_selections. " To get details of input selection
** "criteria
** LOOP AT gdt_list_comments INTO gds_list_comments.
** ldf_text = gds_list_comments-info.
** WRITE:/1 ldf_text.
** CLEAR gds_list_comments.
** ENDLOOP.
**
**
**ENDFORM. "TOP_OF_PAGE
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = gcf_prog_name
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
i_callback_top_of_page = lcf_top_of_page
lcf_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
FORM top_of_page.
DATA: lcf_text LIKE gds_listheader-info VALUE 'Multi Plant MRP Report',
lcf_s TYPE c VALUE 'S',
lcf_h TYPE c VALUE 'H',
lcf_program(8) TYPE c VALUE 'Program:',
lcf_user(10) TYPE c VALUE 'User Name:',
lcf_execdat(12) TYPE c VALUE 'Executed On:',
lcf_pgno(5) TYPE c VALUE 'Page:',
lcf_material(9) TYPE c VALUE 'Material:',
lcf_mrpcontoller(15) TYPE c VALUE 'MRP Controller:',
lcf_mrpprofile(12) TYPE c VALUE 'MRP Profile:',
lcf_stockplant(12) TYPE c VALUE 'Stock Plant:',
lcf_supplyplant(16) TYPE c VALUE 'Supplying plant:',
lcf_to(2) TYPE c VALUE 'TO'.
DATA: ldf_matnr TYPE matnr,
ldf_matnr1 TYPE matnr,
ldf_dispo TYPE dispo,
ldf_dispo1 TYPE dispo,
ldf_dispr TYPE dispr,
ldf_dispr1 TYPE dispr,
ldf_werks TYPE werks,
ldf_werks1 TYPE werks.
MOVE: s_matnr-low TO ldf_matnr,
s_matnr-high TO ldf_matnr1,
s_dispo-low TO ldf_dispo,
s_dispo-high TO ldf_dispo1,
s_dispr-low TO ldf_dispr,
s_dispr-high TO ldf_dispr1,
s_werks-low TO ldf_werks,
s_werks-high TO ldf_werks1.
CLEAR: gds_listheader.
gds_listheader-typ = lcf_h.
gds_listheader-info = lcf_text.
APPEND gds_listheader TO gdt_listheader.
CLEAR gds_listheader.
gds_listheader-typ = lcf_s.
gds_listheader-key = lcf_program.
WRITE sy-cprog TO gds_listheader-info.
APPEND gds_listheader TO gdt_listheader.
CLEAR gds_listheader.
gds_listheader-typ = lcf_s.
gds_listheader-key = lcf_user.
WRITE gdf_name_text TO gds_listheader-info.
APPEND gds_listheader TO gdt_listheader.
CLEAR gds_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gdt_listheader."it_listheader.
* I_LOGO = 'ENJOYSAP_LOGO'.
REFRESH gdt_listheader. "it_listheader.
ENDFORM. "TOP_OF_PAGE
******************************************************************
2) CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = gcf_prog_name
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* i_callback_top_of_page = lcf_top_of_page
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE1'
to display heading top left side and right side.
FORM html_top_of_page1 USING top TYPE REF TO cl_dd_document.
DATA: ldf_text(255) TYPE c.
DATA: ldf_date(10),
ldf_time(8),
ldf_name TYPE ad_namtext.
CREATE OBJECT top.
* heading of Report
ldf_text = text-005. "'Sales UoM Report'.
* Add gap
CALL METHOD top->add_gap
EXPORTING
width = 140.
*Dispaly heading
CALL METHOD top->add_text
EXPORTING
text = ldf_text
sap_fontsize = 'LARGE'
sap_emphasis = cl_dd_document=>strong.
*New line
CALL METHOD top->new_line.
CLEAR ldf_text.
* Program Name
CONCATENATE text-006 "'Program:'(006)
sy-repid
INTO ldf_text SEPARATED BY space.
CALL METHOD top->add_text
EXPORTING
text = ldf_text.
CALL METHOD top->add_gap
EXPORTING
width = 186.
* Execution Date and Time
WRITE sy-datum TO ldf_date DD/MM/YYYY.
WRITE sy-uzeit TO ldf_time ENVIRONMENT TIME FORMAT.
CONCATENATE text-003 "'Executed on'(003)
ldf_date
text-004 "'at'(004)
' '
ldf_time
INTO ldf_text SEPARATED BY space.
CALL METHOD top->add_text
EXPORTING
text = ldf_text.
CALL METHOD top->new_line.
* Display user and logon details on report
SELECT SINGLE name_text
INTO ldf_name
FROM v_username
WHERE bname = sy-uname.
CONCATENATE text-007 "'User Name:'(007)
ldf_name
INTO ldf_text SEPARATED BY space.
CALL METHOD top->add_text
EXPORTING
text = ldf_text.
CALL METHOD top->add_gap
EXPORTING
width = 180.
* Display page numbers
ldf_text = text-009. "'Page: 1 of 1'(009).
CALL METHOD top->add_text
EXPORTING
text = ldf_text.
CALL METHOD top->new_line.
Print input selection criteria
PERFORM print_selections.
LOOP AT gdt_list_comments INTO gds_list_comments.
*Adding Line
CALL METHOD top->new_line.
ldf_text = gds_list_comments-info.
CALL METHOD top->add_text
EXPORTING
text = ldf_text.
CLEAR gds_list_comments.
ENDLOOP.
ENDFORM. "top_of_page
********************************************************************
3)IN list top of page
* it_events = gdt_events
**FORM build_events .
**
** CLEAR gdt_events.
**
** gds_events-form = 'TOP_OF_PAGE'.
** gds_events-name = 'TOP_OF_PAGE1'.
** APPEND gds_events TO gdt_events.
** CLEAR gds_events.
**
**ENDFORM. " BUILD_EVENTS
*&---------------------------------------------------------------------*
*& Form TOP_OF_PAGE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
**FORM top_of_page1.
**
** DATA: ldt_headings TYPE slis_t_listheader,
** lds_headings LIKE LINE OF ldt_headings,
** ldf_text(255) TYPE c,
** ldf_uname(80) TYPE c,
** ldf_lines TYPE i,
** ldf_pagno TYPE cfcount,
** ldf_tot_pages TYPE cfcount,
** ldf_date(10),
** ldf_uzeit(8).
**
** CONSTANTS : lcf_lines_per_page TYPE i VALUE 30.
**
*** Date
** WRITE sy-datum TO ldf_date DD/MM/YYYY.
*** Time
** WRITE sy-uzeit TO ldf_uzeit ENVIRONMENT TIME FORMAT.
*** Executed on (SY-datum) at (sy-uzeit)
** CONCATENATE text-003 "'Executed on'(003)
** ldf_date
** text-004 "'at'(004)
** ' '
** ldf_uzeit
** INTO ldf_text SEPARATED BY space.
**
*** Select name of current user
** SELECT SINGLE name_text
** INTO ldf_uname
** FROM v_username
** WHERE bname = sy-uname.
**
*** Heading of the report
** WRITE : 55 text-005. "'Multi Plant MRP Report'(005).
*** Program Name
** WRITE :/ text-006, sy-repid.
*** Executed on (SY-datum) at (sy-uzeit)
** WRITE : 100 ldf_text.
*** User Name
** WRITE : / text-007, ldf_uname.
**
****************** To Discribe current page of total No of pages*********
**
*** calculate No of pages
** DESCRIBE TABLE gdt_output_list LINES ldf_lines.
** ldf_tot_pages = ldf_lines / lcf_lines_per_page.
**
** IF ldf_tot_pages LE 1.
** WRITE: 100 text-009.
** ELSE.
** CLEAR : ldf_text.
** WRITE: ldf_tot_pages TO ldf_text NO-ZERO.
** CONDENSE ldf_text.
** WRITE: sy-pagno TO ldf_pagno NO-ZERO.
**
** CONCATENATE text-008 " 'Page :'(038)
** ldf_pagno
** text-010 "'Of'(039)
** ldf_text
** INTO ldf_text SEPARATED BY space.
**
*** Display current page of total No of pages
** WRITE: 100 ldf_text.
** ENDIF.
** SKIP 1.
**
*** print input selection criteria
** PERFORM print_selections. " To get details of input selection
** "criteria
** LOOP AT gdt_list_comments INTO gds_list_comments.
** ldf_text = gds_list_comments-info.
** WRITE:/1 ldf_text.
** CLEAR gds_list_comments.
** ENDLOOP.
**
**
**ENDFORM. "TOP_OF_PAGE
No comments:
Post a Comment