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:Β 

performance tuning of this report

Former Member
0 Kudos

Hello friends iam attaching my report give the performance tuning for this report to avoid nested endloops. how to do without using nested endloops.

give me the reply urgent.

-


*

REPORT ZDEMO9 NO STANDARD PAGE HEADING

LINE-SIZE 250

LINE-COUNT 22(3). .

*****************************************************

  • TABLES DECLARATION *

*****************************************************

TABLES : MARA, "general material data

MAKT, "material description

MARC, "plant data for material

VBAP, "sales document for item data

EKKO, "purchasing document header

EKPO, "purchasing document item

KNA1. "customer master details

******************************************************

  • INTERNAL TABLE DECLARATION *

******************************************************

DATA : BEGIN OF T_MARA OCCURS 0,

MATNR LIKE MARA-MATNR,

MTART LIKE MARA-MTART,

MEINS LIKE MARA-MEINS,

END OF T_MARA.

DATA : BEGIN OF T_MAKT OCCURS 0,

MATNR LIKE MAKT-MATNR,

MAKTX LIKE MAKT-MAKTX,

SPRAS LIKE MAKT-SPRAS,

END OF T_MAKT.

DATA : BEGIN OF T_MARC OCCURS 0,

MATNR LIKE MARC-MATNR,

WERKS LIKE MARC-WERKS,

END OF T_MARC.

DATA : BEGIN OF T_KNA1 OCCURS 0,

KUNNR LIKE KNA1-KUNNR,

NAME1 LIKE KNA1-NAME1,

LAND1 LIKE KNA1-LAND1,

END OF T_KNA1.

DATA : BEGIN OF T_VBAP OCCURS 0,

MATNR LIKE VBAP-MATNR,

POSNR LIKE VBAP-POSNR,

MATKL LIKE VBAP-MATKL,

VBELN LIKE VBAP-VBELN,

END OF T_VBAP.

DATA : BEGIN OF T_EKPO OCCURS 0,

EBELN LIKE EKPO-EBELN,

EBELP LIKE EKPO-EBELP,

BUKRS LIKE EKPO-BUKRS,

WERKS LIKE EKPO-WERKS,

LGORT LIKE EKPO-LGORT,

MATNR LIKE EKPO-MATNR,

MANDT LIKE EKPO-MANDT,

END OF T_EKPO.

********************************************************

  • FINAL INTERNAL TABLE *

********************************************************

DATA : BEGIN OF T_FINAL OCCURS 0,

MATNR LIKE MARA-MATNR,

MTART LIKE MARA-MTART,

MEINS LIKE MARA-MEINS,

WERKS LIKE MARC-WERKS,

MAKTX LIKE MAKT-MAKTX,

SPRAS LIKE MAKT-SPRAS,

VBELN LIKE VBAP-VBELN,

POSNR LIKE VBAP-POSNR,

MATKL LIKE VBAP-MATKL,

EBELN LIKE EKPO-EBELN,

EBELP LIKE EKPO-EBELP,

BUKRS LIKE EKPO-BUKRS,

KUNNR LIKE KNA1-KUNNR,

LAND1 LIKE KNA1-LAND1,

NAME1 LIKE KNA1-NAME1,

LGORT LIKE EKPO-LGORT,

END OF T_FINAL.

*DATA: BEGIN OF V_matnr OCCURS 0,

  • matnr LIKE mara-matnr,

  • END OF t_matnr.

data:

a(32) type c.

a = 'IBT000000000000000001000000000000000050'.

***************************************************************

  • SELECTION SCREEN *

***************************************************************

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS : S_BUKRS FOR EKPO-BUKRS,

S_KUNNR FOR KNA1-KUNNR,

S_WERKS FOR MARC-WERKS,

S_MATNR FOR MARA-MATNR obligatory.

SELECTION-SCREEN END OF BLOCK B1.

*****************************************************************

  • START OF SELECTION *

*****************************************************************

START-OF-SELECTION.

SELECT MATNR mtart meins

FROM MARA

INTO CORRESPONDING FIELDS OF TABLE T_MARA

WHERE MATNR IN S_MATNR.

SELECT MATNR WERKS

FROM MARC

INTO CORRESPONDING FIELDS OF TABLE T_MARC

FOR ALL ENTRIES IN T_MARA

WHERE MATNR = T_MARA-MATNR

and werks in s_werks.

select matnr maktx spras

from makt

