Skip to Content
author's profile photo Former Member
Former Member

Re: ECC 6.0

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jun 12, 2007 at 04:33 AM

    Hi,

    SInce ECC 6.0 using Headerline table's is obsolete, you have to create a WORKAREA (that is a strucutre of the table's line type) and use it instead of using the table name itself.

    When you use table with header line, ITAB is workarea and ITAB[] is the table.

    So use

    <b>DATA: display_itab TYPE STANDARD TABLE OF display_struct,

    wa_display_tab type display_sruct.</b>

    And use

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

    <fs_struct2>-posnr TO wa_display_itab-posnr,

    <fs_struct2>-matnr TO wa_display_itab-matnr,

    <fs_struct2>-fkimg TO wa_display_itab-fkimg,

    <fs_struct2>-aubel TO wa_display_itab-aubel,

    <fs_struct2>-kostl TO wa_display_itab-kostl,

    <fs_struct2>-ps_psp_pnr TO wa_display_itab-ps_psp_pnr,

    <fs_struct2>-arktx TO wa_display_itab-arktx.

    MOVE:

    <fs_struct1>-fkart TO wa_display_itab-fkart,

    <fs_struct1>-fkdat TO wa_display_itab-fkdat,

    <fs_struct1>-bukrs TO wa_display_itab-bukrs,

    <fs_struct1>-netwr TO wa_display_itab-netwr.

    append wa_display-tab to display_itab.</b>

    <b>LOOP AT display_itab into wa_display_tab .

    WRITE: / wa_displaY-tab-vbeln,

    wa_display_itab-fkart,

    wa_display_itab-fkdat,

    wa_display_itab-bukrs,

    wa_display_itab-netwr CURRENCY 'us',

    wa_display_itab-POSNR,

    wa_display_itab-matnr,

    wa_display_itab-fkimg UNIT 'kg',

    wa_display_itab-aubel,

    wa_display_itab-kostl,

    wa_display_itab-arktx.

    ENDLOOP.</b>

    Regards,

    Sesh

    /

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2007 at 04:34 AM

    Hi,

    Check the changes marked with the wrapper NAREN CHANGES.

    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 .
    ** NAREN CHANGES BEGIN
    *DATA: display_itab TYPE STANDARD TABLE OF display_struct with header *line .
    DATA: display_itab TYPE STANDARD TABLE OF display_struct.  " Added here
    DATA: wa_display   TYPE display_struct.                                    " Added here
    ** NAREN CHANGES END.
    
    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 wa_display-VBELN,  " Modified here Naren
    <fs_struct2>-posnr TO wa_display-posnr,  " Modified here Naren
    <fs_struct2>-matnr TO wa_display-matnr,  " Modified here Naren
    <fs_struct2>-fkimg TO wa_display-fkimg,  " Modified here Naren
    <fs_struct2>-aubel TO wa_display-aubel,  " Modified here Naren
    <fs_struct2>-kostl TO wa_display-kostl,  " Modified here Naren
    <fs_struct2>-ps_psp_pnr TO wa_display-ps_psp_pnr, " Modified here Naren
    <fs_struct2>-arktx TO wa_display-arktx.  " Modified here Naren
    MOVE:
    <fs_struct1>-fkart TO wa_display-fkart, " Modified here Naren
    <fs_struct1>-fkdat TO wa_display-fkdat,  " Modified here Naren
    <fs_struct1>-bukrs TO wa_display-bukrs, " Modified here Naren
    <fs_struct1>-netwr TO wa_display-netwr. " Modified here Naren
    append wa_display to display_itab. " Modified here Naren
    clear wa_display. " Modified here Naren
    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 INTO wa_display. " Modified here Naren
    WRITE: / wa_display-vbeln,  " Modified here Naren
    wa_display-fkart,   " Modified here Naren
    wa_display-fkdat,  " Modified here Naren
    wa_display-bukrs,  " Modified here Naren
    wa_display-netwr CURRENCY 'us',  " Modified here Naren
    wa_display-POSNR, " Modified here Naren
    wa_display-matnr,   " Modified here Naren
    wa_display-fkimg UNIT 'kg',  " Modified here Naren
    wa_display-aubel,  " Modified here Naren
    wa_display-kostl,  " Modified here Naren
    wa_display-arktx.  " Modified here Naren
    ENDLOOP.
    ENDFORM. " DISPLAY_DATA
    
    

    Thanks,

    Naren

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 12, 2007 at 04:41 AM

    hi,

    i have corrected the program.

    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 .

    DATA: display_itab TYPE STANDARD TABLE OF display_struct.

    data: display_wa like line of display_itab.

    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_wa-VBELN,

    <fs_struct2>-posnr TO display_wa-posnr,

    <fs_struct2>-matnr TO display_wa-matnr,

    <fs_struct2>-fkimg TO display_wa-fkimg,

    <fs_struct2>-aubel TO display_wa-aubel,

    <fs_struct2>-kostl TO display_wa-kostl,

    <fs_struct2>-ps_psp_pnr TO display_wa-ps_psp_pnr,

    <fs_struct2>-arktx TO display_wa-arktx.

    MOVE:

    <fs_struct1>-fkart TO display_wa-fkart,

    <fs_struct1>-fkdat TO display_wa-fkdat,

    <fs_struct1>-bukrs TO display_wa-bukrs,

    <fs_struct1>-netwr TO display_wa-netwr.

    append display_wa to display_itab .

    clear display_wa.

    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 into display_wa.

    WRITE: / display_wa-vbeln,

    display_wa-fkart,

    display_wa-fkdat,

    display_wa-bukrs,

    display_wa-netwr CURRENCY 'us',

    display_wa-POSNR,

    display_wa-matnr,

    display_wa-fkimg UNIT 'kg',

    display_wa-aubel,

    display_wa-kostl,

    display_wa-arktx.

    ENDLOOP.

    ENDFORM. " DISPLAY_DATA

    Thanks & Regards,

    Naveen

    Reward if useful

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.