1 / 19

ABAP and Stuff

ABAP and Stuff. MINS298c-01 Fall 1998. Overview. Control Break Logic in ABAP Nested Selects Debugger Extended Check Runtime Comparisons. Control Breaks Made Easy. Terr Region Total ----------------------------- A 100 3

neith
Télécharger la présentation

ABAP and Stuff

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ABAP and Stuff MINS298c-01 Fall 1998

  2. Overview • Control Break Logic in ABAP • Nested Selects • Debugger • Extended Check • Runtime Comparisons

  3. Control Breaks Made Easy Terr Region Total ----------------------------- A 100 3 200 2 300 1 6 ---------------------------- B 100 4 150 4 8 ---------------------------- C 100 1 175 5 300 3 9 23 Data: TR_TAB like TERR_REGION occurs 0 with header line. LOOP AT TR_TAB. AT FIRST. WRITE: ‘ Terr Region Total’. ENDAT. AT NEW Terr. VLINE. Sub = 0. WRITE Terr. ENDAT. ADD Count to Sub. WRITE: Region, Count. AT END OF Region. WRITE: Sub. ADD Sub to Total. ENDAT. AT LAST: WRITE: Total. ENDAT. ENDLOOP.

  4. Control Breaks Made Easy Terr Region Total ----------------------------- A 100 3 200 2 300 1 6 ---------------------------- B 100 4 150 4 8 ---------------------------- C 100 1 175 5 300 3 9 23 Data: TR_TAB like TERR_REGION occurs 0 with header line. LOOP AT TR_TAB. AT FIRST. WRITE: ‘ Terr Region Total’. ENDAT. AT NEW Terr. VLINE. Sub = 0. WRITE Terr. ENDAT. ADD Count to Sub. WRITE: Region, Count. AT END OF Region. WRITE: Sub. ADD Sub to Total. ENDAT. AT LAST: WRITE: Total. ENDAT. ENDLOOP.

  5. Control Breaks Made Easy Terr Region Total ----------------------------- A 100 3 200 2 300 1 6 ---------------------------- B 100 4 150 4 8 ---------------------------- C 100 1 175 5 300 3 9 23 Data: TR_TAB like TERR_REGION occurs 0 with header line. LOOP AT TR_TAB. AT FIRST. WRITE: ‘ Terr Region Total’. ENDAT. AT NEW Terr. VLINE. Sub = 0. WRITE Terr. ENDAT. ADD Count to Sub. WRITE: Region, Count. AT END OF Region. WRITE: Sub. ADD Sub to Total. ENDAT. AT LAST: WRITE: Total. ENDAT. ENDLOOP.

  6. Control Breaks Made Easy Terr Region Total ----------------------------- A 100 3 200 2 300 1 6 ---------------------------- B 100 4 150 4 8 ---------------------------- C 100 1 175 5 300 3 9 23 Data: TR_TAB like TERR_REGION occurs 0 with header line. LOOP AT TR_TAB. AT FIRST. WRITE: ‘ Terr Region Total’. ENDAT. AT NEW Terr. VLINE. Sub = 0. WRITE Terr. ENDAT. ADD Count to Sub. WRITE: Region, Count. AT END OF Region. WRITE: Sub. ADD Sub to Total. ENDAT. AT LAST: WRITE: Total. ENDAT. ENDLOOP.

  7. Control Breaks Made Easy Terr Region Total ----------------------------- A 100 3 200 2 300 1 6 ---------------------------- B 100 4 150 4 8 ---------------------------- C 100 1 175 5 300 3 9 23 Data: TR_TAB like TERR_REGION occurs 0 with header line. LOOP AT TR_TAB. AT FIRST. WRITE: ‘ Terr Region Total’. ENDAT. AT NEW Terr. VLINE. Sub = 0. WRITE Terr. ENDAT. ADD Count to Sub. WRITE: Region, Count. AT END OF Region. WRITE: Sub. ADD Sub to Total. ENDAT. AT LAST: WRITE: Total. ENDAT. ENDLOOP.

  8. Control Breaks Made Easy Terr Region Total ----------------------------- A 100 3 200 2 300 1 6 ---------------------------- B 100 4 150 4 8 ---------------------------- C 100 1 175 5 300 3 9 23 Data: TR_TAB like TERR_REGION occurs 0 with header line. LOOP AT TR_TAB. AT FIRST. WRITE: ‘ Terr Region Total’. ENDAT. AT NEW Terr. VLINE. Sub = 0. WRITE Terr. ENDAT. ADD Count to Sub. WRITE: Region, Count. AT END OF Region. WRITE: Sub. ADD Sub to Total. ENDAT. AT LAST: WRITE: Total. ENDAT. ENDLOOP.

  9. Control Breaks Made Easy Terr Region Total ----------------------------- A 100 3 200 2 300 1 6 ---------------------------- B 100 4 150 4 8 ---------------------------- C 100 1 175 5 300 3 9 23 Data: TR_TAB like TERR_REGION occurs 0 with header line. LOOP AT TR_TAB. AT FIRST. WRITE: ‘ Terr Region Total’. ENDAT. AT NEW Terr. VLINE. Sub = 0. WRITE Terr. ENDAT. ADD Count to Sub. WRITE: Region, Count. AT END OF Region. WRITE: Sub. ADD Sub to Total. ENDAT. AT LAST: WRITE: Total. ENDAT. ENDLOOP.

  10. Control Breaks Made Easy Terr Region Total ----------------------------- A 100 3 200 2 300 1 6 ---------------------------- B 100 4 150 4 8 ---------------------------- C 100 1 175 5 300 3 9 23 Data: TR_TAB like TERR_REGION occurs 0 with header line. LOOP AT TR_TAB. AT FIRST. WRITE: ‘ Terr Region Total’. ENDAT. AT NEW Terr. VLINE. Sub = 0. WRITE Terr. ENDAT. ADD Count to Sub. WRITE: Region, Count. AT END OF Region. WRITE: Sub. ADD Sub to Total. ENDAT. AT LAST: WRITE: Total. ENDAT. ENDLOOP.

  11. Control Breaks Made Easy Terr Region Total ----------------------------- A 100 3 200 2 300 1 6 ---------------------------- B 100 4 150 4 8 ---------------------------- C 100 1 175 5 300 3 9 23 Data: TR_TAB like TERR_REGION occurs 0 with header line. LOOP AT TR_TAB. AT FIRST. WRITE: ‘ Terr Region Total’. ENDAT. AT NEW Terr. VLINE. Sub = 0. WRITE Terr. ENDAT. ADD Count to Sub. WRITE: Region, Count. AT END OF Region. WRITE: Sub. ADD Sub to Total. ENDAT. AT LAST: WRITE: Total. ENDAT. ENDLOOP.

  12. Control Breaks Made Easy Terr Region Total ----------------------------- A 100 3 200 2 300 1 6 ---------------------------- B 100 4 150 4 8 ---------------------------- C 100 1 175 5 300 3 9 23 Data: TR_TAB like TERR_REGION occurs 0 with header line. LOOP AT TR_TAB. AT FIRST. WRITE: ‘ Terr Region Total’. ENDAT. AT NEW Terr. VLINE. Sub = 0. WRITE Terr. ENDAT. ADD Count to Sub. WRITE: Region, Count. AT END OF Region. WRITE: Sub. ADD Sub to Total. ENDAT. AT LAST: WRITE: Total. ENDAT. ENDLOOP.

  13. Control Breaks Made Easy Terr Region Total ----------------------------- A 100 3 200 2 300 1 6 ---------------------------- B 100 4 150 4 8 ---------------------------- C 100 1 175 5 300 3 9 23 Data: TR_TAB like TERR_REGION occurs 0 with header line. LOOP AT TR_TAB. AT FIRST. WRITE: ‘ Terr Region Total’. ENDAT. AT NEW Terr. VLINE. Sub = 0. WRITE Terr. ENDAT. ADD Count to Sub. WRITE: Region, Count. AT END OF Region. WRITE: Sub. ADD Sub to Total. ENDAT. AT LAST: WRITE: Total. ENDAT. ENDLOOP.

  14. Control Breaks Made Easy Terr Region Total ----------------------------- A 100 3 200 2 300 1 6 ---------------------------- B 100 4 150 4 8 ---------------------------- C 100 1 175 5 300 3 9 23 Data: TR_TAB like TERR_REGION occurs 0 with header line. LOOP AT TR_TAB. AT FIRST. WRITE: ‘ Terr Region Total’. ENDAT. AT NEW Terr. VLINE. Sub = 0. WRITE Terr. ENDAT. ADD Count to Sub. WRITE: Region, Count. AT END OF Region. WRITE: Sub. ADD Sub to Total. ENDAT. AT LAST: WRITE: Total. ENDAT. ENDLOOP.

  15. On Change Of • You control the logic • Example Perform Headings LOOP AT TR_TAB ON CHANGE OF Region Perform Region_Break. ON CHANGE OF Terr Perform Region_Break. Perform Terr_Break. ENDLOOP. Perform Region_Break. Perform Terr_Break. Perform Footings.

  16. Nested Selects (p236) • What is the outcome of the following nested selects • Example Select * From Customers Select * From Bookings Where Customerid = Customer-id and order_date = ‘19990101’. Write: / customers-name, bookings-fldate. Endselect. Endselect. • What can you tell about the relationship between the Tables?

  17. Debugger (p597) • Allows you to • watch program execute step by step • check contents of • fields • tables • change contents • establish breakpoints

  18. Extended Check (p596) • Catches inconsistencies • unreachable code • uncalled subroutines • notifies you of potential problems • may explain unexpected results

  19. Runtime Comparisons • Given that there are many ways to accomplish the same thing in ABAP, SAP provides a means to compare them side by side. • Predefined comparisons • Can put own code in • Use SE30 to run comparisons

More Related