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

Internal table

Hi all,

i am new to abap so orking on my skills. i have declared 2 tables as below, i can populate the data in one table(itab) but could not do the same in another(jtab).

Can some one please rectify the mistake iam doing.

REPORT ZPRACTICE NO STANDARD PAGE HEADING.

DATA: BEGIN OF ITAB occurs 0,

CARRID LIKE SPFLI-CARRID,

CONNID LIKE SPFLI-CONNID,

CITYFROM LIKE SPFLI-CITYFROM,

END OF ITAB.

data: jtab like table of itab with header line.

select carrid connid cityfrom from spfli into table itab up to 5

rows.

move-corresponding itab to jtab.

loop at jtab.

write:/ jtab-cityfrom.

endloop.

uline.

loop at itab.

write: /5(3) itab-carrid, 9(5) itab-connid.

endloop.

regards

Rahul.

Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2005 at 08:01 PM

    Rahul - try:

    select carrid connid cityfrom from spfli
      into table itab
      up to 5 rows.
    
    loop at itab
      move-corresponding itab to jtab.
      modify jtab.
      write:/ jtab-cityfrom.
    endloop.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 24, 2005 at 08:02 PM

    try the dark one

    and this will help you.

    REPORT ZPRACTICE NO STANDARD PAGE HEADING.

    DATA: BEGIN OF ITAB occurs 0,

    CARRID LIKE SPFLI-CARRID,

    CONNID LIKE SPFLI-CONNID,

    CITYFROM LIKE SPFLI-CITYFROM,

    END OF ITAB.

    data: jtab like table of itab with header line.

    select carrid connid cityfrom from spfli into table itab up to 5

    rows.

    <b>loop at itab.

    move-corresponding itab to jtab.

    modify jtab.

    endloop.</b>

    loop at jtab.

    write:/ jtab-cityfrom.

    endloop.

    uline.

    loop at itab.

    write: /5(3) itab-carrid, 9(5) itab-connid.

    endloop.

    regards

    vijay

    reward points if it helps you

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 24, 2005 at 08:13 PM

    Try this.

    REPORT ZPRACTICE NO STANDARD PAGE HEADING.

    DATA: BEGIN OF ITAB occurs 0,

    CARRID LIKE SPFLI-CARRID,

    CONNID LIKE SPFLI-CONNID,

    CITYFROM LIKE SPFLI-CITYFROM,

    END OF ITAB.

    data: jtab like table of itab with header line.

    select carrid connid cityfrom from spfli into table itab up to 5

    rows.

    <b>jtab[] = itab[].</b>

    loop at jtab.

    write:/ jtab-cityfrom.

    endloop.

    uline.

    loop at itab.

    write: /5(3) itab-carrid, 9(5) itab-connid.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 25, 2005 at 02:46 AM

    try this one kesi,

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

    REPORT ZPRACTICE NO STANDARD PAGE HEADING.

    DATA: BEGIN OF ITAB OCCURS 0,

    CARRID LIKE SPFLI-CARRID,

    CONNID LIKE SPFLI-CONNID,

    CITYFROM LIKE SPFLI-CITYFROM,

    END OF ITAB.

    DATA: JTAB LIKE ITAB OCCURS 0 WITH HEADER LINE .

    SELECT CARRID CONNID CITYFROM FROM SPFLI INTO TABLE ITAB UP TO 5

    ROWS.

    LOOP AT ITAB.

    MOVE-CORRESPONDING ITAB TO JTAB.

    COLLECT: JTAB.

    ENDLOOP.

    LOOP AT JTAB.

    WRITE:/ JTAB-CITYFROM.

    ENDLOOP.

    ULINE.

    LOOP AT ITAB.

    WRITE: /5(3) ITAB-CARRID, 9(5) ITAB-CONNID.

    ENDLOOP.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 25, 2005 at 06:38 AM

    hI,

    uSE LIKE THIS,

    ITAB1[] = ITAB2[].

    APPEND ITAB1.

    OTHERWISE,

    MOVE ITAB1 TO ITAB2.

    APPEND ITAB1.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 25, 2005 at 08:04 AM

    Hi,

    I think jtab[] = itab[] statement will slove your problem rather than move-corresponding itab to jtab.

    regards,

    Amey

    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.