Bdc on vk11 using control break events

hi
have any one done bdc for vk11 using control break events.my flat file is
ZTAX     X     IN     1000     1200     2000     A0
ZTAX     X     IN     1000     1210     3000     A1
ZTAX     X     US     7676     01     4000     L3
ZTAX     X     US     7676     02     5000     s1
i need the logic for this any sample code will be useful

hi, check the sample code using Control break statements.
  LOOP AT IT_MAIN.
WRITE : IT_MAIN.
C_TABIX = SY-TABIX.
<b>AT NEW LIFNR_001.</b>
READ TABLE IT_MAIN INDEX C_TABIX.
REFRESH IT_BDC.
perform bdc_dynpro      using 'SAPMM06E' '0100'.
perform bdc_field       using 'BDC_CURSOR'
                              'RM06E-BSTNR'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'EKKO-LIFNR'
                              IT_MAIN-LIFNR_001.
perform bdc_field       using 'RM06E-BSART'
                              IT_MAIN-BSART_002.
perform bdc_field       using 'RM06E-BEDAT'
                              IT_MAIN-BEDAT_003.
perform bdc_field       using 'EKKO-EKORG'
                              IT_MAIN-EKORG_004.
perform bdc_field       using 'EKKO-EKGRP'
                              IT_MAIN-EKGRP_005.
perform bdc_field       using 'RM06E-LPEIN'
                              IT_MAIN-LPEIN_006.
perform bdc_field       using 'RM06E-WERKS'
                              IT_MAIN-WERKS_007.
MOVE 1 TO CNT.
<b>ENDAT.</b>
perform bdc_dynpro      using 'SAPMM06E' '0120'.
perform bdc_field       using 'BDC_CURSOR'
                              'EKPO-TXZ01(01)'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
CONCATENATE 'EKPO-EMATN(' CNT ')' INTO FLD.
perform bdc_field       using FLD IT_MAIN-EMATN_01_008.
CONCATENATE 'EKPO-TXZ01(' CNT ')' INTO FLD.
perform bdc_field       using FLD IT_MAIN-TXZ01_01_009.
CONCATENATE 'EKPO-MENGE(' CNT ')' INTO FLD.
perform bdc_field       using FLD IT_MAIN-MENGE_01_010.
perform bdc_dynpro      using 'SAPMM06E' '0120'.
perform bdc_field       using 'BDC_CURSOR'
                              'RM06E-EBELP'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
CNT = CNT + 1.
       IF CNT = 6.
        CNT = 1.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                              '=P+'.
       ENDIF.
<b>AT END OF LIFNR_001.</b>
READ TABLE IT_MAIN INDEX C_TABIX.
RECORD = IT_MAIN.
perform bdc_dynpro      using 'SAPLSPO1' '0100'.
perform bdc_field       using 'BDC_OKCODE'
                              '=YES'.
CALL TRANSACTION 'ME21' USING IT_BDC MODE 'A' MESSAGES INTO IT_MESSAGES.
  clear: cnt, C_tabix .
<b>ENDAT.</b>
ENDLOOP.

