‎2007 Dec 05 5:09 AM
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.
‎2007 Dec 05 5:14 AM
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
‎2007 Dec 05 5:15 AM
Hi,
You can display your report using FM REUSE_ALV_BLOCK_LIST_DISPLAY. For this first you need to append your internal table(which is having set of lgtyp's) using FM 'REUSE_ALV_BLOCK_LIST_APPEND'. Then after you need to call FM 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
Cheers,
Bujji
‎2007 Dec 05 5:16 AM
U can append the field LGTYP into the it_sort table of REUSE_ALV_GRID_DISPLAY function module and export it to the ALV.
Reward points if useful.
‎2007 Dec 05 5:22 AM
‎2007 Dec 05 5:27 AM
HI,
Then you have a chance to display your report by sorting field LGTYP. or you have a chance to display different tables in different tabs.
Cheers,
Bujji