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

Report heading

Former Member
0 Likes
1,231

Hi,

I would maintain at the top of the report output the following heading:

 

* REPORT HEADER

 

WRITE: /1 'REPORT MATERIAL MASTER'.

WRITE SY-ULINE. "1st Horizontal line

WRITE:/1 'Material number',

20 'Material type',

37 'Author'.

WRITE SY-ULINE. "2nd Horizontal line

Actually when I scroll down the page, the heading goes up

Is there any way to lock it ?

It looks like excel sheet where is possible to lock the upper rows of the heading and scrolling down so that these remains at the top of the screen

Thanks

Best regards

11 REPLIES 11
Read only

laurent_fournier2
Contributor
0 Likes
1,193

Use TOP-OF-PAGE.

Search to find out how.

Read only

yogendra_bhaskar
Contributor
0 Likes
1,193

hi ,

write the heading in

TOP-OF-PAGE. event .

it will work.

regards,

Yogendra Bhaskar

Read only

former_member212705
Active Participant
0 Likes
1,193

Dear a a,

use top-of page after start of selection and display report after end-of-selection..

start-of-selection.

top-of-page.

WRITE: /1 'REPORT MATERIAL MASTER'.

WRITE SY-ULINE. "1st Horizontal line

WRITE:/1 'Material number',

20 'Material type',

37 'Author'.

WRITE SY-ULINE.

Regards,

Ashish

Read only

0 Likes
1,193

Hi,

I modified the following report  but is not clear where to put top-of-page

I also have another issue: material description MAKTX is not printed in the output of the report may be the selection is not correct...

*&---------------------------------------------------------------------*

*& Report ZL

*&

*&---------------------------------------------------------------------*

* Title  :                                                             *

* Project  :                                                         *

* ID :                                                                  *

* Author                                                           : *

*&---------------------------------------------------------------------*

 

REPORT ZL

 

* Columns

 

LINE-SIZE 200

 

* Rows

 

LINE-COUNT 0.

 

 

* Internal tables definition

 

TABLES: mara, makt.

 

* SELECTION FIELDS

 

SELECT-OPTIONS: s_matnr FOR mara-matnr OBLIGATORY."Material number

SELECT-OPTIONS: s_maktx FOR makt-maktx. "Material Description

SELECT-OPTIONS: s_mtart FOR mara-mtart."Material type

SELECT-OPTIONS: s_ernam FOR mara-ernam."Created by

SELECT-OPTIONS: s_laeda FOR mara-laeda no-extension no intervals.

 

 

* REPORT HEADER

 

WRITE: /1 'REPORT MATERIAL MASTER'.

 

WRITE SY-ULINE. "1st Horizontal line

WRITE:/1 'Material number',

20 'Material description',

70 'Material type',

90 'Created by'.

WRITE SY-ULINE. "2nd Horizontal line

 

 

* START OF SELECTION

 

SELECT * FROM MARA WHERE MATNR IN S_MATNR.

 

 

* OUTPUT

 

WRITE: /1 MARA-MATNR, 20 MAKT-MAKTX, 70 MARA-MTART, 90 MARA-ERNAM.

ENDSELECT.

Read only

0 Likes
1,193

Hi,

Do like this

*&---------------------------------------------------------------------*

*& Report ZL

*&

*&---------------------------------------------------------------------*

* Title  :                                                             *

* Project  :                                                         *

* ID :                                                                  *

* Author                                                           : *

*&---------------------------------------------------------------------*

 

REPORT ZL

 

* Columns

 

LINE-SIZE 200

 

* Rows

 

LINE-COUNT 0.

 

 

* Internal tables definition

 

TABLES: mara, makt.

 

* SELECTION FIELDS

 

SELECT-OPTIONS: s_matnr FOR mara-matnr OBLIGATORY."Material number

SELECT-OPTIONS: s_maktx FOR makt-maktx. "Material Description

SELECT-OPTIONS: s_mtart FOR mara-mtart."Material type

SELECT-OPTIONS: s_ernam FOR mara-ernam."Created by

SELECT-OPTIONS: s_laeda FOR mara-laeda no-extension no intervals.

 

 

 

* START OF SELECTION

 

SELECT * FROM MARA WHERE MATNR IN S_MATNR.

 

 

* OUTPUT

 

WRITE: /1 MARA-MATNR, 20 MAKT-MAKTX, 70 MARA-MTART, 90 MARA-ERNAM.

ENDSELECT.

TOP-OF-PAGE.

 

WRITE: /1 'REPORT MATERIAL MASTER'.

 

WRITE SY-ULINE. "1st Horizontal line

WRITE:/1 'Material number',

20 'Material description',

70 'Material type',

90 'Created by'.

WRITE SY-ULINE. "2nd Horizontal line

 

Regards,

Prashant

Read only

0 Likes
1,193

Dear AA,

  TABLES: mara, makt.

SELECT-OPTIONS: s_matnr FOR mara-matnr OBLIGATORY."Material number

SELECT-OPTIONS: s_maktx FOR makt-maktx. "Material Description

SELECT-OPTIONS: s_mtart FOR mara-mtart."Material type