Similar Messages

  • In alv report can i use control break events? if no .whay?

    Hi all,
    in alv report can i use control break events? if no .whay?

    hi,
    you can use control break statements in ALV report.
    for example: if one PO is having more than one line item, that time you need to display PO only once.

  • Smartforms, how to use control break events

    Please help with this requirement.
    Purchase Docu No.111
    Pur Item No       Mat no       Quantity 
    1                        2356      2000
    2                     1256      2000
    3                     8556      2000
    Purchase Docu No.112
    Pur Item No    Mat no    Quantity 
    1                      9656      2000
    2                      7356      2000
    3                      1356      2000
    Purchase Docu No.113
    Pur Item No    Mat no    Quantity 
    1                      5356      2000
    2                      8356      2000
    This i have to design for the smartform.
    1 header data then its item data.
    like is Script i can call the WIndow elements using control break events in the driver prog but how to get this kind of output in Smartforms.???????
    Thanks

    I dont want trigger new page.
    In the same page i want like this
    I have purchase docu data in only 1 internal table.
    So, for every new VBELN, under this i want its corresponding item details.
    I have created the command node for the main window with 2 rows, in the 1st row i am giving VBELN and in the 2nd row i am giving in item details like item no, matnr etc etc and in the condition its askng Field name and Comparison Value.
    How shold i give condition.??????
    Thanks
    Edited by: Jalaaluddin Syed on May 1, 2008 5:03 PM

  • What happen if i use controll break statement in between select & endselect

    Hi all,
    what happen if i use controll break statement in between select & endselect ?
    Thanks in Advance
    KR

    Hi for reference u can go through this code example
    data:
      fs_tab like sflight.
      data:
       t_tab like standard table of fs_tab.
       select * from sflight into table t_tab.
       loop at t_tab into fs_tab.
         write: / fs_tab-carrid.
       endloop.
       refresh t_tab.
       clear fs_tab.
       select * from sflight into fs_tab.
         at new fs_tab-carrid.
           append fs_tab to t_tab.
         endat.
       endselect.

  • How can I use control break statement in my requirement

    Hi ABAPers,
    In my requirement, I have 4 fields in sorted internal table, (audat, prdha, ipnum, netwr). In that i need to do summation of netwr field falling under same prdha(BU) for the same month
    internal table fields :
    audat  prdha  ipnum  netwr
    02      abc     1      100
    02      abc     2      200
    02      xyz     3      300
    03      abc     4      100
    03      xyz     5      300
    03      xyz     6      200
    i need output like this:
    audat  prdha  ipnum  netwr
    02      abc     1,2      300
    02      xyz     3         300
    03      abc     4         100
    03      xyz     5,6      500
    Can anyone suggest me logic for this by using control break statements
    Thanks in advance,
    Ankita
    Moderator Message: Duplciate Post.
    Edited by: kishan P on Apr 14, 2011 3:03 PM

    Hi ABAPers,
    In my requirement, I have 4 fields in sorted internal table, (audat, prdha, ipnum, netwr). In that i need to do summation of netwr field falling under same prdha(BU) for the same month
    internal table fields :
    audat  prdha  ipnum  netwr
    02      abc     1      100
    02      abc     2      200
    02      xyz     3      300
    03      abc     4      100
    03      xyz     5      300
    03      xyz     6      200
    i need output like this:
    audat  prdha  ipnum  netwr
    02      abc     1,2      300
    02      xyz     3         300
    03      abc     4         100
    03      xyz     5,6      500
    Can anyone suggest me logic for this by using control break statements
    Thanks in advance,
    Ankita
    Moderator Message: Duplciate Post.
    Edited by: kishan P on Apr 14, 2011 3:03 PM

  • ALV Control break events

    Hi all,
    I have a requirement in ALV ,
    100 abc
    100 xyz
    using control break statement how we remove two hundreds and display output only one 100 ,names
    100 abc
        xyz.
    regrads,
    Praveen

    Hi,
    with the help of sort option you can get that. just check this sample.
    REPORT  ZTEST_ALV1                              .
    TYPE-POOLS: SLIS.
    DATA:
      LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
      LT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      LT_SORT     TYPE SLIS_T_SORTINFO_ALV,
      LS_SORT     TYPE SLIS_SORTINFO_ALV.
    DATA: BEGIN OF ITAB OCCURS 0,
           VBELN LIKE VBAK-VBELN,
           POSNR LIKE VBAP-POSNR,
          END OF ITAB.
    ITAB-VBELN  = '12345'.
    ITAB-POSNR = '10'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-VBELN = '12345'.
    ITAB-POSNR = '11'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-VBELN = '12345'.
    ITAB-POSNR = '12'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-VBELN = '12356'.
    ITAB-POSNR = '10'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-VBELN = '12356'.
    ITAB-POSNR = '11'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-VBELN = '12356'.
    ITAB-POSNR = '12'.
    APPEND ITAB.
    CLEAR ITAB.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        I_PROGRAM_NAME         = SY-REPID
        I_INTERNAL_TABNAME     = 'ITAB'
        I_INCLNAME             = SY-REPID
      CHANGING
        CT_FIELDCAT            = LT_FIELDCAT
      EXCEPTIONS
        INCONSISTENT_INTERFACE = 1
        PROGRAM_ERROR          = 2
        OTHERS                 = 3.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LS_SORT-FIELDNAME = 'VBELN'.
    LS_SORT-UP        = 'X'.
    *ls_sort-group = 'UL'.  "using this you can get new lines
    APPEND LS_SORT TO LT_SORT.
    CLEAR LS_SORT.
    LS_SORT-FIELDNAME = 'POSNR'.
    LS_SORT-UP        = 'X'.
    *ls_sort-group = '*'."using this you get new pages
    APPEND LS_SORT TO LT_SORT.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        IT_FIELDCAT = LT_FIELDCAT
        IT_SORT     = LT_SORT
      TABLES
        T_OUTTAB    = ITAB.
    Regards
    vijay

  • Is there any way to use Control Break in a SQL Query

    Hi,
    Is there any way to use a control break on Dept column in a SQL query to have a Output-2 instead of Output-1.
    Is there any way to modify the SQL query.
    SQL
    select dept, loc, count(*)
      from dept
    group by dept, locOutput-1
      Dept      Loc       Count(*)
      10         AA        1
      10         BB        2
      10         CC        2
      20         AA        2
      20         BB        2Output-2
      Dept      Loc       Count(*)
      10         AA        1
                 BB        2
                 CC        2
      20         AA        2
                 BB        2Thanks,
    Deepak

    DeepakJ wrote:
    Hi,
    Is there any way to use a control break on Dept column in a SQL query to have a Output-2 instead of Output-1.
    Is there any way to modify the SQL query.
    SQL
    select dept, loc, count(*)
    from dept
    group by dept, locOutput-1
    Dept      Loc       Count(*)
    10         AA        1
    10         BB        2
    10         CC        2
    20         AA        2
    20         BB        2Output-2
    Dept      Loc       Count(*)
    10         AA        1
    BB        2
    CC        2
    20         AA        2
    BB        2
    Yes, using the <tt>lag</tt> analytic function and specified ordering of the data:
    select
        nullif(d.deptno, lag(d.deptno) over (order by d.deptno, d.loc, e.mgr nulls first)) deptno
      , nullif(d.loc, lag(d.loc) over (order by d.deptno, d.loc, e.mgr nulls first)) loc
      , e.mgr
      , count(*) n
    from
        dept d
          join emp e
            on d.deptno = e.deptno
    group by
        d.deptno
      , d.loc
      , e.mgr
    order by
        d.deptno
      , d.loc
      , e.mgr nulls first;
    DEPTNO  LOC       MGR   N
        10  NEW YORK         1
                      7782   1
                      7839   1
        20  DALLAS    7566   2
                      7788   1
                      7839   1
        30  CHICAGO   7698   4
                      7839   1
        40  BOSTON    7698   2
                      7902   1

  • Control break events

    Hi sdn,
    i have a problem when i grouping the materials under the same invoice.
    EX:
    date   address  invoice  material
        1         apple
                                        tomato
                                        banana
         2         apple
                                        orange
    when i use at new statement o/p coming like above, bcoz address have so many lines.
    To avoid this i skip material to upper position.
    Then,
    date   address  invoice  material
        1         apple
                   tomato
                   banana
         2         apple
                    orange
    Here also no problem, but when ever the page  
    changes how can i move this material to  upper  page
    please suggest me.

    Hi Ramya,
    Please create new internal table like this.
    DATA: BEGIN OF ITAB2 OCCURS 0,
            CC_GL LIKE ...
            COST_CENTER LIKE ...
            GL_ACCOUNT LIKE ...
            MATERIAL LIKE ...
            PRICE LIKE ...
    DATA: END OF ITAB2.
    DATA: WA_ITAB2 LIKE ITAB2.
    SORT ITAB1.
    LOOP AT ITAB1.
      MOVE ITAB1-COST_CENTER TO ITAB2-CC_GL(4).
      MOVE ITAB1-GL_ACCOUNT  TO ITAB2-CC_GL+4(10).
      MOVE-CORRESPONDING ITAB1 TO ITAB2.
      APPEND ITAB2.
    ENDLOOP ITAB1.
    SORT ITAB2.
    LOOP ITAB2 INTO WA_ITAB2.
       AT NEW CC_GL.
       ENDAT.
    ENDLOOP.
    Please check the syntax ... and hope this will help.
    Regards,
    Ferry Lianto

  • What is the use of control breaks in reoprts?how can we use them in report?

    hello all
    what is the use of control breaks in reoprts? and how can we use them in reports?

    hi,
    check this sample program using control break statements.
    *& Report  Y777_CBSTABLE
    REPORT  Y777_CBSTABLE1.
    TYPES:
    BEGIN OF S_MARKS,
         ROLLNO    TYPE I,
         SCODE(3)  TYPE C,
        ROLLNO    TYPE I,
         SNAME(10) TYPE C,
         MARKS     TYPE I,
    END OF S_MARKS.
    DATA : C TYPE I,
           D(3) TYPE C,
           TOT TYPE I,
           STU TYPE I,
           MARKS TYPE STANDARD TABLE OF S_MARKS,
           WA_MARKS TYPE S_MARKS.
    WA_MARKS-ROLLNO = 1.
    WA_MARKS-SCODE  = 'MAT'.
    WA_MARKS-SNAME  = 'MATHS'.
    WA_MARKS-MARKS  = 65.
    APPEND WA_MARKS TO MARKS.
    CLEAR WA_MARKS.
    WA_MARKS-ROLLNO = 1.
    WA_MARKS-SCODE  = 'SCI'.
    WA_MARKS-SNAME  = 'SCIENCE'.
    WA_MARKS-MARKS  = 85.
    APPEND WA_MARKS TO MARKS.
    CLEAR WA_MARKS.
    WA_MARKS-ROLLNO = 1.
    WA_MARKS-SCODE  = 'COM'.
    WA_MARKS-SNAME  = 'COMPUTER'.
    WA_MARKS-MARKS  = 90.
    APPEND WA_MARKS TO MARKS.
    CLEAR WA_MARKS.
    WA_MARKS-ROLLNO = 2.
    WA_MARKS-SCODE  = 'MAT'.
    WA_MARKS-SNAME  = 'MATHS'.
    WA_MARKS-MARKS  = 55.
    APPEND WA_MARKS TO MARKS.
    CLEAR WA_MARKS.
    WA_MARKS-ROLLNO = 2.
    WA_MARKS-SCODE  = 'SCI'.
    WA_MARKS-SNAME  = 'SCIENCE'.
    WA_MARKS-MARKS  = 75.
    APPEND WA_MARKS TO MARKS.
    CLEAR WA_MARKS.
    WA_MARKS-ROLLNO = 2.
    WA_MARKS-SCODE  = 'COM'.
    WA_MARKS-SNAME  = 'COMPUTER'.
    WA_MARKS-MARKS  = 80.
    APPEND WA_MARKS TO MARKS.
    CLEAR WA_MARKS.
    RETRIVAL ************************************
    SORT MARKS BY SCODE .
    LOOP AT MARKS INTO WA_MARKS.
        AT FIRST .
           ULINE.
           FORMAT COLOR 6 ON.
           WRITE:/ 'SUBJECT CODE', 65 ' ' .
           FORMAT RESET.
           FORMAT COLOR 6 ON INTENSIFIED OFF.
           WRITE:/20 'ROLL NO',
                  40 'SUBJECT NAME',
                  55 'MARKS',
                  65 ' '.
           FORMAT RESET.
           ULINE.
        ENDAT.
        ON CHANGE OF WA_MARKS-SCODE.
           IF SY-TABIX NE 1.
               NEW-LINE.
               ULINE 40(25).
               FORMAT COLOR 5 ON INVERSE ON INTENSIFIED ON.
               TOT = TOT / STU.
               WRITE:/40 'AVERAGE MARKS =', TOT.
               FORMAT RESET.
               CLEAR TOT.
               CLEAR STU.
           ENDIF.
          FORMAT COLOR 6 ON INTENSIFIED ON.
          WRITE:/ WA_MARKS-SCODE.
          FORMAT RESET.
        ENDON.
        FORMAT COLOR 6 ON INTENSIFIED OFF.
        WRITE:/20 WA_MARKS-ROLLNO,
               40 WA_MARKS-SNAME,
               55 WA_MARKS-MARKS,
               65 ' '.
        FORMAT RESET.
        STU = STU + 1.
        TOT = TOT + WA_MARKS-MARKS.
        C = STU.
        AT LAST.
               NEW-LINE.
               ULINE 40(25).
               FORMAT COLOR 5 ON INVERSE ON INTENSIFIED ON.
               TOT = TOT / STU.
               WRITE:/40 'AVERAGE MARKS =', TOT.
               FORMAT RESET.
               CLEAR TOT.
               CLEAR STU.
             ULINE.
             FORMAT COLOR 6 ON INVERSE ON INTENSIFIED ON.
             WRITE:/ ' TOTAL STUDENTS : ', C.
             FORMAT RESET.
        ENDAT.
    ENDLOOP.
    reward points if hlpful.

  • Control break statements in smart forms

    Hi,
    Can we use control break statements(at new,at end of) in smart forms?
    if no why?
    if yes, how?
    Regards,
    Sonika

    you can use control block statements in smartforms by using the SORT events.
    In TABLES go to to the SORT section.Here you can give the field by which you want the table to be sorted.There are two radio buttons available for sort : SORT BEGIN and SORT end.
    On selecting any one sort event are generated automatically and event nodes are created in smartforms.Inside these event nodes you can add text nodes or code nodes and write your code.
    SORT BEGIN works like AT NEW
    SORT END works like AT END OF.

  • Proble with control breaks

    Hi,
    When i use control breaks  and write a output i get astreix(*) in the output.
    I even tried with a local vriable but the value is not displayed in the output. i need to output the material description in the output.
    My code is as follows:
    LOOP AT lt_output INTO wa_output.
        AT NEW matnr.
          CLEAR: lv_matdesc.
          MOVE: wa_output-maktx TO lv_matdesc.
          WRITE: / '|',  wa_output-matnr, 30(40) lv_matdesc, 80(5)
                 wa_output-cocode, 86(4) wa_output-valarea, 93  '|'.
        ENDAT.
          AT END OF matnr.
          WRITE: / '|', 2(91) sy-uline, 93 '|'.
          WRITE: / '|', '*', 4(15) wa_output-matnr, 93 '|'.
          WRITE:/'|', 48(10) lv_mat_qty, 59(4) wa_output-bum, 70(15)
                lv_mat_amt, 85 wa_output-curr, 93 '|'.
          WRITE: / '|', 2(91) sy-uline, 93 '|'.
          CLEAR: lv_mat_qty, lv_mat_amt.
        ENDAT.
        AT LAST.
          WRITE: / '|', 2(91) sy-uline , 93 '|'.
          WRITE: / '|', '***', 5(15) 'Total', 93 '|'.
          WRITE:/'|', 48(10) lv_total_qty, 59(4) wa_output-bum, 70(15)
                lv_total_amt, 85 wa_output-curr, 93 '|'.
          WRITE: / '|', 2(91) sy-uline, 93 '|'.
        ENDAT.
      ENDLOOP.
    The output looks like this:
    9M27W8.X9B.0               ****************************************          ****  ****
    WE 4700001289   001  04/10/2002                  1.000  PC              31,667.65 CAD
    WE 4700001454   001  07/29/2002                  1.000  PC              30,074.63 CAD
    WE 4700001455   001  07/29/2002                  1.000  PC              30,074.63 CAD
    WE 4700001457   001  07/29/2002                  1.000  PC              30,513.47 CAD
    *9M27W8.X9B.0
    4.000  ****           122,330.38 *****
    **Total
    1,441.000  ****        38,926,097.05 *****

    Hi,
    LOOP AT lt_output INTO wa_output.
    wa_out = wa_output.    " and use this variable in the events to print the data instead of wa_output.
    AT NEW matnr.
    CLEAR: lv_matdesc.
    MOVE: wa_output-maktx TO lv_matdesc.
    WRITE: / '|', wa_output-matnr, 30(40) lv_matdesc, 80(5)
    wa_output-cocode, 86(4) wa_output-valarea, 93 '|'.
    ENDAT.
    AT END OF matnr.
    WRITE: / '|', 2(91) sy-uline, 93 '|'.
    WRITE: / '|', '*', 4(15) wa_output-matnr, 93 '|'.
    WRITE:/'|', 48(10) lv_mat_qty, 59(4) wa_output-bum, 70(15)
    lv_mat_amt, 85 wa_output-curr, 93 '|'.
    WRITE: / '|', 2(91) sy-uline, 93 '|'.
    CLEAR: lv_mat_qty, lv_mat_amt.
    ENDAT.
    AT LAST.
    WRITE: / '|', 2(91) sy-uline , 93 '|'.
    WRITE: / '|', '***', 5(15) 'Total', 93 '|'.
    WRITE:/'|', 48(10) lv_total_qty, 59(4) wa_output-bum, 70(15)
    lv_total_amt, 85 wa_output-curr, 93 '|'.
    WRITE: / '|', 2(91) sy-uline, 93 '|'.
    ENDAT.
    ENDLOOP.

  • Problem with the control break statement  - AT END OF

    data : IT_DATA   TYPE STANDARD TABLE OF /BIC/OH0SPA_OHD WITH  KEY /B28/S_D1DVOX5 ,
    FIELD-SYMBOLS :   <ls_data> TYPE any,
    SELECT * FROM (c_open_hub) INTO TABLE IT_DATA .
    *IF sy-subrc = 0.
    *ENDIF.
    Create the GUID for header
    CALL FUNCTION 'GUID_CREATE'
      IMPORTING
        EV_GUID_32 = LV_GUID.
    TRY.
        CALL METHOD CL_GDT_CONVERSION=>GUID_OUTBOUND
          EXPORTING
            IM_GUID_C = LV_GUID
          IMPORTING
            EX_VALUE  = LV_UUID.
      CATCH CX_GDT_CONVERSION  INTO go_exc .
        gv_text = go_exc->get_text( ).
    Application log for errors
        IF gv_text IS NOT INITIAL.
          PERFORM add_msg_to_log CHANGING lt_return.
          CALL FUNCTION '/SPA/APPL_LOG'
            EXPORTING
              LV_OBJECT    = '/SPA/APPL'
              LV_SUBOBJECT = '/SPA/ESOA'
              IT_RETURN    = lt_return.
        ENDIF.
    ENDTRY.
    OUTPUT-TRADE_PROMOTION_CRMBULK_CREATE-MESSAGE_HEADER-ID-CONTENT = LV_GUID.
    OUTPUT-TRADE_PROMOTION_CRMBULK_CREATE-MESSAGE_HEADER-UUID-CONTENT = LV_UUID.
    SELECT * FROM DD03T INTO TABLE lt_dd03t WHERE TABNAME = c_open_hub AND DDLANGUAGE = 'E' AND AS4LOCAL = 'A'.
    *IF sy-subrc = 0.
    *ENDIF.
    Sort the delta table
    SORT it_data.
    populate the output structure
    LOOP AT IT_DATA ASSIGNING <ls_data>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_keyfigures.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_keyfigures>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_signdata.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_signdata>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_bbtype.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_bbtype>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_customer.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_customer>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_product.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_product>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_territory.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_territory>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_time.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_time>.
      CASE <l_keyfigures>.
        WHEN c_sd.
          PERFORM DATE_CALC USING <l_signdata> CHANGING  LV_DATE.
          ls_period_term-start_date = lv_date.
        WHEN c_ed.
          PERFORM DATE_CALC USING <l_signdata> CHANGING  LV_DATE.
          ls_period_term-end_date = lv_date.
        WHEN c_uplift.
          LS_PRODUCT_KF-ID-CONTENT = c_uplift_qyts.
          LS_PRODUCT_KF-VALUE = <l_signdata>.
         LS_PRODUCT_KF-YEAR = lv_week(4).
         LS_PRODUCT_KF-CALENDAR_PERIOD_ORDINAL_NUMBER = lv_week+4.
          APPEND LS_PRODUCT_KF TO LT_PRODUCT_KF.
        WHEN OTHERS.
        PERFORM DATE_CALC USING <l_signdata> CHANGING  LV_DATE.
         ls_period_term-start_date = lv_date.
    Get week
         CALL FUNCTION 'DATE_GET_WEEK'
           EXPORTING
             DATE = LS_PERIOD_TERM-START_DATE
           IMPORTING
             WEEK = LV_WEEK.
    append Keyfigure
          LS_PRODUCT_KF-ID-CONTENT = <l_keyfigures> .
          LS_PRODUCT_KF-VALUE = <l_signdata>.
         LS_PRODUCT_KF-YEAR = lv_week(4).
         LS_PRODUCT_KF-CALENDAR_PERIOD_ORDINAL_NUMBER = lv_week+4.
          APPEND LS_PRODUCT_KF TO LT_PRODUCT_KF.
    append tradespend
          SELECT SINGLE * FROM /SPA/SPEND_MAP INTO CORRESPONDING FIELDS OF LV_/SPA/SPEND_MAP
                 WHERE KEY_FIGURE = <l_keyfigures>.
          IF sy-subrc = 0.
            LS_TRADE_SPEND-TYPE_CODE-CONTENT = LV_/SPA/SPEND_MAP-SPEND_TYPE.
            LS_TRADE_SPEND-CATEGORY_CODE-CONTENT = LV_/SPA/SPEND_MAP-SPEND_CATEGORY.
            LS_TRADE_SPEND-METHOD_CODE-CONTENT = LV_/SPA/SPEND_MAP-SPEND_METHOD.
            APPEND LS_TRADE_SPEND TO LT_TRADE_SPEND.
          else.
            lv_flg = 'X'.
          ENDIF.
      ENDCASE.
    AT END OF /B28/S_D1DVOX5.   "
        SELECT SINGLE * FROM  /SPA/SO_TER_MAP INTO LS_/SPA/SO_TER_MAP WHERE TERRITORY = <l_territory>.
        IF sy-subrc = 0 AND lv_flg IS INITIAL.
    Create the GUID for TP's
          CALL FUNCTION 'GUID_CREATE'
            IMPORTING
              EV_GUID_32 = LV_GUID_MESSAGE.
          TRY.
              CALL METHOD CL_GDT_CONVERSION=>GUID_OUTBOUND
                EXPORTING
                  IM_GUID_C = LV_GUID_MESSAGE
                IMPORTING
                  EX_VALUE  = LV_UUID_MESSAGE.
            CATCH CX_GDT_CONVERSION .
          ENDTRY.
    populate the product
          LS_PRODUCT-ID-CONTENT = <l_product>.
          LS_CUSTOMER-ID-CONTENT = '300022'.
          LS_CUSTOMER-ROLE_CODE = '00000105'.
          LS_PRODUCT-KEY_FIGURE = LT_PRODUCT_KF.
          APPEND LS_PRODUCT TO LT_PRODUCT.
          APPEND LS_CUSTOMER TO LT_CUSTOMER.
          APPEND LS_DESCRIPTION TO LT_DESCRIPTION.
          APPEND LS_PERIOD_TERM TO LT_PERIOD_TERM.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-SALES_AREA-ORGANISATIONAL_CENTRE_ID = LS_/SPA/SO_TER_MAP-SALES__ORG.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-SALES_AREA-DISTRIBUTION_CHANNEL_CODE-CONTENT = LS_/SPA/SO_TER_MAP-DIST_CHANNEL.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_ACCOUNT-CUSTOMER_INTERNAL_ID = <l_customer>.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_PROFILE_GROUP_CODE-CONTENT = '4TPM'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-TYPE_CODE-CONTENT = 'Z002'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-UPLIFT_ACTIVE_INDICATOR = 'X'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_INFORMATION-MARKETING_PROJECT_PLANNING_PRO = '5'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_INFORMATION-CALENDAR_UNIT_CODE = 'WEE'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-TRADE_SPEND = LT_TRADE_SPEND.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PARTY = LT_CUSTOMER.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-DESCRIPTION = LT_DESCRIPTION.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_INFORMATION-PRODUCT = LT_PRODUCT.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PERIOD_TERM = LT_PERIOD_TERM.
          LS_TRADE_PROMOTION-MESSAGE_HEADER-ID-CONTENT = LV_GUID_MESSAGE.
          LS_TRADE_PROMOTION-MESSAGE_HEADER-UUID-CONTENT = LV_UUID_MESSAGE.
          LS_/SPA/REPORT_TAB-SPA_TP_ID = <l_bbtype>.
          LS_/SPA/REPORT_TAB-MESSAGE_ID = LV_GUID_MESSAGE.
          LS_/SPA/REPORT_TAB-CREATE_DATE = SY-DATUM.
          INSERT /SPA/REPORT_TAB FROM LS_/SPA/REPORT_TAB.
          APPEND LS_TRADE_PROMOTION TO LT_TRADE_PROMOTION.
          OUTPUT-TRADE_PROMOTION_CRMBULK_CREATE-TRADE_PROMOTION_CRMCREATE_REQU = LT_TRADE_PROMOTION.
          CLEAR : LT_DESCRIPTION, LT_PERIOD_TERM,LT_CUSTOMER, LT_PRODUCT, LT_PRODUCT_KF, LT_TRADE_SPEND,LS_/SPA/HEADER_TAB.
        ENDIF.
        CLEAR lv_flg .
      ENDAT.
    ENDLOOP.
    My problem is AT-END OF STATEMENT IS executing for each and every record of same /B28/S_D1DVOX5.
    Please help me from this problem

    Hello,
    First of all to know clearly about AT END.
    Let's say In IT_DATA fields are F1 F2 F3 /B28/S_D1DVOX5 F5.
    then AT END of /B28/S_D1DVOX5 means for each new value of this field at the end it will trigger.
    Please ensure thet IT_DATA is sorted by this field and then used Control break.
    Thanks,
    Pramod

  • Control break behavior

    Hi,
    Can anyone tell if there's a way to override the default behavior of Control Break?
    In my report (a schedule), I have a column that holds the values for days (monday, tuesday, etc.).
    I want to control break on that column but keep the resulting grups ordered in a natural order (monday first, tuesday second and so on).
    I can write the sql that generates my report that way by using decode, but once I Control Break apex is applying a new order by clause on my report, destroying my order.
    Any ideas on how to tell apex how to order for control break using decode, or how to disable ordering entirely when I use Control Break on a specific column?
    Thank you!
    Edited by: user2130586 on May 17, 2012 6:40 AM
    Edited by: user2130586 on May 17, 2012 6:41 AM

    Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already).
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
    When asking a question about "reports" it's firstly essential to differentiate between standard and interactive reports. Which is it?
    I suggest you take advantage of the opportunities provided by apex.oracle.com and reproduce the problem there...

  • Want to know more details about control breaks in reports

    hello all
    i want to know more details about control breaks AT First,
                                                                          AT Last,
                                                                          AT New,
                                                                          At End of and on change .
    can anybody tell with examples?

    Hi Swamy,
       Check the following.
    Control break statements are used to create statement blocks which process only specific table lines the LOOP – ENDLOOP block.
    You open such a statement block with the control level statement AT and close it with the control level statement ENDAT. The syntax is as follows:
    Table should be sorted when you use control-break statements
    You can break the sequential access of internal tables by using these statements.
    Syntax:
    At first.
    <Statement block>
    Endat.
    This is the first statement to get executed inside the loop (remember control break statements are applicable only inside the loop)
    So in this block you can write or process those statements which you want to get executed when the loop starts.
    At New carrid.
    Write:/ carrid.
    Endat.
    In this case whenever the new carrid is reached, carrid will be written.
    At End of carrid.
    Uline.
    Endat.
    In this case whenever the end of carrid is reached, a line will be drawn.
    At Last.
    Write:/ ‘Last Record is reached’.
    Endat.
    Processing of statements within this block is done when entire processing of entire internal table is over. Usually used to display grand totals.
    You can use either all or one of the above control break statements with in the loop for processing internal table.
    At end of carrid.
    Sum.
    Endat.
    In above case the statement SUM (applicable only within AT-ENDAT) will sum up all the numeric fields in internal table and result is stored in same internal table variable.
    Hope this helps you.
    Any queries, get back to me.
    Regards,
    Chandra Sekhar

  • Control Break

    HI
    What happens if I use control break statement in between select & endselect?
    Thanks

    Hi,
    They are used only with respect to Internal Tables (not between Select...endselect)to calculate Totals for Qty and Amount fields based on certain  key fields
    see the doc;
    AT - Control break with internal tables
    Variants
    1. AT NEW f.
    2. AT END OF f.
    3. AT FIRST.
    4. AT LAST.
    Effect
    In a LOOP which processes a dataset created with EXTRACT , you can use special control structures for control break processing. All these structures begin with AT and end with ENDAT . The sequence of statements which lies between them is then executed if a control break occurs.
    You can use these key words for control break processing with extract datasets only if the active LOOP statement is proceesing an extract dataset.
    The control level structure with extract datasets is dynamic. It corresponds exactly to the sort key of the extract dataset, i.e. to the order of fields in the field group HEADER by which the extract dataset was sorted .
    At the start of a new control level (i.e. immediately after AT ), the following occurs in the output area of the current LOOP statement:
    All default key fields (on the right) are filled with "*" after the current control level key.
    All other fields (on the right) are set to their initial values after the current control level key.
    Between AT and ENDAT , you can use SUM to insert the appropriate control totals in the number fields (see also ABAP/4 number types ) of the LOOP output area (on the right) after the current control level key. Summing is supported both at the beginning of a control level ( AT FIRST , AT NEW f ) and also the end of a control level ( AT END OF f , AT LAST ).
    At the end of the control level processing (i.e. after ENDAT ), the old contents of the LOOP output area are restored.
    Notes
    When calculating totals, you must ensure that the totals are inserted into the same sub-fields of the LOOP output area as those where the single values otherwise occur. If there is an overflow, processing terminates with a runtime error.
    If an internal table is processed only in a restricted form (using the additions FROM , TO and/or WHERE with the LOOP statement), you should not use the control structures for control level processing because the interaction of a restricted LOOP with the AT statement is currenly not properly defined.
    With LOOP s on extracts, there are also special control break control structures you can use.
    DATA: sflight_tab TYPE SORTED TABLE OF sflight
                      WITH UNIQUE KEY carrid connid fldate,
          sflight_wa  LIKE LINE OF sflight_tab.
    SELECT *
           FROM sflight
           INTO TABLE sflight_tab.
    LOOP AT sflight_tab INTO sflight_wa.
      AT NEW connid.
        WRITE: / sflight_wa-carrid,
                 sflight_wa-connid.
        ULINE.
      ENDAT.
      WRITE: / sflight_wa-fldate,
               sflight_wa-seatsocc.
      AT END OF connid.
        SUM.
        ULINE.
        WRITE: / 'Sum',
                  sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
        SKIP.
      ENDAT.
      AT END OF carrid.
        SUM.
        ULINE.
        WRITE: / 'Carrier Sum',
                  sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
        NEW-PAGE.
      ENDAT.
      AT LAST.
        SUM.
        WRITE: / 'Overall Sum',
                  sflight_wa-seatsocc UNDER sflight_wa-seatsocc.
      ENDAT.
    ENDLOOP.
    reward if useful
    regards,
    Anji
    Message was edited by:
            Anji Reddy Vangala

