Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

AT END

Former Member
0 Kudos

Hi All,

Can u please tell me is it mandatory to use SUM in the at end of statement in the loop.

Thanks,

Sriram.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Dear Sriram,

No its not.

Only thing SUM statement is used there because that step executes in such way it considers all the subsequent items.

Regards,

Suresh.

5 REPLIES 5

Former Member
0 Kudos

Hi sriram,

It is not mandotory to use SUM at end of <f> in between loop and and loop.

At end of <f> (F: Field in you internal table) between loop and end loop means :

End of a group of lines with the same contents in the field <f> and in the fields left of <f>.

Example: At end of MATNR I am moving entry to a BAPI structure.

LOOP AT XMDPB .

AT END OF MATNR .

READ TABLE XMDPB INDEX L_TABIX.

MOVE : XMDPB-MATNR TO XBAPISITEMR-MATERIAL,

P_PWERK TO XBAPISITEMR-PLANT,

A_VERSB TO XBAPISITEMR-VERSION,

XMDPB-BEDAE TO XBAPISITEMR-REQU_TYPE,

'X' TO XBAPISITEMR-VERS_ACTIV.

APPEND XBAPISITEMR.

Endat.

ENDLOOP.

Lanka

Former Member
0 Kudos

Dear Sriram,

No its not.

Only thing SUM statement is used there because that step executes in such way it considers all the subsequent items.

Regards,

Suresh.

Former Member
0 Kudos

Hi Sriram,

Its not mandatory to use <b>SUM</b> between at end of statement.

Generally they use for getting the totals at the end of a report.

You can press F1 help on the AT statement to know more.

Message was edited by: Phani Kiran Nudurupati

Former Member
0 Kudos

Hi,

Let us know what is the problem/error you are facing when AT END is used.

Regards,

Ramesh.

Former Member
0 Kudos

Hi sriram,

There is nothing like madatory in ABAP when it comes to ABAP programming.

<b>Then you may ask What is mandatory?</b>

Answer is there should not be a syntax error in your code.

<b>For eg.</b>

Every statement should end with a pullstop. This is mandatory.

<b>Why SUM statement is use At End?</b>

This is because only at the end of the record of an internal table or table you can get all the entries information so that when you use the sum statement you will get the actuall sum and the partial sum.

Hope it helps.

Regards,

Maheswaran.B