control break statements in ABAP?

Answers were Sorted based on User's Feedback



control break statements in ABAP?..

Answer / prasad1983

at first ... endat.
at new ... endat.
at end of ... endat.
on change of ... endon.
at last ... andat.

Is This Answer Correct ?    37 Yes 4 No

control break statements in ABAP?..

Answer / prabhakararao

hi all
This is Prabhakararao

Control break statememnts are:

AT FIRST
AT LAST
AT NEW
AT END OF

all the above are used for different purposed

Is This Answer Correct ?    32 Yes 5 No

control break statements in ABAP?..

Answer / niranjan

The Control Break Statements are used to print headings,subheadings,totals and subtotal.
We must use this statements inside the loop.

1.AT FIRST...........ENDAT:It is useful to print headings.
-->it will triggered before starting a first record in a loop.

2.AT LAST............ENDAT:It is useful to print TOTALS.
-->it will triggered after the last record in a loop.

3.AT NEW ON..........ENDAT:It is useful to print subheadings.
-->it will triggered before starting a new value for that particular field.

4.AT END OF..........ENDAT:It is useful to display sub-totals.
-->it will triggered after heading the old value.

5.ON CHANGE OF.......ENDAT:It is same as 'AT FIRST' but the only difference is we can use 'ON CHANGE OF' in any kind of loop statements like loop.....endloop,select.....endselect,do.....enddo,while.....endwhile.
-->it will triggered before starting a new value.

Is This Answer Correct ?    16 Yes 1 No

control break statements in ABAP?..

Answer / g.sivaramakrishnamohan

hi this is
G.sivaramakrishnamohan
Control break statememnts are:
1)At first.....endat
2)At last......endat
3)At new <field name>....endat
4)At end of <field name>........endat
5)change of <field name>........endon

Is This Answer Correct ?    10 Yes 4 No

control break statements in ABAP?..

Answer / deepti pattnaik

at first ... endat.
at new ... endat.
at end of ... endat.
on change of ... endon.
at last ... andat.

Is This Answer Correct ?    8 Yes 2 No

control break statements in ABAP?..

Answer / arasu

Control Break Statement is different from Control statement,
the BREAK, EXIT, CONTINUE are used to break and come out of
the current loop where it occurs, where as AT NEW, AT END,
AT LAST, AT FIRST is used to check for a table field value
(internal table). When u asked for control statements alone,
u need to answer as BREAK, EXIT, CONTINUE, CHECK because it
controls the program flow.

Is This Answer Correct ?    9 Yes 5 No

control break statements in ABAP?..

Answer / kotireddy5

Control break statements:

Control break statements are like events inside the loop. There are 5 control break statements in ABAP. These are used within loop.(Except ON CHANGE OF which can be used outside the loop as well)


• AT FIRST - ENDAT
• AT NEW - ENDAT
• AT END OF - ENDAT
• AT LAST - ENDAT
• ON CHANGE OF


Explanation:

AT FIRST : Will trigger at the first run of the loop.

AT LAST: Will trigger at the last run of the loop.

The below 3 events are normally used when the table is sorted.


AT END OF : When we use At end for a field, it will trigger whenever there is any change in any of the fields from the left to that of the particular field. The trigger point will be the at the last occurrence of the same value for the field.

AT NEW: When we use At new for a field, it will trigger whenever there is any change in any of the fields from the left to that of the particular field.The trigger point will be the at the first occurrence of the new value for the field.

ON CHANGE OF: On change of it triggers only when there is any change in the particular field.
On change of can be used outside the loop too


Example Program:

Here is an example program which gives you the practical understanding of all control break statements.

Example Program for Control Break Statements
NOTE: It is important to note that we need a temporary work-area apart from the work-area used in loop for the last 3 control break statements. If we directly use the work-area of the loop, then we will get **** value and not the output we are expecting.
*&---------------------------------------------------------------------*
*& Report ZAU_CONTROLBREAK
*&
*&---------------------------------------------------------------------*
*& NEW TO SAP CONTROL BREAK EXAMPLE
*& http://www.newtosap.info
*&
*&---------------------------------------------------------------------*

REPORTzau_controlbreak.
TYPES: BEGIN OFty_marc,
matnr TYPE marc-matnr,
werks TYPE marc-werks,
END OFty_marc.

DATA: it_marc TYPE STANDARD TABLE OFty_marc,
wa_marc TYPEty_marc,
wa_temp TYPEty_marc.

SELECTmatnrwerks FROM marc INTO TABLEit_marc UP TO 10 ROWS WHEREmatnrge40.
SORTit_marc BY matnr.
FIELD-SYMBOLS :<matnr> typematnr.

WRITE:/'FULL TABLE'.
LOOP ATit_marc INTOwa_marc.
wa_temp = wa_marc.
WRITE: / sy-tabix ,wa_temp-matnr, wa_temp-werks.
ENDLOOP.

WRITE:/'AT FIRST AND LAST'.
LOOP ATit_marc INTOwa_marc.
wa_temp = wa_marc.
AT FIRST.
WRITE:/'First Entry'.
WRITE:/wa_temp-matnr, wa_temp-werks.
ENDAT.
AT LAST.
WRITE:/'Last Entry'.
WRITE:/wa_temp-matnr, wa_temp-werks.
ENDAT.
ENDLOOP.


