Skip to Content
0
Former Member
Jun 12, 2007 at 04:28 AM

Re: ECC 6.0

20 Views

Hi Friends,

<b>I have written small piece code in ECC 6.0,but i am getting error message that with header line is obselete in ECC 6.0.I am sending the code along with this mail,any suggestions please.</b>

REPORT ysdb_alv_ecc NO STANDARD PAGE HEADING LINE-SIZE 260 LINE-COUNT 58.

TABLES: VBRK,VBRP.

TYPES:

BEGIN OF vbrk_struct ,

vbeln TYPE vbrk-vbeln,

fkart TYPE vbrk-fkart,

fkdat TYPE vbrk-fkdat,

bukrs TYPE vbrk-bukrs,

netwr TYPE vbrk-netwr,

END OF vbrk_struct.

TYPES:

BEGIN OF vbrp_struct,

vbeln TYPE vbrp-vbeln,

posnr TYPE vbrp-posnr,

matnr TYPE vbrp-matnr,

fkimg TYPE vbrp-fkimg,

aubel TYPE vbrp-aubel,

kostl TYPE vbrp-kostl,

ps_psp_pnr TYPE vbrp-ps_psp_pnr,

arktx TYPE vbrp-arktx,

END OF vbrp_struct.

TYPES:

BEGIN OF display_struct,

vbeln TYPE vbrk-vbeln,

fkart TYPE vbrk-fkart,

fkdat TYPE vbrk-fkdat,

bukrs TYPE vbrk-bukrs,

netwr TYPE vbrk-netwr,

posnr TYPE vbrp-posnr,

matnr TYPE vbrp-matnr,

fkimg TYPE vbrp-fkimg,

aubel TYPE vbrp-aubel,

kostl TYPE vbrp-kostl,

ps_psp_pnr TYPE vbrp-ps_psp_pnr,

arktx TYPE vbrp-arktx,

END OF display_struct .

DATA: v_index LIKE sy-tabix.

DATA: t_vbrk_itab TYPE STANDARD TABLE OF vbrk_struct .

DATA: t_vbrp_itab TYPE STANDARD TABLE OF vbrp_struct .

<b>DATA: display_itab TYPE STANDARD TABLE OF display_struct with header line .</b>

FIELD-SYMBOLS: <fs_struct1> TYPE vbrk_struct,

<fs_struct2> TYPE vbrp_struct,

<fs_struct3> TYPE display_struct .

SELECT-OPTIONS s_vbeln FOR vbrk-vbeln.

SELECT-OPTIONS s_bukrs FOR vbrk-bukrs.

SELECT-OPTIONS s_fkdat FOR vbrk-fkdat.

START-OF-SELECTION.

PERFORM get_data1.

PERFORM get_data2.

PERFORM get_data3.

PERFORM display_data.

&----


*& Form get_data1

&----


  • text

----


FORM get_data1 .

SELECT vbeln fkart fkdat bukrs netwr FROM vbrk

INTO CORRESPONDING FIELDS OF TABLE

t_vbrk_itab

WHERE

bukrs IN s_bukrs AND

fkdat IN s_fkdat AND

vbeln IN s_vbeln.

ENDFORM. " GET_DATA1

&----


*& Form GET_DATA2

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_data2 .

SELECT vbeln posnr matnr fkimg aubel kostl ps_psp_pnr

arktx FROM vbrp

INTO CORRESPONDING

FIELDS OF TABLE

t_vbrp_itab

FOR ALL ENTRIES IN

t_vbrk_itab

WHERE vbeln =

t_vbrk_itab-vbeln.

ENDFORM. " GET_DATA2

&----


*& Form GET_DATA3

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM get_data3 .

SORT t_vbrk_itab BY vbeln.

SORT t_vbrp_itab BY vbeln.

CLEAR: v_index.

LOOP AT t_vbrk_itab ASSIGNING <fs_struct1>.

READ TABLE t_vbrp_itab ASSIGNING <fs_struct2>

WITH KEY vbeln = <fs_struct1>-vbeln BINARY SEARCH.

MOVE sy-tabix TO v_index.

WHILE sy-subrc IS INITIAL AND <fs_struct1>-vbeln =

<fs_struct2>-vbeln.

MOVE: <fs_struct2>-vbeln TO display_itab-VBELN,

<fs_struct2>-posnr TO display_itab-posnr,

<fs_struct2>-matnr TO display_itab-matnr,

<fs_struct2>-fkimg TO display_itab-fkimg,

<fs_struct2>-aubel TO display_itab-aubel,

<fs_struct2>-kostl TO display_itab-kostl,

<fs_struct2>-ps_psp_pnr TO display_itab-ps_psp_pnr,

<fs_struct2>-arktx TO display_itab-arktx.

MOVE:

<fs_struct1>-fkart TO display_itab-fkart,

<fs_struct1>-fkdat TO display_itab-fkdat,

<fs_struct1>-bukrs TO display_itab-bukrs,

<fs_struct1>-netwr TO display_itab-netwr.

append display_itab.

clear display_itab.

ADD 1 TO v_index.

READ TABLE t_vbrp_itab ASSIGNING <fs_struct2>

INDEX v_index.

ENDWHILE.

ENDLOOP.

ENDFORM. " GET_DATA3

&----


*& Form DISPLAY_DATA

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM display_data .

LOOP AT display_itab .

WRITE: / display_itab-vbeln,

display_itab-fkart,

display_itab-fkdat,

display_itab-bukrs,

display_itab-netwr CURRENCY 'us',

display_itab-POSNR,

display_itab-matnr,

display_itab-fkimg UNIT 'kg',

display_itab-aubel,

display_itab-kostl,

display_itab-arktx.

ENDLOOP.

ENDFORM. " DISPLAY_DATA

Regards

Dinesh