Skip to Content
0
Former Member
Oct 19, 2006 at 07:35 AM

i need header with page no's to every Pages

23 Views

Hi Experts,

i need header with page no's with this logic.

it came one header and one page no. to every pages.

FORM COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE

SLIS_T_LISTHEADER.

DATA: LS_LINE TYPE SLIS_LISTHEADER.

DATA: LV_PAGE_STRING(11),

lv_page_no(3).

pagno = sy-pagno.

data: pagno(5) type c.

CLEAR

ls_line.

refresh lt_top_of_page.

CLEAR

ls_line.

ls_line-typ = 'A'.

LS_LINE-key = 'Page Number'.

PAGNO = sy-pagno.

IF

PAGNO = 0.

PAGNO = 1.

ENDIF.

SHIFT PAGNO LEFT DELETING LEADING space.

LS_LINE-INFO = PAGNO.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

CLEAR LS_LINE.

LS_LINE-TYP = 'H'.

LS_LINE-INFO = TEXT-001.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

CLEAR LS_LINE.

LS_LINE-TYP = 'A'.

SELECT SINGLE * FROM T001W WHERE

WERKS IN WERKS.

CONCATENATE 'Name Of The Plant ' '-' T001W-NAME1 INTO

TXT SEPARATED BY SPACE.

LS_LINE-INFO = TXT.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

CLEAR:TXT, LS_LINE.

LS_LINE-TYP = 'H'.

LS_LINE-INFO = TEXT-002.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

CLEAR LS_LINE.

IF WERKS-HIGH EQ SPACE.

CONCATENATE 'Plant : ' WERKS-LOW INTO TXT.

ELSE.

CONCATENATE 'FROM PLANT : ' WERKS-LOW 'TO PLANT : ' WERKS-HIGH INTO TXT SEPARATED BY SPACE.

ENDIF.

LS_LINE-TYP = 'H'.

LS_LINE-INFO = TXT.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

IF BUDAT-HIGH EQ SPACE. BUDAT-HIGH = BUDAT-LOW.

ENDIF.

CONCATENATE 'Date : From ' BUDAT-LOW6(2) '-' BUDAT-LOW4(2) '-'

BUDAT-LOW0(4) 'to' BUDAT-HIGH6(2) '-'

BUDAT-HIGH4(2) '-' BUDAT-HIGH0(4) INTO

TXT SEPARATED BY SPACE.

CLEAR LS_LINE.

LS_LINE-TYP = 'A'.

LS_LINE-INFO = TXT.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

ENDFORM.

Thanks & Regards.

Sreedhar.