Maybe you are looking for

  • Mapping Between Business Partners and Customers in CRM and ERP

    Hi, I wanted to know how are the business Partners and Customers replicated from ERP to CRM systems and Vice Versa. I would also want to know how can i check this mapping in the tables. eg: Get a customer or BP from the ERP system, how do i find it i

  • How can I disable hardware acceleration in Safari 5.1 ?

    for performance testing purposes, I need to do so. Specifically, to disable 2D Canvas hardware acceleration. I can't figure out how. Is there any way? I am on Mac. I would like to know about how to do so both on Mac and Windows.

  • Does 9-slice work?

    I'm making a new skin for a scrollbar (losing the track and the thumb, then stretching the buttons all the way across the list), and the method I used works for fixed-size lists (the bitmaps don't resize, because I'm having to do my own BitmapData re

  • Newbie: loading a symbol from the library

    Hey Environment: Flash Lite 2.0 ActionScript 2.0 Would like some tips about how to use ActionScript to load symbol from the Library and place the symbol on a specific frame in the main timeline... I also want to specify (using ActionScript) where on

  • Tecra A9 - memory card controler under Windows XP?

    Hello, I have a new Tecra A9-51G. I had downgrade Vista to Windows XP Professional and evrything is working fine, but Windows can't find driver to memory card contorler and I can't use 5-in-1 Bridge Media slot (supports SD Card, Memory Stick, Memory