into corresponding fields of table t_makt

for all entries in t_mara

where matnr = t_mara-matnr

and spras = sy-langu.

select matnr posnr matkl vbeln

from vbap

into corresponding fields of table t_vbap

for all entries in t_mara

where matnr = t_mara-matnr.

select matnr werks bukrs ebeln ebelp lgort

from ekpo

into corresponding fields of table t_ekpo

for all entries in t_mara

where matnr = t_mara-matnr

and werks in s_werks.

LOOP AT T_MARA.

MOVE T_MARA-matnr TO T_FINAL-matnr.

move t_mara-mtart to t_final-mtart.

move t_mara-meins to t_final-meins.

loop at t_marc where matnr eq t_mara-matnr.

move t_marc-werks to t_final-werks.

loop at t_makt.

move t_makt-maktx to t_final-maktx.

move t_makt-spras to t_final-spras.

loop at t_vbap.

move t_vbap-posnr to t_final-posnr.

move t_vbap-matkl to t_final-matkl.

move t_vbap-vbeln to t_final-vbeln.

loop at t_ekpo.

move t_ekpo-bukrs to t_final-bukrs.

move t_ekpo-ebeln to t_final-ebeln.

move t_ekpo-ebelp to t_final-ebelp.

move t_ekpo-lgort to t_final-lgort.

append t_final.

endloop.

endloop.

endloop.

endloop.

endloop.

SELECT werks KUNNR LAND1 NAME1

INTO CORRESPONDING FIELDS OF TABLE T_KNA1

FROM KNA1.

  • WHERE WERKS in s_werks.

loop at t_kna1.

move t_kna1-kunnr to t_final-kunnr.

move t_kna1-name1 to t_final-name1.

move t_kna1-land1 to t_final-land1.

append t_final.

endloop.

"endloop.

loop at t_final.

write : 4 t_final-matnr,

20 t_final-mtart,

28 t_final-meins,

46 t_final-werks,

58 t_final-maktx,

71 t_final-spras,

78 t_final-posnr,

100 t_final-matkl,

115 t_final-vbeln,

130 t_final-kunnr,

142 t_final-name1,

156 t_final-land1,

168 t_final-bukrs,

190 t_final-ebeln,

205 t_final-ebelp,

208 t_final-lgort.

endloop.

***************************************************

  • TOP-OF-PAGE *

***************************************************

top-of-page.

uline.

write : /60 'G E N E R A L D E T A I L S' COLOR 2 INVERSE OFF.

ULINE.

write πŸ˜• SY-VLINE, 'MATERIAL' COLOR 4, "12 SY-VLINE,

13 SY-VLINE, 'IND SECTOR',

28 SY-VLINE, 'UNITS',

43 SY-VLINE, 'PLANT',

55 SY-VLINE, 'MAT DESC',

68 SY-VLINE, 'LANGU',

70 SY-VLINE, 'SALES DOC ITEM',

95 SY-VLINE, 'MAT GROUP',

110 SY-VLINE, 'SALES DOC',

125 SY-VLINE, 'CUST ID',

140 SY-VLINE, 'NAME',

155 SY-VLINE, 'COUNTRY',

165 sy-vline, 'company code',

205 sy-vline, 'storge loc'.

15 REPLIES 15

Former Member
0 Kudos

Hi,

Do not use "into corresponding fields of" in your selects.

Alexandre Nogueira

0 Kudos

The POs and the Sales documents don't seem to be related in anyway. Is this correct?

You can get rid of the LOOP for T_MAKT like so.



  loop at t_mara.

    move t_mara-matnr to t_final-matnr.
    move t_mara-mtart to t_final-mtart.
    move t_mara-meins to t_final-meins.

<b>    read table t_makt with key matnr = t_mara-matnr.
    if sy-subrc  = 0.
      move t_makt-maktx to t_final-maktx.
      move t_makt-spras to t_final-spras.
    endif.</b>

    loop at t_marc where matnr eq t_mara-matnr.

      move t_marc-werks to t_final-werks.

      loop at t_vbap where matnr eq t_mara-matnr..

        move t_vbap-posnr to t_final-posnr.
        move t_vbap-matkl to t_final-matkl.
        move t_vbap-vbeln to t_final-vbeln.

        loop at t_ekpo where matnr eq t_mara-matnr..
          move t_ekpo-bukrs to t_final-bukrs.
          move t_ekpo-ebeln to t_final-ebeln.
          move t_ekpo-ebelp to t_final-ebelp.
          move t_ekpo-lgort to t_final-lgort.

          append t_final.

        endloop.
      endloop.
    endloop.
  endloop.


