Total Text Display at the end of the ALV
Hi,
I want to display the text 'TOTAL' in my ALV at the end of my report.I am pasting my code, So please any one help me in this issue.
*& Report ZFIR0011_O2C_TAX_GL_SUMMARY
REPORT zfir0011_o2c_tax_gl_summary.
TYPE-POOLS slis.
TABLES: faglflexa.
Column positions to pass to field catalog
CONSTANTS : c_pos_1 TYPE sy-cucol VALUE '1', " position of the columns
c_pos_2 TYPE sy-cucol VALUE '2',
c_pos_3 TYPE sy-cucol VALUE '3',
c_pos_4 TYPE sy-cucol VALUE '4',
c_pos_5 TYPE sy-cucol VALUE '5'.
*Field names for Field Catalog
CONSTANTS : c_h TYPE c VALUE 'H',
c_s TYPE c VALUE 'S',
c_slash TYPE c VALUE '/',
c_colon TYPE c VALUE ':',
c_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE',
c_top_of_page_split TYPE slis_formname VALUE 'TOP_OF_PAGE_SPLIT',
c_txjcd TYPE slis_fieldname VALUE 'TXJCD', "Tax Jurisdiction
c_region TYPE slis_fieldname VALUE 'STATE', "State
c_currb TYPE slis_fieldname VALUE 'CURR_BAL', "Current Balance
c_perch TYPE slis_fieldname VALUE 'PER_CHNG', "Period Change
c_prbal TYPE slis_fieldname VALUE 'PRI_BALA', "Prior Balance
c_total TYPE slis_fieldname VALUE 'TOTAL'. "Total
CONSTANTS : c_table_name TYPE slis_tabname VALUE 'IT_FINAL', "For Field Catalog
c_spras TYPE spras VALUE 'E', "Language
c_buzei TYPE c VALUE '1',
c_zp TYPE bset-mwskz VALUE 'ZP',
c_zr TYPE bset-mwskz VALUE 'ZR'.
Types Declaration.
TYPES: BEGIN OF ty_faglflexa,
ryear TYPE gjahr,
bukrs TYPE bukrs,
belnr TYPE belnr_d, "Document Number
poper TYPE poper, "Posting Period
budat TYPE budat, "Posting Date
buzei TYPE buzei, "Document line item
racct TYPE racct, "G/L Account no.
END OF ty_faglflexa,
ty_t_faglflexa TYPE STANDARD TABLE OF ty_faglflexa.
TYPES: BEGIN OF ty_bset,
belnr TYPE belnr_d,
buzei TYPE buzei,
mwskz TYPE mwskz, "Tax code
hkont TYPE hkont,
shkzg TYPE shkzg, "Debit/Credit Indicator
txjcd TYPE txjcd, "Tax Jurisdiction
h2ste TYPE h2ste, "Tax Amount
h2bas TYPE h2bas_bses, "Tax Amount
END OF ty_bset,
ty_t_bset TYPE STANDARD TABLE OF ty_bset.
TYPES: BEGIN OF ty_skat,
spras TYPE spras,
ktopl TYPE ktopl,
saknr TYPE saknr,
text TYPE txt20_skat,
END OF ty_skat,
ty_t_skat TYPE STANDARD TABLE OF ty_skat.
TYPES: BEGIN OF ty_custom,
geo_state TYPE char2,
geo_county TYPE char3,
country TYPE char2,
description TYPE char40,
END OF ty_custom,
ty_t_custom TYPE STANDARD TABLE OF ty_custom.
TYPES : BEGIN OF ty_budat,
sign TYPE char_01,
option TYPE char2,
low TYPE budat,
high TYPE budat,
END OF ty_budat,
ty_t_budat TYPE STANDARD TABLE OF ty_budat.
TYPES: BEGIN OF ty_txjcd,
geo_state TYPE char2,
geo_county TYPE char3,
END OF ty_txjcd,
ty_t_txjcd TYPE STANDARD TABLE OF ty_txjcd.
TYPES: BEGIN OF ty_inter,
ryear TYPE gjahr,
bukrs TYPE bukrs,
txjcd TYPE txjcd, "Tax Jurisdiction
racct TYPE racct, "G/L Account no.
h2ste TYPE h2ste, "Tax Amount
poper TYPE poper, "Posting Period
belnr TYPE belnr_d, "Document Number
shkzg TYPE shkzg, "Debit/Credit Indicator
END OF ty_inter,
ty_t_inter TYPE STANDARD TABLE OF ty_inter.
TYPES: BEGIN OF ty_final,
txjcd TYPE bset-txjcd, "Tax Jurisdiction
state TYPE char40, "State
curr_bal TYPE bset-h2ste, "Current Balance
per_chng TYPE bset-h2ste, "Period Change
pri_bala TYPE bset-h2ste, "Prior Balance
END OF ty_final,
ty_t_final TYPE STANDARD TABLE OF ty_final.
Internal Tables Declaration.
DATA : it_faglflexa TYPE ty_t_faglflexa,
it_bset TYPE ty_t_bset,
it_skat TYPE ty_t_skat,
it_custom TYPE ty_t_custom,
it_txjcd TYPE ty_t_txjcd,
it_inter TYPE ty_t_inter. "Intermediate table for storing data
DATA : it_final TYPE ty_t_final. "#EC NEEDED
*Fieldcatalogue Internal Table Declaration
DATA : it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv,
it_alv_top_of_page TYPE slis_t_listheader,
gs_line TYPE slis_listheader.
*Field-symbols and Work Area Declarations
FIELD-SYMBOLS : <fs_faglflexa> TYPE ty_faglflexa,
<fs_bset> TYPE ty_bset,
<fs_inter> TYPE ty_inter.
DATA : wa_faglflexa TYPE ty_faglflexa, "#EC NEEDED
wa_bset TYPE ty_bset,
wa_skat TYPE ty_skat,
wa_custom TYPE ty_custom,
wa_txjcd TYPE ty_txjcd,
wa_inter TYPE ty_inter,
wa_final TYPE ty_final. " #EC NEEDED
Variables Declaration.
DATA : v_current_year TYPE i,
v_poper TYPE poper,
v_saknr TYPE saknr, "#EC NEEDED
v_ktopl TYPE ktopl,
v_konts TYPE saknr,
v_bukrs TYPE bukrs,
v_buzei(2) TYPE n VALUE '0',
v_sum_val TYPE h2ste,
v_sum_val1 TYPE h2ste,
v_sum_val2 TYPE h2ste,
v_h2ste TYPE string,
v_desc TYPE char40,
v_title TYPE char40,
v_start_date TYPE char10. "Temp Added
SELECTION-SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_bukrs TYPE faglflexa-rbukrs OBLIGATORY, " Company Code
p_gjahr TYPE faglflexa-gjahr OBLIGATORY. " Fiscal Year
SELECT-OPTIONS: s_budat FOR faglflexa-budat OBLIGATORY
NO-EXTENSION
NO INTERVALS.
PARAMETERS: p_racct TYPE faglflexa-racct OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN VALIDATIONS.
*Company Code Validation.
AT SELECTION-SCREEN ON p_bukrs.
SELECT SINGLE bukrs INTO v_bukrs
FROM t001
WHERE bukrs = p_bukrs.
IF sy-subrc NE 0.
MESSAGE text-002 TYPE 'E'.
ENDIF.
Fiscal Year Validation. It should not be more than Current.
AT SELECTION-SCREEN ON p_gjahr.
v_current_year = sy-datum+0(4).
IF p_gjahr > v_current_year.
MESSAGE text-003 TYPE 'E'.
ENDIF.
*G/L Account Validation.
AT SELECTION-SCREEN ON p_racct.
SELECT SINGLE saknr INTO v_saknr
FROM skb1
WHERE saknr EQ p_racct
AND bukrs EQ p_bukrs.
IF sy-subrc EQ 0.
SELECT SINGLE ktopl FROM t001
INTO v_ktopl
WHERE bukrs = p_bukrs.
SELECT SINGLE konts FROM t030k
INTO v_konts
WHERE ktopl = v_ktopl
AND konts = v_saknr.
IF sy-subrc NE 0.
MESSAGE text-004 TYPE 'E'.
ENDIF.
ELSE.
MESSAGE text-004 TYPE 'E'.
ENDIF.
START-OF-SELECTION.
PERFORM get_data USING p_bukrs
p_gjahr
s_budat[]
p_racct CHANGING it_final.
*Display report in ALV grid
IF it_final IS NOT INITIAL.
*Build Top of the page table.
PERFORM comment_build USING it_skat CHANGING it_alv_top_of_page.
*Build Field catalog table for ALV
PERFORM build_field_catalog CHANGING it_fieldcat.
*Display report
PERFORM display_alv USING it_final.
ELSE.
*No data found for the selection criteria/period.
MESSAGE text-018 TYPE 'I'.
ENDIF.
*& Form GET_DATA
text
-->P_P_BUKRS text
-->P_P_GJAHR text
-->P_P_BUDAT text
-->P_P_RACCT text
<--P_IT_FINAL text
FORM get_data USING fp_bukrs TYPE bukrs
fp_gjahr TYPE gjahr
fp_budat TYPE ty_t_budat
fp_racct TYPE racct
CHANGING fp_it_final TYPE ty_t_final.
DATA : v_date(2) TYPE c VALUE '01',
v_month(2) TYPE c VALUE '01',
v_start_date TYPE datum.
*concatenate p_gjahr v_month v_date into v_start_date. " separated by c_slash.
SELECT ryear
rbukrs
belnr "Document Number
poper "Posting Period
budat "Posting Date
buzei "Document line item
racct "G/L Account no.
INTO TABLE it_faglflexa
FROM faglflexa
WHERE rbukrs EQ p_bukrs
AND gjahr EQ p_gjahr
AND budat LE s_budat
AND racct EQ p_racct.
*selecting the Tax Jurisdiction, Tax amount from BSET
IF it_faglflexa IS NOT INITIAL.
SELECT belnr
buzei
mwskz
"hkont
shkzg "Debit/Credit Indicator
txjcd "Tax Jurisdicaiton
h2ste "Tax Amount
h2bas "Tax Amount1
INTO TABLE it_bset
FROM bset
FOR ALL ENTRIES IN it_faglflexa
WHERE belnr EQ it_faglflexa-belnr
AND gjahr EQ p_gjahr "it_faglflexa-ryear
AND buzei EQ c_buzei. "Line item
ENDIF.
IF sy-subrc EQ 0.
SORT it_bset BY txjcd ASCENDING.
ENDIF.
*Selecting the G/L Account Long Text from SKAT
IF it_faglflexa IS NOT INITIAL.
SELECT spras " Language key
ktopl " Chart of Accounts
saknr " G/L Account Number
txt20 " G/L Account Long Text
INTO TABLE it_skat
FROM skat
FOR ALL ENTRIES IN it_faglflexa
WHERE spras = c_spras
AND saknr = it_faglflexa-racct.
ENDIF.
*Selecting the Description from Custom table
LOOP AT it_bset ASSIGNING <fs_bset>.
wa_txjcd-geo_state = <fs_bset>-txjcd+0(2).
wa_txjcd-geo_county = <fs_bset>-txjcd+2(3).
APPEND wa_txjcd TO it_txjcd.
CLEAR wa_txjcd.
ENDLOOP.
IF it_txjcd IS NOT INITIAL.
SELECT geo_state
geo_county
country
description
INTO TABLE it_custom
FROM ztfi_tgl_summary
FOR ALL ENTRIES IN it_txjcd
WHERE geo_state = it_txjcd-geo_state
AND geo_county = it_txjcd-geo_county.
ENDIF.
LOOP AT it_faglflexa ASSIGNING <fs_faglflexa>.
MOVE-CORRESPONDING <fs_faglflexa> TO wa_inter. "#EC ENHOK
*Read Tax Jurisdiction and Tax Amount from BSET Table.
READ TABLE it_bset INTO wa_bset WITH KEY belnr = <fs_faglflexa>-belnr.
IF sy-subrc EQ 0.
wa_inter-shkzg = wa_bset-shkzg.
wa_inter-txjcd = wa_bset-txjcd.
ENDIF.
*If BSET-MWSKZ = ZP or ZR then pick H2BAS as Tax Amount.
IF wa_bset-mwskz = c_zp.
wa_inter-h2ste = wa_bset-h2bas.
ELSEIF wa_bset-mwskz = c_zr.
wa_inter-h2ste = wa_bset-h2bas.
ELSE.
wa_inter-h2ste = wa_bset-h2ste.
ENDIF.
*Check it is credit entry or debit entry ('H' or 'S').
IF wa_inter-shkzg EQ 'H'.
wa_inter-h2ste = wa_inter-h2ste * -1.
ENDIF.
APPEND wa_inter TO it_inter.
CLEAR: wa_inter, wa_bset.
ENDLOOP.
IF sy-subrc EQ 0.
SORT it_inter BY bukrs ryear txjcd ASCENDING.
DELETE it_inter WHERE txjcd EQ space.
ENDIF.
v_poper = s_budat-low+4(2).
LOOP AT it_inter INTO wa_inter.
*Read the Text maintained in the custom table based on the GEO_STATE = First two digits of TXJCD
*and GEO_COUNTY = Next three digits of TXJCD. If this is blank pick based on First two digits of TXJCD.
READ TABLE it_custom INTO wa_custom WITH KEY geo_state = wa_bset-txjcd+0(2)
geo_county = wa_bset-txjcd+2(3).
IF sy-subrc NE 0.
READ TABLE it_custom INTO wa_custom WITH KEY geo_state = wa_bset-txjcd+0(2).
ENDIF.
IF sy-subrc = 0.
wa_final-state = wa_custom-description.
ENDIF.
AT NEW txjcd.
CLEAR: v_sum_val, v_sum_val1, v_sum_val2.
ENDAT.
Period Change
IF wa_inter-poper EQ v_poper.
v_sum_val1 = v_sum_val1 + wa_inter-h2ste.
ENDIF.
Prior Balance
IF wa_inter-poper LT v_poper.
v_sum_val2 = v_sum_val2 + wa_inter-h2ste.
ENDIF.
AT END OF txjcd.
wa_final-txjcd = wa_inter-txjcd.
wa_final-per_chng = v_sum_val1. "Period change
wa_final-pri_bala = v_sum_val2. "Prior Balance
wa_final-curr_bal = v_sum_val1 + v_sum_val2. "Current Balance
APPEND wa_final TO it_final.
CLEAR wa_final.
ENDAT.
ENDLOOP.
ENDFORM. " GET_DATA
*& Form COMMENT_BUILD
text
-->P_IT_SKAT text
<--P_IT_ALV_TOP_OF_PAGE text
FORM comment_build USING fp_it_skat TYPE ty_t_skat
CHANGING fp_it_alv_top_of_page TYPE slis_t_listheader.
DATA: v_budat_low TYPE c LENGTH 10,
v_budat_high TYPE c LENGTH 10,
v_butxt TYPE butxt.
CLEAR gs_line.
*Report Title
CONCATENATE text-005 p_bukrs INTO v_title SEPARATED BY space.
gs_line-typ = c_h.
gs_line-key = ' '.
gs_line-info = v_title.
APPEND gs_line TO fp_it_alv_top_of_page.
CLEAR gs_line.
*Account Number
gs_line-typ = c_s.
gs_line-key = text-006.
gs_line-info = p_racct.
APPEND gs_line TO fp_it_alv_top_of_page.
CLEAR gs_line.
*G/L Account Description
READ TABLE it_skat INTO wa_skat WITH KEY ktopl = v_ktopl.
IF sy-subrc EQ 0.
v_desc = wa_skat-text.
ENDIF.
gs_line-typ = c_s.
gs_line-key = text-007.
gs_line-info = v_desc.
APPEND gs_line TO fp_it_alv_top_of_page.
CLEAR gs_line.
*Fiscal Year from selection
IF NOT p_gjahr IS INITIAL.
gs_line-info = p_gjahr.
gs_line-typ = c_s.
gs_line-key = text-008. "Fiscal Year
APPEND gs_line TO fp_it_alv_top_of_page.
CLEAR gs_line.
ENDIF.
*Posting Date
CONCATENATE s_budat-low4(2) s_budat-low6(2) s_budat-low+0(4) INTO gs_line-info SEPARATED BY c_slash.
gs_line-typ = c_s.
gs_line-key = text-009. "Posting Date
APPEND gs_line TO fp_it_alv_top_of_page.
CLEAR gs_line.
*Company Code Description from selection
IF NOT p_bukrs IS INITIAL.
SELECT SINGLE butxt FROM t001
INTO v_butxt WHERE bukrs EQ p_bukrs.
gs_line-info = v_butxt.
gs_line-typ = c_s.
gs_line-key = text-010. "Company Code Description
APPEND gs_line TO fp_it_alv_top_of_page.
CLEAR gs_line.
ENDIF.
Printed Date
gs_line-typ = c_s.
gs_line-key = text-011. "Printed Date
CONCATENATE sy-datum+4(2)
sy-datum+6(2)
sy-datum(4) INTO gs_line-info SEPARATED BY c_slash. "todays date
APPEND gs_line TO fp_it_alv_top_of_page.
CLEAR: gs_line.
Printing Time
gs_line-typ = c_s.
gs_line-key = text-012. "Printing Time
gs_line-info = sy-uzeit.
CONCATENATE sy-uzeit(2)
sy-uzeit+2(2)
sy-uzeit+4(2) INTO gs_line-info SEPARATED BY c_colon. "current time
APPEND gs_line TO fp_it_alv_top_of_page.
CLEAR: gs_line.
ENDFORM. " COMMENT_BUILD
*& Form BUILD_FIELD_CATALOG
text
<--P_IT_FIELDCAT text
FORM build_field_catalog CHANGING fp_it_fieldcat TYPE slis_t_fieldcat_alv.
TAX JURISDICTION
wa_fieldcat-col_pos = c_pos_1.
wa_fieldcat-reptext_ddic = text-013. "TAX JURISDICTION
wa_fieldcat-fieldname = c_txjcd.
wa_fieldcat-tabname = c_table_name.
wa_fieldcat-outputlen = '15'.
APPEND wa_fieldcat TO fp_it_fieldcat.
CLEAR : wa_fieldcat.
STATE
wa_fieldcat-col_pos = c_pos_2.
wa_fieldcat-reptext_ddic = text-014. "STATE
wa_fieldcat-fieldname = c_region.
wa_fieldcat-tabname = c_table_name.
wa_fieldcat-outputlen = '40'.
APPEND wa_fieldcat TO fp_it_fieldcat.
CLEAR : wa_fieldcat.
CURRENT BALANCE
wa_fieldcat-col_pos = c_pos_3.
wa_fieldcat-reptext_ddic = text-015. "CURRENT BALANCE
wa_fieldcat-fieldname = c_currb.
wa_fieldcat-tabname = c_table_name.
wa_fieldcat-do_sum = 'X'.
wa_fieldcat-datatype = 'CURR'.
wa_fieldcat-outputlen = '17'.
APPEND wa_fieldcat TO fp_it_fieldcat.
CLEAR : wa_fieldcat.
PERIOD CHANGE
wa_fieldcat-col_pos = c_pos_4.
wa_fieldcat-reptext_ddic = text-016. "PERIOD CHANGE
wa_fieldcat-fieldname = c_perch.
wa_fieldcat-tabname = c_table_name.
wa_fieldcat-do_sum = 'X'.
wa_fieldcat-datatype = 'CURR'.
wa_fieldcat-outputlen = '17'.
APPEND wa_fieldcat TO fp_it_fieldcat.
CLEAR : wa_fieldcat.
PRIOR BALANCE
wa_fieldcat-col_pos = c_pos_5.
wa_fieldcat-reptext_ddic = text-017. "PRIOR BALANCE
wa_fieldcat-fieldname = c_prbal.
wa_fieldcat-tabname = c_table_name.
wa_fieldcat-do_sum = 'X'.
wa_fieldcat-datatype = 'CURR'.
wa_fieldcat-outputlen = '17'.
APPEND wa_fieldcat TO fp_it_fieldcat.
CLEAR : wa_fieldcat.
ENDFORM. " BUILD_FIELD_CATALOG
*& Form DISPLAY_ALV
text
-->P_IT_FINAL text
FORM display_alv USING fp_it_final TYPE ty_t_final.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
i_callback_top_of_page = c_top_of_page
i_callback_html_top_of_page = c_top_of_page_split
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
it_fieldcat = it_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
i_save = 'A'
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = fp_it_final
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM. " DISPLAY_ALV
*& Form top_of_page
Top of the page for ALV
FORM top_of_page. "#EC CALLED
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_alv_top_of_page
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. "top_of_page
*& Form top_of_page_split
text
FORM top_of_page_split USING r_top TYPE REF TO cl_dd_document."#EC *
TYPES: BEGIN OF ty_text,
text TYPE sdydo_text_element,
END OF ty_text.
TYPES: BEGIN OF ty_text1, "AAAAAAAA
text1 TYPE sdydo_text_element,
END OF ty_text1.
DATA: s_tab TYPE sdydo_text_table,
c_area TYPE REF TO cl_dd_area,
text TYPE sdydo_text_element,
c_area1 TYPE REF TO cl_dd_area, "AAAAAAA
text1 TYPE sdydo_text_element,
s_tab1 TYPE sdydo_text_table.
DATA: it_text TYPE TABLE OF ty_text,
wa_text TYPE ty_text.
DATA: it_text1 TYPE TABLE OF ty_text1,
wa_text1 TYPE ty_text1.
DATA: v_title TYPE string,
v_accts_desc TYPE string,
v_year TYPE string,
v_comp_code TYPE string,
v_desc TYPE char40,
v_budat TYPE char10,
v_budat1 TYPE char10,
v_butxt TYPE butxt,
v_time TYPE char10,
v_comma TYPE c VALUE ','.
CALL METHOD r_top->initialize_document.
CALL METHOD r_top->vertical_split
EXPORTING
split_area = r_top
split_width = '31%'
IMPORTING
right_area = c_area.
IF sy-subrc EQ 0.
*MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*G/L Account Description
READ TABLE it_skat INTO wa_skat WITH KEY ktopl = v_ktopl.
IF sy-subrc EQ 0.
v_desc = wa_skat-text.
ENDIF.
*Company code Description
IF NOT p_bukrs IS INITIAL.
SELECT SINGLE butxt FROM t001
INTO v_butxt WHERE bukrs EQ p_bukrs.
ENDIF.
CONCATENATE text-005 p_bukrs INTO v_title SEPARATED BY space.
wa_text1-text1 = v_title.
APPEND wa_text1 TO it_text1.
s_tab1 = it_text1.
CALL METHOD c_area->add_text
EXPORTING
text_table = s_tab1
fix_lines = 'X'
sap_fontsize = cl_dd_document=>large
sap_emphasis = cl_dd_document=>strong. "AAAAAA
CONCATENATE text-006 p_racct v_comma text-007 v_desc INTO v_accts_desc SEPARATED BY space.
CONCATENATE s_budat-low4(2) s_budat-low6(2) s_budat-low+0(4) INTO v_budat SEPARATED BY c_slash.
CONCATENATE text-008 p_gjahr v_comma text-009 v_budat INTO v_year SEPARATED BY space.
CONCATENATE text-010 v_butxt INTO v_comp_code SEPARATED BY space.
wa_text-text = v_title.
APPEND wa_text TO it_text.
wa_text-text = v_accts_desc.
APPEND wa_text TO it_text.
wa_text-text = v_year.
APPEND wa_text TO it_text.
wa_text-text = v_comp_code.
APPEND wa_text TO it_text.
s_tab = it_text.
CALL METHOD c_area->add_text
EXPORTING
text_table = s_tab
fix_lines = 'X'
sap_fontsize = cl_dd_document=>medium
sap_emphasis = cl_dd_document=>medium.
CALL METHOD r_top->new_line.
CALL METHOD r_top->new_line.
CALL METHOD r_top->new_line.
CALL METHOD r_top->add_gap
EXPORTING
width = 0.
CONCATENATE sy-datum4(2) sy-datum6(2) sy-datum+0(4) INTO v_budat1 SEPARATED BY c_slash.
CALL METHOD r_top->add_text
EXPORTING
text = text-011
sap_emphasis = 'STRONG'.
CALL METHOD r_top->add_gap
EXPORTING
width = 1.
text = v_budat1.
CALL METHOD r_top->add_text
EXPORTING
text = text.
sap_style = 'KEY'.
CALL METHOD r_top->new_line.
CALL METHOD r_top->add_text
EXPORTING
text = text-012
sap_emphasis = 'STRONG'.
CALL METHOD r_top->add_gap
EXPORTING
width = 1.
CONCATENATE sy-uzeit(2)
sy-uzeit+2(2)
sy-uzeit+4(2) INTO v_time SEPARATED BY c_colon. "current time
text = v_time.
CALL METHOD r_top->add_text
EXPORTING
text = text.
sap_style = 'KEY'.
ENDFORM. "top_of_page_split
Thanks & Regards,
Ramana
Hi,
try to declare alv layout and in that
FORM t_layout USING i_layout TYPE slis_layout_alv.
i_layout-colwidth_optimize = 'X'.
i_layout-zebra = 'X'.
p_i_layout-totals_text = 'GRAND TOTAL ='.
p_i_layout-subtotals_text = 'Sub Total'.
p_i_layout-DEF_STATUS = ' '.
p_i_layout-info_fieldname = 'LINE_COLOR'.
ENDFORM. " T_LAYOUT
hope this helps you.
Thanks & Regards,
Y.R.Prem Kumar
Similar Messages
-
How to display the total at the end of the column in the report.
Hi all,
Could any one please intimate, how to display the total at the end of the column. For example, i have a column, "sales" as the Key figure, and it has the data for all the transactions. Now, i would like to display the total at the end of the report, below the same column.
Similarly, for all the other columns in the report, i need to display the total for all the columns in the report.
Thanks & Regards,
A.V.N.RaoHi All,
Thanks for many suggestions. I tried by providing the "Total" under "Calculate Results as" and also "Counter for all detailed values" under "Calcuate Single Values as", in the "Calculations" tab of the key figure, but i am unable to get the information. Again, i am providing the requirement below:
CHAR - A CHAR - B TIME CH. - 1 KF -1 KF- 2 KF - 3
1 RAM 2012 1 50 50
2 SAM 2012 2 100 200
Result 3 150 250
Assume KF -1 as "Qty." KF-2 as "Price" KF-3 as "Sales".
Please intimate the solution.
Thanks & Regards,
A.V.N.Rao. -
How to position the cursor at the end of the text with EDIT_TEXT?
Hello, it wanted to ask to them if somebody could make work the module of function EDIT_TEXT so that it positions the cursor at the end of the text that is visualizing in the text editor. In the documentation it says that passing a ' X' to him in the field scrollend of the parameter Control is obtained that operation. Nevertheless, I did this and the cursor continues appearing at the beginning of the text that visualizes.
Somebody could help me please?
Regards,
Gabriel
PD: The code that I use is the following one:
FORM f_ingresar_comentarios.
DATA: l_action,
l_result LIKE itcer,
l_pedido LIKE thead-tdname,
li_coment_save LIKE i_comentarios OCCURS 0,
li_coment_aux LIKE i_comentarios OCCURS 0 WITH HEADER LINE,
l_lines TYPE i,
l_lines_save TYPE i,
l_lines_insert TYPE i,
l_index TYPE i,
l_index_aux TYPE i,
l_insert,
lwa_control LIKE itced.
CLEAR: l_action.
CLEAR i_comentarios.
REFRESH: i_comentarios,
li_coment_save,
li_coment_aux.
l_pedido = v_pedido.
Leemos el texto si es que existe
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = v_id_text
language = sy-langu
name = l_pedido
object = c_ekko
IMPORTING
header = wa_cabecera
TABLES
lines = i_comentarios "Lineas de texto leídas
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
Armamos la cabecera por primer comentario para el pedido
CLEAR wa_cabecera.
wa_cabecera-tdobject = c_ekko. "Objeto en tabla TTXID
wa_cabecera-tdname = v_pedido. "Nro de pedido
wa_cabecera-tdid = v_id_text. "ID en tabla TTXID
wa_cabecera-tdspras = sy-langu. "Lenguaje
wa_cabecera-tdlinesize = 70.
ENDIF.
Salva comentarios originales
li_coment_save[] = i_comentarios[].
lwa_control-scrollend = c_x. " c_x = 'X'
Abre el editor de texto
CALL FUNCTION 'EDIT_TEXT'
EXPORTING
header = wa_cabecera
save = space
control = lwa_control
IMPORTING
newheader = wa_cabecera
function = l_action
RESULT = l_result
TABLES
lines = i_comentarios
EXCEPTIONS
object = 1
id = 2
language = 3
name = 4
linesize = 5.
Si cambio los comentarios, actualiza comentarios
CASE l_action.
WHEN c_unchanged.
WHEN c_delete.
WHEN c_update OR
c_insert.
Obtiene cantidad de lineas de comentarios originales y modificados
DESCRIBE TABLE li_coment_save LINES l_lines_save.
DESCRIBE TABLE i_comentarios LINES l_lines.
Si se insertaron lineas...
IF l_lines > l_lines_save.
Calcula cantidad de lineas a insertar para luego calcular valor de
indice a partir del cual insertar los nuevos comentarios
l_lines_insert = l_lines - l_lines_save.
l_index = ( l_lines - l_lines_insert ) + 1.
Controla que al menos una de las lineas insertadas sea diferente de
blanco
l_index_aux = l_lines.
l_insert = c_n.
DO l_lines_insert TIMES.
READ TABLE i_comentarios INDEX l_index_aux.
IF sy-subrc = 0 AND
i_comentarios-tdline <> space.
l_insert = c_s.
EXIT.
ENDIF.
l_index_aux = l_index_aux - 1.
ENDDO.
IF l_insert = c_s.
Carga comentarios originales y agrega lineas insertadas
li_coment_aux[] = li_coment_save[].
APPEND LINES OF i_comentarios
FROM l_index
TO l_lines
TO li_coment_aux.
Setea variable para indicar actualizacion de comentarios.
v_comentario = 'S'.
Agrega usuario y fecha del comentario
CONCATENATE sy-uname
sy-datum
INTO li_coment_aux-tdline
SEPARATED BY space.
li_coment_aux-tdformat = '*'.
APPEND li_coment_aux.
Grabamos el texto
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
client = sy-mandt
header = wa_cabecera
savemode_direct = c_x
IMPORTING
newheader = wa_cabecera
TABLES
lines = li_coment_aux
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
ENDIF.
ENDCASE.
ENDFORM. " f_ingresar_comentarios
In addition, I made another program simpler that it uses the same functions and also have the same problem:
*& Report Y_GVA_TEXT *
REPORT y_gva_text .
DATA: wa_cabecera LIKE thead,
i_comentarios LIKE tline OCCURS 0 WITH HEADER LINE.
DATA: l_action,
v_comentario,
l_result LIKE itcer,
v_pedido LIKE thead-tdname VALUE '3',
l_pedido LIKE thead-tdname,
c_a05 LIKE thead-tdid VALUE 'A05',
c_ekko LIKE stxh-tdobject VALUE 'EKKO',
l_lines LIKE sy-tabix,
lwa_control LIKE itced.
CONSTANTS: c_x VALUE 'X',
update VALUE 'U', "Langtext verändert
insert VALUE 'I', "Langtext eingefügt
delete VALUE 'D', "Langtext gelöscht
modify VALUE 'M', "Kein Langtext, Inlinezeile veränd.
unchanged VALUE ' '.
CLEAR: l_action.
CLEAR i_comentarios.
REFRESH i_comentarios.
Leemos el texto si es que existe
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = c_a05
language = sy-langu
name = v_pedido
object = c_ekko
IMPORTING
header = wa_cabecera
TABLES
lines = i_comentarios "Lineas de texto leídas
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
Armamos las cabecera para mostrar los comentarios
CLEAR wa_cabecera.
wa_cabecera-tdobject = c_ekko. "Objeto en tabla TTXID
wa_cabecera-tdname = v_pedido. "Nro de pedido
wa_cabecera-tdid = c_a05. "ID en tabla TTXID
wa_cabecera-tdspras = sy-langu. "Lenguaje
wa_cabecera-tdlinesize = 70.
ENDIF.
lwa_control-noendlines = c_x.
lwa_control-scrollend = c_x.
Abre el editor de texto
CALL FUNCTION 'EDIT_TEXT'
EXPORTING
header = wa_cabecera
save = space
control = lwa_control
IMPORTING
newheader = wa_cabecera
function = l_action
RESULT = l_result
TABLES
lines = i_comentarios
EXCEPTIONS
object = 1
id = 2
language = 3
name = 4
linesize = 5.
Si cambio los comentarios, actualiza comentarios
CASE l_action.
WHEN unchanged.
WHEN delete.
WHEN update OR
insert.
Agrega usuario y fecha del comentario
CONCATENATE sy-uname
sy-datum
INTO i_comentarios-tdline
SEPARATED BY space.
i_comentarios-tdformat = '*'.
APPEND i_comentarios.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
header = wa_cabecera
IMPORTING
newheader = wa_cabecera
TABLES
lines = i_comentarios.
ENDCASE.Murugesh,
I believe that you have mis-read Gabriel's problem.
Gabriel,
The cursor is not positioning at the base of the editor as you have cited.
In order to get this functionality to work, you must set the LINE_EDITOR import paramter to 'X'.
data: hdr like THEAD.
data: l_itced like itced.
hdr-tdobject = 'VBBP'.
hdr-tdname = '4000029521000030'.
hdr-tdid = 'Z005'.
hdr-tdspras = 'E'.
hdr-TDLINESIZE = '100'.
hdr-TDTXTLINES = '3'.
l_itced-SCROLLEND = 'X'.
CALL FUNCTION 'EDIT_TEXT'
EXPORTING
DISPLAY = ' '
EDITOR_TITLE = ' '
HEADER = hdr
PAGE = ' '
WINDOW = ' '
SAVE = 'X'
LINE_EDITOR = 'X' " here !!!
CONTROL = l_itced
PROGRAM = ' '
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER =
RESULT =
TABLES
LINES = lines
EXCEPTIONS
ID = 1
LANGUAGE = 2
LINESIZE = 3
NAME = 4
OBJECT = 5
TEXTFORMAT = 6
COMMUNICATION = 7
OTHERS = 8
Don't forget those points !! -
what does it mean when you receive a text on your iphone 6 from your own number and the message is duplicated on each side (sent/received) and has "verizon message" with a long number at the end of the text, duplicated as well?
Great question stacybrownie! Let's get to the bottom of this so that it's not a cause for concern. When a message is sent to/from your own number, it will display as one sent, one received. This makes it display two messages as you are seeing. Let's clarify the second part of your question. Where do you see "Verizon Message" exactly? What is the long number at the end of the text? When did this start and is it with all text messages or only this instance?
AdaS_VZW
Follow us on Twitter at @VZWSupport -
Printing totals at the end of the main window?
Hi All,
This is Hr related and the data displayed in the main window is regarding the five benefit plans. I need to add the values from each plan. But the number of plans displayed is not constant. The plans for which he is eligible are displayed. So I need to display the totals after completion of the data.
I want to print totals in the main window at the end of the form. The print program is a standard SAP program and it is not to be changed. I had calculated the totals by calling a perform in the script editor. Thats working fine.
But the problem is while displaying it. Is there a solution to print totals at the end of the form without changing the print program or without creating a new element(as it cannot be called from the print program)?
Thanks
SatishSee there are so many element which ends with the ATLAST, like INVEST_AT_LAST.
You need to find out which AT_LAST is triggering in your prorgram. Or, you can use the AT_LAST element of the same family where you put your PERFORM to get the total.
Say if you put your code at BENEFI_AT_EACH_PERSON, you can use the BENEFI_AT_LAST for displaying the TOTAL.
Hope it helps..!
Regards,
Naimesh Patel -
How to calculate the total of a calculated column in a list view at the end of the view?
I have a view with the following columns ProductName, Quantity, Price, Total The total column is a calculated column which is the product of quantity and price. I want to place the sum of the total column by the end of the list view. I can do this with
the price and quantity but not with the total column. how do I do this?You can use SharePoint Designer and calculate the total in xslt view. Refer to the following post for more information
http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2009/04/24/how-to-total-calculated-columns-in-a-sharepoint-list.aspx
http://blog.metrostarsystems.com/2012/12/03/jennys-sharepoint-tip-sum-calculated-columns/
Cheers, -
in numbers, how would I make a line for each family (100+) a column for each fundraiser. and at mid year, and year end be able to print an alphabetical listing?
example: entertainment books Chip Shoppe Yankee Candle
Smith $350 $245 $100
Total at the end of the line, but I could live without. I am just trying to lose the paperwork, and have it in the ipad for when parents approach me at meetings.
Help!HI m,
Using Numbers '09 (the Mac version), I'd use a table with one header row and two header columns.
Family Total Ent.Books Chip S. Y. Candle
Smith, J $695 350 245 100
Jones, T $765 250 445 70
An ascending sort on column A will put the families in alphabetical order (and carry the rest of the row along with them).
The formula =SUM(2) in B2, and filled down from there, keeps the total for each family right beside the family name.
You could add a Footer row at the bottom to keep totals for each column. Formula for column B: =SUM(B)
I would leave the currency signs ($) off the amounts—they just clutter up the table.
This assumes that the features listed are all supported on Numbers for iOS, the version running on your iPad.
Regards,
Barry -
I got a text saying that I don't pay my bill, my service is going to get cut off by the end of the day. I don't have the funds to pay it in full, so I paid half the amount. Would that suffice? Or would I have to pay it in its entirety to save my service from being cut off?
As it was pointed out making prior arrangements could of helped extend the time you need to get your account back in order..
But if you have to have the phone and its the only thing you have to make calls, I would try other means ( Family, Friends, or other ) to get the rest of the balance payed and you can pay at a Corporate store using the stores Kiosk machine.! You can pay with Cash, Credit or I think with a check but using a check I'd ask the Local store how the policy is on that..
Hope that Helps.! Good luck.. -
A document page opens that is too big for the display and runs off the end of the monitor
How do you fix a problem where document pages open that are too big for the display and runs off the end of the monitor? The borders are off the monitor so there is no window edge to grab and adjust.
Please read this whole message before doing anything.
This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, or by a peripheral device.
Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and Wi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test. -
Long paragraphs in incoming emails display as a single line, with the end of the paragraph running off the screen. I want to make it wrap automatically to fit the screen.
For the browser window, just drag it to the top left of the screen (click and hold on the top bar with the traffic lights to drag), then in the bottom right of the window you'll see a rectangle with diagonal hatching. Click and hold on that and drag the window to the size you want.
Clicking on the green dot at top left will expand the window to fit the screen, clicking it again will shrink it back to where it was (this doesn't work in Finder windows quite the same).
The menu bar size is set in the bowels of the OS, though there may be third-party applications which can alter it.
As it's size is relative to the screen resolution, you could try reducing the resolution in System Preferences > Displays to see if that would suit you better. -
I need to display a timecode of selected sections in edited FCPX timeline. I need the timecode display to start at 00:00:00 and time to the end of the selection. Can I do this using the timecode generator in FCPX ?
ThanksFxFactory Pro: Timecode Plugin
Generates a timecode based on the current playback position relative to the duration of the clip.
Full Disclosure: I work for Noise Industries.
I may receive some form of compensation, financial or otherwise, from my recommendation or link. -
Visualisation of the end of the text of the JScrollPane
I have create a JScrollPane with a JTextArea in it, but when the text becomes to long for the windows, a JScrollBar appears, but I must scroll it to see the end of the text.
Is there any instruction to see automatically the end of the text.
Thanks.Otherwise you have to focus on last input.
textArea.setCaretPosition( textArea.getDocument().getLength() );
textArea.updateUI(); -
Phone says there is a new text message but there is no blue dot next to any of the conversations, nor is there an unread message at the end of the conversation.
my ipod is not the newest update possible as i said i tried to update but it wouldnt let me as it wont let me on wifi sources such as safari facebook and other apps which use wifi.all the apps are fully updated
-
Other ways to send the cursor to the end of the text
Hi everybody
Is there any other way to send the cursor to the end of the textfield except win_api_shell.sendkeys and keep cursor position.
Because when I use keep cursor position property.. it is not working properly when i programatically write go_block and return back to this block.
win_api_shell.sendkeys is working fine but, it is not giving me the desired results...
so can any1 please suggest other ways to do it.....
Thanks in advanceYou could use a global to deactivate this trigger before using ther sendkeys(), then reactivate it after
KEY-PRESSED trigger
If :global.fire = 'true' then
-- do the job
end if ;your code:
:global.fire := 'false';
win_api_shell.sendkeys()...
:global.fire := 'true';Francois -
THE END OF THE RECORD IS NOT TRIGGERING(urgent)
HI ALL I HAVE WRITTEN A REPORT AND I AM DISPLAYING THE OUTPUT OF EACH DISTRICT..
NOW THE REPORT IS SHOWING RIGHT WHEN IT IS CHANGING THE DISTRICT BUT IT IS NOT TRIGGERING AT THE END OF THE REPORT AS AFTER THAT THE DISTRICT IS NOT CHANGING..
I TRIED WITH AT END OF BUT IT IS SOME HOW SHOWING PROBLEM SO I USED A VARIBLE CONCEPT TO GET THE REPORT....
HERE IS THE REPORT can anyone please look at this and let me know how can i do that..
is there any method where i can used in the IF condition to get the last record...
==========================================================
*& Report ZDISTRICT_CUST_AUCSALES
&--THE PROGRAM USED TO DISPLAY THE TOTAL NUMBER OF CONSUMER IN A D.C.-
&----PROCESSED ON A PERTICULAR MONTH AND YEAR..--
REPORT ZDISTRICT_CUST_AUCSALES .
*TABLE DECLARATION*****************************************************
TABLES: /BIC/AUCSALES00,
/BIC/TCOKEY.
*DATA DECLARATION*****************************************************
DATA: BEGIN OF ITAB OCCURS 0,
/BIC/COKEY LIKE /BIC/TCOKEY-/BIC/COKEY,
TXTSH LIKE /BIC/TCOKEY-TXTSH,
END OF ITAB.
DATA: BEGIN OF ITAB2 OCCURS 0,
BILL_DATE LIKE /BIC/AUCSALES00-BILL_DATE,
/BIC/COKEY LIKE /BIC/AUCSALES00-/BIC/COKEY,
BPARTNER LIKE /BIC/AUCSALES00-BPARTNER,
END OF ITAB2.
DATA: COUNT TYPE I,
COKEY TYPE I,
COKEYNO(2) TYPE C,
COKEYCH(2),
BILDT TYPE I,
PROCOKEY TYPE I,
NOTPROCOKEY TYPE I,
TOTCOKEYDIV TYPE I,
TOTCOKEYDIV1 TYPE I,
TOTCOKEYDIV2 TYPE I,
TOTAL TYPE I.
DATA: C TYPE I VALUE 4.
SELECT OPTION FOR DATE SELECTION IN THE SELECTION SCREEN.************
SELECTION-SCREEN BEGIN OF BLOCK DATE WITH FRAME TITLE TEXT-001.
PARAMETERS: S_BILDT LIKE /BIC/AUCSALES00-BILL_DATE OBLIGATORY .
SELECTION-SCREEN END OF BLOCK DATE.
*INITIALIZATION******************************************************
FORMAT INTENSIFIED ON COLOR = C.
write:/ 'PROCESSING DATE:', 20 S_BILDT,
128 'TIME:', 135 SY-UZEIT.
WRITE:/ 'USER NAME :', 20 SY-UNAME,
142 ' '.
WRITE SY-ULINE.
WRITE: / 'D.C' , 12 SY-VLINE,
'NAME OF D.C' , 39 SY-VLINE,
'NUMBER OF CONSUMER' , 60 SY-VLINE,
'REMARKS' , 105 SY-VLINE.
WRITE:/ SY-ULINE.
FORMAT INTENSIFIED OFF.
*AT SELECTION-SCREEN**************************************************
SELECT BILL_DATE
UP TO 1 ROWS
INTO (/BIC/AUCSALES00-BILL_DATE)
FROM /BIC/AUCSALES00
WHERE BILL_DATE = S_BILDT.
ENDSELECT.
IF SY-SUBRC <> 0.
WRITE:/ ' NO DATA FOUND ON THIS DATE'.
EXIT.
ENDIF.
START OF SELECTION***************************************************
SELECT /BIC/COKEY TXTSH from /BIC/TCOKEY into table itab.
SORT ITAB.
IF NOT ITAB[] IS INITIAL.
SELECT BILL_DATE
/BIC/COKEY
BPARTNER
FROM /BIC/AUCSALES00
INTO CORRESPONDING FIELDS OF TABLE ITAB2
FOR ALL ENTRIES IN ITAB
WHERE /BIC/COKEY = ITAB-/BIC/COKEY
AND BILL_DATE = S_BILDT.
SORT ITAB BY /BIC/COKEY.
ENDIF.
*CHECK WHETHER THE DATA RETRIVE SUCESSFULLY OR NOT********************
IF SY-SUBRC NE 0.
WRITE:/ 'THIS DATE DOESNOT CONTAIN ANY DATA'.
ENDIF.
*DATA DISPLAY*********************************************************
*****GET THE FIRST VALUE AND DELETE THE ADJECENT AND DUPLICATE FROM ITAB2.
READ TABLE ITAB INDEX 1.
IF SY-SUBRC = 0.
COKEYNO = ITAB-/BIC/COKEY+4(2).
ENDIF.
READ TABLE ITAB2 WITH KEY /BIC/COKEY = itab-/BIC/COKEY.
IF SY-SUBRC = 0.
SORT ITAB2 BY /BIC/COKEY.
DELETE ADJACENT DUPLICATES FROM ITAB2 COMPARING /BIC/COKEY.
ENDIF.
LOOP AT ITAB.
READ TABLE ITAB2 WITH KEY /BIC/COKEY = itab-/BIC/COKEY.
*IF THE D.C ARE NOT SAME THEN DISPLAY THE SUM***************************
COKEYCH = ITAB-/BIC/COKEY+4(2).
IF ( COKEYCH <> COKEYNO ).
FORMAT COLOR = 4.
WRITE:/ ' TOTAL NUMBER OF D.C IN PERTICULAR RAO ','(', COKEYNO,')','=',TOTCOKEYDIV.
WRITE:/ ' TOTAL NUMBER OF CONSUMER PROCESSED IN RAO ','(', COKEYNO,')','=',TOTAL.
WRITE:/ ' TOTAL NUMBER OF D.C PROCESSED IN RAO ','(', COKEYNO,')','=',PROCOKEY.
WRITE:/ ' TOTAL NUMBER OF D.C NOT PROCESSED IN RAO ','(', COKEYNO,')','=',NOTPROCOKEY.
WRITE:/ '', 128 'PAGE NUMBER:', 139 SY-PAGNO.
SKIP 4.
*******INITIALLIZE ALL THE VARIABLE*************************************
FORMAT COLOR OFF .
TOTCOKEYDIV = 0.
TOTCOKEYDIV1 = 0.
TOTCOKEYDIV2 = 0.
TOTAL = 0.
PROCOKEY = 0.
NOTPROCOKEY = 0.
WRITE:/ SY-ULINE.
NEW-PAGE WITH-TITLE.
NEW-PAGE WITH-HEADING.
ENDIF.
**END OF THE TOTAL SUM OF ALL THE D.C.**********************************
*IF THE D.C ARE SAME THEN DISPLAY THE D.C.******************************
IF ITAB2-/BIC/COKEY = ITAB-/BIC/COKEY.
SELECT COUNT( DISTINCT BPARTNER )
INTO COUNT
FROM /BIC/AUCSALES00
WHERE /BIC/COKEY = ITAB2-/BIC/COKEY and
BILL_DATE = S_BILDT.
IF SY-SUBRC = 0.
PROCOKEY = PROCOKEY + 1.
ENDIF.
TOTCOKEYDIV1 = TOTCOKEYDIV1 + 1.
TOTAL = TOTAL + COUNT.
COKEY = ITAB2-/BIC/COKEY.
FORMAT INTENSIFIED ON COLOR = 2.
WRITE:/ ITAB2-/BIC/COKEY, SY-VLINE,
15 ITAB-TXTSH+1(19), 39 SY-VLINE,
40 COUNT, 60 SY-VLINE,
' ', 105 SY-VLINE.
WRITE :/ SY-ULINE.
FORMAT INTENSIFIED ON COLOR = 2.
ELSE.
FORMAT INTENSIFIED ON COLOR = 2.
COKEY = ITAB-/BIC/COKEY.
WRITE:/ ITAB-/BIC/COKEY, SY-VLINE,
15 ITAB-TXTSH+1(19), 39 SY-VLINE,
40 ' ', 60 SY-VLINE,
'Data Not extracted to BW', 105 SY-VLINE.
FORMAT INTENSIFIED ON COLOR = 2.
WRITE:/ SY-ULINE.
TOTCOKEYDIV2 = TOTCOKEYDIV2 + 1.
ENDIF.
TOTCOKEYDIV = TOTCOKEYDIV1 + TOTCOKEYDIV2.
NOTPROCOKEY = TOTCOKEYDIV - PROCOKEY.
COKEYNO = ITAB-/BIC/COKEY+4(2).
CLEAR: ITAB, ITAB2.
ENDLOOP.
===========================================================
please at this and let me know..
thanks in advance,,,HI ALL ,
I GOT THE ANSWER...
THANKS TO SDNNNN AND ALL THE FRIENDS LOOKING AT THIS...
THANKS ONCE AGAIN.... -
'TOTAL' text display in ALV GRID output
Hi,
My requirement is to display 'TOTAL' text at the end of the ALV report alongwith Totals for the respective columns.
I've used Classical method(i.e. used ALV GRID FM) to display the report.
For Totals I've used 'DO_SUM', option and for text populated 'TOTALS_TEXT' field, but still its not showing the desired text.
I've tried most of the solutions provided on SDN, and they are not working.
So, plssss help me to find out correct solution.
Thanks in Advance!!!!!!
Thanks & regards,
Amithi,
i hope this code will exactli fulfil ur requirement.
type-poolS: slis.
TYPES: BEGIN OF S_TAB,
F1 TYPE CHAR5,
F2 TYPE I,
F3 TYPE I,
END OF S_TAB.
TYPES: BEGIN OF sf_TAB,
f0 type char10,
F1 TYPE CHAR5,
F2 TYPE I,
F3 TYPE I,
END OF Sf_TAB.
DATA: IT_TAB TYPE TABLE OF S_TAB,
WA_TAB TYPE S_TAB,
IT_FIN TYPE TABLE OF Sf_TAB,
WA_FIN TYPE Sf_TAB.
data: fcat type slis_t_fieldcat_alv,
wa_fcat type slis_fieldcat_alv,
layout type slis_layout_alv,
it_sort type SLIS_T_SORTINFO_ALV,
wa_sort type SLIS_SORTINFO_ALV.
FREE IT_TAB. CLEAR WA_TAB.
WA_TAB-F1 = 'A1'.
WA_TAB-F2 = '10'.
WA_TAB-F3 = '20'.
APPEND WA_TAB TO IT_TAB.
CLEAR WA_TAB.
WA_TAB-F1 = 'A1'.
WA_TAB-F2 = '10'.
WA_TAB-F3 = '20'.
APPEND WA_TAB TO IT_TAB.
CLEAR WA_TAB.
WA_TAB-F1 = 'A2'.
WA_TAB-F2 = '15'.
WA_TAB-F3 = '30'.
APPEND WA_TAB TO IT_TAB.
CLEAR WA_TAB.
WA_TAB-F1 = 'A3'.
WA_TAB-F2 = '15'.
WA_TAB-F3 = '40'.
APPEND WA_TAB TO IT_TAB.
CLEAR WA_TAB.
WA_TAB-F1 = 'A3'.
WA_TAB-F2 = '20'.
WA_TAB-F3 = '60'.
APPEND WA_TAB TO IT_TAB.
CLEAR WA_TAB.
LOOP AT IT_TAB INTO WA_TAB.
wa_fin-f0 = 'Total'.
wa_fin-f1 = wa_tab-f1.
wa_fin-f2 = wa_tab-f2.
wa_fin-f3 = wa_tab-f3.
append wa_fin to it_fin.
clear wa_fin.
ENDLOOP.
Define Imacro.
wa_fcat-fieldname = &1.
wa_fcat-tabname = &2.
wa_fcat-reptext_ddic = &3.
wa_fcat-col_pos = &4.
WA_FCAT-DO_SUM = &5.
WA_FCAT-NO_OUT = &6.
append wa_fcat to fcat .
clear wa_fcat.
end-of-definition.
imacro 'F0' 'it_fin' '' '1' '' 'X'.
imacro 'F1' 'it_fin' 'PO Document' '2' '' ''.
imacro 'F2' 'it_fin' 'TOTAL' '3' 'X' ''.
imacro 'F3' 'it_fin' 'Space' '4' '' ''.
****************DEFINE LAYOUT
layout-zebra = 'X'.
layout-colwidth_optimize = 'X'.
layout-no_totAlLine = 'X'.
WA_SORT-SPOS = 1.
WA_SORT-fieldname = 'F0'.
wa_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
CLEAR WA_SORT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_GRID_TITLE = 'SALES ORDER DETAILS'
IS_LAYOUT = layout
IT_FIELDCAT = fcat
IT_SORT = IT_SORT
TABLES
T_OUTTAB = IT_FIN
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Cheers,
Rudhir
Maybe you are looking for
-
Calling a method in the backing bean when rendering a table
I'm rendering a table that begins with : <h:dataTable value="#{showRooms.rooms}" var="rowRoom" ... There are several properties I'm displaying. Some are just displayed as they appear from the database like: <h:outputText value="#{rowRoom.roomNumber}"
-
"Detecting" a variable from an externally-loaded SWF via SWFLoader
I load an external SWF file from a click event. Then, when the interactions has reached the end of the presentation, we'd like it to unload itself, and go into another state. Is that possible? ( actually transformed the SWF into a component using F
-
Series Recordings - missing episodes
Is anyone else having issues with series recordings at the moment? I'm having to delete a series link then re-apply to pick up future episodes for some programmes. The programmes I am having issues include Merlin, Hells Kitchen and now Spooks. Is thi
-
what are the paremeters for srw.run_report? i looked at the MAIL_IT example for reports, i'm not sure about the quotes in the paremeters. thanks null
-
Informal newsletter - page background
First time using iWorks pages and I have a question about the informal newsletter template. If you open the informal newsletter template, you'll notice that the background section is a red pattern design. How do you update this? I want to change it t