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

Control break statements

Hi,

We use "sum" in control break statements.Is there possibility to take this into a variable.

With regards

kiran

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Aug 12, 2005 at 05:56 AM

    s u can do like this..

    LOOP AT <>.

    AT FIRST.

    SUM.

    write <sum varible> to <tmp variable>.

    ENDAT.

    endloop

    example:

    TYPES: BEGIN OF T_TYPE,

    CODE(4),

    DISCOUNT TYPE P,

    END OF T_TYPE.

    DATA: T TYPE STANDARD TABLE OF T_TYPE WITH NON-UNIQUE

    DEFAULT KEY INITIAL SIZE 100,

    WA_T TYPE T_TYPE,

    tmp(20).

    WA_T-CODE = 'a'.

    WA_T-DISCOUNT = '2'.

    append WA_T to t.

    WA_T-CODE = 'a'.

    WA_T-DISCOUNT = '2'.

    append WA_T to t.

    WA_T-CODE = 'a'.

    WA_T-DISCOUNT = '2'.

    append WA_T to t.

    WA_T-CODE = 'a'.

    WA_T-DISCOUNT = '4'.

    append WA_T to t.

    LOOP AT T INTO WA_T.

    AT FIRST.

    SUM.

    write WA_T-DISOUNT to tmp.

    ENDAT.

    ENDLOOP.

    write tmp.

    after this loop u will get the sum in variable tmp.

    regds

    gv

    Message was edited by: Venkatesan Ganesan

    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.