Regards,

Rich Heilman

Former Member
0 Kudos

HI,

try to avoid using INTO CORRESPONDING FIELDS OF TABLE

which can hamper performance...

i could see in your program for nested loops there is no condition at all..try sorting the internal tables first and using the necessary conditions...

regards

sai easwar

former_member188685
Active Contributor
0 Kudos

use types while declaring internal table,

don't use <b>tables</b>.

for select options declare type variable and use them..

types: v_matnr type mara-matnr.

select-options: s_matnr for v_matnr.

check them..

regards

vijay

Former Member
0 Kudos

You have to use binary searches and indexed reads:

Rob

0 Kudos

Also - there is no index on material for VBAP:

select matnr posnr matkl vbeln
from vbap
into corresponding fields of table t_vbap
for all entries in t_mara
where matnr = t_mara-matnr.

These are your two biggest problems in the program.

Rob

0 Kudos

This might help the select on VBAP:


DATA: BEGIN OF mseg_int OCCURS 0,
        kdauf LIKE mseg-kdauf,
        kdpos LIKE mseg-kdpos,
      END   OF mseg_int.

  SELECT kdauf kdpos
    FROM mseg
    INTO TABLE mseg_int
    FOR ALL ENTRIES IN t_mara
    WHERE matnr = t_mara-matnr.

  SELECT matnr posnr matkl vbeln
    FROM vbap
    INTO CORRESPONDING FIELDS OF TABLE t_vbap
    FOR ALL ENTRIES IN mseg_int
    WHERE vbeln = mseg_int-kdauf
      AND posnr = mseg_int-kdpos.

I notice that you haven't closed any of your posts or assigned any points. If you are getting any help from the forum, you should take care of this.

Rob

0 Kudos

1. there is an index for material

Table Name Short text

VAPMA Sales Index: Order Items by

Material

2. use table joins for selection

3. use field-symbols for loops

4. the use of select ... into corresponding fields of

does not really need notably more time. But it is forbidden in the abap objects contents. Better specify explicit field-lists.

C.

Former Member
0 Kudos

Hi,

In loop at T_MARA there are nested loops. In nested loop use WHERE condition.

Avoid using INTO CORRESPONDING. Insted decalre internal table appropriately.

Use Join for selects on MARA,MARC and MAKT.

Ramesh.

Former Member
0 Kudos

1. Use joins for MARA , MARC , MAKT.

Ensure that all materials has got description in MAKT when using join.

2. you are appending the same records of table ekpo, vbap, maktx multiple times and I donot think that is the requirement.

3. Take the mara, marc, makt recoords in one table.(t_material)

4. Loop at this table (t_material). Read the vbap table with key Matnr . get all the records of t_vbap.

5. now get the record from t_ekpo table by reading with key matnr and werks.

7 move all the read records into your final internal table.

8. endloop.

Hope this helps

Former Member
0 Kudos

In addition to all the great sugestions posted, here's one more :

In using SELECTs with FOR ALL ENTRIES IN T_MARA, make sure that the internal table T_MARA is not empty. If its empty, you would end up selecting all the records from MARC...

Former Member
0 Kudos

&----


*& Report YTESTCHA *

*& *

&----


*& *

*& *

&----


REPORT ytestcha NO STANDARD PAGE HEADING

LINE-SIZE 250

LINE-COUNT 22(3). .

*****************************************************

  • TABLES DECLARATION *

*****************************************************

TABLES : mara, "general material data

makt, "material description

marc, "plant data for material

vbap, "sales document for item data

ekko, "purchasing document header

ekpo, "purchasing document item

kna1. "customer master details

******************************************************

  • INTERNAL TABLE DECLARATION *

******************************************************

*DECLARE TYPES FIRST AND THE INTERNAL TABLES

*DONT USE MATNR LIKE MARA-MATNR ,INSTEAD USE MARA TYPE MATNR WHERE MATNR

*IS THE DATA ELEMENT FOR FIELD MATNR.

*

TYPES: BEGIN OF ty_mara,

matnr TYPE matnr,

mtart TYPE mtart,

meins TYPE meins,

kunnr TYPE wettb,

END OF ty_mara.

TYPES: BEGIN OF ty_makt,

matnr TYPE matnr,

