Needed sample program for emailing the report output
hi all,
neede sample program for emailing the report output
Hi,
Please refer this program for sending e-mail with attachment.
***INCLUDE ZHZLPP_CLZSN_DAILY_MIS_PRINT .
*& Form print
* text
* --> p1 text
* <-- p2 text
FORM print .
DATA: wa_output_options TYPE ssfcompop,
wa_control_parameters TYPE ssfctrlop,
t_otfdata TYPE ssfcrescl,
t_pdf_tab TYPE TABLE OF tline WITH HEADER LINE.
DATA: t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE.
DATA: w_filesize TYPE i.
DATA: w_bin_filesize TYPE i.
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
v_form_name TYPE rs38l_fnam,
v_len_in LIKE sood-objlen,
w_return TYPE ssfcrescl.
DATA : l_mean TYPE p DECIMALS 2,
l_mean1 TYPE p DECIMALS 2,
l_mean2 TYPE p DECIMALS 2,
l_mean3 TYPE p DECIMALS 4,
temp TYPE p DECIMALS 2,
v_header LIKE zmisdisp3-remark,
disp_d_kwh_mt TYPE zmisdisp5,
disp_m_kwh_mt TYPE zmisdisp5,
disp_d_mt_mw TYPE zmisdisp5,
disp_m_mt_mw TYPE zmisdisp5,
l_bptarget(16) TYPE p DECIMALS 2,
l_act_d(16) TYPE p DECIMALS 2,
l_act_c(16) TYPE p DECIMALS 2,
l_pow_gen TYPE p DECIMALS 2,
l_pow_gen_d TYPE p DECIMALS 2,
l_pow_gen_c TYPE p DECIMALS 2,
l_no_of_days TYPE p,
disp_bptarget TYPE zmisdisp5,
disp_act_d TYPE zmisdisp5,
disp_act_c TYPE zmisdisp5,
disp_d_kwh TYPE zmisdisp5,
disp_c_kwh TYPE zmisdisp5,
disp_d_mw TYPE zmisdisp5,
disp_c_mw TYPE zmisdisp5,
disp_pow_gen_d TYPE zmisdisp5,
disp_pow_gen_c TYPE zmisdisp5,
disp_pow_gen TYPE zmisdisp5,
disp_ftd_h1 TYPE zmisdisp5,
disp_ftd_h2 TYPE zmisdisp5,
disp_ftd_h3 TYPE zmisdisp5,
disp_ftd_h4 TYPE zmisdisp5,
disp_ftd_h5 TYPE zmisdisp5,
disp_ftd_o1 TYPE zmisdisp5,
disp_ftd_o2 TYPE zmisdisp5,
disp_ftd_o4 TYPE zmisdisp5,
disp_ftd_o5 TYPE zmisdisp5,
disp_***_o1 TYPE zmisdisp5,
disp_***_o2 TYPE zmisdisp5,
disp_***_o4 TYPE zmisdisp5,
disp_***_o5 TYPE zmisdisp5,
disp_cath_d TYPE zmisdisp5,
disp_cath_c TYPE zmisdisp5,
disp_anode_d TYPE zmisdisp5,
disp_anode_c TYPE zmisdisp5,
l_rec_con_d_kwh(16) TYPE p DECIMALS 2,
l_rec_con_c_kwh(16) TYPE p DECIMALS 2,
l_rec_con_d_mw(16) TYPE p DECIMALS 2,
l_rec_con_c_mw(16) TYPE p DECIMALS 2,
tot_kah TYPE p DECIMALS 2,
avg_kah TYPE p DECIMALS 2,
disp_tot_kah TYPE zmisdisp5,
disp_avg_kah TYPE zmisdisp5,
v_ftd_h1 TYPE p DECIMALS 2,
v_ftd_h2 TYPE p DECIMALS 2,
v_ftd_h3 TYPE p DECIMALS 2,
v_ftd_h4 TYPE p DECIMALS 2,
v_ftd_h5 TYPE p DECIMALS 2,
v_ftd_o1 TYPE p DECIMALS 2,
v_ftd_o2 TYPE p DECIMALS 2,
v_ftd_o4 TYPE p DECIMALS 2,
v_ftd_o5 TYPE p DECIMALS 2,
v_***_o1 TYPE p DECIMALS 2,
v_***_o2 TYPE p DECIMALS 2,
v_***_o4 TYPE p DECIMALS 2,
v_***_o5 TYPE p DECIMALS 2,
l_cdiff1 LIKE imrg-cdiff,
l_cdiff2 LIKE imrg-cdiff,
l_cdiff3 LIKE imrg-cdiff,
l_cdiff4 LIKE imrg-cdiff,
l_path LIKE rlgrap-filename,
l_flag.
DATA :prod_disp TYPE TABLE OF zmisdisp1 WITH HEADER LINE,
keyp_disp TYPE TABLE OF zmisdisp2 WITH HEADER LINE,
keyp_dis1 TYPE TABLE OF zmisdisp2 WITH HEADER LINE,
rmat_disp TYPE TABLE OF zmisdisp4 WITH HEADER LINE,
rcur_disp TYPE TABLE OF zmisdisp6 WITH HEADER LINE,
rhrs_disp TYPE TABLE OF zmisdisp4 WITH HEADER LINE,
brkd_disp TYPE TABLE OF zmisdisp7 WITH HEADER LINE.
DEFINE fill_kpp.
clear l_flag.
loop at it_mic_data where kurztext = &1.
l_mean1 = it_mic_data-mittelwert.
l_mean = it_mic_data-mean.
if l_flag = ' '.
move : &2 to keyp_disp-desc,
l_mean1 to keyp_disp-ftd.
if it_mic_data-kurztext = 'Ingot Pb SHG Zinc'.
l_mean2 = v_mean_pbshg.
move l_mean2 to keyp_disp-avg.
elseif it_mic_data-kurztext = 'Ingot Cu SHG Zinc'.
l_mean2 = v_mean_cushg.
move l_mean2 to keyp_disp-avg.
elseif it_mic_data-kurztext = 'Ingot Cd SHG Zinc'.
l_mean2 = v_mean_cdshg.
move l_mean2 to keyp_disp-avg.
elseif it_mic_data-kurztext = 'Ingot Fe SHG Zinc'.
l_mean2 = v_mean_feshg.
move l_mean2 to keyp_disp-avg.
elseif it_mic_data-kurztext = 'Ingot Zn SHG Zinc'.
l_mean2 = v_mean_znshg.
move l_mean2 to keyp_disp-avg.
else.
move l_mean to keyp_disp-avg.
endif.
if it_mic_data-masseinhsw = 'GLI'.
move 'g/l' to keyp_disp-unit.
elseif it_mic_data-masseinhsw = 'PPM'.
move 'ppm' to keyp_disp-unit.
elseif it_mic_data-masseinhsw = 'NO'.
move 'no' to keyp_disp-unit.
else.
move it_mic_data-masseinhsw to keyp_disp-unit.
endif.
append keyp_disp.
clear keyp_disp.
move 'X' to l_flag.
else.
move : l_mean1 to keyp_disp-ftd.
append keyp_disp.
clear keyp_disp.
endif.
endloop.
if sy-subrc is not initial.
move &2 to keyp_disp-desc.
append keyp_disp.
clear keyp_disp.
endif.
END-OF-DEFINITION.
DEFINE fill_kp1.
clear l_flag.
loop at it_mic_data where kurztext = &1.
l_mean1 = it_mic_data-mittelwert.
l_mean = it_mic_data-mean.
if l_flag = ' '.
move : &2 to keyp_dis1-desc,
l_mean1 to keyp_dis1-ftd.
if it_mic_data-kurztext = 'Ingot Pb SHG Zinc'.
l_mean2 = v_mean_pbshg.
move l_mean2 to keyp_dis1-avg.
elseif it_mic_data-kurztext = 'Ingot Cu SHG Zinc'.
l_mean2 = v_mean_cushg.
move l_mean2 to keyp_dis1-avg.
elseif it_mic_data-kurztext = 'Ingot Cd SHG Zinc'.
l_mean2 = v_mean_cdshg.
move l_mean2 to keyp_dis1-avg.
elseif it_mic_data-kurztext = 'Ingot Fe SHG Zinc'.
l_mean2 = v_mean_feshg.
move l_mean2 to keyp_dis1-avg.
elseif it_mic_data-kurztext = 'Ingot Zn SHG Zinc'.
l_mean3 = v_mean_znshg.
move l_mean3 to keyp_dis1-avg.
clear l_mean3.
l_mean3 = it_mic_data-mittelwert.
move l_mean3 to keyp_dis1-ftd.
else.
move l_mean to keyp_dis1-avg.
endif.
if it_mic_data-masseinhsw = 'GLI'.
move 'g/l' to keyp_dis1-unit.
elseif it_mic_data-masseinhsw = 'PPM'.
move 'ppm' to keyp_dis1-unit.
elseif it_mic_data-masseinhsw = 'NO'.
move 'no' to keyp_dis1-unit.
else.
move it_mic_data-masseinhsw to keyp_dis1-unit.
endif.
append keyp_dis1.
clear keyp_dis1.
move 'X' to l_flag.
else.
if it_mic_data-kurztext = 'Ingot Zn SHG Zinc'.
clear l_mean3.
l_mean3 = it_mic_data-mittelwert.
move l_mean3 to keyp_dis1-ftd.
else.
move : l_mean1 to keyp_dis1-ftd.
endif.
append keyp_dis1.
clear keyp_dis1.
endif.
endloop.
if sy-subrc is not initial.
move &2 to keyp_dis1-desc.
append keyp_dis1.
clear keyp_dis1.
endif.
END-OF-DEFINITION.
*FIRST PAGE
********PLANT HEADER
MOVE 'CLZS HYDRO I PLANT - DAILY PRODUCTION REPORT' TO v_header.
********Production figure
LOOP AT it_disp1.
prod_disp-desc = it_disp1-desc.
prod_disp-d_plnmg = it_disp1-d_plnmg.
prod_disp-d_menge = it_disp1-d_menge.
prod_disp-u_plnmg = it_disp1-u_plnmg.
prod_disp-u_menge = it_disp1-u_menge.
prod_disp-avg = it_disp1-avg.
prod_disp-ask_rate = it_disp1-ask_rate.
prod_disp-m_plnmg = it_disp1-m_plnmg.
prod_disp-y_plnmg = it_disp1-y_plnmg.
prod_disp-y_menge = it_disp1-y_menge.
prod_disp-y_variance = it_disp1-y_variance.
APPEND prod_disp.
ENDLOOP.
********Key performance parameters
MOVE 'ROASTER :' TO keyp_disp-desc.
APPEND keyp_disp.
fill_kpp '% S/S IN 45 DEG' ' S/S in Calcine'.
MOVE 'LEACHING :' TO keyp_disp-desc.
APPEND keyp_disp.
fill_kpp '% S/S IN CAL' ' S/S in Calcine'.
fill_kpp '%water soluble Zn' ' W/S Zn in Jarosite Cake'.
fill_kpp '%total Zn in HBF' ' T/Zn in Jarosite cake'.
fill_kpp 'ZINC IN CT' ' Zn in Conditioning tank'.
fill_kpp 'g/l zn in neutral overflow' ' Zn in Electrolyte Prod (gpl)'.
fill_kpp 'PPM CU IN PS25' ' Purified Solution Cu'.
fill_kpp 'PPM CADMIUM IN PS25' ' Purified Solution Cd'.
fill_kpp 'PPM COBALT IN PS25' ' Purified Solution Co'.
MOVE 'CELLHOUSE :' TO keyp_disp-desc.
APPEND keyp_disp.
fill_kpp 'g/l zinc in cell feed' ' Cell Feed Zinc gpl'.
fill_kpp 'GPL ACID IN CELL FEED' ' Cell Feed acidity gpl'.
fill_kpp 'g/l manganese in cell feed' ' Cell Feed Mn gpl'.
LOOP AT t_imrg_add_disp.
MOVE: t_imrg_add_disp-desc TO keyp_disp-desc,
t_imrg_add_disp-d_value TO keyp_disp-ftd,
t_imrg_add_disp-c_value TO temp,
temp TO keyp_disp-avg.
IF t_imrg_add_disp-units = 'NO'.
MOVE: 'no' TO keyp_disp-unit.
ELSE.
MOVE: t_imrg_add_disp-units TO keyp_disp-unit.
ENDIF.
APPEND keyp_disp.CLEAR keyp_disp.
ENDLOOP.
fill_kp1 'Ingot Pb SHG Zinc' ' Ingot Pb SHG Zinc'.
fill_kp1 'Ingot Cu SHG Zinc' ' Ingot Cu SHG Zinc'.
fill_kp1 'Ingot Cd SHG Zinc' ' Ingot Cd SHG Zinc'.
fill_kp1 'Ingot Fe SHG Zinc' ' Ingot Fe SHG Zinc'.
fill_kp1 'Ingot Zn SHG Zinc' ' Ingot Zn SHG Zinc'.
********Cellhouse power
CATCH SYSTEM-EXCEPTIONS bcd_zerodivide = 1.
v_m_kwh_mt = v_ind8_m / cathode_recipt.
v_m_mt_mw = cathode_recipt / ( v_ind8_m / 24000 ).
ENDCATCH.
MOVE : v_d_kwh_mt TO disp_d_kwh_mt,
v_m_kwh_mt TO disp_m_kwh_mt,
v_d_mt_mw TO disp_d_mt_mw,
v_m_mt_mw TO disp_m_mt_mw.
*SECOND PAGE
********Raw Material
LOOP AT it_disp3.
rmat_disp-desc = it_disp3-desc.
rmat_disp-opstk = it_disp3-opstk.
rmat_disp-d_recpt = it_disp3-d_recpt.
rmat_disp-u_recpt = it_disp3-u_recpt.
rmat_disp-d_cons = it_disp3-d_cons.
rmat_disp-u_cons = it_disp3-u_cons.
rmat_disp-clstk = it_disp3-clstk.
APPEND rmat_disp.
ENDLOOP.
********Work in Progress
********Finished Goods
********power consumption
l_no_of_days = v_mm_en_dt+6(2).
CATCH SYSTEM-EXCEPTIONS bcd_zerodivide = 1.
l_bptarget = ( v_bp_nrms_p * v_gross_d ) / l_no_of_days.
l_act_d = v_ind6_d + v_ind2_d - ( v_ind3_d + ( v_ind4_d / 2 ) ) - v_ind5_d.
l_act_c = v_ind6_m + v_ind2_m - ( v_ind3_m + ( v_ind4_m / 2 ) ) - v_ind5_m.
l_pow_gen = ( v_ind2_d / 1000 ) / v_ind7_d.
ENDCATCH.
l_pow_gen_d = v_ind2_d / 1000.
l_pow_gen_c = v_ind9_m / 1000.
l_rec_con_d_kwh = v_ind8_d.
l_rec_con_c_kwh = v_ind8_m.
l_rec_con_d_mw = v_ind8_d / 24000.
l_rec_con_c_mw = v_ind8_m / ( 24000 * v_days_pased ).
LOOP AT t_disp_curr.
rcur_disp-time = t_disp_curr-time.
rcur_disp-current = t_disp_curr-current.
rcur_disp-kah = t_disp_curr-kah.
APPEND rcur_disp.
AT LAST.
SUM.
tot_kah = t_disp_curr-kah.
ENDAT.
ENDLOOP.
avg_kah = tot_kah / '24'.
*********************running hrs
LOOP AT it_disp6.
rhrs_disp-desc = it_disp6-desc.
rhrs_disp-opstk = it_disp6-d_runhrs.
rhrs_disp-d_recpt = it_disp6-m_runhrs.
APPEND rhrs_disp.
ENDLOOP.
rhrs_disp-desc = 'Turbo Generator'.
rhrs_disp-opstk = v_turbod.
rhrs_disp-d_recpt = v_turboc.
INSERT rhrs_disp INDEX 2.
**********************BREAK_DOWN & OIL
CLEAR value.
LOOP AT itab2.
IF itab2-equnr = 'NMZ-EH01G001'.
PERFORM s_conversion_h.
v_ftd_h1 = v_ftd_h1 + value.
CLEAR value.
ENDIF.
IF itab2-equnr = 'NMZ-EH01G002'.
PERFORM s_conversion_h.
v_ftd_h2 = v_ftd_h2 + value.
CLEAR value.
ENDIF.
IF itab2-equnr = 'NMZ-EH01V003'.
PERFORM s_conversion_h.
v_ftd_h3 = v_ftd_h3 + value.
CLEAR value.
ENDIF.
IF itab2-equnr = 'NMZ-EH01V001'.
PERFORM s_conversion_h.
v_ftd_h4 = v_ftd_h4 + value.
CLEAR value.
ENDIF.
IF itab2-equnr = 'NMZ-EH01V002'.
PERFORM s_conversion_h.
v_ftd_h5 = v_ftd_h5 + value.
CLEAR value.
ENDIF.
ENDLOOP.
LOOP AT t_oil.
AT END OF ind.
SUM.
IF t_oil-ind = 1.
v_***_o1 = t_oil-cdiff * 1000.
ELSEIF t_oil-ind = 2.
v_***_o2 = t_oil-cdiff * 1000.
ELSEIF t_oil-ind = 3.
v_***_o4 = t_oil-cdiff * 1000.
ELSEIF t_oil-ind = 4.
v_***_o5 = t_oil-cdiff * 1000.
ENDIF.
ENDAT.
IF t_oil-idate = p_repdt.
IF t_oil-ind = 1.
l_cdiff1 = l_cdiff1 + t_oil-cdiff.
ELSEIF t_oil-ind = 2.
l_cdiff2 = l_cdiff2 + t_oil-cdiff.
ELSEIF t_oil-ind = 3.
l_cdiff3 = l_cdiff3 + t_oil-cdiff.
ELSEIF t_oil-ind = 4.
l_cdiff4 = l_cdiff4 + t_oil-cdiff.
ENDIF.
ENDIF.
ENDLOOP.
v_ftd_o1 = l_cdiff1 * 1000.
v_ftd_o2 = l_cdiff2 * 1000.
v_ftd_o4 = l_cdiff3 * 1000.
v_ftd_o5 = l_cdiff4 * 1000.
*********Breakdown details----3rd page
LOOP AT itab INTO wa.
CALL FUNCTION 'FLTP_CHAR_CONVERSION'
EXPORTING
decim = 0
expon = 0
input = wa-auszt
ivalu = 'X'
IMPORTING
flstr = wk_char_auszt.
CONDENSE wk_char_auszt NO-GAPS.
wk_flt_auszt = wk_char_auszt.
wk_flt_auszt = wk_flt_auszt / 3600.
duration = wk_flt_auszt.
brkd_disp-eqdesc = wa-eqktx.
brkd_disp-nodesc = wa-qmtxt.
brkd_disp-hrs = duration.
APPEND brkd_disp.
ENDLOOP.
MOVE : v_ftd_h1 TO disp_ftd_h1,
v_ftd_h2 TO disp_ftd_h2,
v_ftd_h3 TO disp_ftd_h3,
v_ftd_h4 TO disp_ftd_h4,
v_ftd_h5 TO disp_ftd_h5,
v_ftd_o1 TO disp_ftd_o1,
v_ftd_o2 TO disp_ftd_o2,
v_ftd_o4 TO disp_ftd_o4,
v_ftd_o5 TO disp_ftd_o5,
v_***_o1 TO disp_***_o1,
v_***_o2 TO disp_***_o2,
v_***_o4 TO disp_***_o4,
v_***_o5 TO disp_***_o5,
l_bptarget TO disp_bptarget,
l_act_d TO disp_act_d,
l_act_c TO disp_act_c,
l_rec_con_d_kwh TO disp_d_kwh,
l_rec_con_c_kwh TO disp_c_kwh,
l_rec_con_d_mw TO disp_d_mw,
l_rec_con_c_mw TO disp_c_mw,
tot_kah TO disp_tot_kah,
avg_kah TO disp_avg_kah,
l_pow_gen TO disp_pow_gen,
l_pow_gen_d TO disp_pow_gen_d,
l_pow_gen_c TO disp_pow_gen_c,
v_cath_d TO disp_cath_d,
v_cath_c TO disp_cath_c,
v_anode_d TO disp_anode_d,
v_anode_c TO disp_anode_c.
wa_output_options-tdimmed = 'X'.
wa_control_parameters-device = 'PRINTER'.
wa_control_parameters-preview = 'X'.
IF rb3 = 'X'.
wa_control_parameters-getotf = 'X'.
wa_control_parameters-no_dialog = 'X'.
ENDIF.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZHZLPP_CLZSN_DAILY_MIS'
IMPORTING
fm_name = v_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = wa_control_parameters
output_options = wa_output_options
user_settings = 'X'
header = v_header
date = p_repdt
l_bptarget = disp_bptarget
l_act_d = disp_act_d
l_act_c = disp_act_c
disp_d_kwh = disp_d_kwh
disp_c_kwh = disp_c_kwh
disp_d_mw = disp_d_mw
disp_c_mw = disp_c_mw
disp_tot_kah = disp_tot_kah
disp_avg_kah = disp_avg_kah
disp_d_kwh_mt = disp_d_kwh_mt
disp_m_kwh_mt = disp_m_kwh_mt
disp_d_mt_mw = disp_d_mt_mw
disp_m_mt_mw = disp_m_mt_mw
disp_pow_gen = disp_pow_gen
disp_pow_gen_d = disp_pow_gen_d
disp_pow_gen_c = disp_pow_gen_c
disp_ftd_h1 = disp_ftd_h1
disp_ftd_h2 = disp_ftd_h2
disp_ftd_h3 = disp_ftd_h3
disp_ftd_h4 = disp_ftd_h4
disp_ftd_h5 = disp_ftd_h5
disp_ftd_o1 = disp_ftd_o1
disp_ftd_o2 = disp_ftd_o2
disp_ftd_o4 = disp_ftd_o4
disp_ftd_o5 = disp_ftd_o5
disp_***_o1 = disp_***_o1
disp_***_o2 = disp_***_o2
disp_***_o4 = disp_***_o4
disp_***_o5 = disp_***_o5
disp_cath_d = disp_cath_d
disp_cath_c = disp_cath_c
disp_anode_d = disp_anode_d
disp_anode_c = disp_anode_c
IMPORTING
job_output_info = w_return " .
TABLES
prod_tab = prod_disp
keyp_tab = keyp_disp
remk_tab = it_remarks
rmat_tab = rmat_disp
rwip_tab = it_disp4
rfng_tab = it_disp_fg
rcur_tab = rcur_disp
rhrs_tab = rhrs_disp
brkd_tab = brkd_disp
keyp_tab1 = keyp_dis1
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE 'Error in printing form' TYPE 'I'.
ENDIF.
********Downloading in pdf format.
IF rb3 = 'X'.
IF l_usract <> 9.
MOVE fullpath TO l_path.
i_otf[] = w_return-otfdata[].
CALL FUNCTION 'CONVERT_OTF' "
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = v_len_in
TABLES
otf = i_otf
lines = i_tline
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc <> 0.
ENDIF.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
bin_filesize = v_len_in
filename = l_path
filetype = 'BIN'
IMPORTING
filelength = w_filesize
TABLES
data_tab = i_tline
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc = 0.
MESSAGE 'File downloaded successfully' TYPE 'S'.
ENDIF.
ENDIF.
ENDIF.
IF sy-batch = 'X'. " SENDING MAILS IF SCHEDULED IN BACKGROUND
DATA: formname TYPE tdsfname,
fm_name TYPE rs38l_fnam,
control_parameters TYPE ssfctrlop,
output_options TYPE ssfcompop,
job_output_info TYPE ssfcrescl,
otf_data TYPE tsfotf.
DATA: otf TYPE TABLE OF itcoo WITH HEADER LINE,
doctab_archive TYPE TABLE OF docs WITH HEADER LINE,
lines TYPE TABLE OF tline WITH HEADER LINE,
bin_filesize TYPE i.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZHZLPP_CLZSN_DAILY_MIS'
IMPORTING
fm_name = v_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
control_parameters-no_dialog = 'X'.
control_parameters-getotf = 'X'.
CALL FUNCTION v_form_name
EXPORTING
control_parameters = control_parameters
header = v_header
date = p_repdt
l_bptarget = disp_bptarget
l_act_d = disp_act_d
l_act_c = disp_act_c
disp_d_kwh = disp_d_kwh
disp_c_kwh = disp_c_kwh
disp_d_mw = disp_d_mw
disp_c_mw = disp_c_mw
disp_tot_kah = disp_tot_kah
disp_avg_kah = disp_avg_kah
disp_d_kwh_mt = disp_d_kwh_mt
disp_m_kwh_mt = disp_m_kwh_mt
disp_d_mt_mw = disp_d_mt_mw
disp_m_mt_mw = disp_m_mt_mw
disp_pow_gen = disp_pow_gen
disp_pow_gen_d = disp_pow_gen_d
disp_pow_gen_c = disp_pow_gen_c
disp_ftd_h1 = disp_ftd_h1
disp_ftd_h2 = disp_ftd_h2
disp_ftd_h3 = disp_ftd_h3
disp_ftd_h4 = disp_ftd_h4
disp_ftd_h5 = disp_ftd_h5
disp_ftd_o1 = disp_ftd_o1
disp_ftd_o2 = disp_ftd_o2
disp_ftd_o4 = disp_ftd_o4
disp_ftd_o5 = disp_ftd_o5
disp_***_o1 = disp_***_o1
disp_***_o2 = disp_***_o2
disp_***_o4 = disp_***_o4
disp_***_o5 = disp_***_o5
disp_cath_d = disp_cath_d
disp_cath_c = disp_cath_c
disp_anode_d = disp_anode_d
disp_anode_c = disp_anode_c
IMPORTING
job_output_info = job_output_info
TABLES
prod_tab = prod_disp
keyp_tab = keyp_disp
remk_tab = it_remarks
rmat_tab = rmat_disp
rwip_tab = it_disp4
rfng_tab = it_disp_fg
rcur_tab = rcur_disp
rhrs_tab = rhrs_disp
brkd_tab = brkd_disp
keyp_tab1 = keyp_dis1
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc = 0.
otf_data = job_output_info-otfdata[].
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
bin_filesize = bin_filesize
TABLES
otf = otf_data[]
doctab_archive = doctab_archive[]
lines = lines[]
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
IF sy-subrc = 0.
SUBMIT rsconn01 with mode = 'INT' AND RETURN.
* ----<<distrubution list>>----
PERFORM mail_users TABLES lines USING 'MIS-HY1A' v_header. " Donot put more than 8 email-ids
PERFORM mail_users TABLES lines USING 'MIS-HY1B' v_header. " in a distribution list
PERFORM mail_users TABLES lines USING 'MIS-HY1C' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1D' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1E' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1F' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1G' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1H' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1I' v_header.
PERFORM mail_users TABLES lines USING 'MIS-HY1J' v_header.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " print
*& Form get_download_path
* text
* --> p1 text
* <-- p2 text
FORM get_download_path .
CALL FUNCTION 'GUI_FILE_SAVE_DIALOG'
EXPORTING
window_title = 'Download as pdf file'
default_extension = 'pdf'
IMPORTING
fullpath = fullpath
user_action = l_usract.
IF l_usract = '9'.
STOP.
ENDIF.
ENDFORM. " get_download_path
*& Form mail_users
* text
* -->P_LINES text
* -->P_2153 text
* -->P_V_HEADER text
FORM mail_users TABLES p_lines STRUCTURE tline
USING p_dist_list
p_v_header.
CONSTANTS: c_raw TYPE so_obj_tp VALUE 'RAW',
c_pdf TYPE so_obj_tp VALUE 'PDF',
c_255 TYPE i VALUE 255,
c_134 TYPE i VALUE 134,
c_x TYPE c VALUE 'X'.
DATA: document_data LIKE sodocchgi1 ,
tab_lines TYPE i,
contents_txt TYPE TABLE OF solisti1 WITH HEADER LINE,
contents_bin TYPE TABLE OF solisti1 WITH HEADER LINE,
packing_list TYPE TABLE OF sopcklsti1 WITH HEADER LINE,
object_header TYPE TABLE OF solisti1 WITH HEADER LINE,
receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
l_str(255) ,
v1 TYPE i,
v2 TYPE i,
v3 TYPE i.
document_data-obj_name = 'EMAIL'.
document_data-obj_descr = p_v_header. " SUBJECT LINE
CONCATENATE 'Please find the attached SAP generated Daily Production Report for the day'
p_repdt+6(2)
p_repdt+4(2)
'.' p_repdt+0(4)
INTO contents_txt.
APPEND contents_txt.
CLEAR contents_txt.
APPEND contents_txt.
APPEND contents_txt.
DESCRIBE TABLE contents_txt LINES tab_lines.
READ TABLE contents_txt INDEX tab_lines.
document_data-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( contents_txt ).
document_data-doc_size = tab_lines .
CLEAR packing_list-transf_bin.
packing_list-head_start = 1.
packing_list-head_num = 0.
packing_list-body_start = 1.
packing_list-body_num = tab_lines.
packing_list-doc_type = c_raw.
packing_list-doc_size = document_data-doc_size.
APPEND packing_list.
LOOP AT p_lines.
CLEAR l_str.
l_str+0(2) = p_lines-tdformat.
l_str+2(132) = p_lines-tdline.
v2 = v1 + c_134.
IF v2 LE c_255.
contents_bin-line+v1(c_134) = l_str. v1 = v2.
ELSE.
v3 = v2 - c_255.
v2 = c_255 - v1.
IF NOT v2 IS INITIAL.
contents_bin-line+v1(v2) = l_str+0(v2).
ENDIF.
APPEND contents_bin.
CLEAR contents_bin.
v1 = v3.
v3 = 134 - v1.
IF NOT v1 IS INITIAL.
contents_bin-line+0(v1) = l_str+v3(v1).
ENDIF.
ENDIF.
ENDLOOP.
APPEND contents_bin.
CLEAR contents_bin.
DESCRIBE TABLE contents_bin LINES tab_lines.
READ TABLE contents_bin INDEX tab_lines.
CONCATENATE 'Hy-I Report'
p_repdt+6(2)
p_repdt+4(2)
'.' p_repdt+0(4)
'.pdf'
INTO object_header.
APPEND object_header.
packing_list-transf_bin = c_x.
packing_list-head_start = 1.
packing_list-head_num = 1.
packing_list-body_start = 1.
packing_list-body_num = tab_lines.
packing_list-doc_type = c_pdf.
packing_list-obj_name = 'text1'.
packing_list-obj_descr = 'Production report'.
packing_list-doc_size = tab_lines * 255 + STRLEN( contents_bin ).
APPEND packing_list.
receivers-receiver = p_dist_list.
receivers-rec_type = 'C'.
APPEND receivers.
CLEAR receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = document_data
put_in_outbox = ' '
SENDER_ADDRESS = 'CZPPPLG'
SENDER_ADDRESS_TYPE = 'B'
commit_work = 'X'
TABLES
packing_list = packing_list
object_header = object_header
contents_bin = contents_bin
contents_txt = contents_txt
receivers = receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc = 0.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 with mode = 'INT' AND RETURN.
ENDIF.
ENDFORM. " mail_users
Similar Messages
-
Need sample programs for inbound & outbound interfaces in abap hr?
hi friends
i need sample programs for inbound & outbound interface programs in hr abap . any one send me pls
thanks & regards
deepurd&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
*& Report ZPROG65_11 *
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
REPORT zprog65_11 .
TABLES : lfa1.
TYPES : BEGIN OF ven ,
lifnr LIKE rf02k-lifnr,
bukrs LIKE rf02k-bukrs ,
ekorg LIKE rf02k-ekorg,
ktokk LIKE rf02k-ktokk,
name1 LIKE lfa1-name1,
sortl LIKE lfa1-sortl,
land1 LIKE lfa1-land1,
spars LIKE lfa1-spras,
akont LIKE lfb1-akont,
fdgrv LIKE lfb1-fdgrv,
waers LIKE lfm1-waers,
anred LIKE lfa1-anred ,
END OF ven .
DATA : t_ven TYPE TABLE OF ven WITH HEADER LINE ,
t_bdc LIKE TABLE OF bdcdata WITH HEADER LINE .
DATA : v_file TYPE string ,
v_temp TYPE i ,
v_lifnr(10) TYPE n,
v_hdate LIKE sy-datum.
DATA : c_tcode LIKE sy-tcode .u201Dvalue u2018XK01u2032.
PARAMETERS : p_file(30) DEFAULT u2018c:\vendor1_11.txtu2019,
p_group LIKE apqi-groupid.
START-OF-SELECTION .
MOVE p_file TO v_file .
PERFORM file_upload TABLES t_ven USING v_file .
v_hdate = sy-datum - 1.
CALL FUNCTION u2018BDC_OPEN_GROUPu2019
EXPORTING
client = sy-mandt
DEST = FILLER8
group = p_group
holddate = v_hdate
keep = u2018Xu2019
user = sy-uname
IMPORTING
QID =
EXCEPTIONS
client_invalid = 1
destination_invalid = 2
group_invalid = 3
OTHERS = 11
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT t_ven .
clear lfa1.
v_temp = 0.
MOVE t_ven-lifnr TO v_lifnr.
SELECT SINGLE * FROM lfa1 INTO lfa1 WHERE lifnr =
v_lifnr.
IF sy-subrc = 0.
WRITE :/ u2018foundu2019.
v_temp = 1.
else.
write: / u2018not foundu2019.
ENDIF.
IF v_temp = 0.
c_tcode = u2018xk01u2032.
PERFORM fill_ddc_table .
ELSEIF v_temp = 1.
c_tcode = u2018xk02u2032.
PERFORM fill_bdc_table .
ENDIF.
CALL FUNCTION u2018BDC_INSERTu2019
EXPORTING
tcode = c_tcode
TABLES
dynprotab = t_bdc
EXCEPTIONS
internal_error = 1
OTHERS = 7.
REFRESH t_bdc .
ENDLOOP .
CALL FUNCTION u2018BDC_CLOSE_GROUPu2019
EXCEPTIONS
not_open = 1
queue_error = 2
OTHERS = 3.
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
*& Form file_upload
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
u2013>P_T_VEN text
u2013>P_V_FILE text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
FORM file_upload TABLES p_tven STRUCTURE t_ven
USING p_vfile.
CALL FUNCTION u2018GUI_UPLOADu2019
EXPORTING
filename = p_vfile
filetype = u2018ASCu2019
has_field_separator = u2018Xu2019
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = p_tven
EXCEPTIONS
file_open_error = 1
file_read_error = 2
OTHERS = 17
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. u201D file_upload
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
*& Form FILL_DDC_TABLE
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
u2013> p1 text
<u2013 p2 text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
FORM fill_ddc_table .
SCREN 100
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180100u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-LIFNRu2019.
t_bdc-fval = t_ven-lifnr .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-BUKRSu2019.
t_bdc-fval = t_ven-bukrs.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-EKORGu2019.
t_bdc-fval = t_ven-ekorg.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-KTOKKu2019.
t_bdc-fval = t_ven-ktokk.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
110
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180110u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-NAME1u2032.
t_bdc-fval = t_ven-name1 .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-SORTLu2019.
t_bdc-fval = t_ven-sortl.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-LAND1u2032.
t_bdc-fval = t_ven-land1.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-SPRASu2019.
t_bdc-fval = t_ven-spars.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
120
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180120u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
130
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180130u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018=ENTRu2019.
APPEND t_bdc. CLEAR t_bdc.
210
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180210u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFB1-AKONTu2019.
t_bdc-fval = t_ven-akont .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFB1-FDGRVu2019.
t_bdc-fval = t_ven-fdgrv.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
215
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180215u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
220
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180220u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
310
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180310u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFM1-WAERSu2019.
t_bdc-fval = t_ven-waers .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
320
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180320u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018=UPDAu2019.
APPEND t_bdc. CLEAR t_bdc.
ENDFORM. u201CFILL_DDC_TABLE
u201D FILL_DDC_TABLE
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
*& Form FILL_BDC_TABLE
&u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014
text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
u2013> p1 text
<u2013 p2 text
u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014u2014-
FORM fill_bdc_table .
SCREN 101
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180101u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-LIFNRu2019.
t_bdc-fval = t_ven-lifnr .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-BUKRSu2019.
t_bdc-fval = t_ven-bukrs.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018RF02K-EKORGu2019.
t_bdc-fval = t_ven-ekorg.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
110
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180110u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018lfa1-anredu2019.
t_bdc-fval = t_ven-anred .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-NAME1u2032.
t_bdc-fval = t_ven-name1 .
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-SORTLu2019.
t_bdc-fval = t_ven-sortl.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-LAND1u2032.
t_bdc-fval = t_ven-land1.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018LFA1-SPRASu2019.
t_bdc-fval = t_ven-spars.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018/00u2032.
APPEND t_bdc. CLEAR t_bdc.
300
t_bdc-program = u2018SAPMF02Ku2019.
t_bdc-dynpro = u20180300u2032.
t_bdc-dynbegin = u2018Xu2019.
APPEND t_bdc. CLEAR t_bdc.
t_bdc-fnam = u2018BDC_OKCODEu2019.
t_bdc-fval = u2018=YESu2019.
APPEND t_bdc. CLEAR t_bdc.
ENDFORM. u201D FILL_BDC_TABLE
Best Regards -
Need standrad program for vendor aging report
Hi
Need standrad program for vendor aging report.
Please reply me only standrad programs.
Point are sure.
Regards,
kumarHi Pankaj
sorry to say that this is not my required program.
I need vendor aging report like s_alr_87012178 tc leads to customer aging report.
Thanks for your effort.
points are awarded.
Regards,
kumar -
I need a program for camera.The androide has a program IP Cam View basic that has the fohu HA 425 and I get the cameras.I downlouded the IP camera viewer in the Aple but this program doesnt have the fuho HA 425. Which apple program is compatible?
Hi,
As far as I know, Sony Ericsson Z520, like a lot of the other cell phones, doesn�t support bluetooth serial communication.
See:
http://developer.sonyericsson.com/entry.jspa?externalID=138&categoryID=5
BUT(!) You should double check this information.
If you ask me, we have done similar project.
We are working on hobby project � our robot use J2ME cell phone as on-board brain.
And there is connection between this small robot and Linux-based PC.
Communication was done via BlueTooth (in reality we use Linux implementation of BlueTooth stack and obexftp).
BUT (!) We use Siemens S75 for this communication.
I�m afraid that Siemens is the only manufacture, which implemented serial communication over bluetooth, embedded camera and non-usb socket.
Also there are some Motorola phones, which implement serial communication over bluetooth.
But � note that all Motorola phones use USB sockets and it will not be easy for you to make connection between such a phone and the robot.
If you need just connection between cell phone and PC, then may be USB is OK too.
Our robot project: www.RoboHobby.com -
Need a program for Y/Z report (extended report ) in START_REPORT
Hi,
Am trying to execute a Y transaction (report ) which is called by start_report transaction. Pls find the details below.
D_SREPOVARI-REPORTTYPE= RE
D_SREPOVARI-REPORT=
D_SREPOVARI-EXTDREPORT= KP 01RPSCO_X Z12KST1D4
I want to execute this by using SUBMIT statement, for that need a program name of Y report . Let me know the prog name / How to execute this type of reports ?
Thanks in advance.
Best regards,
Shasidhar.CHi ,
Am trying to execute a Y/S transaction ( extended reports S_ALR_87013559 / S_ALR_87013557 / Y_DVE_38000074 / Y_DVE_38000044 ) in a custom report. The transactions are related to budget/cost/planing reports in PS module. In se 93, that is called by START_REPORT transaction with the below mentioned details.
D_SREPOVARI-REPORTTYPE= RE "report type
D_SREPOVARI-REPORT=
D_SREPOVARI-EXTDREPORT= KP 01RPSCO_X Z12KST1D4 "extended report
The Y/S transaction program is varying from client to client. We are using ECC6.0 version.
Thanks & Regards,
Shasidhar.C -
How to send the Report output thru email
Dear All,
Is there a way to send the output of a abap report thru mail. I am sure it is there.
My report output is as following.
Emp Code : A01234
Name: XYZ
Email-ID: [email protected]
Dear XYZ,
You have Rs....... as outstanding. Please clear all dues by ..(date).
Thankyou,
asdf.
Please advice how to accomplish this. Send a sample source code if possible.
Regards,
Alok.Below you can find the sample code for sending the report as email.
Do use this as cross reference..
DATA: reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
listobject LIKE abaplist OCCURS 0 WITH HEADER LINE,
so_ali LIKE soli OCCURS 0 WITH HEADER LINE,
list_index LIKE sy-lsind VALUE 0,
packing_list LIKE sopcklsti1,
docdata LIKE sodocchgi1,
tab_lines TYPE i,
l_rqident LIKE tsp01-rqident,
att_type LIKE soodk-objtp.
objtxt[] = mail_text[].
IF p_skip_attach IS INITIAL. " INS SIR 3971 TODD
SYSTEM-CALL LOAD LISTLEVEL-STACK INTO wrkstack.
IF wrkstack[] IS INITIAL.
SKIP 2.
WRITE: /30 text-001 COLOR 5.
ENDIF.
ENDIF. " INS SIR 3971 TODD
Prepare Receipient List
REFRESH: reclist.
LOOP AT rcpnt_userids.
IF rcpnt_userids-l_adr_name NA '@'.
reclist-receiver = rcpnt_userids-usrnam.
reclist-rec_type = 'B'.
reclist-express = 'X'.
ELSE.
reclist-receiver = rcpnt_userids-l_adr_name.
reclist-rec_type = 'U'.
reclist-express = 'X'.
ENDIF.
APPEND reclist.
CLEAR reclist.
ENDLOOP.
Prepare Doc Data
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
docdata-obj_langu = sy-langu.
docdata-obj_name = 'ABAP Listing'.
docdata-obj_descr = subject.
docdata-sensitivty = 'O'.
Prepare OBJPACK
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
APPEND objpack.
att_type = 'ALI'.
DESCRIBE TABLE so_ali LINES tab_lines.
READ TABLE so_ali INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( so_ali ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = subject.
APPEND objpack.
SAP supplied API function module to send Message
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
TABLES
packing_list = objpack
object_header = objhead
contents_bin = so_ali
contents_txt = objtxt
receivers = reclist
EXCEPTIONS
too_many_reclist = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE i398(00) WITH 'SAP Office API Error'
sy-subrc
ENDIF. -
Need to send the report output in email body.
Hi Friends,
I need to send the report output in body of the email but not as an attachment.
Requesting your suggestions. Please elaborated answers are expected.
Thanks & Regards,
S.Suresh Babu.If you are looking for same output to be available in the email body, i think this is not possible.
If you are just concentrated on the data, then you can do as below.
1. In your custom program, submit the actual report program via spool and by making use of that spool, read the spool content (We have function modules which can download the content from spool to the internal table), and by making use of this internal table, build the actual internal table as required which will be passed to email function module lets say SO_OBJECT_SEND etc..
2. You can make use of even LIST_TO_MEMORY and LIST_FROM_MEMORY function modules as well instead of spool, if you have data in the final internal table.
I am not sure, how can we handle in terms of logos if any.....or the data in the top of page related things...... -
Need a sample program for hierarchial oops ALV report
Hello experts,
I Need a sample program for hierarchial oops ALV report.Hi,
Check the following sample code...
T A B L E S
tables : ekko.
data definition
types : begin of ty_ekko,
ebeln type ekko-ebeln,
lifnr type ekko-lifnr,
bsart type ekko-bsart,
aedat type ekko-aedat,
ernam type ekko-ernam,
end of ty_ekko.
types : begin of ty_eket,
ebeln type ekpo-ebeln,
ebelp type ekpo-ebelp,
werks type ekpo-werks,
matnr type ekpo-matnr,
menge type eket-menge,
wamng type eket-wamng,
netpr type ekpo-netpr,
end of ty_eket.
data : it_ekko type table of ty_ekko,
it_eket type table of ty_eket.
data: ob_hieralv type ref to cl_salv_hierseq_table.
data: it_binding type salv_t_hierseq_binding,
is_binding type salv_s_hierseq_binding.
S E L C T O P T I O N S
select-options : s_ebeln for ekko-ebeln.
S T A R T O F S E L E C T I O N
start-of-selection.
select ebeln
lifnr
bsart
aedat
ernam from ekko
into corresponding fields of table it_ekko
where ebeln in s_ebeln.
if sy-subrc eq 0.
select aebeln aebelp
awerks amatnr
bmenge bwamng
a~netpr from ekpo as a join eket as b
on amandt = bmandt
and aebeln = bebeln
and aebelp = bebelp
into corresponding fields of table it_eket
where a~ebeln in s_ebeln.
endif.
is_binding-master = 'EBELN'.
is_binding-slave = 'EBELN'.
append is_binding to it_binding.
*TRY.
call method cl_salv_hierseq_table=>factory
exporting
t_binding_level1_level2 = it_binding
importing
r_hierseq = ob_hieralv
changing
t_table_level1 = it_ekko
t_table_level2 = it_eket .
*CATCH cx_salv_data_error .
*CATCH cx_salv_not_found .
*ENDTRY.
call method ob_hieralv->display( ).
Cheers,
Ram -
Send some sample program for ALV reports
Hi all ,
send some sample program for ALV reports for learing purpose
tahnks.Hi ,
Resource Master
Program YPPCRR *
Program type Report Program *
Title Resource Master Dara for Updation *
Author Naga Raju *
Requested By Balaji *
Date Written 24.05.2007 *
Specification Id F2-DP-FS-2-0002 *
Transport Request *
On-line Documentation
Description
This Program updates the Location Mater through the Transaction
/SAPAPO/LOC3 Based on the User Selection
Update
Reset
No Action
Output
ALV List output of the main Program
ALV List output of the Error Log
REPORT YPPCRR NO STANDARD PAGE HEADING
LINE-SIZE 120
LINE-COUNT 62(4)
MESSAGE-ID yap..
Global data
Include where all the data declarations are coded.
INCLUDE YPPCRR_data.
*Initialization
INITIALIZATION.
perform init_variant.
Constants
CONSTANTS: c_formname_top_of_page TYPE slis_formname
VALUE 'F_TOP_OF_PAGE'.
Selection-Screen
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-040.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS:p_prs RADIOBUTTON GROUP ztyp USER-COMMAND ucom DEFAULT 'X'.
SELECTION-SCREEN COMMENT 3(28) text-003.
position 40.
parameters: p_file1 TYPE rlgrap-filename.
SELECTION-SCREEN END OF LINE.
skip 5.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: p_aps RADIOBUTTON GROUP ztyp.
SELECTION-SCREEN COMMENT 3(28) text-004.
position 40.
parameters: p_file2 type rlgrap-filename.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN .
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = syst-repid
DYNPRO_NUMBER = SYST-DYNNR
field_name = p_file1
STATIC = ' '
MASK = ' '
CHANGING
file_name = p_file1
EXCEPTIONS
MASK_TOO_LONG = 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.
START-OF-SELECTION.
if p_prs = 'X'.
PERFORM f_read_datum1 TABLES t_res_head
USING p_file1
CHANGING w_subrc.
elseif p_aps = 'X'.
PERFORM f_read_datum2 TABLES t_res_head
USING p_file2
CHANGING w_subrc.
endif.
IF w_subrc = 0.
Validations
PERFORM VALIDATION.
PERFORM display_alv.
IF SY-UCOMM = '&F03'
or SY-UCOMM = '&F12'
or SY-UCOMM = '&F15'.
LEAVE LIST-PROCESSING.
ELSE.
ENDIF.
ELSE.
Message s100 with text-002.
ENDIF.
END-OF-SELECTION.
Forms part*
INCLUDE YPPCRR_forms.
*& Include YPPCRR_DATA
Type-Pools
TYPE-POOLS: slis.
*TYPES
DATA: BEGIN OF tl_res_head.
INCLUDE STRUCTURE ypp_res_head.
DATA: END OF tl_res_head.
DATA: BEGIN OF tl_res_head_val.
INCLUDE STRUCTURE ypp_resv.
DATA: END OF tl_res_head_val.
DATA : BEGIN OF ty_errlog ,
counter type i,
type(2) ,
name(10) TYPE c,
vrsioid(22) TYPE c,
restype TYPE c,
message(80) TYPE c,
END OF ty_errlog.
Global Variables
DATA : gc_flag(1) TYPE c,
w_val_err_flag(1) type c.
DATA: w_filename TYPE rlgrap-filename,
w_subrc TYPE sy-subrc,
w_t_res_head TYPE slis_t_fieldcat_alv,
wa_t_res_head TYPE slis_fieldcat_alv.
DATA : wa_date(10) TYPE c,
wa_time(10) TYPE c,
wa_title(40) TYPE c,
wa_type(4) TYPE c .
DATA: BAPI_RUN_YES_NO TYPE C.
*Structure
*INTERNAL TABLES USED BY ALV
DATA:
it_fieldcat_alv TYPE slis_t_fieldcat_alv,
IT_FIELDCAT_ALV_ERR TYPE SLIS_T_FIELDCAT_ALV,
it_status TYPE slis_formname VALUE 'F_MAIN',
it_user_command TYPE slis_formname VALUE 'F_USER_COMMAND',
it_events TYPE slis_t_event,
it_event_exit TYPE slis_t_event_exit,
it_list_comments TYPE slis_t_listheader,
it_excluding TYPE slis_t_extab,
it_sort TYPE slis_t_sortinfo_alv.
*Internal Table Declarations
DATA : BEGIN OF t_imex OCCURS 0 ,
string(256) TYPE c,
END OF t_imex.
DATA : fcode TYPE TABLE OF sy-ucomm.
DATA : fcode_bdc TYPE TABLE OF sy-ucomm.
DATA : fcode_error TYPE TABLE OF sy-ucomm.
DATA : fcode_final TYPE TABLE OF sy-ucomm.
STRUCTURE and WORKARES
*Internal Table Declarations
DATA : t_res_head like tl_res_head occurs 0 WITH HEADER LINE.
DATA : t_res_head_val like tl_res_head_val occurs 0 with header line.
data :l_res_head LIKE LINE OF t_res_head.
DATA : w_file TYPE string.
*DATA : wa_vrsioid(22) type c,
wa_locno(20) type c,
wa_calendar(2) type c,
wa_planner(3) type c.
DATA: T_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
DATA: RESOURCE_HEAD LIKE BAPI10004RESHEAD OCCURS 0 WITH HEADER LINE,
RESOURCE_HEAD_X LIKE BAPI10004RESHEADX OCCURS 0 WITH HEADER LINE,
RESOURCE_TEXT LIKE BAPI10004RESTEXT OCCURS 0 WITH HEADER LINE,
RESOURCE_TEXT_X LIKE BAPI10004RESTEXTX OCCURS 0 WITH HEADER LINE.
data : t_errlog like ty_errlog occurs 0 with header line.
DATA : wk_lines TYPE i,
wk_errlines TYPE i,
wk_count TYPE i.
DATA: g_tabname TYPE slis_tabname VALUE 'T_RES_HEAD'.
Variables to be used by ALV
DATA:
wk_variant LIKE disvariant,
wx_variant LIKE disvariant,
wk_variant_save(1) TYPE c,
wk_exit(1) TYPE c,
wk_repid LIKE sy-repid,
wk_user_specific(1) TYPE c,
wk_callback_ucomm TYPE slis_formname,
wk_callback_status TYPE slis_formname,
wk_callback_status1 TYPE slis_formname,
wk_print TYPE slis_print_alv,
wk_layout TYPE slis_layout_alv,
wk_html_top_of_page TYPE slis_formname,
wk_fieldcat_alv LIKE LINE OF it_fieldcat_alv,
wk_excluding LIKE LINE OF it_excluding,
wk_events LIKE LINE OF it_events,
wk_event_exit LIKE LINE OF it_event_exit,
wk_list_comments LIKE LINE OF it_list_comments,
wk_list1_comments LIKE LINE OF it_list_comments,
wk_list2_comments LIKE LINE OF it_list_comments,
wk_sort LIKE LINE OF it_sort.
*DATA :gc_delete_flag(1).
*& Include YAPOLOC_FORMS
FORM display_alv .
PERFORM f_fieldcat_build.
PERFORM f_event_build.
PERFORM f_exclude_build.
PERFORM f_print_build.
PERFORM f_layout_build.
PERFORM f_display_data.
ENDFORM. " display_alv
*& Form f_fieldcat_build
text
FORM f_fieldcat_build .
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = wk_repid
i_structure_name = 'YPP_RESV'
i_inclname = wk_repid
CHANGING
ct_fieldcat = it_fieldcat_alv.
ENDFORM. " F_FIELDCAT_BUILD
*& Form F_EVENT_BUILD
text
> p1 text* < p2 text
FORM f_event_build .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events.
READ TABLE it_events WITH KEY
name = slis_ev_top_of_page INTO wk_events.
IF sy-subrc = 0.
MOVE c_formname_top_of_page TO wk_events-form.
MODIFY it_events FROM wk_events INDEX sy-tabix.
ENDIF.
ENDFORM. " F_EVENT_BUILD
*& Form F_EXCLUDE_BUILD
text
--> p1 text
<-- p2 text
FORM f_exclude_build .
wk_excluding = '&GRAPH'. "Graphic
APPEND wk_excluding TO it_excluding.
ENDFORM. " F_EXCLUDE_BUILD
*& Form F_PRINT_BUILD
text
--> p1 text
<-- p2 text
FORM f_print_build .
wk_print-no_print_listinfos = 'X'.
ENDFORM. " F_PRINT_BUILD
*& Form F_LAYOUT_BUILD
text
--> p1 text
<-- p2 text
FORM f_layout_build .
wk_layout-zebra = 'X'.
WK_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
wk_layout-detail_popup = 'X'.
wk_layout-detail_initial_lines = 'X'.
wk_layout-detail_titlebar = 'Details '.
ENDFORM. " F_LAYOUT_BUILD
*& Form F_DISPLAY_DATA
text
--> p1 text
<-- p2 text
FORM f_display_data .
wk_callback_ucomm = 'CALLBACK_UCOMM'.
IF sy-ucomm = 'UPD' OR sy-ucomm = space .
wk_callback_status = 'CALLBACK_STATUS'.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_background_id = 'SIWB_WALLPAPER'
i_callback_program = wk_repid
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
i_callback_pf_status_set = wk_callback_status
i_callback_user_command = wk_callback_ucomm
it_sort = it_sort
i_default = 'X'
i_save = 'A'
is_variant = wk_variant
is_layout = wk_layout
it_fieldcat = it_fieldcat_alv
it_events = it_events
it_event_exit = it_event_exit
it_excluding = it_excluding
is_print = wk_print
TABLES
t_outtab = t_res_head_val.
ENDFORM. " F_DISPLAY_DATA
ALV for Error Log
*& Form display_alv_ERR
text
--> p1 text
<-- p2 text
FORM display_alv_err .
PERFORM f_fieldcat_build_err.
PERFORM f_event_build_err.
PERFORM f_exclude_build_err.
PERFORM f_print_build_err.
PERFORM f_layout_build_err.
PERFORM f_display_data_err.
ENDFORM. " display_alv_ERR
*& Form F_FIELDCAT_BUILD_err
text
--> p1 text
<-- p2 text
FORM f_fieldcat_build_err .
BREAK-POINT.
REFRESH it_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = wk_repid
i_internal_tabname = 'TY_ERRLOG'
i_structure_name = 'YPP_ERR_LOG'
i_inclname = wk_repid
CHANGING
ct_fieldcat = it_fieldcat_alv_err.
LOOP AT it_fieldcat_alv INTO wk_fieldcat_alv.
CASE wk_fieldcat_alv-fieldname.
WHEN 'COUNTER'.
wk_fieldcat_alv-seltext_s = text-023.
wk_fieldcat_alv-seltext_m = text-023.
wk_fieldcat_alv-seltext_l = text-023.
wk_fieldcat_alv-reptext_ddic = text-023.
wk_fieldcat_alv-edit = 'X'.
WHEN 'TYPE'.
wk_fieldcat_alv-seltext_s = text-009.
wk_fieldcat_alv-seltext_m = text-009.
wk_fieldcat_alv-seltext_l = text-009.
wk_fieldcat_alv-reptext_ddic = text-009.
wk_fieldcat_alv-edit = 'X'.
WHEN 'NAME'.
wk_fieldcat_alv-seltext_s = text-010.
wk_fieldcat_alv-seltext_m = text-010.
wk_fieldcat_alv-seltext_l = text-010.
wk_fieldcat_alv-reptext_ddic = text-010.
wk_fieldcat_alv-edit = 'X'.
WHEN 'VRSIOID'.
wk_fieldcat_alv-seltext_s = text-011.
wk_fieldcat_alv-seltext_m = text-011.
wk_fieldcat_alv-seltext_l = text-011.
wk_fieldcat_alv-reptext_ddic = text-011.
wk_fieldcat_alv-edit = 'X'.
WHEN 'RESTYPE'.
wk_fieldcat_alv-seltext_s = text-012.
wk_fieldcat_alv-seltext_m = text-012.
wk_fieldcat_alv-seltext_l = text-012.
wk_fieldcat_alv-reptext_ddic = text-012.
wk_fieldcat_alv-edit = 'X'.
WHEN 'MESSAGE'.
wk_fieldcat_alv-seltext_s = text-013.
wk_fieldcat_alv-seltext_m = text-013.
wk_fieldcat_alv-seltext_l = text-013.
wk_fieldcat_alv-reptext_ddic = text-013.
wk_fieldcat_alv-edit = 'X'.
WHEN OTHERS.
ENDCASE.
MODIFY it_fieldcat_alv FROM wk_fieldcat_alv.
ENDLOOP.
ENDFORM. " F_FIELDCAT_BUILD_err
*& Form F_EVENT_BUILD_err
text
--> p1 text
<-- p2 text
FORM f_event_build_err .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = it_events.
READ TABLE it_events WITH KEY name = slis_ev_top_of_page
INTO wk_events.
IF sy-subrc = 0.
MOVE c_formname_top_of_page TO wk_events-form.
MODIFY it_events FROM wk_events INDEX sy-tabix.
ENDIF.
ENDFORM. " F_EVENT_BUILD_err
*& Form F_EXCLUDE_BUILD_err
text
--> p1 text
<-- p2 text
FORM f_exclude_build_err .
wk_excluding = '&GRAPH'. "Graphic
APPEND wk_excluding TO it_excluding.
ENDFORM. " F_EXCLUDE_BUILD_err
*& Form F_PRINT_BUILD_err
text
--> p1 text
<-- p2 text
FORM f_print_build_err .
wk_print-no_print_listinfos = 'X'.
ENDFORM. " F_PRINT_BUILD_err
*& Form F_LAYOUT_BUILD_err
text
--> p1 text
<-- p2 text
FORM f_layout_build_err .
wk_layout-zebra = 'X'.
WK_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
wk_layout-detail_popup = 'X'.
wk_layout-detail_initial_lines = 'X'.
wk_layout-detail_titlebar = 'Details '.
ENDFORM. " F_LAYOUT_BUILD_err
*& Form F_DISPLAY_DATA_err
text
--> p1 text
<-- p2 text
FORM f_display_data_err .
wk_callback_ucomm = 'CALLBACK_UCOMM'.
IF SY-UCOMM ne '&F03'.
wk_callback_status = 'CALLBACK_STATUS'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_background_id = 'SIWB_WALLPAPER'
i_callback_program = wk_repid
i_callback_pf_status_set = wk_callback_status
i_callback_user_command = wk_callback_ucomm
it_sort = it_sort
i_default = 'X'
i_save = 'A'
is_variant = wk_variant
is_layout = wk_layout
it_fieldcat = it_fieldcat_alv_err
it_events = it_events
it_event_exit = it_event_exit
it_excluding = it_excluding
is_print = wk_print
TABLES
t_outtab = t_errlog.
KEEP EERRLOG BUTTON
SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD' IMMEDIATELY.
ENDFORM. "f_display_data_err
**& Form F_TOP_OF_PAGE
text
FORM f_top_of_page.
CLEAR: it_list_comments[],
wk_list_comments,
wk_list1_comments,
wk_list2_comments.
wk_list_comments-typ = 'H'. "H=Header,S=Selection, A=Action
wk_list_comments-key = ''.
CASE sy-ucomm.
WHEN ''.
wk_list_comments-info = text-030.
WHEN 'UPD'.
IF t_errlog[] IS INITIAL.
wk_list_comments-info = text-031.
ELSE.
wk_list_comments-info = text-032.
ENDIF.
WHEN 'ERRLOG'.
wk_list_comments-info = text-032.
WHEN '&F03'.
wk_list_comments-info = text-031.
WHEN '&F15'.
wk_list_comments-info = text-031.
WHEN '&F12'.
wk_list_comments-info = text-031.
ENDCASE.
APPEND wk_list_comments TO it_list_comments.
WRITE sy-datum TO wa_date.
WRITE sy-uzeit TO wa_time.
wk_list_comments-typ = 'S'. "H=Header, S=Selection, A=Action
wk_list_comments-key = ''.
wk_list_comments-info = 'User:'.
wk_list1_comments-info = sy-uname.
CONCATENATE wk_list_comments wk_list1_comments
INTO wk_list2_comments.
APPEND wk_list2_comments TO it_list_comments.
wk_list_comments-typ = 'S'. "H=Header, S=Selection, A=Action
wk_list_comments-key = ''.
wk_list_comments-info = ' Run Date : '.
wk_list1_comments-info = wa_date.
CONCATENATE wk_list_comments wk_list1_comments
INTO wk_list2_comments .
APPEND wk_list2_comments TO it_list_comments.
wk_list_comments-typ = 'S'. "H=Header, S=Selection, A=Action
wk_list_comments-key = ''.
wk_list_comments-info = 'Run Time : '.
wk_list1_comments-info = wa_time.
CONCATENATE wk_list_comments wk_list1_comments
INTO wk_list2_comments .
APPEND wk_list2_comments TO it_list_comments.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
I_LOGO = 'ENJOYSAP_LOGO'
it_list_commentary = it_list_comments.
ENDFORM. "F_TOP_OF_PAGE
FORM USER_COMMAND_SAMPLE *
--> UCOMM *
--> SELFIELD *
FORM callback_ucomm USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
DATA: v_langu(2) ,
v_loctype TYPE /sapapo/c_loctype.
data err_flg(1).
IF bapi_run_yes_no IS INITIAL.
CASE sy-ucomm.
WHEN 'UPD'.
bapi_run_yes_no = 'X'.
LOOP AT t_res_head_val WHERE val_err_msg EQ space.
v_langu = 'EN'.
refresh tables
REFRESH : resource_head ,
resource_head_x ,
resource_text ,
resource_text_x,
t_return.
CLEAR : resource_head ,
resource_head_x ,
resource_text ,
resource_text_x,
t_return .
resource_head-resource = t_res_head-name .
resource_head-restype = t_res_head-restype.
resource_head-location = t_res_head-locno.
CLEAR : v_loctype .
SELECT SINGLE loctype FROM /sapapo/loc CLIENT SPECIFIED
INTO v_loctype
WHERE mandt = sy-mandt
AND locno = t_res_head-locno.
resource_head-loctype = v_loctype.
resource_head-calendar = t_res_head-calendar.
resource_head-type = t_res_head-type.
IF t_res_head-type = '03'.
resource_head-dimension_bucket = t_res_head-dimension_bucket.
ELSE.
resource_head-dimension_bucket = space.
ENDIF.
APPEND resource_head.
CLEAR resource_head.
resource_head_x-resource = t_res_head-name.
resource_head_x-restype = 'X'.
resource_head_x-location = 'X'.
resource_head_x-loctype = 'X'.
resource_head_x-calendar = 'X'.
resource_head_x-type = 'X'.
IF t_res_head-type = '03'.
resource_head_x-dimension_bucket = 'X'.
ELSE.
resource_head_x-dimension_bucket = space.
ENDIF.
APPEND resource_head_x.
CLEAR resource_head_x.
resource_text-resource = t_res_head-name.
resource_text-langu = v_langu.
resource_text-res_short_text = t_res_head-text.
APPEND resource_text.
CLEAR resource_text.
resource_text_x-resource = t_res_head-name.
resource_text_x-langu = v_langu.
resource_text_x-res_short_text = 'X'.
APPEND resource_text_x.
CLEAR resource_text_x.
call bapi
CALL FUNCTION 'BAPI_RSSRVAPS_SAVEMULTI_30A'
EXPORTING
logical_system = 'AD2CLNT200'
business_system_group = 'BSG001'
commit_control = 'E'
NO_CREATE = ' '
TABLES
resource_head = resource_head
resource_head_x = resource_head_x
resource_text = resource_text
resource_text_x = resource_text_x
return = t_return.
IF sy-subrc = 0.
LOOP AT t_return WHERE type = 'E'
OR type = 'A'.
MOVE t_res_head_val-counter TO t_errlog-counter.
MOVE t_res_head_val-type TO t_errlog-type.
MOVE t_res_head_val-name TO t_errlog-name.
MOVE t_res_head_val-vrsioid TO t_errlog-vrsioid.
MOVE t_res_head_val-restype TO t_errlog-restype.
MOVE t_return-message TO t_errlog-message.
APPEND t_errlog.
CLEAR t_errlog..
ENDLOOP.
IF not t_errlog[] is initial..
IF sy-subrc = 0.
ERROR POP UP
MESSAGE text-007 type 'I'.
ELSE.
err_flg = 'X'.
SUCC POP UP
MESSAGE text-008 type 'I'.
ENDIF.
ELSE. "NE 0
LOOP AT t_return WHERE type = 'E'
OR type = 'A'.
MOVE t_res_head_val-counter TO t_errlog-counter.
MOVE t_res_head_val-type TO t_errlog-type.
MOVE t_res_head_val-name TO t_errlog-name.
MOVE t_res_head_val-vrsioid TO t_errlog-vrsioid.
MOVE t_res_head_val-restype TO t_errlog-restype.
MOVE t_return-message TO t_errlog-message.
APPEND t_errlog.
CLEAR t_errlog..
ENDLOOP.
IF sy-subrc = 0.
ELSE.
MOVE t_res_head_val-counter TO t_errlog-counter.
MOVE t_res_head_val-type TO t_errlog-type.
MOVE t_res_head_val-name TO t_errlog-name.
MOVE t_res_head_val-vrsioid TO t_errlog-vrsioid.
MOVE t_res_head_val-restype TO t_errlog-restype.
MOVE 'Error in Creation' TO t_errlog-message.
APPEND t_errlog.
CLEAR t_errlog..
ENDIF.
ENDIF.
ENDLOOP.
gc_flag = 'X'.
REFRESH fcode.
if err_flg = 'X'.
MESSAGE text-008 type 'I'.
endif.
ENDCASE.
ENDIF.
IF NOT t_errlog[] IS INITIAL.
wk_list_comments-info = text-032.
APPEND wk_list_comments TO it_list_comments.
APPEND 'UPD' TO fcode_error.
APPEND 'ERRLOG' TO fcode_error.
SET PF-STATUS 'ZSTANDARD' EXCLUDING fcode_error.
PERFORM display_alv_err.
ELSE.
ENDIF.
ENDFORM. "CALLBACK_UCOMM=
*& Form CALLBACK_STATUS
text
-->RT_EXTAB text
FORM callback_status USING rt_extab TYPE slis_t_extab.
IF bapi_run_yes_no IS NOT INITIAL .
IF t_errlog[] IS INITIAL.
REFRESH fcode.
APPEND 'UPD' TO fcode.
APPEND 'ERRLOG' TO fcode.
SET PF-STATUS 'ZSTANDARD' EXCLUDING 'ERRLOG'.
SET PF-STATUS 'ZSTANDARD' EXCLUDING fcode IMMEDIATELY .
ENDIF.
ELSE.
SET PF-STATUS 'ZSTANDARD' EXCLUDING 'ERRLOG' IMMEDIATELY .
ENDIF.
ENDFORM. "CALLBACK_STATUS
*& Form CALLBACK_STATUS1
text
-->RT_EXTAB text
FORM callback_status1 USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD'.
ENDFORM. " CALLBACK_STATUS
*& Form CALLBACK_STATUS2
text
-->RT_EXTAB text
FORM callback_status2 USING rt_extab TYPE slis_t_extab.
REFRESH fcode_final.
IF sy-ucomm NE '&F03'.
APPEND 'UPD' TO fcode_final.
APPEND 'ERRLOG' TO fcode_final.
SET PF-STATUS 'ZSTANDARD' EXCLUDING fcode_final.
ELSE.
SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD'.
ENDIF.
ENDFORM. "CALLBACK_STATUS2
*& Form callback_ucomm_E
text
-->UCOMM text
-->SELFIELD text
FORM callback_ucomm_e USING ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
CASE sy-ucomm.
WHEN 'ERRLOG' .
PERFORM display_alv_err.
WHEN '&F03'.
SET PF-STATUS 'ZSTANDARD' EXCLUDING 'UPD' IMMEDIATELY .
PERFORM display_alv .
ENDCASE.
ENDFORM. "CALLBACK_UCOMM=
*& Form init_variant
text
--> p1 text
<-- p2 text
FORM init_variant .
CLEAR: wk_variant.
wk_repid = sy-repid.
wk_variant-report = wk_repid.
wk_variant-username = sy-uname.
wk_variant_save = 'A'. "All types
ENDFORM. " init_variant
*& Form f_read_datum1
text
-->P_T_RES_HEAD text
-->P_P_FILE1 text
<--P_W_SUBRC text
FORM f_read_datum1 TABLES p_t_res_head STRUCTURE ypp_res_head
USING p_p_file1
CHANGING p_w_subrc.
DATA : iexcel LIKE zexcel_read OCCURS 0 WITH HEADER LINE.
CLEAR p_w_subrc.
CALL FUNCTION 'ZALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_p_file1
i_begin_col = 1
i_begin_row = 1
i_end_col = 62
i_end_row = 50000
TABLES
intern = iexcel
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
p_w_subrc = 0 .
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT iexcel WHERE row > 2.
IF iexcel-col = '0001'.
p_t_res_head-type = iexcel-value.
ENDIF.
IF iexcel-col = '0002'.
p_t_res_head-name = iexcel-value.
ENDIF.
IF iexcel-col = '0003'.
p_t_res_head-vrsioid = iexcel-value.
ENDIF.
IF iexcel-col = '0004'.
p_t_res_head-restype = iexcel-value.
ENDIF.
IF iexcel-col = '0005'.
p_t_res_head-locno = iexcel-value.
ENDIF.
IF iexcel-col = '0006'.
p_t_res_head-tzone = iexcel-value.
ENDIF.
IF iexcel-col = '0007'.
p_t_res_head-calendar = iexcel-value.
ENDIF.
IF iexcel-col = '0008'.
p_t_res_head-planner = iexcel-value.
ENDIF.
IF iexcel-col = '0009'.
p_t_res_h -
Need sample program OO abap alv using hotspot( interactive report)
need sample program on Object Oriented program using alv interactive report.
*& Report Z8VM_N_PO_PRICING_CONDITION *
REPORT Z8VM_N_PO_PRICING_CONDITION NO STANDARD PAGE HEADING
MESSAGE-ID Z8VM.
vivekanand meghmala
trial assignment
po with pricing condition interactive report with checkbox
data declaration
TYPES : BEGIN OF STRUCT_EKKO, "po header
BUKRS LIKE T001-BUKRS,
EBELN LIKE EKKO-EBELN,
BSART LIKE EKKO-BSART,
BEDAT LIKE EKKO-BEDAT,
EKORG LIKE EKKO-EKORG,
WAERS LIKE EKKO-WAERS,
LIFNR LIKE EKKO-LIFNR,
KNUMV LIKE EKKO-KNUMV,
END OF STRUCT_EKKO.
TYPES : BEGIN OF STRUCT_EKPO, "po details
EBELN LIKE EKPO-EBELN,
EBELP LIKE EKPO-EBELP,
MATNR LIKE EKPO-MATNR,
END OF STRUCT_EKPO.
TYPES : BEGIN OF STRUCT_KONV,
KNUMV LIKE KONV-KNUMV,
KPOSN LIKE KONV-KPOSN,
KSCHL LIKE KONV-KSCHL,
KAWRT LIKE KONV-KAWRT,
KBETR LIKE KONV-KBETR,
END OF STRUCT_KONV.
DATA : IT_EKKO TYPE STANDARD TABLE OF STRUCT_EKKO WITH HEADER LINE.
DATA : IT_EKPO TYPE STANDARD TABLE OF STRUCT_EKPO WITH HEADER LINE.
DATA : IT_KONV TYPE STANDARD TABLE OF STRUCT_KONV WITH HEADER LINE.
PARAMETERS : T_BUKRS LIKE EKKO-BUKRS .
SELECT-OPTIONS : S_BEDAT FOR IT_EKKO-BEDAT.
SELECT-OPTIONS : S_EKORG FOR IT_EKKO-EKORG.
validations
AT SELECTION-SCREEN.
IF T_BUKRS = ' '.
MESSAGE E009.
ENDIF.
SELECT BUKRS FROM T001
INTO CORRESPONDING FIELDS OF IT_EKKO
WHERE BUKRS = T_BUKRS.
EXIT.
ENDSELECT.
IF SY-SUBRC 0.
MESSAGE E001.
ENDIF.
logic
START-OF-SELECTION.
SELECT BUKRS
EBELN
BSART
BEDAT
EKORG
WAERS
LIFNR
KNUMV FROM EKKO INTO CORRESPONDING FIELDS OF TABLE IT_EKKO
WHERE BUKRS = T_BUKRS
AND BEDAT IN S_BEDAT
AND EKORG IN S_EKORG.
SELECT EBELN
EBELP
MATNR FROM EKPO INTO CORRESPONDING FIELDS OF IT_EKPO
FOR ALL ENTRIES IN IT_EKKO WHERE EBELN = IT_EKKO-EBELN.
APPEND IT_EKPO.
ENDSELECT.
LOOP AT IT_EKPO.
SELECT KNUMV
KPOSN
KSCHL
KAWRT
KBETR FROM KONV INTO CORRESPONDING FIELDS OF IT_KONV
WHERE KPOSN = IT_EKPO-EBELP.
APPEND IT_KONV.
ENDSELECT.
ENDLOOP.
*data printing
LOOP AT IT_EKKO.
WRITE :/ IT_EKKO-BUKRS,IT_EKKO-EBELN,IT_EKKO-BSART,IT_EKKO-BEDAT,
IT_EKKO-EKORG,IT_EKKO-WAERS,IT_EKKO-LIFNR,IT_EKKO-KNUMV.
LOOP AT IT_EKPO WHERE EBELN = IT_EKKO-EBELN.
WRITE :/ IT_EKPO-EBELP,IT_EKPO-MATNR.
LOOP AT IT_KONV.
WHERE KPOSN = IT_EKPO-EBELN.
WRITE :/ IT_KONV-KNUMV COLOR 3,IT_KONV-KPOSN COLOR 3,IT_KONV-KSCHL COLOR 3,IT_KONV-KAWRT COLOR 3,IT_KONV-KBETR COLOR 3.
ENDLOOP.
ENDLOOP.
ENDLOOP.[/code]
thanks
reward if helpful -
Need a Syatem variable for Executing the report by RFC.
Hi Experts,
Need a Syatem variable for Executing the report by RFC.
what i mean to say is,i can execure the report directly ...then no issues.
But if i execute the Report by RFC ,then i should put a condition with system variable...
Please suggest me ,how can put a condition when i am executing the report through RFC.
Thanks
BabuHello Friend,
what I understood that you want to put some extra condition if that report is getting called from RFC...
you can use the system variable SY-CPROG....it will hold the value of the report when it is geeting executing directly...
but when it is getting executed therough RFC...it will hold that RFC name...
Thanks
Krish -
Need to Print the Report Output
Hi,
I want to print the report output. How to install a printer in Oracle Appls. If i give number of copies 1 or morethan 1(from SRS Window)...the report is completed-warning. pls advice
Thanks in advance.Hi,
I changed the printer to Epson LQ2170 and Epson LQ2180 but since I don't know the initialization and reset parameter (already search for the manual but couldn't find it, downloaded from Epson's website but couldn't find it either) so I register it with LQ1070. I'd tested to print the reports directly from Reports Builder 6i and it printed just as I wanted to but when I tried to print from oracle apps it only printed up to about 3/4 width of the paper. I tried to change the report's height and width, paper size, orientation but no luck. What should I do? Thanks -
i'm a new mac user and need to program future email's. How can I do that? in outlook I can make a change in the date that the email will be sent. How I do that in mail?
There isn't a way directly in Mail.
Here's what google says: http://www.google.com/search?client=safari&rls=en&q=mac+os+x+mail+delayed+send&i e=UTF-8&oe=UTF-8 -
Please send sample document for understanding the requirement for reports
Hi
Can some body send sample document for the understanding the requiremets of reports in BI
I nee to prepare sample document for understanding the requirement.
please help on this.
Regards,
Anand Reddyhai experts,
please share the code how to enable the selections at the rsa3 level ,if the generic extractor is based on function module.
thanks in advance -
Send the Report output to email from spool
Hi All,
The following process which i am doing to send the report output(Executed in background) to my mail id.
I ran the report in Background and got the output in the spool. i opened the spool from the transaction SM37 and send the output to my external mail id via the following process
click Spool Request->forward-> send SAP data
here i am getting one POP up in there i gave my mail id and tick the check box on Express and click copy.
Now i received the output in my mail .
By doing the above process in the Quality server i am receiving the output in the mail as a PDF format that is correct.(Output is also correct).
But when i execute the same in production server i am receiving the output in the mail as HTML format. (output and format is totally wrong). I want to know why its coming as HTML format instead of PDF format.
Kindly help me regarding this.. Any configuration is there? If yes please let me know soon..
Regards,
Navaneeth...Hi,
use scon, double-click on SMTP, select internet
and compare the types of you both SAP-Systems.
Hope it helps.
Regards, Dieter
Maybe you are looking for
-
How to display an error message in maintenace view
Hi, I have following requirement. I have a table. In the table, there is a field named REPORT which keeps an executable report name. When adding an entry i need to fill the field with an report name, which should exist in the system. The report name
-
Project Server 2010 - task shows NA as actual finish but zero work remaining?
So, here's the problem: We are running Server 2010, SP1 I believe (Can check this tomorrow when back in the office) Users update tasks via PWA but have various options around how they do these updates: they are able to update %complete (as a %age of
-
Help please, how do i convert itunes files to mp3 format. i purchased a hp notebook and it has itunes and windows xp home. i have always used windows media player and am new to itunes. do i have to go back to media player or can itunes do the convers
-
Shared members in duplicate member enabled EPMA outlines
Hi all, I have created an EPMA ASO "allow duplicate members application". I want to create an alternate shared hierarchy but all teh shared members are getting deployed in essbase as stored members. Do I need to enable any other property also so that
-
This is the second time that CS5 has completely wrecked a file. It happened after running a High Pass filter. As I was using the Hight Pass filter slider in the filter dialog the whole image was showing vertical and horizontal bands. I thought it