Submit report with radiobutton
Hi experts,
I have a req. in which I need to call a report in my method, with a particular radiobutton selected as default.
How can I achieve the same?
For ex: if the report name is zrep, what addition should I give with:
SUBMIT zrep USING SELECTION-SCREEN '1000'
Thanks,
Ajay.
Try something like this
SUBMIT zrep USING SELECTION-SCREEN '1000' with p_radio = 'X'.
Vikranth
Similar Messages
-
Submit report with dynamic selections
Hi All,
I am trying to Submit a report with dynamic selections. I am using the option SUBMIT REPORT WITH FREE SELECTIONS.
But the dynamic selections are not getting passed.
Request you to kindly provide some inputs
My code is
DATA: trange TYPE rsds_trange,
trange_line LIKE LINE OF trange,
trange_frange_t_line LIKE LINE OF trange_line-frange_t,
trange_frange_t_selopt_t_line LIKE LINE OF trange_frange_t_line-selopt_t,
texpr TYPE rsds_texpr.
trange_line-tablename = 'PA0002'.
*trange_frange_t_line-tablename = 'PA0002'.
trange_frange_t_line-fieldname = 'GBJHR'.
trange_frange_t_selopt_t_line-sign = 'I'.
trange_frange_t_selopt_t_line-option = 'EQ'.
trange_frange_t_selopt_t_line-low = '1987'.
trange_frange_t_selopt_t_line-high = '1987'.
APPEND trange_frange_t_selopt_t_line TO trange_frange_t_line-selopt_t.
APPEND trange_frange_t_line TO trange_line-frange_t.
APPEND trange_line TO trange.
CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
EXPORTING
field_ranges = trange
IMPORTING
expressions = texpr.
submit RPCADVQ0
VIA SELECTION-SCREEN
WITH SELECTION-TABLE rspar_tab
WITH FREE SELECTIONS it_texpr
and returN.
Kindly provide your inputs
Regards
ReshmaHi Reshma,
Use the FM - RS_REFRESH_FROM_DYNAMICAL_SEL before FREE_SELECTIONS_RANGE_2_EX.
data: trange type rsds_trange,
g_repid type sy-repid.
g_repid = 'RPCADVQ0'.
call function 'RS_REFRESH_FROM_DYNAMICAL_SEL'
exporting
curr_report = g_repid
mode_write_or_move = 'M'
importing
p_trange = trange
exceptions
not_found = 1
wrong_type = 2
others = 3.
if sy-subrc eq 0.
" Do the changes to the trange
CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
EXPORTING
field_ranges = trange
IMPORTING
expressions = texpr.
submit RPCADVQ0
VIA SELECTION-SCREEN
WITH SELECTION-TABLE rspar_tab
WITH FREE SELECTIONS it_texpr
and returN.
endif.
Cheers,
Kothand -
Problem with SUBMIT report [ WITH SELECTION-TABLE ] or [ IN range ]
Hello Everybody,
I am trying to call transaction F.80 for mass reversal of FI documents by using SUBMIT sentence and its parameters like this:
LOOP AT i_zfi013 INTO wa_zfi013.
PERFORM llena_params USING 'BR_BELNR' 'S' 'I' 'EQ' wa_zfi013-num_doc ''.
range_line-sign = 'I'.
range_line-option = 'EQ'.
range_line-low = wa_zfi013-num_doc.
APPEND range_line TO range_tab.
endloop.
Line: -
SUBMIT sapf080
WITH br_bukrs-low = p_bukrs
WITH SELECTION-TABLE it_params [ same problem with - WITH BR_BELNR IN range_tab]
WITH br_gjahr-low = p_an1
WITH stogrd = '05'
WITH testlauf = ''
AND RETURN.
My problem is that when the report is executed the BR_BELNR only delete one document of the all the inputs in the selection criteria from the loop. if I add the statement [ VIA SELECTION-SCREEN] in the SUBMIT if open the multiple selection criteria in the screen I can check that all the documents are set in it from the ABAP code in the loop from it I just need to push F8 to copy them and run the program processing all the documents normally .
Can some one help me with this? is there a way to execute the transaction BY the SUBMIT with the multiple selection criteria for the Document Number working well?
Thank for you time and help.This is my code:
TYPES: BEGIN OF T_ZFI013,
BUKRS TYPE BUKRS,
GJAHR TYPE GJAHR,
MONAT TYPE MONAT,
ANLN1 TYPE ANLN1,
ANLN2 TYPE ANLN2,
NUM_DOC TYPE BELNR_D,
DATE TYPE DATUM,
TIME TYPE UZEIT,
USER TYPE SYUNAME,
END OF T_ZFI013.
DATA: I_ZFI013 TYPE STANDARD TABLE OF T_ZFI013,
WA_ZFI013 TYPE T_ZFI013,
DATA: br_belnr TYPE BELNR_D,
rspar_tab TYPE TABLE OF rsparams,
rspar_line LIKE LINE OF rspar_tab,
range_tab LIKE RANGE OF br_belnr,
range_line LIKE LINE OF range_tab."range_tab.
LOOP AT i_zfi013 INTO wa_zfi013.
range_line-sign = 'I'.
range_line-option = 'EQ'.
range_line-low = wa_zfi013-num_doc.
APPEND range_line TO range_tab.
ENDLOOP.
SUBMIT sapf080
WITH br_bukrs-low = p_bukrs
WITH br_belnr IN range_tab
WITH br_gjahr-low = p_an1
WITH stogrd = '05'
WITH testlauf = ''.
This is the RANGE_TAB table before submit:
1 I EQ 1001xxxxxx
2 I EQ 1002xxxxxx
3 I EQ 1003xxxxxx
4 I EQ 1004xxxxxx
5 I EQ 1005xxxxxx
6 I EQ 1006xxxxxx
7 I EQ 1007xxxxxx
8 I EQ 1008xxxxxx
I think this wont work for some reason so I will start to do this by a BDC.
Many thanks for your help. -
SUBMIT Report with return values
Hi,
I am using the SUBMITE REPORT STATEMENT as
SUBMIT RVV50R10C WITH st_ledat-LOW = s_vstel-LOW
WITH st_ledat-HIGH = s_vstel-HIGH
AND RETURN EXPORTING LIST TO MEMORY.
For the report RVV50R10C the o/p is an hierarchical display.
So when i am exporting list to memory. how exactly are the values populated and,
if i want two fields from the o/p of the report t be populated in another internal table, how can i get it.
initially i am calling FM LIST_FROM_MEMORY and getting values in to a itab of type abaplist.
how the values will be populated into this table.Hi,
Hope this wud help u...
Once the program report has been accessed, the list stored there in the ABAP Memory is read by means of function modules and inserted in the current list.
DATA list_tab TYPE TABLE OF abaplist.
SUBMIT report EXPORTING LIST TO MEMORY
AND RETURN.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
CALL FUNCTION 'WRITE_LIST'
TABLES
listobject = list_tab.
ENDIF.
Keerthi. -
Submit reports (with parameters) from TabStrip.
Hi,
I have this target:
I have two programs (A and B) called by two different transactions.
Now I had to use a single transaction that calls a screen with two TabStrips.
In the first, I must include the parameters of report A and in the second
the parameters of report B.
I can't modify report A and B.
Is it possible ? ..And how I can obtain this goal ?
Does anybody have a good example?
I Thank You in advance. Regards,
Valerio.In the submitted program, the fields on the tabs are uniquely defined, so when using the SUBMIT statement you simply need to address the parameters that you want to pass. Take this example. Here we have two tabs, one parameter on each, we what to execute this program and pass "X" to P_FLD2 on the 2nd tab.
report zrich_0001.
selection-screen begin of screen 101 as subscreen.
selection-screen begin of block b1 with frame title text-001.
parameters: p_fld1 type c.
selection-screen end of block b1.
selection-screen end of screen 101.
selection-screen begin of screen 102 as subscreen.
selection-screen begin of block b2 with frame title text-002.
parameters: p_fld2 type c.
selection-screen end of block b2.
selection-screen end of screen 102.
selection-screen begin of tabbed block one for 20 lines.
selection-screen tab (15) name1 user-command ucomm1
default screen 101.
selection-screen tab (17) name2 user-command ucomm2
default screen 102.
selection-screen end of block one.
initialization.
name1 = 'Tab 1'.
name2 = 'Tab 2'.
start-of-selection.
write:/ 'Value of P_FLD1 is', p_fld1.
write:/ 'Value of P_FLD2 is', p_fld2.
So when submitting this program just pass the value to the parameter
submit zrich_0001
with p_fld2 = 'X' and return.
Regards,.
Rich Heilman -
Submit report with internal table
Hi Experts !
I have a requirement where report is showing output in ALV1. Based user action I need to process further in background mode.
I have developed a report which I am submitting for this background mode.
I am opening a Job sumbitting created report with return. Job close.
This created report is in scheduled status in SM37. I have to go there and release it.
To pass parameters to newly created report I have used WITH field names with developed report name. But I am not getting parameters at new report. Similarly used import/export --- set/get but still not getting parameters at submitted report.
Is it because it is in background mode? If so how can I achieve this functionality. Can anybody suggest me something ?Hi,
IMPORT and EXPORT from memory doesn't work here.
Have a look into the SAP documentation:
When the program is scheduled in the background task, the selections specified by the user or in the additions for filling the selection screen are stored in an internal variant. When the program is executed in the background request, it is processed fully but the selection screen is processed in the background. The system triggers all events, including that for selection screen processing. The variant stored internally is transferred to the selection screen between the INITIALIZATION and AT SELECTION SCREEN OUTPUT events.
The transfer of the parameters should work, if you don't have any statements that clear those parameters. Maybe parameters with SET/GET parameters also will cause a problem. But it should work with this internal variants. Before you start the jov, please have a look in those generated variants, whether the parameters have the right values.
Regards,
Klaus
Edited by: Klaus Babl on Feb 8, 2011 6:58 AM -
Combination of Submit report with SELECTION-SET and WITH is not working
I tried all possibilities to make the additional parameter also pass to the report along with variant but it just does not work. Anybody faced this issue before?
Code snipped which is not taking pernr parameter along with variant 'Report Dis'.
SUBMIT H99CWTR0 USING SELECTION-SET 'REPORT DIS'
WITH pernr = pernr-low
EXPORTING LIST TO MEMORY
AND RETURN.Hi,
THis sample code worked for me
data:params type rsparams.
data:it type table of rsparams.
params-low = '2003'. "In variant ZSURESHPAGA the actual value is 2004, but it got executed for 2003.
params-kind = 'P'.
params-option = 'EQ'.
params-sign = 'I'.
params-selname = 'P_YEAR'.
append params to it.
CALL FUNCTION 'SUBMIT_REPORT'
EXPORTING
report = 'Z12256_TASK1'
VARIANT = 'ZSURESHPAGA'
SKIP_SELSCREEN = 'X'
TABLES
SELECTION_TABLE = it
EXCEPTIONS
JUST_VIA_VARIANT = 1
NO_SUBMIT_AUTH = 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.
SUBMIT H99CWTR0 USING SELECTION-SET 'REPORT DIS'
WITH pernr = pernr-low "<----check this statemnent
EXPORTING LIST TO MEMORY
AND RETURN.
Edited by: Keshav.T on May 13, 2010 4:07 PM -
Hi,
can any one help me out how to get the output from a report by using the submit report . with out disturbing the report sequence of the calling programme
ie need to capture the output of a report in back ground and use the output in the calling report with out any calling screens or stopping the report sequence,,,,,,,,,,,,
ThankX in advance...............Hi Siva
do it like this
Construct job name
PERFORM job_name USING v_text
v_vsg
CHANGING v_jobname.
Open job
PERFORM job_open USING v_jobname
CHANGING p_jobcnt.
Submit Job
SUBMIT RLKOMM40
WITH p_warehno = warehouse number
WITH p_group = group
VIA
JOB v_jobname NUMBER p_jobcnt
TO SAP-SPOOL WITHOUT SPOOL DYNPRO
WITH immediately = space
WITH keep_in_spool = 'X' AND RETURN.
*& Form job_name
text
FORM job_name USING p_v_text
p_v_vsg
CHANGING p_v_jobname.
CONCATENATE p_v_text p_v_vsg INTO p_v_jobname.
CONDENSE p_v_jobname.
ENDFORM. " job_name
*& Form job_open
text
FORM job_open USING p_v_jobname
CHANGING p_p_jobcnt.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = p_v_jobname
IMPORTING
jobcount = p_p_jobcnt
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
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. " job_open
Do Reward if helpful.
Regards
Azad. -
Submit a PNP Report with A Radiobutton Parameter
Hi,
i have a fm to submit a PNP report, i sent selection options parameters but radiobutton parameter wasn't sent.
FUNCTION ZHR_SUBMIT_TO_ZHRSABORDROWDA.
submit ZHRSABORDROWDA
WITH wdaflag = 1
WITH pnppernr in personel
WITH PNPBUKRS in SIRKET_K
WITH PNPWERKS in PERALAN
WITH PNPBTRTL in PERALTA
WITH PNPPERSG in CALIALG
WITH PNPPERSK in CALIALT
WITH PNPABKRS in BORDROA
WITH PNPKOSTL in MASRAFY
WITH PNPTIMR4 = 'X' " pnp radiobutton
WITH P_FPPER = period
AND RETURN
ENDFUNCTION.
How can i send parameter to pnp radiobutton with submit?
Can somebody help me pls?
ThanksYes i solved my problem with that method;
DATA : SEL_TAB TYPE RSPARAMS OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
CURR_REPORT = 'ZHRSABORDROWDA'
* IMPORTING
* SP =
TABLES
SELECTION_TABLE = SEL_TAB
EXCEPTIONS
NOT_FOUND = 1
NO_REPORT = 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.
LOOP AT SEL_TAB.
CASE SEL_TAB-SELNAME.
WHEN 'PNPPERNR'.
READ TABLE personel INDEX 1.
MOVE-CORRESPONDING personel to SEL_TAB.
MODIFY SEL_TAB.
ENDLOOP.
SUBMIT ZHRSABORDROWDA WITH SELECTION-TABLE SEL_TAB AND RETURN.
i hope it will help you.
Thanks. -
Problem with submit report for transaction LT23
Hi,
I want to submit report for transaction LT23 based on the double click on a field in the output of my report. I am using selection table to pass values. The problem is I have something called dynamic selections. I am using some selection fields from the dynamic selection option. Can anyone tell me how do I pass the values in such a case?In your [submit|http://help.sap.com/abapdocu/en/ABAPSUBMIT.htm] statement in the [selection screen parameters|http://help.sap.com/abapdocu/en/ABAPSUBMIT_SELSCREEN_PARAMETERS.htm] use the [WITH FREE SELECTIONS|http://help.sap.com/abapdocu/en/ABAPSUBMIT_SELSCREEN_PARAMETERS.htm#!ABAP_ADDITION_5@5@] option to pass dynamic selections
NB: Use FREE_SELECTIONS_RANGE_2_EX to build the correct parameter texpr.
Regards
Raymond -
Error on running reports with filters/security
Post Author: mishel
CA Forum: Publishing
Hi, I am trying to run a report with filters/security defined via Business View. When I run the report as administrator, I am able to view successfully. However, when I login as test/dummy account which filters my parameters, I am getting such error - "A request was cancelled. The necessary security privileges could not be verified. This indicates a problem with the security server." Appreciate all the help I can get.Thank you,MichelleHi onizga,
According to your description that you are migrating SSRS 2008 R2 reports to SSRS 2012 SP2, after migration you got some error like “The Uri string is too long” which only occurred when accessing the drill-through actions, right?
Usually, the issue can be caused when you try to pass some parameters that cause the URL length to exceed 65,520 characters for a Microsoft SQL Server 2012 Reporting Services (SSRS 2012), you cannot render the report, and you may receive the following error
message:
The value of parameter 'param' is not valid. (rsInvalidParameter).Invalid URI: The Uri string is too long.
This is an known issue and already have the hotfix SQL Server 2012 Service Pack1 Cumulative Update 9 (CU9) as you know, you can try to reinstall this hotfix to fixed this issue:
http://support.microsoft.com/kb/2916827 .Any issue after applying the update, please post it on the following thread or you can submit an feedback:
http://connect.microsoft.com/SQLServer/feedback/details/788964/ssrs-2012-invalid-uri-the-uri-string-is-too-long
Similar threads for your reference:
SSRS - The value of parameter 'param' is
not valid. ---> System.UriFormatException: Invalid URI: The Uri string is too long.
Microsoft.ReportingServices.Diagnostics.Utilities.InvalidParameterException:
The value of parameter 'pSetOfScopes' is not valid. ---> System.UriFormatException: Invalid URI: The Uri string is too long
If you still have any question, please feel free to ask
Regards
Vicky Liu
If you have any feedback on our support, please click here -
Skip Error message in submit report
Hello Gurus,
I am using SUBMIT <REPORT> command inside a loop of my calling report. For one record the SUBMIT <report> is throwing an eror message due to which my report is getting stopped by displaying the error message.
My requirement is to skip the record if there is any error in SUBMIT <report> and process rest of the records.
Please help me out.Hi,
Vasanth's idea regarding doing a CALL FUNCTION IN BACKGRUOND TASK does work, unless you need to get back some information from the SUBMIT, as export parameters can't be set when using IN BACKGRUOND TASK.
As i need to get data from the SUBMIT, i'll keep looking for other alternatives, so other ideas are still welcome...
Regards,
mr.
Hi Manuel,
Try calling report in background task like below:
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = c_name "this name can be any name defined in constants(you do not have to create a job name anywhere in system or SM36)
IMPORTING
jobcount = w_number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
*" Job opened successfully
IF sy-subrc EQ c_0.
*" Call program to process IDoc
SUBMIT ZSubmit WITH <any value> " e.g. p_field1 EQ <value>
VIA JOB c_name NUMBER w_number
AND RETURN.
[Note: In ZSubmit report you can send the data to calling program through ABAP memory i.e. Use EXPORT parameter to export data
Ex: constants: c_memory(7) type c value 'MEMORY1'.
At the end of ZSubmit report, before returning to the calling program write below statement:
EXPORT i_message TO MEMORY ID c_memory1.]
*" Successful processing of IDoc
IF sy-subrc EQ c_0.
"Here you can import data from ZSubmit report
import i_message from memory id c_memory1.
After retrieving the data, free the memory otherwise it will affect the performance of your report:
Free memory id c_memory1.
*" Close the job
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = w_number
jobname = c_name
strtimmed = c_x
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
ENDIF.
ENDIF.
Hope this helps!
Regards,
Saba -
A big problem of Generate report with PDF format....Urgent
I want to generate a report with pdf format through one java file, it have two page 1)gen_report.jsp 2) report_gen.java , the compliation was failed. However, i don't what the problem is .... i hope anyone can help me as it is very argent for me ....Thanks a lot
1)gen_report.jsp
<table id="AutoNumber1">
<tr>
<td background="images/top5movie.png">
<p align="center"> </p>
</td>
</tr>
<tr>
<td >
<div align="center">
<table id="AutoNumber2" >
<form method="GET" action="../report_gen" name="report_gen" target="_blank" onSubmit="javascript:return checkr1(this)">
<tr>
<td ><b>Report Description:</b></td>
<td >This report is to show the top five popular movies in cinemix for a period </td>
</tr>
<tr>
<td><b>Data scope:</b></td>
<td >Start from
<input type="text" name="start" value="2003-1-1" >to
<input type="text" name="end" value="2006-1-1" ></td>
</tr>
<tr>
<td><b>Data processing:</b></td>
<td >Show
<select name="order_by">
<option value="desc" selected>top</option>
<option value="asc">bottom</option>
</select>
5 films</td>
</tr>
<tr>
<td> <p align="center">
<input type="submit" value="View_Report" name="subm">
</p></td>
</tr>
<input type="hidden" name="report" value="r1">
</form>
<form method="GET" action="../report_gen" name="report_gen" target="_blank" onSubmit="javascript:return checkr2(this)">
<input type="hidden" name="report" value="r2">
</form>
</table>
</div>
</td>
</tr>
</table>Then my java code is here
report_gen.java
import java.io.*;
import java.net.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.sql.*;
// chart and pdf out
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.data.xy.*;
import org.jfree.data.xy.XYBarDataset;
import org.jfree.data.general.DefaultPieDataset;
import org.jfree.data.statistics.SimpleHistogramDataset;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Rectangle;
import com.lowagie.text.pdf.DefaultFontMapper;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfTemplate;
import com.lowagie.text.pdf.PdfWriter;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import com.lowagie.text.pdf.PdfPCell;
public class report_gen extends HttpServlet
private final String titles[] = {"Top Five popular movies ",
"Financial cirumstance of cinemas",
"Distribution of time segment",
"Distribution of favourite movie type"
private final String descs[] = {"This report is to show the top five popular movies in cinemix for a period ",
"This report is to show the financial circumstance of each cinema site ",
"This report is to analysis the customer when is the most visit time ",
"This report is to analysis the customer which type of movie do they watch the most"
private final String bigTitle = "Cinemix";
private final String driver = "org.gjt.mm.mysql.Driver";
private final String url= "jdbc:mysql://localhost:3306/cinemix";
private final String userID = "abc";
private final String passwd = "abc";
public void init(ServletConfig config) throws ServletException
super.init(config);
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
final int width = 550;
final int height = 200;
/ title font (centre and report title)
final Font fTitle0 = FontFactory.getFont("Helvetica", 42, Font.BOLD);
final Font fTitle1 = FontFactory.getFont("Helvetica", 30, Font.BOLD);
// centre name:
final String title0 = bigTitle;
// Default category for DefaultCategoryDataset
final String cat = "data";
Connection conn;
JFreeChart chart;
String title1 = "xyz Report";
String chartDesc = "description";
String notes[] = new String[4];
String chartTitle = "so bad this is title";
String chartXTitle = "this is x";
String chartYTitle = "this is y.";
String report = request.getParameter("report");
int max=-10000;
int min=10000;
int j=0;
// do some basic checking
if (report == null || report.equals(""))
report = "-1"; // this course unknow report error message
String start = request.getParameter("start");
String end = request.getParameter("end");
String order_by = request.getParameter("order_by"); // ToDo: check invalid string
int topN = 5;
String order = (order_by.equals("desc")) ? "Top" : "Last";
String inv[] = {"08:30", "09:30", "10:30", "11:30", "12:30", "11:30", "12:30", "13:30", "14:30", "15:30", "16:30", "17:30","18:30","19:30","20:30","21:30","22:30","23:30"};
int inv_val[] = new int[inv.length - 1];
try
Class.forName(driver).newInstance();
catch(Exception e)
printE("Cannot load mysql database driver!", response);
e.printStackTrace();
return;
try
conn = DriverManager.getConnection(url, userID, passwd);
if (report.equals("r1")) { // report 1
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
Statement stmt = conn.createStatement();
String sql = "select *,count(f.Name),f.Name from film f, filmDetail fd, ticket t where f.startDate > '" + start + "' and f.endDate < '" + end + "'and fd.filmID = f.filmID and fd.filmDetailID = t.filmDetailID group by f.name order by fd.filmDetailID asc limit '" +topN+"'";
ResultSet rs = stmt.executeQuery(sql);
while (rs.next())
if (rs.getInt("fd.filmDetailID") > max) max = rs.getInt("fd.filmDetailID");
if (rs.getInt("fd.filmDetailID") < min) min = rs.getInt("fd.filmDetailID");
j++;
ataset.setValue(rs.getInt("fd.filmDetailID"), cat,rs.getString("f.Name"));
title1 = titles[0];
chartDesc = descs[0];
chartTitle = order + " " + topN + " popular movie";
chartYTitle = "Box Office record";
chartXTitle = "Film Name";
gender = " ";
chart = ChartFactory.createBarChart(chartTitle, chartXTitle, chartYTitle, dataset,PlotOrientation.VERTICAL, false, true, false);
else
print("Error: I don't inderstand your request!", response);
return;
catch (SQLException e)
printE("Cannot open database connection? <br>", response);
// printE(e.toString);
e.printStackTrace();
return;
response.setContentType("application/pdf");
Document document = new Document(PageSize.A4, 5, 5, 5, 5);
try
PdfWriter writer;
writer = PdfWriter.getInstance(document, response.getOutputStream());
HeaderFooter footer = new HeaderFooter(new Phrase("Page: "), true);
footer.setBorder(Rectangle.NO_BORDER);
document.setFooter(footer);
footer.setAlignment(Element.ALIGN_CENTER);
// step 3
document.open();
document.add(getHeader(title0, title1, start, end, gender, order, topN, chartDesc));
document.add(printChart(chart, writer));
document.add(getFooter(notes));
catch(DocumentException de)
de.printStackTrace();
// step 5
document.close();
return;
}// end doGet()
/** Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
// processRequest(request, response);
/** Returns a short description of the servlet.
public String getServletInfo()
return "Generate reports for " + bigTitle;
/* To print en error and exit(?) */
private void printE(Object obj, HttpServletResponse response) throws IOException
response.setContentType("text/html");
PrintWriter out;
out = response.getWriter();
out.print(obj.toString());
out.close();
// To-Do: how to force exiting?
// create data chart
private PdfPTable getHeader(String title0, String title1, String start, String end, String sex, String order, int topN, String desc)
Font fTitle0 = FontFactory.getFont("Helvetica", 42, Font.BOLD);
Font fTitle1 = FontFactory.getFont("Helvetica", 24, Font.BOLD);
Font fTitle3 = FontFactory.getFont("Helvetica", 12, Font.BOLD);
Font fValue = FontFactory.getFont("Helvetica", 12, Font.UNDERLINE);
Paragraph parStartEnd = new Paragraph();
parStartEnd.add(new Phrase("Data start from: ", fTitle3));
parStartEnd.add(new Phrase(start, fValue));
parStartEnd.add(new Phrase(" to ", fTitle3));
parStartEnd.add(new Phrase(end, fValue));
Paragraph parGenerateDate = new Paragraph();
parGenerateDate.add(new Phrase("Report generated at: ", fTitle3));
parGenerateDate.add(new Phrase(new java.util.Date().toString(), fValue));
Paragraph parGender = new Paragraph();
parGender.add(new Phrase("Current show gender: ", fTitle3));
parGender.add(new Phrase(sex, fValue));
Paragraph parTopN = new Paragraph();
parTopN.add(new Phrase("Now is showing ", fTitle3));
parTopN.add(new Phrase(order, fValue));
parTopN.add(new Phrase(" ", fValue));
parTopN.add(new Phrase(new Integer(topN).toString(), fValue));
parTopN.add(new Phrase(" record(s)", fTitle3));
// Start main table
PdfPTable tblMain = new PdfPTable(1);
tblMain.getDefaultCell().setBorder(0);
// Print title
tblMain.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
tblMain.addCell(new Paragraph(title0, fTitle0));
tblMain.addCell(new Paragraph(title1, fTitle1));
tblMain.addCell("");
tblMain.addCell("");
tblMain.addCell("");
// Print headers data
//tblMain.getDefaultCell().setHorizontalAlignment(Element.ALIGN_RIGHT);
//tblMain.addCell(parInvoiceNum);
//tblMain.addCell("");
tblMain.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
tblMain.addCell(parStartEnd);
tblMain.addCell("");
tblMain.addCell(parGenerateDate);
tblMain.addCell("");
if (sex != " ")
tblMain.addCell(parGender);
else if(order != null && topN > 0)
tblMain.addCell(parTopN);
else
tblMain.addCell(" \n");
tblMain.addCell("");
tblMain.setWidthPercentage(96);
tblMain.addCell(new Paragraph("Description of this report:", fTitle3));
tblMain.addCell(desc);
tblMain.addCell("\n");
// Finish main table
return tblMain;
// print a chart _directly_ to pdf and return a empty Pdftable...
public PdfPTable printChart(JFreeChart chart, PdfWriter writer)
PdfContentByte cb = writer.getDirectContent();
int width = 550;
int height = 450;
PdfTemplate tp = cb.createTemplate(width, height);
Graphics2D g2d = tp.createGraphics(width, height, new DefaultFontMapper());
Rectangle2D r2d = new Rectangle2D.Double(0, 0, width, height); //->,
chart.draw(g2d, r2d);
g2d.dispose();
cb.addTemplate(tp, 20, 170);
// quick method to push down the footer text
// the only things this method return
PdfPTable tblDownDown = new PdfPTable(1);
tblDownDown.getDefaultCell().setBorder(0);
tblDownDown.addCell(" \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n");
tblDownDown.addCell(" \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n");
tblDownDown.addCell(" \n \n \n \n \n \n");
return tblDownDown;
public PdfPTable getFooter(String notes[])
Font fNote = FontFactory.getFont("Helvetica", 14, Font.UNDERLINE);
Font fComment = FontFactory.getFont("Helvetica", 12, Font.ITALIC);
Font fTitle1 = FontFactory.getFont("Helvetica", 30, Font.ITALIC);
// Start footer table
PdfPTable tblFooter = new PdfPTable(1);
tblFooter.getDefaultCell().setBorder(0);
if (notes != null)
tblFooter.addCell(new Paragraph("Notes:", fNote));
tblFooter.addCell("");
tblFooter.addCell("");
tblFooter.getDefaultCell().setHorizontalAlignment(Element.ALIGN_LEFT);
for (int i=0;i<notes.length;i++)
if (notes[i] != null)
tblFooter.addCell(new Paragraph("" + (i+1) + ". " + notes[i] + "", fComment));
tblFooter.addCell("");
tblFooter.addCell("");
tblFooter.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
tblFooter.addCell(new Paragraph("- End of report -", fComment));
return tblFooter;
}Go to the cache directory and see if you can open the report directly from here (not in IE).
I have seen posts on problems with Acrobat Reader Plugin for IE (I believe it was version 6 of Reader). -
Create a report with PL/SQL
Hi,
I have two pages: the first page contains two text fields and a submit button. In the first text field you can enter a name and in the second field you can enter a number. That means you can search a record by name or by number.
In the second page the report is generated depending on the used text field of the first page.
I tried to to define a region source code with PL/SQL for the report, but nothing appears on the report page although the record I was looking for exists in the database.
begin
if :ENTERNAME IS NOT NULL then
FOR item IN (select "TB_PERSON_INSTITUTION"."PI_ID" as "PI_ID",
"TB_PERSON_INSTITUTION"."PI_NAME" as "PI_NAME",
"TB_PERSON_INSTITUTION"."PI_VORNAME" as "PI_VORNAME",
from "TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
where upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:ENTERNAME||'%'))
loop
DBMS_OUTPUT.PUT_LINE('First name = ' || item.PI_NAME ||
', Last name = ' || item.PI_VORNAME);
end loop;
end if;
end;
Regards
MarkHi,
ok thanks. I tried to use the SQL-Report with type "SQL Query (PL/SQL function body returning SQL-Query)" and made a few changes in the SQL-Statement so that a second table is also included:
declare My_select varchar2(500);
begin
if :TEXTEINGABENAME IS NOT NULL then
My_select:='SELECT
"TB_ADRESSE"."A_PLZ" "A_PLZ",
"TB_ADRESSE"."A_ORT" "A_ORT",
"TB_ADRESSE"."A_ID" "A_ID",
"TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
"TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
"TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
"TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
"TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
"TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
FROM
"TB_ADRESSE" "TB_ADRESSE",
"TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
AND upper("TB_PERSON_INSTITUTION"."PI_NAME") like upper(:TEXTEINGABENAME||"%")';
else
if :TEXTMITGLIEDSNUMMER is not null then
My_select:='SELECT
"TB_ADRESSE"."A_PLZ" "A_PLZ",
"TB_ADRESSE"."A_ORT" "A_ORT",
"TB_ADRESSE"."A_ID" "A_ID",
"TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER" "PI_MITGLIEDSNUMMER",
"TB_PERSON_INSTITUTION"."PI_NAME" "PI_NAME",
"TB_PERSON_INSTITUTION"."PI_VORNAME" "PI_VORNAME",
"TB_PERSON_INSTITUTION"."PI_ERGAENZUNG" "PI_ERGAENZUNG",
"TB_PERSON_INSTITUTION"."PI_ERGAENZUNG1" "PI_ERGAENZUNG1",
"TB_PERSON_INSTITUTION"."PI_ID" "PI_ID"
FROM
"TB_ADRESSE" "TB_ADRESSE",
"TB_PERSON_INSTITUTION" "TB_PERSON_INSTITUTION"
WHERE "TB_PERSON_INSTITUTION"."PI_ID" = "TB_ADRESSE"."A_F_PERSON_INSTITUTION"
AND upper("TB_PERSON_INSTITUTION"."PI_MITGLIEDSNUMMER") like upper(:TEXTMITGLIEDSNUMMER||"%")';
end if;
end if;
return My_select;
end;
When I try to apply changes an error message occurs:
"Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. The query can not be parsed, the cursor is not yet open or a function returning a SQL query returned without a value."
Regards,
Mark -
Submit report using internal table
Hi Experts!!,
REPORT 1
TYPES: BEGIN OF ty_out_table,
partner LIKE /sapsll/pntbp-partner,
bpvsy LIKE /sapsll/pntbp-bpvsy,
country LIKE adrc-country,
END OF ty_out_table.
internal table declaration & definition
DATA: gt_out_table TYPE STANDARD TABLE OF ty_out_table
WITH KEY partner
bpvsy.
I have data in internal table gt_out_table.
I want to pass data gt_out_table in report 2. using SUBMIT REPORT.
How to do that ?
REPORT 2
select-options: s_partnr for /sapsll/pntbp-bpvsy.
parameters: p_upd,
p_value .
please suggest.
Thanks
Aneehai,
... WITH SELECTION-TABLE rspar
Effect
If you specify this addition, parameters and selection criteria on the selection screen are supplied from an internal table rspar. You must specify an internal table with the row type RSPARAMS for rspar. The structured data type RSPARAMS is defined in the ABAP Dictionary and has the following components, all of which are data type CHAR:
SELNAME (length 8),
KIND (length 1),
SIGN (length 1),
OPTION (length 2),
LOW (length 45),
HIGH (length 45).
To supply parameters and selection criteria for the selection screen with specific values, the lines in the internal table rspar must contain the following values:
SELNAME must contain the name of a parameter or selection criterion for the selection screen in block capitals
KIND must contain the type of selection screen component (P for parameters, S for selection criteria)
SIGN, OPTION, LOW, and HIGH must contain the values specified for the selection table columns that have the same names as the selection criteria; in the case of parameters, the value must be specified in LOW and all other components are ignored.
If the name of a selection criterion is repeated in rspar, this defines a selection table containing several lines and passes it on to the selection criterion. If parameter names occur several times, the last value is passed on to the parameter.
The contents of the parameters or selection tables for the current program can be entered in the table by the function module RS_REFRESH_FROM_SELECTOPTIONS.
Notes
In contrast to selection tables, the data types of the components LOW and HIGH in table rspar are always of type CHAR and are converted to the type of the parameter or selection criterion during transfer, if necessary.
When entering values, you must ensure that these are entered in the internal format of the ABAP values, and not in the output format of the screen display.
Maybe you are looking for
-
Hello, I'm using Jdeveloper 10.1.3.0.3.3412 on a Mac with a MySQL database. In Jdeveloper i can make a connection to the database and create adf business components I've made a JSP page with ADF on a single table. No errors when compiling. When I try
-
How do I change settings for opening/saving documents from web?
I have an iMac running OS X 10.5.8 and Firefox 3.6.3. When I try to open a document (pdf) from a website, the dialog box only gives a save option with drop down for location. I'm used to a dialog box with open and save options. Open then offers the a
-
Lumia 920 micro usb -- vga ?
Hi, I wonder if it is possible to use a Lumia 920 and a projector with a "micro usb to vga" cable? Thanks in advance!
-
XML import is duplicating xml elements
I have a document which I am importing XML into to create a menu. The xml is in this format. <Root> <Categories> <Category> <CategoryName>Black teas from around the world</CategoryName> <Tea> <TeaNumber>1</TeaNumber>
-
Project my Keynote/PowerPoint presentation wirelessly
I would like to project my presentation to a large screen or large screen TV wirelessly using my mini iPad. What sort of accessories and method I can accomplish this task? Thanks!