Information Broadcasting ( Automatically execute a report and e-mail it)
Hi,
Can BEx Automatically execute a report and e-mail it. The requirement is to Execute a Report periodically and send the report in <b>EXCEL SHEET</b> format to the given e-mail ID.
I have tried configuring it in HTML format.... but I need it EXCEL format.
Waiting for help from the SDN community...
Thanks in Advance.....
Hi,
You can send the workbook automatically when you schedule thru information broadcaster.
But you have to install precalculation server for distributing workbook..
Have a look at OSS note 760775 ..
Hope it helps..
Regards,
Siva.
Similar Messages
-
Which event automatically executes in report by default ?
which event automatically executes in report by default ?
Hi,
Abap is a event driven program all the event triggers sequentially but if no event is wrritten then everything comes under start-of-selection and it is triggered automatically.
By the way sequence of events are:-
1) initialization
2) At selection-screen output
3) At selection-screen on field
4) At selection-screen on block
5) At selection-screen
6) Start-of-selection
7) End-of-selection
8) top-of-page
9) end-of-page
10) At line selection
11) At PF<nn>
12) At User command
Reward some points
Bye,
Anomitro -
Set parameters input automatically in my report and connection to my base
Hello
this my programmes , it work it's ok ( see bottom of the page )
Now i have a rapport rpt with a input edit (example number customer )
I want by my file jsp that the number customer display automatically
in my rapport rpt ( variable string or integer or date) and after validate automaticcaly
and connection to my database automartically ( database oracle 8 user and paswword)
(by example with my url , i pass a parameters input and automatically i will see
the rapport rpt ) it's possible , How to make in jsp ?
thanks to help me
regards
Michel
Ps : Notes fresh for the connection in my database oracle
i have modified CrystalReportViewer.jsp but i have an message
"Information is needed before this report can be processed " why ?
<%@ page import="com.crystaldecisions.report.web.viewer.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.data.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSourceFactory2" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.reportsource.IReportSource" %>
<%
CrystalReportViewer viewer = new CrystalReportViewer();
ConnectionInfos connInfos = new ConnectionInfos();
IConnectionInfo connInfo1 = new ConnectionInfo();
connInfo1.setUserName("user");
connInfo1.setPassword("pass");
viewer.refresh();
Object reportSource = session.getAttribute("reportSource");
viewer.setReportSource(reportSource);
viewer.setDatabaseLogonInfos(connInfos);
viewer.setEnableLogonPrompt(false);
viewer.processHttpRequest(request, response,getServletConfig().getServletContext(), out);
viewer.dispose();
%>
this programmes are ok (but now i search to display a variable on my report)
via url
http://pa-81b36a7e9d/businessobjects/enterprise11/desktoplaunch/opendoc/view_report.jsp?sdoc=axeriatest&user=Administrator&pass=&cms=pa-81b36a7e9d
CrystalReportViewer.jsp
<%@ page import = "com.crystaldecisions.report.web.viewer.*"%>
<%
CrystalReportViewer viewer = new CrystalReportViewer();
viewer.setName("CrystalReportViewer");
viewer.setOwnPage(true);
//Enable Active-X print mode.
viewer.setPrintMode(CrPrintMode.ACTIVEX);
//Obtain report source of the report that the viewer will display.
Object reportSource = session.getAttribute("reportSource");
viewer.setReportSource(reportSource);
viewer.processHttpRequest(request, response, getServletConfig().getServletContext(), null);
%>
view_report.jsp
<%
Applies to Versions: XI
Creation Date: Febuary 28 2005
Description:
This sample to demonstrates how to view a Crystal Report on demand in
* the zero-client DHTML viewer.
Author: CW.
%>
<%@ page import = "com.crystaldecisions.sdk.occa.infostore.*,
com.crystaldecisions.sdk.plugin.desktop.common.*,
com.crystaldecisions.sdk.framework.*,
com.crystaldecisions.sdk.occa.security.*,
com.crystaldecisions.sdk.exception.SDKException,
com.crystaldecisions.sdk.occa.managedreports.IReportSourceFactory,
java.util.Locale,
com.crystaldecisions.sdk.occa.report.reportsource.IReportSource"
%>
<%@ include file = "logonform.jsp" %>
<%
String cms = request.getParameter("cms");
String user = request.getParameter("user");
String pass = request.getParameter("pass");
String sdocName = request.getParameter("sdoc");
try {
//If logon information is required, display the logonForm and exit.
//Create a special logon form that requests 2 Report Names
//(code for LogonForm class is included).
LogonForm logonform = new LogonForm(response, request, LogonForm.REPORT_NAME);
//if (logonform.display_if_needed()) return;
// ici doit recuperer le nom du document
logonform.reportname[0] = sdocName ; //"diagramme";
//Log in.
IEnterpriseSession enterpriseSession = CrystalEnterprise.getSessionMgr().logon(user,pass,cms,"secEnterprise");
//Grab the InfoStore from the httpsession
IInfoStore infoStore = (IInfoStore)enterpriseSession.getService("", "InfoStore");
//Query for the report object in the CMS. See the Developer Reference guide for more information the query language.
IInfoObjects oInfoObjects = (IInfoObjects)infoStore.query("SELECT TOP 1 * " +
"FROM CI_INFOOBJECTS " +
"WHERE SI_PROGID = 'CrystalEnterprise.Report' AND SI_INSTANCE=0 AND SI_NAME='" + logonform.reportname[0] + "'" );
if (oInfoObjects.size() > 0) {
//Retrieve the latest instance of the report
IInfoObject oInfoObject = (IInfoObject) oInfoObjects.get(0);
//Use the PS report factory to obtain a report source that will be processed on the Page Server.
IReportSourceFactory factoryPS = (IReportSourceFactory)enterpriseSession.getService("PSReportFactory");
Object reportSource = factoryPS.openReportSource((oInfoObject), Locale.ENGLISH);
session.setAttribute("reportSource", reportSource);
//View the report in the standard DHTML viewer.
response.sendRedirect("CrystalReportViewer.jsp");
else {
out.println("Report " + logonform.reportname[0] + " not found.");
catch(SDKException sdkEx) {
out.println(sdkEx);
%>
logonform.jsp
<%!
/**************************** class LogonForm ***************************
This logon form is used to gather the logon information needed
to login to Enterprise
private class LogonForm {
HttpServletResponse response;
HttpServletRequest request;
int num_reports_needed = 1;
String[] reportname;
public static final int NONE = 0;
public static final int REPORT_NAME = 1;
public static final int REPORT_NAME_X2 = 2;
Constructor - Save the response and request objects
LogonForm(HttpServletResponse response, HttpServletRequest request)
//this.response = response;
//this.request = request;
Constructor with options - Add some optional boxes to request other
input from the user such as reportnames.
LogonForm(HttpServletResponse response, HttpServletRequest request, int extra_requests) {
this.response = response;
this.request = request;
switch (extra_requests) {
case NONE:
break;
case REPORT_NAME:
num_reports_needed = 1;
reportname = new String[1];
break;
case REPORT_NAME_X2:
num_reports_needed = 2;
reportname = new String[2];
break;
%>oh thanks but i have an error on this example Viewingview_report_parameters
but where is my connection to my database in file jsp ?
thanks
windows
CMS NAme = MyCMS
user = myuser
pass = password
aut = enterprise
doc = my doc
ok
after enter values : i Put my values
ok
after click on button view report this is error
Etat HTTP 500 -
type Rapport d'exception
message
description Le serveur a rencontré une erreur interne () qui l'a empêché de satisfaire la requête.
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
cause mère
java.lang.NullPointerException
org.apache.jsp.opendoc.CrystalReportViewer_jsp._jspService(CrystalReportViewer_jsp.java:80)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note La trace complète de la cause mère de cette erreur est disponible dans les fichiers journaux de Apache Tomcat/5.0.27.
Apache Tomcat/5.0.27 -
Automatically execute a report
Hello gurus,
I am aware that this might be the newbie-question of the year, but nonetheless:
I would like to have the system periodically (e.g. once a month) execute a report (e.g. RMCBUH30, TAC MC44) with certain parameters and automatically print the result on a pre-defined printer.
Could somebody please point out how to do this? Any hints to fitting tutorials would be very welcome, too.
Thanks in advance
AliciaDear Alicia,
If my understanding is correct means,This program RMCBUH30 is related to T Code MC44.
Enter the parameters like the purchase organizations and plants and click on save button and save this as a variant after
entering some variant name ,meaning and include the check box for only for background processing and other parameters and
while scheduling the job in T Code SM36,after entering the program name,select this variant and schedule the job.
Check and revert back.
Regards
Mangalraj.S -
Can I execute a report and skip the first screen in CJE0
I'm trying to call transaction CJE0 and skip the first screen. The report name I'm assigning to the PID REI appears in the screen field, but you have to click execute to continue to the report.
Is there something I'm missing.
Thanks
KarenI've tried using the following code to run project reports without having to select the report name and exectue, but it is still leaving the user on the screen for CJE0 with the correct report name, but it's not skipping the screen and executing the report. Can you see what I'm doing wrong.
Thank-you for your help
Karen
Code -
data begin of bdcdata occurs 100.
include structure bdcdata.
data end of bdcdata.
data begin of itab occurs 10.
include structure bdcmsgcoll.
data end of itab.
data program like sy-repid.
program = '11ERL1A'.
bdcdata-program = 'SAPMKCEE'.
bdcdata-dynpro = '0500'.
bdcdata-dynbegin = 'X'.
append bdcdata. clear bdcdata.
bdcdata-fnam = 'RKB1D-REPID'.
bdcdata-fval = program.
append bdcdata. clear bdcdata.
call transaction 'CJE0' using bdcdata mode 'N'
messages into itab. -
Automatic scheduling of report and send the output to user via email
Good Morning,
Please i need to scheduled report and send the output via email in Discoverer . Please can someone assist in how to achieve this ?Hi,
You cannot schedule and email a Discoverer report using standard Discoverer scheduling. You have to use a third party scheduler and Discoverer Desktop running on a windows PC.
This presentation has some more details on how to do this.
Rod West -
Email to R/3 to execute a report and reply to requester
Is it possible to send an email to R/3 server to request the system to execute a report, then email the report back to the email sender?
I think not. But you can call to RFCs.
-
Information broadcasting in 2004s for pdf and HTML format throws error
hi experts,
I am broadcasting via e-mail, when i use output format as MHTML or XML it works fine, when i change the output format to pdf or html (as zip file) i get the following errors
<b>For PDF</b>
--><b><i>Settings ZTEST1 were started from the BEx Broadcaster </i></b>
--><b><i>Processing for user BSHKSC, language EN </i></b>
--><b><i>Processing setting ZTEST1</i></b>
Error: com.sap.ip.bi.base.exception.BIBaseRuntimeException
Error occurred during processing of framework class
CL_RSRD_PRODUCER_PRECALC, type PROD
<i><b>FOR HTML</b></i>
--><i><b>Settings ZTEST1 were started from the BEx Broadcaster</b></i>
--><i><b>Processing for user BSHKSC, language EN </b></i>
--><i><b>Processing setting ZTEST1</b></i>
Web template 0BROADCAST_INDEX_PAGE could not be intstantiated
Error occurred during processing of framework class
CL_RSRD_PRODUCER_PRECALC, type PROD
Anyhelp will be really appreciatedHi Guus,
We are not using the new authorizations we are still on 3.5 authorization and we tried for an user with SAP_ALL, SAP_NEW authorization , so i am not sure if this is an authorization problem.
We have a new issue on hand, initially i was able to broadcast thru xml,mhtml, xml formats, yesterday our portal was down, when the portal was brought up, i found that even the ones that were working were now throwing an error.
I spoke with the basis person, and he told me user mappings were lost, but even after restoring the user mapping were restored we still have the problem.
If this error is caused by lack of new authorization, atleast we know what we are dealing with, but for now iam not sure if this error is due to authorization or some settings on the web server side.
Message was edited by:
shiva k -
Changing layout at runtime, executing background job and sending mail inXLS
Hi
When i execute my program in foregroung by manually changing value of s_job = 'X' in debugging mode it is sending the correct XLS file via mail with all the data , whereas when i execute my program in backgroud mode it sends incomlete XLS file via mail, it has only first 2 records in any layout........can anybody please help in this regard....
program is as follows...
REPORT ZPMACR01_MD_MRP_100.
*& Report : ZPMACR01_MD_MRP_100
TABLES : MARA, MARC, MAKT, MBEW,MARD.
MAIL data declarations
TABLES : adr6 , sscrfields.
DATA: BEGIN OF mbody OCCURS 0,
message(100),
END OF mbody.
DATA: BEGIN OF addresses OCCURS 0,
addresses(100),
END Of addresses.
FIELD-SYMBOLS: <f> type ANY,
<tab> TYPE STANDARD TABLE,
<wa> type ANY.
DATA: count TYPE i value 0,
col_1 TYPE i.
DATA: new_table TYPE REF TO data, "pointer to dynamic table
new_line TYPE REF TO data. "pointer to work area of dynamic table
DATA: s_job TYPE c.
DATA: i_data_out_text TYPE string OCCURS 0 WITH HEADER LINE.
DATA: message TYPE string OCCURS 0 WITH HEADER LINE.
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: BEGIN OF it_attach OCCURS 0,
line(2650) TYPE c,
END OF it_attach.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_hex LIKE solix OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c,
w_doc_data LIKE sodocchgi1,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
ALV data declarations
TYPE-POOLS: SLIS.
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
IT_FIELDCAT2 TYPE LVC_T_FCAT,
IT_FIELDCAT_FIN TYPE LVC_T_FCAT,
IT_FIELDCAT3 TYPE SLIS_T_FIELDCAT_ALV,
itab1 TYPE SLIS_T_FIELDCAT_ALV,
W_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
W_REPID TYPE SY-REPID,
IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA: is_fieldcat LIKE LINE OF it_fieldcat.
DATA: is_fieldcat2 LIKE LINE OF it_fieldcat2,
Is_FIELDCAT3 LIKE LINE OF it_fieldcat3.
Data: variant type DISVARIANT,
v_size LIKE sy-tabix.
ALV Data
DATA:
i_sort TYPE slis_t_sortinfo_alv,
v_lvc_title TYPE lvc_title,
v_repid LIKE sy-repid,
c_user_command TYPE slis_formname VALUE 'ALV_USER_COMMAND',
gt_list_top_of_page TYPE slis_t_listheader,
gt_list_end_of_list TYPE slis_t_listheader,
gs_layout TYPE slis_layout_alv,
gt_events TYPE slis_t_event,
gs_events type slis_alv_event,
gt_print TYPE slis_print_alv,
g_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
Selection Parameters
SELECTION-SCREEN BEGIN OF BLOCK B1.
SELECT-OPTIONS : SO_MATNR FOR MARA-MATNR OBLIGATORY.
SELECT-OPTIONS : SO_WERKS FOR MARC-WERKS.
SELECT-OPTIONS : SO_SPRAS FOR MAKT-SPRAS.
SELECT-OPTIONS : SO_BWKEY FOR MBEW-BWKEY.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
PARAMETERS: p_email TYPE somlreci1-receiver
default '[email protected]'.
SELECTION-SCREEN END OF BLOCK B2.
SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-002.
PARAMETERS : SO_LAY TYPE DISVARIANT-VARIANT DEFAULT '/DEFAULT'.
SELECTION-SCREEN END OF BLOCK B3.
DATA Declarations.
Data : BEGIN OF ITab OCCURS 0,
manr type mara-matnr,
end of ITAB.
data : BEGIN OF IT_TABLE OCCURS 0,
MATNR TYPE MARA-MATNR,
MATKL TYPE MARA-MATKL,
MEINS TYPE MARA-MEINS,
MTART TYPE MARA-MTART,
AHDIS TYPE MARC-AHDIS,
AUSDT TYPE MARC-AUSDT,
AUTRU TYPE MARC-AUTRU,
BESKZ TYPE MARC-BESKZ,
BSTFE TYPE MARC-BSTFE,
BSTMA TYPE MARC-BSTMA,
BSTMI TYPE MARC-BSTMI,
BSTRF TYPE MARC-BSTRF,
BWSCL TYPE MARC-BWSCL,
DIBER TYPE MARC-DIBER,
DISGR TYPE MARC-DISGR,
DISLS TYPE MARC-DISLS,
DISMM TYPE MARC-DISMM,
DISPO TYPE MARC-DISPO,
DISPR TYPE MARC-DISPR,
DZEIT TYPE MARC-DZEIT,
EISBE TYPE MARC-EISBE,
EISLO TYPE MARC-EISLO,
EKGRP TYPE MARC-EKGRP,
FHORI TYPE MARC-FHORI,
FXHOR TYPE MARC-FXHOR,
KAUTB TYPE MARC-KAUTB,
KORDB TYPE MARC-KORDB,
KZAUS TYPE MARC-KZAUS,
LFGJA TYPE MARC-LFGJA,
LFMON TYPE MARC-LFMON,
LGRAD TYPE MARC-LGRAD,
LVORM TYPE MARC-LVORM,
MABST TYPE MARC-MABST,
MINBE TYPE MARC-MINBE,
MMSTA TYPE MARC-MMSTA,
MMSTD TYPE MARC-MMSTD,
MRPPP TYPE MARC-MRPPP,
MTVFP TYPE MARC-MTVFP,
NFMAT TYPE MARC-NFMAT,
PERKZ TYPE MARC-PERKZ,
PLIFZ TYPE MARC-PLIFZ,
PLVAR TYPE MARC-PLVAR,
PSTAT TYPE MARC-PSTAT,
QZGTP TYPE MARC-QZGTP,
RGEKZ TYPE MARC-RGEKZ,
RWPRO TYPE MARC-RWPRO,
SBDKZ TYPE MARC-SBDKZ,
SCHGT TYPE MARC-SCHGT,
SHFLG TYPE MARC-SHFLG,
SHPRO TYPE MARC-SHPRO,
SHZET TYPE MARC-SHZET,
SOBSL TYPE MARC-SOBSL,
STRGR TYPE MARC-STRGR,
TRAME TYPE MARC-TRAME,
UEETK TYPE MARC-UEETK,
UEETO TYPE MARC-UEETO,
UMLMC TYPE MARC-UMLMC,
UNETO TYPE MARC-UNETO,
USEQU TYPE MARC-USEQU,
VINT1 TYPE MARC-VINT1,
VINT2 TYPE MARC-VINT2,
VRBDT TYPE MARC-VRBDT,
VRBFK TYPE MARC-VRBFK,
VRBMT TYPE MARC-VRBMT,
VRBWK TYPE MARC-VRBWK,
VRMOD TYPE MARC-VRMOD,
WEBAZ TYPE MARC-WEBAZ,
WERKS TYPE MARC-WERKS,
WZEIT TYPE MARC-WZEIT,
DISKZ TYPE MARD-DISKZ,
LBSTF TYPE MARD-LBSTF,
LGORT TYPE MARD-LGORT,
LMINB TYPE MARD-LMINB,
LSOBS TYPE MARD-LSOBS,
MAKTX TYPE MAKT-MAKTX,
END OF IT_TABLE.
DATA: BEGIN OF IT_MARD OCCURS 0,
MATNR TYPE MARA-MATNR,
MATKL TYPE MARA-MATKL,
MEINS TYPE MARA-MEINS,
MTART TYPE MARA-MTART,
DISKZ TYPE MARD-DISKZ,
LBSTF TYPE MARD-LBSTF,
LGORT TYPE MARD-LGORT,
LMINB TYPE MARD-LMINB,
LSOBS TYPE MARD-LSOBS,
MAKTX TYPE MAKT-MAKTX,
END OF IT_MARD.
DATA: BEGIN OF IT_MBEW OCCURS 0,
MATNR TYPE MBEW-MATNR,
BKLAS TYPE MBEW-BKLAS,
SALK3 TYPE MBEW-SALK3,
PEINH TYPE MBEW-PEINH,
STPRS TYPE MBEW-STPRS,
VERPR TYPE MBEW-VERPR,
VPRSV TYPE MBEW-VPRSV,
END OF IT_MBEW.
data : BEGIN OF IT_FINAL0 occurs 0,
MATNR LIKE MARA-MATNR,
MATKL LIKE MARA-MATKL,
MEINS LIKE MARA-MEINS,
MTART LIKE MARA-MTART,
AHDIS LIKE MARC-AHDIS,
AUSDT LIKE MARC-AUSDT,
AUTRU LIKE MARC-AUTRU,
BESKZ LIKE MARC-BESKZ,
BSTFE LIKE MARC-BSTFE,
BSTMA LIKE MARC-BSTMA,
BSTMI LIKE MARC-BSTMI,
BSTRF LIKE MARC-BSTRF,
BWSCL LIKE MARC-BWSCL,
DIBER LIKE MARC-DIBER,
DISGR LIKE MARC-DISGR,
DISLS LIKE MARC-DISLS,
DISMM LIKE MARC-DISMM,
DISPO LIKE MARC-DISPO,
DISPR LIKE MARC-DISPR,
DZEIT LIKE MARC-DZEIT,
EISBE LIKE MARC-EISBE,
EISLO LIKE MARC-EISLO,
EKGRP LIKE MARC-EKGRP,
FHORI LIKE MARC-FHORI,
FXHOR LIKE MARC-FXHOR,
KAUTB LIKE MARC-KAUTB,
KORDB LIKE MARC-KORDB,
KZAUS LIKE MARC-KZAUS,
LFGJA LIKE MARC-LFGJA,
LFMON LIKE MARC-LFMON,
LGRAD LIKE MARC-LGRAD,
LVORM LIKE MARC-LVORM,
MABST LIKE MARC-MABST,
MINBE LIKE MARC-MINBE,
MMSTA LIKE MARC-MMSTA,
MMSTD LIKE MARC-MMSTD,
MRPPP LIKE MARC-MRPPP,
MTVFP LIKE MARC-MTVFP,
NFMAT LIKE MARC-NFMAT,
PERKZ LIKE MARC-PERKZ,
PLIFZ LIKE MARC-PLIFZ,
PLVAR LIKE MARC-PLVAR,
PSTAT LIKE MARC-PSTAT,
QZGTP LIKE MARC-QZGTP,
RGEKZ LIKE MARC-RGEKZ,
RWPRO LIKE MARC-RWPRO,
SBDKZ LIKE MARC-SBDKZ,
SCHGT LIKE MARC-SCHGT,
SHFLG LIKE MARC-SHFLG,
SHPRO LIKE MARC-SHPRO,
SHZET LIKE MARC-SHZET,
SOBSL LIKE MARC-SOBSL,
STRGR LIKE MARC-STRGR,
TRAME LIKE MARC-TRAME,
UEETK LIKE MARC-UEETK,
UEETO LIKE MARC-UEETO,
UMLMC LIKE MARC-UMLMC,
UNETO LIKE MARC-UNETO,
USEQU LIKE MARC-USEQU,
VINT1 LIKE MARC-VINT1,
VINT2 LIKE MARC-VINT2,
VRBDT LIKE MARC-VRBDT,
VRBFK LIKE MARC-VRBFK,
VRBMT LIKE MARC-VRBMT,
VRBWK LIKE MARC-VRBWK,
VRMOD LIKE MARC-VRMOD,
WEBAZ LIKE MARC-WEBAZ,
WERKS LIKE MARC-WERKS,
WZEIT LIKE MARC-WZEIT,
DISKZ LIKE MARD-DISKZ,
LBSTF LIKE MARD-LBSTF,
LGORT LIKE MARD-LGORT,
LMINB LIKE MARD-LMINB,
LSOBS LIKE MARD-LSOBS,
MAKTX LIKE MAKT-MAKTX,
END OF IT_FINAL0.
data : BEGIN OF IT_FINAL occurs 0,
MATNR LIKE MARA-MATNR,
MATKL LIKE MARA-MATKL,
MEINS LIKE MARA-MEINS,
MTART LIKE MARA-MTART,
AHDIS LIKE MARC-AHDIS,
AUSDT LIKE MARC-AUSDT,
AUTRU LIKE MARC-AUTRU,
BESKZ LIKE MARC-BESKZ,
BSTFE LIKE MARC-BSTFE,
BSTMA LIKE MARC-BSTMA,
BSTMI LIKE MARC-BSTMI,
BSTRF LIKE MARC-BSTRF,
BWSCL LIKE MARC-BWSCL,
DIBER LIKE MARC-DIBER,
DISGR LIKE MARC-DISGR,
DISLS LIKE MARC-DISLS,
DISMM LIKE MARC-DISMM,
DISPO LIKE MARC-DISPO,
DISPR LIKE MARC-DISPR,
DZEIT LIKE MARC-DZEIT,
EISBE LIKE MARC-EISBE,
EISLO LIKE MARC-EISLO,
EKGRP LIKE MARC-EKGRP,
FHORI LIKE MARC-FHORI,
FXHOR LIKE MARC-FXHOR,
KAUTB LIKE MARC-KAUTB,
KORDB LIKE MARC-KORDB,
KZAUS LIKE MARC-KZAUS,
LFGJA LIKE MARC-LFGJA,
LFMON LIKE MARC-LFMON,
LGRAD LIKE MARC-LGRAD,
LVORM LIKE MARC-LVORM,
MABST LIKE MARC-MABST,
MINBE LIKE MARC-MINBE,
MMSTA LIKE MARC-MMSTA,
MMSTD LIKE MARC-MMSTD,
MRPPP LIKE MARC-MRPPP,
MTVFP LIKE MARC-MTVFP,
NFMAT LIKE MARC-NFMAT,
PERKZ LIKE MARC-PERKZ,
PLIFZ LIKE MARC-PLIFZ,
PLVAR LIKE MARC-PLVAR,
PSTAT LIKE MARC-PSTAT,
QZGTP LIKE MARC-QZGTP,
RGEKZ LIKE MARC-RGEKZ,
RWPRO LIKE MARC-RWPRO,
SBDKZ LIKE MARC-SBDKZ,
SCHGT LIKE MARC-SCHGT,
SHFLG LIKE MARC-SHFLG,
SHPRO LIKE MARC-SHPRO,
SHZET LIKE MARC-SHZET,
SOBSL LIKE MARC-SOBSL,
STRGR LIKE MARC-STRGR,
TRAME LIKE MARC-TRAME,
UEETK LIKE MARC-UEETK,
UEETO LIKE MARC-UEETO,
UMLMC LIKE MARC-UMLMC,
UNETO LIKE MARC-UNETO,
USEQU LIKE MARC-USEQU,
VINT1 LIKE MARC-VINT1,
VINT2 LIKE MARC-VINT2,
VRBDT LIKE MARC-VRBDT,
VRBFK LIKE MARC-VRBFK,
VRBMT LIKE MARC-VRBMT,
VRBWK LIKE MARC-VRBWK,
VRMOD LIKE MARC-VRMOD,
WEBAZ LIKE MARC-WEBAZ,
WERKS LIKE MARC-WERKS,
WZEIT LIKE MARC-WZEIT,
DISKZ LIKE MARD-DISKZ,
LBSTF LIKE MARD-LBSTF,
LGORT LIKE MARD-LGORT,
LMINB LIKE MARD-LMINB,
LSOBS LIKE MARD-LSOBS,
MAKTX LIKE MAKT-MAKTX,
BKLAS LIKE MBEW-BKLAS,
SALK3 LIKE MBEW-SALK3,
PEINH LIKE MBEW-PEINH,
STPRS LIKE MBEW-STPRS,
VERPR LIKE MBEW-VERPR,
VPRSV LIKE MBEW-VPRSV,
ZXPRS LIKE MBEW-STPRS,
END OF IT_FINAL.
data : BEGIN OF IT_display occurs 0,
matnr LIKE MARA-MATNR,
maktx LIKE MAKT-MAKTX,
meins LIKE MARA-MEINS,
werks LIKE MARC-WERKS,
dispo LIKE MARC-DISPO,
dismm LIKE MARC-DISMM,
plifz LIKE MARC-PLIFZ,
webaz LIKE MARC-WEBAZ,
minbe LIKE MARC-MINBE,
shzet LIKE MARC-SHZET,
eisbe LIKE MARC-EISBE,
disls LIKE MARC-DISLS,
bstmi LIKE MARC-BSTMI,
bstma LIKE MARC-BSTMA,
bstfe LIKE MARC-BSTFE,
ZXPRS LIKE MBEW-STPRS,
peinh LIKE MBEW-PEINH,
salk3 LIKE MBEW-SALK3,
end of it_display.
ALV Layout Variant
AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_lay.
PERFORM get_alv_layout_values.
SELECTION SCREEN.
AT SELECTION-SCREEN.
IF ( sscrfields-ucomm = 'SJOB' OR
sy-batch = 'X' ).
s_job = 'X'.
ENDIF.
select single matnr into itab from mara where matnr in so_matnr.
if sy-subrc <> 0.
message e001(zpal).
endif.
START-OF-SELECTION.
IF SO_LAY <> ' '.
VARIANT-REPORT = 'ZPMACR01_MD_MRP_100'.
VARIANT-VARIANT = SO_LAY.
else.
VARIANT-VARIANT = '/DEFAULT'.
ENDIF.
INITIALIZATION.
W_REPID = SY-REPID.
START-OF-SELECTION.
IF SO_LAY <> ' '.
VARIANT-REPORT = w_repid.
VARIANT-VARIANT = SO_LAY.
else.
VARIANT-VARIANT = '/DEFAULT'.
ENDIF.
SELECT
MARA~MATNR
MARA~MATKL
MARA~MEINS
MARA~MTART
MARC~AHDIS
MARC~AUSDT
MARC~AUTRU
MARC~BESKZ
MARC~BSTFE
MARC~BSTMA
MARC~BSTMI
MARC~BSTRF
MARC~BWSCL
MARC~DIBER
MARC~DISGR
MARC~DISLS
MARC~DISMM
MARC~DISPO
MARC~DISPR
MARC~DZEIT
MARC~EISBE
MARC~EISLO
MARC~EKGRP
MARC~FHORI
MARC~FXHOR
MARC~KAUTB
MARC~KORDB
MARC~KZAUS
MARC~LFGJA
MARC~LFMON
MARC~LGRAD
MARC~LVORM
MARC~MABST
MARC~MINBE
MARC~MMSTA
MARC~MMSTD
MARC~MRPPP
MARC~MTVFP
MARC~NFMAT
MARC~PERKZ
MARC~PLIFZ
MARC~PLVAR
MARC~PSTAT
MARC~QZGTP
MARC~RGEKZ
MARC~RWPRO
MARC~SBDKZ
MARC~SCHGT
MARC~SHFLG
MARC~SHPRO
MARC~SHZET
MARC~SOBSL
MARC~STRGR
MARC~TRAME
MARC~UEETK
MARC~UEETO
MARC~UMLMC
MARC~UNETO
MARC~USEQU
MARC~VINT1
MARC~VINT2
MARC~VRBDT
MARC~VRBFK
MARC~VRBMT
MARC~VRBWK
MARC~VRMOD
MARC~WEBAZ
MARC~WERKS
MARC~WZEIT
MARD~DISKZ
MARD~LBSTF
MARD~LGORT
MARD~LMINB
MARD~LSOBS
MAKT~MAKTX
INTO TABLE IT_TABLE
FROM MARA INNER JOIN MARC ON MARAMATNR = MARCMATNR
INNER JOIN MAKT ON MARAMATNR = MAKTMATNR
WHERE MARA~MATNR IN SO_MATNR
AND MARC~WERKS IN SO_WERKS
AND MAKT~SPRAS IN SO_SPRAS.
SELECT
MARA~MATNR
MARA~MATKL
MARA~MEINS
MARA~MTART
MARD~DISKZ
MARD~LBSTF
MARD~LGORT
MARD~LMINB
MARD~LSOBS
INTO TABLE IT_mard
FROM MARA INNER JOIN MARD ON MARAMATNR = MARDMATNR
WHERE MARA~MATNR IN SO_MATNR
and mard~werks in SO_WERKS.
SELECT MATNR BKLAS SALK3 PEINH STPRS VERPR VPRSV
INTO TABLE IT_MBEW FROM MBEW FOR ALL ENTRIES IN IT_TABLE WHERE MATNR =
IT_TABLE-MATNR AND BWKEY IN SO_BWKEY.
LOOP AT IT_TABLE.
MOVE-CORRESPONDING IT_TABLE TO IT_FINAL0.
READ TABLE IT_MARD WITH KEY MATNR = IT_TABLE-MATNR.
IF SY-SUBRC = 0 .
MOVE-CORRESPONDING IT_MARD TO IT_FINAL0.
ENDIF.
APPEND IT_FINAL0.
CLEAR IT_FINAL0.
ENDLOOP.
LOOP AT IT_FINAL0.
READ TABLE IT_MBEW WITH KEY MATNR = IT_final0-MATNR.
IF SY-SUBRC = 0 .
MOVE-CORRESPONDING IT_MBEW TO IT_FINAL.
IF IT_MBEW-VPRSV = 'S'.
MOVE IT_MBEW-STPRS TO IT_FINAL-ZXPRS.
ELSE.
MOVE IT_MBEW-VERPR TO IT_FINAL-ZXPRS.
ENDIF.
ENDIF.
MOVE-CORRESPONDING IT_FINAL0 TO IT_FINAL.
APPEND IT_FINAL.
CLEAR IT_FINAL.
ENDLOOP.
Default Layout
LOOP AT IT_FINAL.
Read table it_final with key matnr = SO_matnr.
Move it_final-MATNR to it_display-MATNR.
Move it_final-MAKTX to it_display-MAKTX.
Move it_final-MEINS to it_display-MEINS.
Move it_final-WERKS to it_display-WERKS.
Move it_final-DISPO to it_display-DISPO.
Move it_final-DISMM to it_display-DISMM.
Move it_final-PLIFZ to it_display-PLIFZ.
Move it_final-WEBAZ to it_display-WEBAZ.
Move it_final-MINBE to it_display-MINBE.
Move it_final-SHZET to it_display-SHZET.
Move it_final-EISBE to it_display-EISBE.
Move it_final-DISLS to it_display-DISLS.
Move it_final-BSTMI to it_display-BSTMI.
Move it_final-BSTMA to it_display-BSTMA.
Move it_final-BSTFE to it_display-BSTFE.
MOVE it_final-ZXPRS to it_display-ZXPRS.
Move it_final-PEINH to it_display-PEINH.
Move it_final-SALK3 to it_display-SALK3.
Append it_display.
endloop.
data: v_data type c value ' '.
if it_display is initial.
v_data = ' '.
else.
v_data = 'X'.
endif.
END-OF-SELECTION.
END-OF-SELECTION.
if s_job = 'X'.
perform execute_back.
else.
perform execute_fore.
endif.
FORM execute_fore *
Form execute_fore.
*& Form REUSE_ALV_FIELDCATALOG_MERGE
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = W_REPID
I_INTERNAL_TABNAME = 'IT_FINAL'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = W_REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
*IF SO_LAY <> ' '.
VARIANT-VARIANT = SO_LAY.
*endif.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = W_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = IT_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'X'
IS_VARIANT = 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
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = 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.
FORM execute_back *
FORM execute_back.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = W_REPID
I_INTERNAL_TABNAME = 'IT_FINAL'
I_STRUCTURE_NAME =
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = W_REPID
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FIELDCAT
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = W_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
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 = 'X'
IS_VARIANT = variant
IT_EVENTS = gt_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 = 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.
form top_of_page.
CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
IMPORTING
ES_LAYOUT =
ET_FIELDCAT = IT_FIELDCAT3[]
ET_SORT =
ET_FILTER =
ES_GRID_SCROLL =
ES_VARIANT = VARIANT
ET_MARKED_COLUMNS =
ET_FILTERED_ENTRIES =
ET_FIELDCAT_BACKEND =
ES_PRINT =
EXCEPTIONS
NO_INFOS = 1
PROGRAM_ERROR = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
clear count.
LOOP AT IT_FIELDCAT3 into is_fieldcat3 where no_out eq space.
*move-corresponding is_fieldcat3 to is_fieldcat2.
move: is_fieldcat3-fieldname to is_fieldcat2-fieldname,
is_fieldcat3-ref_fieldname to is_fieldcat2-ref_field,
is_fieldcat3-ref_tabname to is_fieldcat2-ref_table,
is_fieldcat3-seltext_l to is_fieldcat2-coltext,
is_fieldcat3-no_out to is_fieldcat2-no_out,
is_fieldcat3-col_pos to is_fieldcat2-col_pos.
*move:
is_fieldcat3-row_pos to is_fieldcat2-row_pos,
is_fieldcat3-col_pos to is_fieldcat2-col_pos,
is_fieldcat3-fieldname to is_fieldcat2-fieldname,
is_fieldcat3-tabname to is_fieldcat2-tabname,
is_fieldcat3-outputlen to is_fieldcat2-outputlen,
is_fieldcat3-no_out to is_fieldcat2-no_out,
is_fieldcat3-seltext_l to is_fieldcat2-coltext,
is_fieldcat3-ref_fieldname to is_fieldcat2-ref_field,
is_fieldcat3-ref_tabname to is_fieldcat2-ref_table,
is_fieldcat3-DDIC_OUTPUTLEN to is_fieldcat2-DD_OUTLEN,
is_fieldcat3-datatype to is_fieldcat2-datatype,
is_fieldcat3-inttype to is_fieldcat2-inttype,
is_fieldcat3-INTLEN to is_fieldcat2-INTLEN.
APPEND IS_FIELDCAT2 TO IT_FIELDCAT2.
*count = count + 1.
ENDLOOP.
loop at it_fieldcat2 into is_fieldcat2.
if is_fieldcat2-no_out = 'X'.
delete it_fieldcat2 index sy-tabix.
else.
count = count + 1.
endif.
endloop.
describe table it_fieldcat2 lines count.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fieldcat2[]
IMPORTING
ep_table = new_table.
ASSIGN new_table->* TO <tab>.
CREATE DATA new_line LIKE LINE OF <tab>.
ASSIGN new_line->* TO <wa>.
*-- Perform to build table for attachment data
PERFORM build_xls_data_table.
*-- Perform to populate e-mail message
PERFORM populate_email_message_body.
*-- Perform to send mail
PERFORM send_file_as_email_attachment.
*-- Perform to Instruct mail send program for SAPCONNECT to send email.
PERFORM initiate_mail_execute_program.
ENDFORM.
*& Form build_xls_data_table
form build_xls_data_table.
data: char_var(30) type C,
num_var(10) type n.
CONSTANTS: con_cret TYPE x VALUE '0D', "NEW LINE
tabchar TYPE x VALUE '09'. "tab
loop at it_fieldcat2 into is_fieldcat2.
concatenate it_attach is_fieldcat2-coltext
into it_attach separated by tabchar.
endloop.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
CLEAR it_attach.
field-symbols: <t> type ANY.
LOOP AT it_final.
col_1 = 1.
do count times.
Assign component col_1 of structure <wa> to <f>.
read table it_fieldcat2 into is_fieldcat2 with key col_pos = col_1.
loop at it_fieldcat into is_fieldcat.
if is_fieldcat-fieldname = is_fieldcat2-fieldname.
assign component is_fieldcat-col_pos of structure it_final to <t>.
exit.
endif.
endloop.
<f> = <t>.
clear <t>.
col_1 = col_1 + 1.
enddo.
append <wa> to <tab>.
endloop.
loop at <tab> into <wa>.
col_1 = 1.
do count times.
Assign component col_1 of structure <wa> to <f>.
move <f> to char_var.
concatenate it_attach char_var
into it_attach separated by tabchar.
col_1 = col_1 + 1.
enddo.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
CLEAR it_attach.
endloop.
ENDFORM.
FORM send_file_as_email_attachment.
DATA:
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ.
ld_email = p_email.
ld_mtitle = text-003.
ld_format = 'XLS'.
ld_attdescription = ' '.
ld_attfilename = 'DATA'.
ld_sender_address = ' '.
ld_sender_address_type = ' '.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
LOOP AT it_attach.
MOVE it_attach(255) TO t_hex.
APPEND t_hex.
MOVE it_attach+255(255) TO t_hex.
APPEND t_hex.
MOVE it_attach+510(255) TO t_hex.
APPEND t_hex.
MOVE it_attach+765(235) TO t_hex.
APPEND t_hex.
MOVE it_attach+765(255) TO t_hex.
APPEND t_hex.
MOVE it_attach+1020(255) TO t_hex.
APPEND t_hex.
MOVE it_attach+1275(255) TO t_hex.
APPEND t_hex.
MOVE it_attach+1530(255) TO t_hex.
APPEND t_hex.
MOVE it_attach+1785(255) TO t_hex.
APPEND t_hex.
MOVE it_attach+2040(255) TO t_hex.
APPEND t_hex.
MOVE it_attach+2295(255) TO t_hex.
APPEND t_hex.
MOVE it_attach+2550(100) TO t_hex.
APPEND t_hex.
ENDLOOP.
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_hex LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_txt = it_message
contents_hex = t_hex
receivers = t_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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ld_error = sy-subrc.
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM. "SEND_FILE_AS_EMAIL_ATTACHMENT
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
FORM populate_email_message_body.
REFRESH it_message.
it_message = text-004.
APPEND it_message.
CONCATENATE SY-DATUM 'to' SY-DATUM INTO it_message SEPARATED BY
space.
APPEND it_message.
ENDFORM. " POPULATE_EMAIL_MESSAGE_BODY
*& Form get_alv_layout_values
FORM get_alv_layout_values.
variant-report = w_repid.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = variant
i_save = 'A'
IMPORTING
es_variant = variant
EXCEPTIONS
not_found = 1
program_error = 2
OTHERS = 3.
CHECK sy-subrc = 0.
so_lay = variant-variant.
ENDFORM. " get_alv_layout_valuesHi Arpit,
Take a look at the documentation of FM 'SO_DOCUMENT_SEND_API1' for parameter PACKING_LIST. I think you should set t_packing_list-head_num to a different value than 0 for the second attachment.
Regards,
John. -
Error when executing a Query through information Broadcasting
Dear SDN,
We have configured information Broadcasting in the Web Reports---
Scheduled and then when executing the following error is coming
500 internal server error - Microsoft internet explorer
Error when processing your request
What has happened?
The URL http://xyz.com:8000/sap/bw/BEx was not called due to an error.
Note
The following error text was processed in the system BWD : Please enter a valid value for characteristic 0CALMONTH.
The error occurred on the application server asalbwd_BWD_00 and in the work process 0 .
The termination type was: ERROR_MESSAGE_STATE
The ABAP call stack was:
START-OF-SELECTION of program RSRD_BROADCAST_PROCESSOR
What can I do?
If the termination type was RABAX_STATE, then you can find more information on the cause of the termination in the system BWD in transaction ST22.
If the termination type was ABORT_MESSAGE_STATE, then you can find more information on the cause of the termination on the application server asalbwd_BWD_00 in transaction SM21.
If the termination type was ERROR_MESSAGE_STATE, then you can search for more information in the trace file for the work process 0 in transaction ST11 on the application server asalbwd_BWD_00 . In some situations, you may also need to analyze the trace files of other work processes.
If you do not yet have a user ID, contact your system administrator.
Error code: ICF-IE-http-c:900-u:VENKAT -l:E-s:BWD-i:asalbwd_BWD_00 -w:0-d:20080708-t:133744-v: ERROR_MESSAGE_STATE-e:Please enter a valid value for characteristic 0CALMONTH.
HTTP 500 - Internal Server Error
Your SAP Internet Communication Framework Team
Please suggest us to resolve this error..
Help will be greatly appreciated with points..
Thanks in advanceHi
Thanks...
I have given only Fiscal Year/Period Variable
Other than Fiscal Year/Period Variable....No Variables in that Query..
In FI Queries, I did not use 0CALMONTH Variable...
I do not know why it is giving that error..
Please suggest us to resolve this error..
Thanks in advance -
Information Broadcast / Sending reports automated
Hello,
I have the following task:
we should send reports to non-bw users.
For each recipient should be set a personlized variable (like customer no). So he only get the report with his company code.
There should be possibility to implement this automated?
In Information Broadcast I have to type in every mail adress and assign the right report.
We would need a solution where the variable (eg. company code) is filled automatically, saving the report under a title starting with the company code and then send the report via mail to the correct partner.
As the mail adresses are all in R/3 in the customer datas. It should not be a problem to load them to BW.
Thank you for your help.
FranzHi!
I think it is hard to implement a scenario of sending automatically to BP's when they dont have a userid in BW.
Problem is that we can makes settings in broadcaseter either manually or by creating a Variant of report automatically for each userid. I think atleast in BW3.5 it is not possible to automate this.
When we contacted sap regarding the simmilar problem,we were informed that it'S not possible. they suggested us to have atleast background user for each BP. this was about an year ago..so i dont know if there is a solution now.
with regards
ashwin -
E-Mail Summary Report and Detailed Report Automatically
Hi, I have just started a new job (1st IT job since leaving college) and I've been told that our Small Business Server 2011 used to email a Summary Report directly to a specified email address, as well as a weekly Detailed Report to the same email address,
but that has stopped sending reports now. How do i make sure that the reports are automatically generated and sent out via email to the specified address. Any help would be great.Hi,
Based on your description, I understand that there some issue occurred in Report feature in the SBS 2011.
On current situation, please refer to following steps and troubleshoot this issue. Then check if can help you.
1. Login the SBS server. Please open Windows SBS Console and select
Reports tab. In the Reports panel, select a report (Summary or Detailed), then View report properties. In Report Properties page, please select
E-Mail Options to check if had added the correct user account or e-mail address. Also please select Schedule tab, and check if had configured correctly.
2. Then manually click
Generate report option in Tasks. Please check if successfully generated the report. If not, please refer to following TechNet article and repair Monitoring and Reporting features in the SBS server. Then monitor the result.
Repair Monitoring and Reporting Features
in Windows Small Business Server 2011 Standard
3. If generated the report successfully, please manually click
Generate report and e-mail report option in Tasks. Then check if run successfully. Or any error message occurred?
4. If this issue still exists, please refer to following path: C:\Program Files\Windows Small Business Server\Logs\MonitoringServiceLogs and check if there has some log files
which be related to Report (Summary or Detailed). If has, please check if can find some more clues. Meanwhile, please open Event Viewer and check if find some relevant errors. Those may hope us to go further analyze.
If any update, please feel free to let me know.
Hope this helps.
Best regards,
Justin Gu -
Information Broadcasting Excel Workbooks with Local Formulas
We are attempting to use information broadcasting to send out reports that use the v7 BEX "convert to local formula" feature in order to reformat the reports. We can execute the reports, and even save them to a local client and review them later when disconnected from the server. However, if we use information broadcasting to send these Excel files out as attachments, the users are unable to see the data unless they connect and refresh, defeating our entire purpose of putting the data in excel.
Has anyone else attempted to Information Broadcast BEX Excel workbooks while using the Local Formula mode provided with v7? Were you successful?Yes, I see some information in the precalc log, but nothing that seems to be wrong:
04-11-2008 11:15:13 -> RS_PREC_GET_SERVER_STATUS invoked in thread 8
04-11-2008 11:15:13 -> Locking MapSessionid in getFreeInstances in thread 8
04-11-2008 11:15:13 -> Locked MapSessionid in getFreeInstances in thread 8
04-11-2008 11:15:13 -> Unlocked MapSessionid in getFreeInstances in thread 8
04-11-2008 11:15:13 -> RS_PREC_GET_SERVER_STATUS finished in thread 8
04-11-2008 11:15:19 -> RS_PREC_GET_SERVER_STATUS invoked in thread 5
04-11-2008 11:15:19 -> Locking MapSessionid in getFreeInstances in thread 5
04-11-2008 11:15:19 -> Locked MapSessionid in getFreeInstances in thread 5
04-11-2008 11:15:19 -> Unlocked MapSessionid in getFreeInstances in thread 5
04-11-2008 11:15:19 -> RS_PREC_GET_SERVER_STATUS finished in thread 5
04-11-2008 11:15:19 -> RS_PREC_GET_SERVER_STATUS invoked in thread 3
04-11-2008 11:15:19 -> Locking MapSessionid in getFreeInstances in thread 3
04-11-2008 11:15:19 -> Locked MapSessionid in getFreeInstances in thread 3
04-11-2008 11:15:19 -> Unlocked MapSessionid in getFreeInstances in thread 3
04-11-2008 11:15:19 -> RS_PREC_GET_SERVER_STATUS finished in thread 3
BR Mikkel -
Information Broadcasting issue
Hi,
I have a BW query which is automated to run in background through Information Broadcasting to send the report to couple of users.
The query 'A' runs for 3 hours in Production , it used to run fine. There were no changes done to the Broadcaster settings.
The only thing that was changed is only this query 'A' used in a single process chain, later a new query 'B' is added to process chain run in background thru broadcaster. The queries run thru RSRD_BROADCAST_STARTER in the process chain , and I tried the same running manually.And it returns the result only when I run around 15:00:00 in the evening.
The next day or 2 onwards this query 'A' runs for 3 hrs but never sends an email. But query B also runs for 3 hrs but sends an email.
I have trouble shooted this in the following way:
1) The process chain runs through BATCH ID which also runs similar process chain for other region and it works fine. So it is not BATCH ID issue.
2) New information broadcaster settings were created and then ran. it never sent a mail. so not problem in broadcaster settings.
3) Checked SCOT transaction to see the mail is transmitted or not. there is no sign of the emails pending for the query A.
4) If i run this in morning or noon or even 14:59 PM it never sends the mail. ONLY at 15:00:00 when run it sends email .
5) there is no flaw in the report A as it returns the results in email at 15:00:00 run but not prior to that..
6) There is nothing in the setting that this has to run only at 15:00:00 time.. and it runs fine at that time and sends email
All priorer runs it runs for 3hour but never sends an email.
I need some experts help on this. Did any one experience this kind of issue.
Could some one tell me any other check points..pointers..etc.
Greatly appreciate your help on this.
ThanksHi Ragini,
Is there any setting based on SCOT Transaction for delaying e-mail broadcasting ?? check numbers for parameter "Maximum waiting time for repeat send attempt procedure" ...
Also some times mail server queues mails for some time and then sends in bulk .. Just check with admin guys ..
Above could be one of the reason for not getting broadcasting till certain time .
Also there is a program called "RSRD_BROADCAST_FOR_TIMEPOINT" link
"http://help.sap.com/saphelp_nw70/helpdata/en/8a/e2fd3f2c14e769e10000000a155106/content.htm
which is used to preset the times for broadcasts. ..
Just check in SM37 if some job using same program has been defined over there ...for time 15:00:00
Hope that helps.
Regards
Kapadia -
Information broadcasting in BW
Hi,
I am getting the following error when I set up the Broadcasting for a BW report and then press the Execute button
500 Connection timed out
Connection timed out(-5)
Error -5
Verstion 6040
Component ICM
Module icxothr_mt.c
Line 2551
Server <servername>
Detail: Connection to partner timedout after 60s
There was one more screen displayed with the following error
Error when processing your request
URL:http:<xxx>:8000/sap/bw/BEx was not called due to an error
The following error text was processed in the system <SID> : Exception condition "COMMUNICATION_ERROR" raised
Error occurred on the application server <servername> and in the work process 1.
The termination type was: RABAX_STATE
If possible please explain me the reason and solution step by step to resolve this issue.
Thanks in advance
Regards
SrinivasHi,
If you are distributing the query with email option as 'Independent HTML file with ZIP option , then check the oss Notes 901358 .
Regards,
Siva.
Maybe you are looking for
-
[solved] problem with wicd and broadcom
I have a compaq 515 with broadcom wireless lspci: 03:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g (rev 01) I installed the b43 firmware from AUR parts of rc.conf: MODULES=(b43 ssb !b43legacy fglrx) DAEMONS=(@syslog-ng !network dbus
-
After installing PS and LR newer CC versions, should uninstall the previous versions? Computer is running ver slow in those programs.
-
how can i create Tree like structure in JSP.can i use swings.IF yes what can be the container. I am trying to access database and show the data in TREE node like structure. Rohit
-
Hi there, as a photographer my photo book printing company has given me instructions to view a photo file in Adobe Reader and compare it with the same file that they will post to me - so that i can make sure that my monitor is properly callibated to
-
Premiere CS4 update order.
Hello, dear Adobe Premiere community. According to Adobe, v4.1 is included with v4.2. Source: http://www.adobe.com/products/premiere/pdfs/premiere_pro_4_2_update.pdf However, as from the size of the updates, I suspect v4.0.1 not to be included in v4.