create ABAP Control Break Statement



Share this facebook google pluse twitter linkedin

Posted 2018-01-08 18:01:06

*&---------------------------------------------------------------------*
*& Report  ZCONTROL_BREAK_STATEMENT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZCONTROL_BREAK_STATEMENT NO STANDARD PAGE HEADING .

TABLES:KNA1,VBAK.

SELECTION-SCREEN:BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.

SELECT-OPTIONS:S_KUNNR FOR KNA1-KUNNR,
               S_ERDAT FOR VBAK-ERDAT.

SELECTION-SCREEN:END OF BLOCK B1.

TYPES:BEGIN OF TY_VBAK,
      KUNNR TYPE KUNNR,
      VBELN TYPE VBELN_VA,
      ERDAT TYPE ERDAT,
      NETWR TYPE NETWR_AK,
      END OF TY_VBAK.

DATA:WA_VBAK TYPE TY_VBAK,
     IT_VBAK TYPE TABLE OF TY_VBAK.

SELECT KUNNR VBELN ERDAT NETWR
       FROM VBAK INTO TABLE IT_VBAK
       WHERE KUNNR IN S_KUNNR
       AND ERDAT IN S_ERDAT.

SORT IT_VBAK BY KUNNR VBELN.

LOOP AT IT_VBAK INTO WA_VBAK.

  AT FIRST.

    WRITE:/50 'Stock Details Report' COLOR 7.

    SKIP.

    ULINE.

  ENDAT.

  AT NEW KUNNR.

    WRITE:/ 'The customer number is:', WA_VBAK-KUNNR.

  ENDAT.

  WRITE:/1 WA_VBAK-VBELN,
        20 WA_VBAK-ERDAT,
        40 WA_VBAK-NETWR.

  AT END OF KUNNR.

    SUM.

    WRITE:/ 'The total amount is :', WA_VBAK-NETWR.

    SKIP.

    ULINE.

  ENDAT.

  AT LAST.

    SUM.

    WRITE:/ 'The grand total amount is :', WA_VBAK-NETWR.

    SKIP.

    ULINE.

  ENDAT.

ENDLOOP.

Share this facebook google pluse twitter linkedin

Share this facebook google pluse twitter linkedin

Posted 2018-02-07 15:24:45

thank for creating this thread bcz it's very useful for my website,,  selenium training in Bangalore

Share this facebook google pluse twitter linkedin