maktx TYPE maktx,

spras TYPE spras,

END OF ty_makt.

TYPES: BEGIN OF ty_marc,

matnr TYPE matnr,

werks TYPE werks_d,

END OF ty_marc.

TYPES : BEGIN OF ty_kna1,

kunnr TYPE kunnr,

name1 TYPE name1_gp,

land1 TYPE land1_gp,

END OF ty_kna1.

TYPES: BEGIN OF ty_vbap,

matnr TYPE matnr,

posnr TYPE posnr_va,

matkl TYPE matkl,

vbeln TYPE vbeln_va,

END OF ty_vbap.

TYPES: BEGIN OF ty_ekpo,

ebeln TYPE ebeln,

ebelp TYPE ebelp,

bukrs TYPE bukrs,

werks TYPE werks_d,

lgort TYPE lgort_d,

matnr TYPE matnr,

mandt TYPE mandt,

END OF ty_ekpo.

DATA:t_mara TYPE TABLE OF ty_mara WITH HEADER LINE,

t_makt TYPE TABLE OF ty_makt WITH HEADER LINE,

t_marc TYPE TABLE OF ty_marc WITH HEADER LINE,

t_kna1 TYPE TABLE OF ty_kna1 WITH HEADER LINE,

t_vbap TYPE TABLE OF ty_vbap WITH HEADER LINE,

t_ekpo TYPE TABLE OF ty_ekpo WITH HEADER LINE.

********************************************************

  • FINAL INTERNAL TABLE *

********************************************************

TYPES: BEGIN OF ty_final,

matnr TYPE matnr,

mtart TYPE mtart,

meins TYPE meins,

werks TYPE werks_d,

maktx TYPE maktx,

spras TYPE spras,

vbeln TYPE vbeln_va,

posnr TYPE posnr_va,

matkl TYPE matkl,

ebeln TYPE ebeln,

ebelp TYPE ebelp,

bukrs TYPE bukrs,

kunnr TYPE kunnr,

land1 TYPE land1_gp,

name1 TYPE name1_gp,

lgort TYPE lgort_d,

END OF ty_final.

DATA : t_final TYPE TABLE OF ty_final WITH HEADER LINE.

*DATA: BEGIN OF V_matnr OCCURS 0,

  • matnr LIKE mara-matnr,

  • END OF t_matnr.

DATA:

a(32) TYPE c.

a = 'IBT000000000000000001000000000000000050'.

***************************************************************

  • SELECTION SCREEN *

***************************************************************

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

SELECT-OPTIONS : s_bukrs FOR ekpo-bukrs,

s_kunnr FOR kna1-kunnr,

s_werks FOR marc-werks,

s_matnr FOR mara-matnr OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b1.

*****************************************************************

  • START OF SELECTION *

*****************************************************************

START-OF-SELECTION.

*USE SUBROUTINES

*get data

PERFORM get_data.

*populate final table

PERFORM populate_final_table.

END-OF-SELECTION.

*display output

PERFORM display_output.

***************************************************

  • TOP-OF-PAGE *

***************************************************

TOP-OF-PAGE.

ULINE.

WRITE : /60 'G E N E R A L D E T A I L S' COLOR 2 INVERSE OFF.

ULINE.

WRITE πŸ˜• sy-vline, 'MATERIAL' COLOR 4, "12 SY-VLINE,

13 sy-vline, 'IND SECTOR',

28 sy-vline, 'UNITS',

43 sy-vline, 'PLANT',

55 sy-vline, 'MAT DESC',

68 sy-vline, 'LANGU',

70 sy-vline, 'SALES DOC ITEM',

95 sy-vline, 'MAT GROUP',

110 sy-vline, 'SALES DOC',

125 sy-vline, 'CUST ID',

140 sy-vline, 'NAME',

155 sy-vline, 'COUNTRY',

165 sy-vline, 'company code',

205 sy-vline, 'storge loc'.

&----


*& Form GET_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


*TRY TO CLEAR AND REFRESH TABLES BEFORE SELECT

FORM get_data .

CLEAR t_mara.

REFRESH t_mara.

SELECT matnr

mtart

meins

kunnr

FROM mara

INTO TABLE t_mara

WHERE matnr IN s_matnr.

IF NOT t_mara[] IS INITIAL.

CLEAR t_marc.

REFRESH t_marc.

SELECT matnr

werks

FROM marc

INTO TABLE t_marc

