Alv control breaks
hi sap fans,
i got one issue in alv's
the o/p display in alv's is like this
top-of-page: reconsilation a/c,
check date,
check no.
o/p: bank a/c, amount,,
client asking me at end of bank a/c no i want a a special row with fields 'reconsilation(lable only),total no of line items,total amount of this bank account.
regards
udaya bhasker bandi
Hi
look thsi threds http://www.sdn.sap.com/irj/scn/advancedsearch?query=controlbreskin+alv
Regards,
Pravin
Similar Messages
-
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,
PraveenHi,
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 -
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. -
Control break functionality for ALV
HI experts,
i want to know how to use control break functionality in ALV's
i 've an int table , which i am processing for AT NEW lgtyp (storage type)
for every set of same lgtyp records , iam making some calculations on itab,
and getting my final int table.
so, for every set of new lgtyp values , i've a new final int table ,
which i need to pass to ALV.
my requirement is for every new storage type
get a block of output.
how to do this in ALV, waiting for response.Hi,
DOnt use AT NEW , use ON CHAGE
Refer this code
FORM sub_claculate_plug .
*--Local Variables
DATA : lv_index LIKE sy-tabix,
lv_total TYPE kzwi2.
LOOP AT it_final INTO wa_final.
lv_index = sy-tabix.
v_month = wa_final-erdat+4(2).
v_year = wa_final-erdat+0(4).
IF NOT p_bud IS INITIAL.
*--Collect all the plug numbers
PERFORM sub_collect_plug.
ENDIF.
ON CHANGE OF v_month.
v_ship = v_ship + v_wdays.
ENDON.
CLEAR : wa_nday.
READ TABLE it_nday INTO wa_nday WITH KEY erdat = wa_final-erdat
BINARY SEARCH.
IF sy-subrc EQ 0.
IF wa_nday-flag NE 'X'.
IF v_wdays NE 0.
wa_final-totbud = p_bud / v_wdays.
ENDIF.
ENDIF.
ENDIF.
wa_final-totrev = wa_final-corebus +
wa_final-onbulk +
wa_final-premier +
wa_final-shipit +
wa_final-onpromo +
wa_final-netrev +
wa_final-storev +
wa_final-connet +
wa_final-sporder.
lv_total = wa_final-corebus +
wa_final-onpromo +
wa_final-netrev.
IF NOT wa_final-oltot IS INITIAL.
wa_final-ordsize = lv_total / wa_final-oltot.
ENDIF.
MODIFY it_final FROM wa_final INDEX lv_index TRANSPORTING
totbud totrev ordsize.
*--Clear
CLEAR : wa_final,
v_days,
v_jan,
v_wdays,
v_ndays,
v_count.
ENDLOOP.
ENDFORM. " sub_claculate_plug
Regards,
Prashant -
Control-break statements:value not being displayed.
Hi all,
Iam using the control break statement at end of ..., sum.
value is not being displayed,instead it is showing *********.
even in the debugging mode the value is not being displayed.
iam passing the values into a temp IT,but still the values are not being dispalyed.
here is the following snippet of code.
what could be the mistake?
Please give me the suitable answer.
Thanks in advance.
LOOP AT FT_ITAB INTO FT_WA.
FTY_WA-EBELN = FT_WA-EBELN.
FTY_WA-EBELP = FT_WA-EBELP.
FTY_WA-NAME1 = FT_WA-NAME1.
FTY_WA-ZTERM = FT_WA-ZTERM.
FTY_WA-INCO1 = FT_WA-INCO1.
FTY_WA-WAERS = FT_WA-WAERS.
FTY_WA-SUBMI = FT_WA-SUBMI.
AT END OF EBELN.
SUM.
FTY_WA-BRTWR = FT_WA-BRTWR.
FTY_WA-KTMNG = FT_WA-KTMNG.
FTY_WA-NETPR = FT_WA-NETPR.
APPEND FTY_WA TO FTY_ITAB.
CLEAR FTY_WA.
ENDAT.Abhi,
i tried as you said values are being diplayed,but they are not gettin totaled,i want the sum of values at the end of line item,I need to pass these valuse to alv.
here is the complete code.Please tell me how should I proceed.
TABLES:EKKO,EKPO,LFA1.
TYPE-POOLS:SLIS.
DATA:HEADER TYPE SLIS_T_FIELDCAT_ALV,
WA TYPE SLIS_FIELDCAT_ALV,
LAYOUT TYPE SLIS_LAYOUT_ALV.
TYPES:BEGIN OF PH_TY,
PH_EBELN LIKE EKKO-EBELN,
PH_AEDAT LIKE EKKO-AEDAT,
PH_LIFNR LIKE EKKO-LIFNR,
PH_ZTERM LIKE EKKO-ZTERM,
PH_EKORG LIKE EKKO-EKORG,
PH_WAERS LIKE EKKO-WAERS,
PH_SUBMI LIKE EKKO-SUBMI,
PH_INCO1 LIKE EKKO-INCO1,
PO_EBELN LIKE EKPO-EBELN,
PO_EBELP LIKE EKPO-EBELP,
PO_BRTWR LIKE EKPO-BRTWR,
PO_KTMNG LIKE EKPO-KTMNG,
PO_NETPR LIKE EKPO-NETPR,
END OF PH_TY.
TYPES:BEGIN OF PO_TY,
PO_EBELN LIKE EKPO-EBELN,
PO_EBELP LIKE EKPO-EBELP,
PO_BRTWR LIKE EKPO-BRTWR,
PO_KTMNG LIKE EKPO-KTMNG,
PO_NETPR LIKE EKPO-NETPR,
END OF PO_TY.
TYPES:BEGIN OF VO_TY,
VO_LIFNR LIKE LFA1-LIFNR,
VO_NAME1 LIKE LFA1-LIFNR,
END OF VO_TY.
TYPES:BEGIN OF FI_TY,
EBELN LIKE EKKO-EBELN,
AEDAT LIKE EKKO-AEDAT,
LIFNR LIKE EKKO-LIFNR,
ZTERM LIKE EKKO-ZTERM,
EKORG LIKE EKKO-EKORG,
WAERS LIKE EKKO-WAERS,
SUBMI LIKE EKKO-SUBMI,
INCO1 LIKE EKKO-INCO1,
EBELN_I LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
NAME1 LIKE LFA1-LIFNR,
BRTWR LIKE EKPO-EBELN,
KTMNG LIKE EKPO-EBELN,
NETPR LIKE EKPO-EBELN,
LIFNR1 LIKE LFA1-LIFNR,
END OF FI_TY.
TYPES:BEGIN OF FT_TY,
EBELN LIKE EKKO-EBELN,
ZTERM LIKE EKKO-ZTERM,
WAERS LIKE EKKO-WAERS,
SUBMI LIKE EKKO-SUBMI,
INCO1 LIKE EKKO-INCO1,
EBELP LIKE EKPO-EBELP,
NAME1 LIKE LFA1-LIFNR,
BRTWR LIKE EKPO-EBELN,
KTMNG LIKE EKPO-EBELN,
NETPR LIKE EKPO-EBELN,
END OF FT_TY.
DATA: PH_ITAB TYPE STANDARD TABLE OF PH_TY,
PO_ITAB TYPE STANDARD TABLE OF PO_TY,
VO_ITAB TYPE STANDARD TABLE OF VO_TY,
FI_ITAB TYPE STANDARD TABLE OF FI_TY,
FT_ITAB TYPE STANDARD TABLE OF FT_TY,
FTY_ITAB TYPE STANDARD TABLE OF FT_TY,
FTY1_ITAB TYPE STANDARD TABLE OF FT_TY.
DATA:PH_WA LIKE LINE OF PH_ITAB,
PO_WA LIKE LINE OF PO_ITAB,
VO_WA LIKE LINE OF VO_ITAB,
FI_WA LIKE LINE OF FI_ITAB,
FT_WA LIKE LINE OF FT_ITAB,
FT_WA1 LIKE LINE OF FT_ITAB,
FTY_WA LIKE LINE OF FT_ITAB,
FTY1_WA LIKE LINE OF FT_ITAB.
SELECT A~EBELN
A~AEDAT
A~LIFNR
A~ZTERM
A~EKORG
A~WAERS
A~SUBMI
A~INCO1
B~EBELN
B~EBELP
B~BRTWR
B~KTMNG
B~NETPR
INTO TABLE PH_ITAB FROM EKKO AS A
INNER JOIN EKPO AS B
ON AEBELN = BEBELN
UP TO 25 ROWS.
CHECK PH_ITAB[] IS NOT INITIAL.
SELECT LIFNR
NAME1
FROM LFA1 INTO TABLE VO_ITAB
FOR ALL ENTRIES IN PH_ITAB
WHERE LIFNR = PH_ITAB-PH_LIFNR.
CHECK VO_ITAB[] IS NOT INITIAL.
SORT PH_ITAB BY PH_EBELN.
SORT VO_ITAB BY VO_LIFNR.
LOOP AT PH_ITAB INTO PH_WA.
FI_WA-SUBMI = PH_WA-PH_SUBMI.
FI_WA-EBELN = PH_WA-PH_EBELN.
FI_WA-ZTERM = PH_WA-PH_ZTERM.
FI_WA-INCO1 = PH_WA-PH_INCO1.
FI_WA-WAERS = PH_WA-PH_WAERS.
FI_WA-EBELP = PH_WA-PO_EBELP.
FI_WA-BRTWR = PH_WA-PO_BRTWR.
FI_WA-KTMNG = PH_WA-PO_KTMNG.
FI_WA-NETPR = PH_WA-PO_NETPR.
READ TABLE VO_ITAB INTO VO_WA WITH KEY VO_LIFNR = PH_WA-PH_LIFNR BINARY SEARCH.
FI_WA-NAME1 = VO_WA-VO_NAME1.
APPEND FI_WA TO FI_ITAB.
CLEAR FI_WA.
ENDLOOP.
LOOP AT FI_ITAB INTO FI_WA.
FT_WA-EBELN = FI_WA-EBELN.
FT_WA-EBELP = FI_WA-EBELP.
FT_WA-NAME1 = FI_WA-NAME1.
FT_WA-ZTERM = FI_WA-ZTERM.
FT_WA-INCO1 = FI_WA-INCO1.
FT_WA-WAERS = FI_WA-WAERS.
FT_WA-SUBMI = FI_WA-SUBMI.
FT_WA-BRTWR = FI_WA-BRTWR.
FT_WA-KTMNG = FI_WA-KTMNG.
FT_WA-NETPR = FI_WA-NETPR.
APPEND FT_WA TO FT_ITAB.
CLEAR FT_WA.
ENDLOOP.
LOOP AT FT_ITAB INTO FT_WA.
AT END OF EBELN.
SUM.
FTY_WA-EBELN = FT_WA-EBELN.
FTY_WA-EBELP = FT_WA-EBELP.
FTY_WA-NAME1 = FT_WA-NAME1.
FTY_WA-ZTERM = FT_WA-ZTERM.
FTY_WA-INCO1 = FT_WA-INCO1.
FTY_WA-WAERS = FT_WA-WAERS.
FTY_WA-SUBMI = FT_WA-SUBMI.
FTY_WA-BRTWR = FT_WA-BRTWR + FTY_WA-BRTWR.
FTY_WA-KTMNG = FT_WA-KTMNG + FTY_WA-KTMNG.
FTY_WA-NETPR = FT_WA-NETPR + FTY_WA-KTMNG.
ENDAT.
APPEND FTY_WA TO FTY_ITAB.
CLEAR FTY_WA.
ENDLOOP.
WA-SELTEXT_L = 'ebeln'.
WA-COL_POS = '1'.
WA-FIELDNAME = 'EBELN'.
WA-TABNAME = 'FTY_ITAB'.
WA-OUTPUTLEN = '15'.
APPEND WA TO HEADER.
CLEAR WA.
WA-SELTEXT_L = 'SUBMI'.
WA-COL_POS = '2'.
WA-FIELDNAME = 'SUBMI'.
WA-TABNAME = 'FTY_ITAB'.
WA-OUTPUTLEN = '15'.
APPEND WA TO HEADER.
CLEAR WA.
WA-SELTEXT_L = 'NAME1'.
WA-COL_POS = '3'.
WA-FIELDNAME = 'NAME1'.
WA-TABNAME = 'FTY_ITAB'.
WA-OUTPUTLEN = '15'.
APPEND WA TO HEADER.
CLEAR WA.
WA-SELTEXT_L = 'ZTERM'.
WA-COL_POS = '4'.
WA-FIELDNAME = 'ZTERM'.
WA-TABNAME = 'FTY_ITAB'.
WA-OUTPUTLEN = '15'.
APPEND WA TO HEADER.
CLEAR WA.
WA-SELTEXT_L = 'INCO1'.
WA-COL_POS = '5'.
WA-FIELDNAME = 'INCO1'.
WA-TABNAME = 'FTY_ITAB'.
WA-OUTPUTLEN = '15'.
APPEND WA TO HEADER.
CLEAR WA.
WA-SELTEXT_L = 'WAERS'.
WA-COL_POS = '6'.
WA-FIELDNAME = 'WAERS'.
WA-TABNAME = 'FTY_ITAB'.
WA-OUTPUTLEN = '15'.
APPEND WA TO HEADER.
CLEAR WA.
WA-SELTEXT_L = 'brtwr'.
WA-COL_POS = '7'.
WA-FIELDNAME = 'BRTWR'.
WA-TABNAME = 'FTY_ITAB'.
WA-OUTPUTLEN = '20'.
APPEND WA TO HEADER.
CLEAR WA.
WA-SELTEXT_L = 'netpr'.
WA-COL_POS = '8'.
WA-FIELDNAME = 'NETPR'.
WA-TABNAME = 'FTY_ITAB'.
WA-OUTPUTLEN = '20'.
APPEND WA TO HEADER.
CLEAR WA.
WA-SELTEXT_L = 'ktmng'.
WA-COL_POS = '9'.
WA-FIELDNAME = 'KTMNG'.
WA-TABNAME = 'FTY_ITAB'.
WA-OUTPUTLEN = '20'.
APPEND WA TO HEADER.
CLEAR WA.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IT_FIELDCAT = header[]
TABLES
T_OUTTAB = FTY_ITAB[].
IF SY-SUBRC = 0.
ENDIF. -
ANY SY-INDEX REFLECT CHANGES WHEN CONTROL BREAK STATEMENT PROCESS
Dear Guru's,
I have a requirement where i have to move the values to variable when control break (AT END OF) process. So i want to move the values according to the end of Vendor so for that i want to know is there any sy-index available which reflects changes when Control break (AT end of) process.
LIKE Sy-subrc = 0 when select statement fetches record or sy-tabix is like counter for loop.
Hope to get reply soon.
Regards,
Himanshu RangappaHi,
There is no system Fields for it.
But your requirement can be done with 'AT NEW' and 'AT END' statement.
Refer this sample example,
loop at otab.
at new module.
move otab-module to otab2-module.
ENDAT.
at END OF effort.
sum. "Do your calculations here
move otab-count to otab2-count.
append otab2.
endat.
endloop. -
Doubts with control break statements on internal table loops (AT/ENDAT)
Hi, i've had a couple of doubts for a long while which I hope someone can clarify today:
1) I know how to use the AT statements, however, i'm not sure I get correctly what this part of help regarding this commands means:
<i>"The control level structure with internal tables is static. It corresponds exactly to the sequence of columns in the internal table (from left to right). In this context, the criteria according to which you sort the internal table are unimportant."</i>
I've always sorted the internal table before the control break and it works that way. For example:
SORT ITAB BY EBELN EBELP.
LOOP AT ITAB.
AT NEW EBELN.
* Code for the order header
ENDAT.
ENDLOOP.
If I <b>don't</b> sort the internal table, it doesn't work! (i get dupplicated processing). In the example, if i have more than one register with the same EBELN and they're not consecutive, the header gets processed twice. I really don't get that part of the help text.
2) I know this: <i>"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 character type 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."</i>
My doubt is: WHY is that this way? Because sometimes (most times) I need those fields INSIDE the statement! So when that happened i've solved it in one of three ways:
LOOP AT ITAB INTO WA_ITAB.
WA_ITAB_AUX = WA_ITAB.
AT NEW FIELD.
WA_ITAB = WA_ITAB_AUX.
* ...Rest of the code for the first register
ENDAT.
ENDLOOP.
LOOP AT ITAB INTO WA_ITAB.
AT NEW FIELD.
READ TABLE ITAB INDEX SY-TABIX INTO WA_ITAB.
* ...Rest of the code for the first register
ENDAT.
ENDLOOP.
* (Without AT)
LOOP AT ITAB INTO WA_ITAB.
IF WA_ITAB-FIELD <> FIELD_AUX.
FIELD_AUX = WA_ITAB_FIELD.
* ...Rest of the code for the first register
ENDIF.
ENDLOOP.
Is there any problem with this way of coding? Can be done better?
Thank you very much in advance.Hi..,
1)
See if u sort the table on a field on which u r using AT ENDAT .. then all the records which are having the same value for that field will form a group or those reocrds will be at one place.. so when u sort the table for all the records AT ENDAT will get executed onli once..
If u dont sort this table on this field then all these records will be at different places and in between there may be records with different value for this field.. so this AT ENDAT will get executed for each record !!
2)
No u cannot use the Right hand fields of the field in the table .. Because these AT events work as Group based operations... So till that field on which AT ENDAT is working it breaks that record into two groups.. One is the left hand fields including that field.. and right hand fields as another group.. and makes the right hand group as stars ****. Thats y u can observe that even any one field in the left hand group changes the AT ENDAT will get executed !!!!
Hope u understood !!!
regards,
sai ramesh -
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 problemHello,
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 -
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
KRHi 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. -
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.???????
ThanksI 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 -
Interactive report with control break displays no data, until control break is unchecked
Hello,
I have an interactive report that is base upon a collection. When one first access the page the report shows no data(no errors are given) and the control break box is red. Once the control break box is unchecked, all the data is shown. Furthermore, navigating to another page causes the same issue.
Any idea into how I can solve this issue will be appreciated.
Thank you,
Apex 4.2
Oracle 11g 2.0.3
Apache Tomcat
GuyenkoVincent,
The aggregates are applied to each control break group, or, if you don't have any, then they're applied to the full report. So, in your case the "count" (= count of non-null values for a column, same as in SQL) should mean there is 1 non-null value in each group.
Does that description match what you're seeing?
- Marco -
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,
DeepakDeepakJ 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 -
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 AMWelcome 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... -
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 PMHi 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 -
At new control break statement
hi all,
I have a requirement where I have to display records for non duplicate matnr.
I have used this control break statement and got
stars for all other fields except matn in the outputr.
code: at new matnr.
write: /10 sy-vline , wa_mara-matnr COLOR 5,
30 sy-vline , wa_mara-ersda COLOR 5 ,
50 sy-vline , wa_mara-ernam COLOR 5 ,
70 sy-vline , wa_mara-laeda COLOR 5 ,
90 sy-vline , wa_mara-mtart COLOR 5 ,
110 sy-vline , wa_mara-matkl COLOR 5 ,
130 sy-vline , wa_mara-meins COLOR 5 ,
150 sy-vline.
ENDAT.
plese do send me solution for this.
with regards,
ASHA.FAQ. This has been discussed many times in the forum. Please search.
Maybe you are looking for
-
I am working with 6 channels, from each of which I am obtaining voltage values ranging from 0.6-6 V. I am using the DAQ Assistant to acquire and write the data to a text file. However, I only want the data to be written to the text file when the di
-
All website went "HTTP Error 404. The requested resource is not found."
''dupe of https://support.mozilla.org/en-US/questions/928117'' all website went "HTTP Error 404. The requested resource is not found." this only happen in firefox (i'm using IE to post this question)
-
Not sure what to do. finally decided to upgrate software on my phone. installed itunes on my new laptop. plugged by phone in and started process. nearing the end i received an error message stating that the phone "could not be updated due to unkno
-
Over 24 hrs to perform a 10 gig back up?
Fios for the most part has worked well for me until lately....I have a BIG issue with the proported speed that I'm supposed to be getting 20 down and 5 up. If that is the case, please tell me why it has taken me WELL OVER 24 HRS to perform a 10 gig b
-
1. Is there a way to rotate the net names and/or bus names to follow the wire if it runs vertically? The command shift/R does not work. (Version 10.1 Power Pro). 2. Can the names be placed off grid? There is no reason to snap a name to the grid. Ther