WRITE:/'AT END OF'.
LOOP ATit_marc INTOwa_marc.
wa_temp = wa_marc.
AT END OFmatnr.
WRITE: / sy-tabix ,wa_temp-matnr, wa_temp-werks.
ENDAT.
ENDLOOP.

WRITE:/'AT NEW'.

LOOP ATit_marc INTOwa_marc.
wa_temp = wa_marc.
AT NEW matnr.
WRITE: / sy-tabix ,wa_temp-matnr, wa_temp-werks.
ENDAT.
ENDLOOP.

WRITE:/'ON CHANGE OF'.
LOOP ATit_marc INTOwa_marc.
wa_temp = wa_marc.
ASSIGNwa_marc-matnr TO<matnr>.
ON CHANGE OFwa_marc-matnr.
WRITE: / sy-tabix ,wa_temp-matnr, wa_temp-werks.
ENDON.
ENDLOOP.

Is This Answer Correct ?    2 Yes 0 No

control break statements in ABAP?..

Answer / rv karthikeyan

Hi this is karthikeyan


control break statement: It is used to control the data flow inside the loop,for example if we need to add some functionality at run time for example subtotal for every new value triggered or sub heading,we use control break statement,now we see the types of control break statement.

at first: when the loop start first this at first will trigger,that when the loop starts the control goes to the at first statement and executed all the function inside it.

at new: when the first occurrence of the new value found this at new will trigger,used for the sub heading or page break purpose.

at end: when the last occurrence of the new value found this at end will trigger,used mainly for sub total purpose.

at last: when the last record in the loop over this at last will trigger used for grand total purpose.

Hope u got idea...

Regards
RV Karthikeyan.

Is This Answer Correct ?    0 Yes 1 No

control break statements in ABAP?..

Answer / lakku sreenivasulu

The Control Break Statements are
AT FIRST
AT LAST
AT NEW
AT END OF

all the above are used for different purposed

Is This Answer Correct ?    3 Yes 5 No

control break statements in ABAP?..

Answer / arun prasad

AT NEW, AT FIRST, ... ARE ALL CONTROL LEVEL STATEMENTS.
THE CONTROL BREAK STATEMENTS ARE EXIT, CONTINUE, STOP.

Is This Answer Correct ?    10 Yes 21 No

Post New Answer

More SAP ABAP Interview Questions

If you are at 3rd list how can you back to 1st list?

3 Answers   Bristle Cone,


What are the different types of the sap abap data dictionary objects?

0 Answers  


What is function group?

0 Answers  


Which one of the following statements are FALSE about Inactive objects in SAP? a) Development Objects are always saved as inactive versions. b) An inactive version of a Development Object is written to developer’s pc c) In DISPLAY mode, other users can NOT access the code of inactive version of a developer d) Generating a runtime object is same as activating a development object.

1 Answers  


What is system-land-scape of your project?

0 Answers  






How to maintain subtotals n grand totals in smart forms?

2 Answers   CSC,


Explain how do you move on to the next screen in interactive reporting?

0 Answers  


Why do we use Process On Value Request(POV) event instead of data element,search help in module pool.

1 Answers   Reliance, Wipro,


What is step-loop? Explain all the steps?

0 Answers  


How can I trigger the outbound IDOC?

2 Answers   Cap Gemini,


how many types of interfaces are there in abap ?

3 Answers  


1) What is read with binary search? 2) I have initialization write ?a? Top-of-page write ?b? what is the output for this/ 3) If I don?t have start of selection event in report will it execute?it is mandatory or not? 4) What is table maintenance generator? 5) Is it advisable to have secondary index/ 6) How we will imlement BAPI? 7) What is process code in idoc? 8) Where the information msg will display? 9) Where warning msg will display? 10) Where we use watch point?what exactly watch point means? 11) What is a spool? 12) What is program name that contains all print program names and form names other than TNAPR? 13) How we will capture errors in bapi? 14) How to transfer std text from production to quality?

5 Answers   CSC,