FOR ALL ENTRIES IN t_mara

WHERE matnr = t_mara-matnr

AND werks IN s_werks.

CLEAR t_makt.

REFRESH t_makt.

SELECT matnr

maktx

spras

FROM makt

INTO TABLE t_makt

FOR ALL ENTRIES IN t_mara

WHERE matnr = t_mara-matnr

AND spras = sy-langu.

CLEAR t_vbap.

REFRESH t_vbap.

SELECT matnr

posnr

matkl

vbeln

FROM vbap

INTO TABLE t_vbap

FOR ALL ENTRIES IN t_mara

WHERE matnr = t_mara-matnr.

CLEAR t_ekpo.

REFRESH t_ekpo.

SELECT ebeln

ebelp

bukrs

werks

lgort

matnr

mandt

FROM ekpo

INTO TABLE t_ekpo

FOR ALL ENTRIES IN t_mara

WHERE matnr = t_mara-matnr

AND werks IN s_werks.

ENDIF.

CLEAR t_kna1.

REFRESH t_kna1.

SELECT kunnr

land1

name1

INTO TABLE t_kna1

FROM kna1.

  • WHERE WERKS in s_werks.

ENDFORM. " GET_DATA

&----


*& Form POPULATE_FINAL_TABLE

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM populate_final_table .

*AVOID LOOPS AND TRY TO USE READ

CLEAR t_final.

REFRESH t_final.

LOOP AT t_mara.

MOVE t_mara-matnr TO t_final-matnr.

MOVE t_mara-mtart TO t_final-mtart.

MOVE t_mara-meins TO t_final-meins.

READ TABLE t_marc WITH KEY matnr = t_mara-matnr.

MOVE t_marc-werks TO t_final-werks.

READ TABLE t_makt WITH KEY matnr = t_mara-matnr.

MOVE t_makt-maktx TO t_final-maktx.

MOVE t_makt-spras TO t_final-spras.

READ TABLE t_vbap WITH KEY matnr = t_mara-matnr.

MOVE t_vbap-posnr TO t_final-posnr.

MOVE t_vbap-matkl TO t_final-matkl.

MOVE t_vbap-vbeln TO t_final-vbeln.

READ TABLE t_ekpo WITH KEY matnr = t_mara-matnr.

MOVE t_ekpo-bukrs TO t_final-bukrs.

MOVE t_ekpo-ebeln TO t_final-ebeln.

MOVE t_ekpo-ebelp TO t_final-ebelp.

MOVE t_ekpo-lgort TO t_final-lgort.

READ TABLE t_kna1 WITH KEY kunnr = t_mara-kunnr.

MOVE t_kna1-kunnr TO t_final-kunnr.

MOVE t_kna1-name1 TO t_final-name1.

MOVE t_kna1-land1 TO t_final-land1.

APPEND t_final.

CLEAR :t_final,t_mara,t_marc,t_makt,t_ekpo,t_vbap.

ENDLOOP.

ENDFORM. " POPULATE_FINAL_TABLE

&----


*& Form DISPLAY_OUTPUT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM display_output .

LOOP AT t_final.

WRITE : 4 t_final-matnr,

20 t_final-mtart,

28 t_final-meins,

46 t_final-werks,

58 t_final-maktx,

71 t_final-spras,

78 t_final-posnr,

100 t_final-matkl,

115 t_final-vbeln,

130 t_final-kunnr,

142 t_final-name1,

156 t_final-land1,

168 t_final-bukrs,

190 t_final-ebeln,

205 t_final-ebelp,

208 t_final-lgort.

ENDLOOP.

ENDFORM. " DISPLAY_OUTPUT

0 Kudos

also use

DELETE ADJACENT DUPLICATES FROM <itab> COMPARING matnr.

wherever possible.

Former Member
0 Kudos

Hi ,

Here r some of the performance tunning points below :

1)When ever u use for all entries see whether it is initial or not.

2)Sort the table with the key field.

3)Use binary search in the read statement.

4)Avoid nested loops.

5)Avoid 'into corresponding fields'.

And one more thing is that always check for sy-subrc

after select , its not mandatory but advisable.

hope these would be helpful to u.

Regards,

Sharath

Former Member
0 Kudos

Hi,

To avoid nested endloops use <b>read statement</b> with binary search. Also avoid using into corresponding fields in select statements.

Go through this example code, in this code nested loops have been replaced by <b>read statement</b>.

