Application Development and Automation 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: 
Read only

ALV list Header !!!

Former Member
0 Likes
522

I have a custom z report . I need to put in my own headers for the report depending on the variant choosen . Thus there are 2 headings for the report . If user chooses option 1 then HEADER1 should be printer in the output of the report else HEADER2 .

I am using ALV list . Right now the program is using the syst-title for the report output .

Please advise .

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
493

Write down Logic like under form COMMENT_BUILD

FORM TOP_OF_PAGE.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

I_LOGO = 'FDTRAN1'

IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.

ENDFORM.

----


  • FORM COMMENT_BUILD *

----


  • ........ *

----


  • --> LT_TOP_OF_PAGE *

----


FORM COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE

SLIS_T_LISTHEADER.

DATA: LS_LINE TYPE SLIS_LISTHEADER.

  • Variables for Date

data : lv_year(4) type c,

lv_mon(2) type c,

lv_day(2) type c,

lv_date1(10) type c,

lv_date2(10) type c,

lv_time(8) type c,

lv_hour(2) type c,

lv_min(2) type c,

lv_sec(2) type c.

  • LIST HEADING LINE: TYPE H

CLEAR LS_LINE.

LS_LINE-TYP = 'H'.

LS_LINE-INFO = sy-title.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • Plant

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-c02.

LS_LINE-INFO = P_WERKS.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

clear : lv_time,

lv_hour,

lv_min,

lv_sec.

lv_hour = sy-uzeit+0(2).

lv_min = sy-uzeit+2(2).

lv_sec = sy-uzeit+4(2).

concatenate lv_hour ':' lv_min ':' lv_sec into lv_time.

  • Current time

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-c03.

LS_LINE-INFO = lv_time.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

clear : lv_year,

lv_day,

lv_mon,

lv_date1.

lv_year = p_vdatu+0(4).

lv_mon = p_vdatu+4(2).

lv_day = p_vdatu+6(2).

concatenate lv_mon '/' lv_day '/' lv_year into lv_date1.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-c01.

LS_LINE-INFO = lv_date1.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

ENDFORM.

if options 1 : print header 1

else print header2.

endif.

Reward Points if it is helpful

Thanks

Seshu

Write down Logic like under form COMMENT_BUILD

FORM TOP_OF_PAGE.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

I_LOGO = 'FDTRAN1'

IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.

ENDFORM.

----


  • FORM COMMENT_BUILD *

----


  • ........ *

----


  • --> LT_TOP_OF_PAGE *

----


FORM COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE

SLIS_T_LISTHEADER.

DATA: LS_LINE TYPE SLIS_LISTHEADER.

  • Variables for Date

data : lv_year(4) type c,

lv_mon(2) type c,

lv_day(2) type c,

lv_date1(10) type c,

lv_date2(10) type c,

lv_time(8) type c,

lv_hour(2) type c,

lv_min(2) type c,

lv_sec(2) type c.

  • LIST HEADING LINE: TYPE H

CLEAR LS_LINE.

LS_LINE-TYP = 'H'.

LS_LINE-INFO = sy-title.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • Plant

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-c02.

LS_LINE-INFO = P_WERKS.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

clear : lv_time,

lv_hour,

lv_min,

lv_sec.

lv_hour = sy-uzeit+0(2).

lv_min = sy-uzeit+2(2).

lv_sec = sy-uzeit+4(2).

concatenate lv_hour ':' lv_min ':' lv_sec into lv_time.

  • Current time

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-c03.

LS_LINE-INFO = lv_time.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

clear : lv_year,

lv_day,

lv_mon,

lv_date1.

lv_year = p_vdatu+0(4).

lv_mon = p_vdatu+4(2).

lv_day = p_vdatu+6(2).

concatenate lv_mon '/' lv_day '/' lv_year into lv_date1.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-c01.

LS_LINE-INFO = lv_date1.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

ENDFORM.

if options 1 : print header 1

else print header2.

endif.

Reward Points if it is helpful

Thanks

Seshu

2 REPLIES 2
Read only

Former Member
0 Likes
493

if option 1.

SET TITLEBAR 'TIT1'.

elseif option 2.

SET TITLEBAR 'TIT2'.

endif

Read only

Former Member
0 Likes
494

Write down Logic like under form COMMENT_BUILD

FORM TOP_OF_PAGE.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

I_LOGO = 'FDTRAN1'

IT_LIST_COMMENTARY = GT_LIST_TOP_OF_PAGE.

ENDFORM.

----


  • FORM COMMENT_BUILD *

----


  • ........ *

----


  • --> LT_TOP_OF_PAGE *

----


FORM COMMENT_BUILD USING LT_TOP_OF_PAGE TYPE

SLIS_T_LISTHEADER.

DATA: LS_LINE TYPE SLIS_LISTHEADER.

  • Variables for Date

data : lv_year(4) type c,

lv_mon(2) type c,

lv_day(2) type c,

lv_date1(10) type c,

lv_date2(10) type c,

lv_time(8) type c,

lv_hour(2) type c,

lv_min(2) type c,

lv_sec(2) type c.

  • LIST HEADING LINE: TYPE H

CLEAR LS_LINE.

LS_LINE-TYP = 'H'.

LS_LINE-INFO = sy-title.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • Plant

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-c02.

LS_LINE-INFO = P_WERKS.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

clear : lv_time,

lv_hour,

lv_min,

lv_sec.

lv_hour = sy-uzeit+0(2).

lv_min = sy-uzeit+2(2).

lv_sec = sy-uzeit+4(2).

concatenate lv_hour ':' lv_min ':' lv_sec into lv_time.

  • Current time

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-c03.

LS_LINE-INFO = lv_time.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

clear : lv_year,

lv_day,

lv_mon,

lv_date1.

lv_year = p_vdatu+0(4).

lv_mon = p_vdatu+4(2).

lv_day = p_vdatu+6(2).

concatenate lv_mon '/' lv_day '/' lv_year into lv_date1.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = TEXT-c01.

LS_LINE-INFO = lv_date1.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

  • STATUS LINE: TYPE S

CLEAR LS_LINE.

LS_LINE-TYP = 'S'.

LS_LINE-KEY = ''.

LS_LINE-INFO = ''.

APPEND LS_LINE TO LT_TOP_OF_PAGE.

ENDFORM.

if options 1 : print header 1

else print header2.

endif.

Reward Points if it is helpful

Thanks

Seshu