Categories
  • SAP Basis Interview Questions SAP Basis (1262)
  • SAP ABAP Interview Questions SAP ABAP (3939)
  • SAPScript Interview Questions SAPScript (236)
  • SAP SD (Sales & Distribution) Interview Questions SAP SD (Sales & Distribution) (2716)
  • SAP MM (Material Management) Interview Questions SAP MM (Material Management) (911)
  • SAP QM (Quality Management) Interview Questions SAP QM (Quality Management) (99)
  • SAP PP (Production Planning) Interview Questions SAP PP (Production Planning) (523)
  • SAP PM (Plant Maintenance) Interview Questions SAP PM (Plant Maintenance) (252)
  • SAP PS (Project Systems) Interview Questions SAP PS (Project Systems) (138)
  • SAP FI-CO (Financial Accounting & Controlling) Interview Questions SAP FI-CO (Financial Accounting & Controlling) (2766)
  • SAP HR (Human Resource Management) Interview Questions SAP HR (Human Resource Management) (1180)
  • SAP CRM (Customer Relationship Management) Interview Questions SAP CRM (Customer Relationship Management) (432)
  • SAP SRM (Supplier Relationship Management) Interview Questions SAP SRM (Supplier Relationship Management) (132)
  • SAP APO (Advanced Planner Optimizer) Interview Questions SAP APO (Advanced Planner Optimizer) (92)
  • SAP BW (Business Warehouse) Interview Questions SAP BW (Business Warehouse) (896)
  • SAP Business Workflow Interview Questions SAP Business Workflow (72)
  • SAP Security Interview Questions SAP Security (597)
  • SAP Interfaces Interview Questions SAP Interfaces (74)
  • SAP Netweaver Interview Questions SAP Netweaver (282)
  • SAP ALE IDocs Interview Questions SAP ALE IDocs (163)
  • SAP Business One Interview Questions SAP Business One (110)
  • SAP BO BOBJ (Business Objects) Interview Questions SAP BO BOBJ (Business Objects) (388)
  • SAP CPS (Central Process Scheduling) Interview Questions SAP CPS (Central Process Scheduling) (14)
  • SAP GTS (Global Trade Services) Interview Questions SAP GTS (Global Trade Services) (21)
  • SAP Hybris Interview Questions SAP Hybris (132)
  • SAP HANA Interview Questions SAP HANA (700)
  • SAP PI (Process Integration) Interview Questions SAP PI (Process Integration) (113)
  • SAP PO (Process Orchestration) Interview Questions SAP PO (Process Orchestration) (25)
  • SAP BI (Business Intelligence) Interview Questions SAP BI (Business Intelligence) (174)
  • SAP BPC (Business Planning and Consolidation) Interview Questions SAP BPC (Business Planning and Consolidation) (38)
  • SAP BODS (Business Objects Data Services) Interview Questions SAP BODS (Business Objects Data Services) (49)
  • SAP BODI (Business Objects Data Integrator) Interview Questions SAP BODI (Business Objects Data Integrator) (26)
  • SAP Ariba Interview Questions SAP Ariba (9)
  • SAP Fiori Interview Questions SAP Fiori (45)
  • SAP EWM (Extended Warehouse Management) Interview Questions SAP EWM (Extended Warehouse Management) (58)
  • Sap R/3 Interview Questions Sap R/3 (150)
  • SAP FSCM Financial Supply Chain Management Interview Questions SAP FSCM Financial Supply Chain Management (101)
  • SAP WM (Warehouse Management) Interview Questions SAP WM (Warehouse Management) (31)
  • SAP GRC (Governance Risk and Compliance) Interview Questions SAP GRC (Governance Risk and Compliance) (64)
  • SAP MDM (Master Data Management) Interview Questions SAP MDM (Master Data Management) (0)
  • SAP MRS (Multi Resource Scheduling) Interview Questions SAP MRS (Multi Resource Scheduling) (0)
  • SAP ESS MSS (Employee Manager Self Service) Interview Questions SAP ESS MSS (Employee Manager Self Service) (13)
  • SAP CS (Customer Service) Interview Questions SAP CS (Customer Service) (0)
  • SAP TRM (Treasury and Risk Management) Interview Questions SAP TRM (Treasury and Risk Management) (0)
  • SAP Web Dynpro ABAP Interview Questions SAP Web Dynpro ABAP (198)
  • SAP IBP (Integrated Business Planning) Interview Questions SAP IBP (Integrated Business Planning) (0)
  • SAP OO-ABAP (Object Oriented ABAP) Interview Questions SAP OO-ABAP (Object Oriented ABAP) (70)
  • SAP S/4 HANA Finance (Simple Finance) Interview Questions SAP S/4 HANA Finance (Simple Finance) (143)
  • SAP FS-CD (Collections and Disbursements) Interview Questions SAP FS-CD (Collections and Disbursements) (0)
  • SAP PLM (Product Lifecycle Management) Interview Questions SAP PLM (Product Lifecycle Management) (0)
  • SAP SuccessFactors Interview Questions SAP SuccessFactors (33)
  • SAP Vistex Interview Questions SAP Vistex (0)
  • SAP ISR (IS Retail) Interview Questions SAP ISR (IS Retail) (28)
  • SAP IdM (Identity Management) Interview Questions SAP IdM (Identity Management) (0)
  • SAP IM (Investment Management) Interview Questions SAP IM (Investment Management) (0)
  • SAP UI5 Interview Questions SAP UI5 (59)
  • SAP SCM (Supply Chain Management) Interview Questions SAP SCM (Supply Chain Management) (51)
  • SAP XI (Exchange Infrastructure) Interview Questions SAP XI (Exchange Infrastructure) (49)
  • SAP Cloud Platform Interview Questions SAP Cloud Platform (34)
  • SAP Testing Interview Questions SAP Testing (89)
  • SAP SolMan (Solution Manager) Interview Questions SAP SolMan (Solution Manager) (63)
  • SAP MaxDB Interview Questions SAP MaxDB (116)
  • SAP GUI Interview Questions SAP GUI (15)
  • SAP AllOther Interview Questions SAP AllOther (329)