2007 Oct 30 11:16 AM
hi all,
i have a problem in alv report . i have displayed a text at my alv top of page header as 'Sales Tax Register Report'. the code for which is displayed below. its working fine. but nw i want to display on more text in which it should show the date high and date low as in my selection screen. say example "from 'date-low' to 'date-high' ". i have a select option for the date at the selection screen. how can i use this.
&----
*& Form COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
&----
text
----
-->P_GT_LIST_TOP_OF_PAGE[] text
----
FORM COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
DATA: LS_LINE TYPE SLIS_LISTHEADER.
CLEAR LS_LINE.
LS_LINE-TYP = 'H'.
LS_LINE-INFO = 'Sales Tax Register Report'.
APPEND LS_LINE TO LT_TOP_OF_PAGE.
endform.
hi all,
i have a problem in alv report . i have displayed a text at my alv top of page header as 'Sales Tax Register Report'. the code for which is displayed below. its working fine. but nw i want to display on more text in which it should show the date high and date low as in my selection screen. say example "from 'date-low' to 'date-high' ". i have a select option for the date at the selection screen. how can i use this.
&----
*& Form COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
&----
text
----
-->P_GT_LIST_TOP_OF_PAGE[] text
----
FORM COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
DATA: LS_LINE TYPE SLIS_LISTHEADER.
CLEAR LS_LINE.
LS_LINE-TYP = 'H'.
LS_LINE-INFO = 'Sales Tax Register Report'.
APPEND LS_LINE TO LT_TOP_OF_PAGE.
endform.
2007 Oct 30 11:20 AM
Hi avinash,
1. somewhat like this :
DATA : D1(15) TYPE C.
DATA : D2(15) TYPE C.
CLEAR LS_LINE.
LS_LINE-TYP = 'S'.
<b>WRITE DATE-LOW TO D1.
WRITE DATE-HIGH TO D2.
CONCATENATE D1 'TO' D2
INTO LS_LINE-INFO
SEPARATED BY SPACE.
APPEND LS_LINE TO LT_TOP_OF_PAGE.</b>
regards,
amit m.
2007 Oct 30 11:32 AM
thanks amit its working , but i am not getting the date in date format i have tried defining d1 and d2 into date format instead of char format.
2007 Oct 30 11:38 AM
Hi again,
1. Put D1 and D2 as CHAR formats only.
2. By using WRITE datum into D1,
it will write in this format
30.10.2007.
regards,
amit m.
2007 Oct 30 11:21 AM
Hi Abinash,
Try this,
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
concatenate sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) into wa_header-info."todays date
append wa_header to t_header.
clear: wa_header.
Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
Regards,
Ruthra
2007 Oct 30 11:23 AM
Hi,
You can use the below code :
*Company Code
IF NOT so_bukrs-low IS INITIAL AND NOT so_bukrs-high IS INITIAL.
CLEAR gs_line.
gs_line-typ = gc_s.
gs_line-key = 'Company Code'(002).
CONCATENATE so_bukrs-low 'to' so_bukrs-high INTO gs_line-info
SEPARATED BY space.
APPEND gs_line TO lt_listheader.
ELSEIF so_bukrs-low IS INITIAL AND so_bukrs-high IS INITIAL.
CLEAR gs_line.
gs_line-typ = gc_s.
gs_line-key = 'Company Code'(002).
gs_line-info = 'ALL Values'(003).
APPEND gs_line TO lt_listheader.
ELSEIF so_bukrs-high IS INITIAL.
CLEAR gs_line.
gs_line-typ = gc_s.
gs_line-key = 'Company Code'(002).
gs_line-info = so_bukrs-low.
APPEND gs_line TO lt_listheader.
ENDIF.Thanks,
Sriram Ponna.
2007 Oct 30 11:35 AM
2007 Oct 30 11:36 AM
Hi,
use the following code.Using the following you will get the date in the required format and also its efficient way:-
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
concatenate sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) into wa_header-info."todays date
append wa_header to t_header.
clear: wa_header.
Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
Regards,
Shilpi