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

control break

wat is the output of this program?

itab table consists of

A B C D

1 1 2 2

1 3 1 2

2 4 1 2

1 1 1 1

loop at itab.

at new D.

write A,B,C,D.

endat.

endloop.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 02:30 PM

    Hi

    See this and do accordingly you will get the output

    you have to sort the Itab which is not done in your case.

    DATA: sflight_tab TYPE SORTED TABLE OF sflight

    WITH UNIQUE KEY carrid connid fldate,

    sflight_wa LIKE LINE OF sflight_tab.

    SELECT *

    FROM sflight

    INTO TABLE sflight_tab.

    LOOP AT sflight_tab INTO sflight_wa.

    AT NEW connid.

    WRITE: / sflight_wa-carrid,

    sflight_wa-connid.

    ULINE.

    ENDAT.

    WRITE: / sflight_wa-fldate,

    sflight_wa-seatsocc.

    AT END OF connid.

    SUM.

    ULINE.

    WRITE: / 'Sum',

    sflight_wa-seatsocc UNDER sflight_wa-seatsocc.

    SKIP.

    ENDAT.

    AT END OF carrid.

    SUM.

    ULINE.

    WRITE: / 'Carrier Sum',

    sflight_wa-seatsocc UNDER sflight_wa-seatsocc.

    NEW-PAGE.

    ENDAT.

    AT LAST.

    SUM.

    WRITE: / 'Overall Sum',

    sflight_wa-seatsocc UNDER sflight_wa-seatsocc.

    ENDAT.

    ENDLOOP.

    <b><REMOVED BY MODERATOR></b>

    regards

    Anji

    Message was edited by:

    Alvaro Tejada Galindo

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 02:30 PM

    hi

    output is

    1122

    1312

    2412

    1111

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 02:50 PM

    if u don't sort itab by D : output is

    1122

    1312

    2412

    1111

    if u sort itab by D : output is

    1111

    1122

    1312

    2412

    If u are using control break statements generally it is advisable to sort the itab and also the field which u r using in ' at new' should be first field in declaration of itab.

    Regards

    vasu

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2007 at 03:12 PM

    in this case the value of only D is displayed and for A,B and C u will get some dump values or * symbol.

    to overcome this u have to write

    at new a.

    write a.

    endat.

    at new b.

    write b.

    endat.

    at new c.

    write c.

    endat.

    write d.

    REWARD POINTS IF HAPPY.

    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.