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: 

Help reg. top-of-page and classic list report

Former Member
0 Kudos

Hi friends,

For the classic list report:

I have a horizontal heading like below:

Jan (space) Feb (space) March etc

This sequence may not be always the same for this report. For example, if the run is run in april, the heading may look like this:

Mar (space) April (space) May (space) etc.

If the heading is constant, i I know it can be displayed as immovable at top-of-page before the start-of-selection. But how do I achieve this(immovable), when the heading sequence keep changing depending on the coding that i do later in the program.

Can I insert top-of-page anywhere in the program (ofcourse before writing the real output data) and expect that heading to display there? Please clarify.

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Plese see the below message.

Edited by: Raj Julakanti on Sep 5, 2008 7:21 PM

4 REPLIES 4

naimesh_patel
Active Contributor
0 Kudos

Try Something like this:


PARAMETERS: P_MONTH TYPE T247-MNR.

TOP-OF-PAGE.
  DATA: L_LTX TYPE T247-LTX.
  DATA: L_MONTH TYPE T247-MNR.
  L_MONTH = P_MONTH - 1.
  IF L_MONTH > 0.
    SELECT SINGLE LTX
           INTO L_LTX
           FROM T247
           WHERE SPRAS = SY-LANGU
           AND   MNR   = l_MONTH.
    WRITE: (20) L_LTX.
  ENDIF.

  L_MONTH = P_MONTH.
  SELECT SINGLE LTX
         INTO L_LTX
         FROM T247
         WHERE SPRAS = SY-LANGU
         AND   MNR   = l_MONTH.
  WRITE: (20) L_LTX.

  IF L_MONTH < 13.
    L_MONTH = P_MONTH + 1.
    SELECT SINGLE LTX
           INTO L_LTX
           FROM T247
           WHERE SPRAS = SY-LANGU
           AND   MNR   = l_MONTH.
    WRITE: (20) L_LTX.
  ENDIF.

START-OF-SELECTION.
  DO 10 TIMES.
    WRITE: / 'Testing'.
  ENDDO.

Regards,

Naimesh Patel

Former Member
0 Kudos

Hi Krishen,

You want to check the date i.e current month to display at top of page ? You can check SY-DATUM in TOP-OF-PAGE event. If you run the report in April then you can get month from SY-DATUM and according to that you can pass the month name to the list display.

TOP-OF-PAGE.
data:
  w_month(2) type c,
  w_month1(3) type c,
  w_month2(3) type c,
  w_month3(3) type c.

w_month =  sy-datum+4(2).

case w_month.
  when '01'.
   w_month1 = 'Dec'.
   w_month2 = 'Jan'.
   w_month3 = 'Feb'.

 when '02'.
    w_month1 = 'Jan'.
   w_month2 = 'Feb'.
   w_month3 = 'Mar'.

when '03'.
   w_month1 = 'Feb'.
   w_month2 = 'Mar'.
   w_month3 = 'Apr'.

...........

endcase.

write :/5   w_month1,
         20  w_month2,
         30 w_month3.

I think like this you can do.

Regards,

Rajitha.

Former Member
0 Kudos

Plese see the below message.

Edited by: Raj Julakanti on Sep 5, 2008 7:21 PM

Former Member
0 Kudos

You can try the below code. Please award points if it helps.

data: W_MONTH(2) type N,

P_VALUE(1) type N,

HEADER1(3) type C,

HEADER2(3) type C,

HEADER3(3) type C,

IT_MONTHS like T247 occurs 0 with header line.

top-of-page.

W_MONTH = SY-DATUM+4(2).

refresh:it_months.

call function 'MONTH_NAMES_GET'

tables

MONTH_NAMES = IT_MONTHS

exceptions

MONTH_NAMES_NOT_FOUND = 1

others = 2.

P_VALUE = 0.

do 3 times.

P_VALUE = P_VALUE + 1.

read table IT_MONTHS with key MNR = W_MONTH.

if SY-SUBRC = 0.

case P_VALUE.

when 1.

HEADER1 = IT_MONTHS-KTX.

when 2.

HEADER2 = IT_MONTHS-KTX.

when 3.

HEADER3 = IT_MONTHS-KTX.

endcase.

endif.

W_MONTH = W_MONTH + 1.

enddo.