SELECT-OPTIONS: s_ernam FOR mara-ernam."Created by

SELECT-OPTIONS: s_laeda FOR mara-laeda NO-EXTENSION NO INTERVALS.

DATA : it_mara TYPE STANDARD TABLE OF mara,
       wa_mara TYPE mara.

START-OF-SELECTION .
  SELECT * FROM mara INTO table it_mara WHERE matnr IN s_matnr.

TOP-OF-PAGE.

  WRITE: /1 'REPORT MATERIAL MASTER'.
  WRITE sy-uline. "1st Horizontal line

  WRITE:/1 'Material number',

  20 'Material description',

  70 'Material type',

  90 'Created by'.

  WRITE sy-uline. "2nd Horizontal line

END-OF-SELECTION.

  LOOP AT it_mara INTO wa_mara.

    WRITE: /1 wa_mara-matnr, 20 makt-maktx, 70 wa_mara-mtart, 90 wa_mara-ernam.

    endloop.

Read only

0 Likes
1,193

And one thing for material description you have to select the description from MAKT  table for all entries of it_mara that you have fetched from MARA table . so make a final output internal table and fetch material description from MAKT table for all entries of it_mara and print according this.

If you are still facing problem then reply me.

regards,

ashish

Read only

0 Likes
1,193

Dear aa,

try to code like this,

  TABLES: mara, makt.

TYPES : BEGIN OF gs_mara,
        matnr TYPE mara-matnr,
        mtart TYPE mara-mtart,
        ernam  TYPE mara-ernam,
       END OF gs_mara.

TYPES : BEGIN OF gs_makt,
        matnr TYPE makt-matnr,
        maktx TYPE makt-maktx,
        END OF gs_makt.
TYPES : BEGIN OF gs_output,
        matnr TYPE mara-matnr,
        mtart TYPE mara-mtart,
        ernam  TYPE mara-ernam,
         maktx TYPE makt-maktx,
        END OF gs_output.


DATA : it_mara TYPE STANDARD TABLE OF gs_mara,
       wa_mara TYPE gs_mara,
       it_makt TYPE STANDARD TABLE OF gs_makt,
       wa_makt TYPE gs_makt,
       it_output TYPE STANDARD TABLE OF gs_output,
       wa_output TYPE gs_output.

SELECT-OPTIONS: s_matnr FOR mara-matnr OBLIGATORY."Material number

SELECT-OPTIONS: s_maktx FOR makt-maktx. "Material Description

SELECT-OPTIONS: s_mtart FOR mara-mtart."Material type

SELECT-OPTIONS: s_ernam FOR mara-ernam."Created by

SELECT-OPTIONS: s_laeda FOR mara-laeda NO-EXTENSION NO INTERVALS.
*

START-OF-SELECTION .
  SELECT matnr mtart ernam FROM mara INTO TABLE it_mara WHERE matnr IN s_matnr.


  SELECT matnr maktx FROM makt INTO TABLE it_makt FOR ALL ENTRIES IN it_mara
            WHERE matnr = it_mara-matnr.
  LOOP AT it_mara INTO wa_mara.
    wa_output-matnr = wa_mara-matnr.
    wa_output-mtart = wa_mara-mtart.
    wa_output-ernam = wa_mara-ernam.
    READ TABLE it_makt INTO wa_makt WITH KEY matnr = wa_mara-matnr.
    wa_output-maktx = wa_makt-maktx.
    APPEND wa_output TO it_output.
    CLEAR wa_output.
  ENDLOOP.

TOP-OF-PAGE.

  WRITE: /1 'REPORT MATERIAL MASTER'.
  WRITE sy-uline. "1st Horizontal line

  WRITE:/1 'Material number',

  20 'Material description',

  70 'Material type',

  90 'Created by'.

  WRITE sy-uline. "2nd Horizontal line

END-OF-SELECTION.

  LOOP AT it_output INTO wa_output.

    WRITE: /1 wa_output-matnr, 20 wa_output-maktx, 70 wa_output-mtart, 90 wa_output-ernam.

  ENDLOOP.

Now similar to this code you can add more fields to your internal table it_output.

Enjoy..

Regards,

Ashish

Read only

Former Member
0 Likes
1,193

Hello,

with the top-of-page event,

you can write the headings in the report,

for example.

implement this code inside top-of-page event and try

CLEAR wa_header.
   REFRESH t_header.

wa_header-typ = 'H'.
   WRITE sy-datum to l_printdate.
   CONCATENATE l_printdate INTO l_string SEPARATED BY space.
   wa_header-info = l_string."'CHANGE NUMBERS'.
   APPEND WA_HEADER TO T_HEADER.
   CLEAR WA_HEADER.

   CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
     EXPORTING
       IT_LIST_COMMENTARY = T_HEADER.

Regards.

Read only

former_member386202
Active Contributor
0 Likes
1,193

Hi,

Write your code in TOP-OF-PAGE event.

Regards,

Prashant    

Read only

ThomasZloch
Active Contributor
0 Likes
1,193

Very basic, please search for available examples.

Discussion locked.

Thomas