report yramu_sdn no standard page heading

line-size 250

line-count 20(3).

*TABLES

tables : mara,

makt,

marc,

vbap,

ekpo.

*INTERNAL TABLES

data : begin of t_mara occurs 0,

matnr like mara-matnr,

mtart like mara-mtart,

meins like mara-meins,

end of t_mara.

data : begin of t_makt occurs 0,

matnr like makt-matnr,

maktx like makt-maktx,

spras like makt-spras,

end of t_makt.

data : begin of t_marc occurs 0,

matnr like marc-matnr,

werks like marc-werks,

end of t_marc.

data : begin of t_vbap occurs 0,

vbeln like vbap-vbeln,

posnr like vbap-posnr,

matnr like vbap-matnr,

matkl like vbap-matkl,

end of t_vbap.

data : begin of t_ekpo occurs 0,

ebeln like ekpo-ebeln,

ebelp like ekpo-ebelp,

matnr like ekpo-matnr,

bukrs like ekpo-bukrs,

lgort like ekpo-lgort,

end of t_ekpo.

data : begin of t_final occurs 0,

matnr like mara-matnr,

mtart like mara-mtart,

meins like mara-meins,

werks like marc-werks,

maktx like makt-maktx,

spras like makt-spras,

vbeln like vbap-vbeln,

posnr like vbap-posnr,

matkl like vbap-matkl,

ebeln like ekpo-ebeln,

ebelp like ekpo-ebelp,

bukrs like ekpo-bukrs,

lgort like ekpo-lgort,

end of t_final.

*SELECTION SCREEN

selection-screen begin of block b1 with frame title text-001.

select-options : s_matnr for mara-matnr,

s_werks for marc-werks,

s_bukrs for ekpo-bukrs.

selection-screen end of block b1.

*START OF SELECTION

start-of-selection.

select matnr

mtart

meins

from mara

into table t_mara

where matnr in s_matnr.

select matnr

werks

from marc

into table t_marc

for all entries in t_mara

where matnr = t_mara-matnr

and werks in s_werks.

select matnr

maktx

spras

from makt

into table t_makt

for all entries in t_mara

where matnr = t_mara-matnr

and spras = sy-langu.

select vbeln

posnr

matnr

matkl

from vbap

into table t_vbap

for all entries in t_mara

where matnr = t_mara-matnr.

select ebeln

ebelp

matnr

bukrs

lgort

from ekpo

into table t_ekpo

for all entries in t_mara

where matnr = t_mara-matnr

and bukrs in s_bukrs.

sort : t_mara by matnr,

t_marc by matnr,

t_makt by matnr,

t_vbap by matnr,

t_ekpo by matnr.

loop at t_mara.

read table t_marc with key matnr = t_mara-matnr binary search.

read table t_makt with key matnr = t_mara-matnr binary search.

read table t_vbap with key matnr = t_mara-matnr binary search.

read table t_ekpo with key matnr = t_mara-matnr binary search.

move : t_mara-matnr to t_final-matnr,

t_mara-mtart to t_final-mtart,

t_mara-meins to t_final-meins,

t_marc-werks to t_final-werks,

t_makt-maktx to t_final-maktx,

t_makt-spras to t_final-spras,

t_vbap-vbeln to t_final-vbeln,

t_vbap-posnr to t_final-posnr,

t_vbap-matkl to t_final-matkl,

t_ekpo-ebeln to t_final-ebeln,

t_ekpo-ebelp to t_final-ebelp,

t_ekpo-bukrs to t_final-bukrs,

t_ekpo-lgort to t_final-lgort.

append : t_final.

clear : t_final.

endloop.

*END OF SELECTION

end-of-selection.

loop at t_final.

write : / sy-vline,

t_final-matnr,

sy-vline,

t_final-mtart,

sy-vline,

t_final-meins,

sy-vline,

t_final-werks,

sy-vline,

t_final-maktx,

sy-vline,

t_final-spras,

sy-vline,

t_final-vbeln,

sy-vline,

t_final-posnr,

sy-vline,

t_final-matkl,

sy-vline,

t_final-ebeln,

sy-vline,

t_final-ebelp,

sy-vline,

t_final-bukrs,

sy-vline,

t_final-lgort,

sy-vline.

endloop.

write : / sy-uline(159).

*END OF PAGE

end-of-page.

write : / sy-uline(159).

*TOP OF PAGE

top-of-page.

write : / sy-uline(159).