Transfering Report To Excel
Hi All,
I want to transfer my report to Excel Sheet Directly from report (Generate to File) Option. I heared that their is one Patch Of Reports 6i which we can use to transfer report to excel sheet directly, If anybody have that Patch or know from where i can download or have any others idea to transfer report to excel then please help me.
Thank You
Imran Ahmed
Hi Imran,
Generate to File > Excel is not available in any of the 6i patches, or even in 9i. In 6i, the only available option is to generate a comma delimited text file, and then open this file up in Excel.
In the upcoming release (OracleAS 10g release 2), Oracle Reports is planning to come out with a new feature where you can generate an Excel file from a report directly.
Navneet.
Similar Messages
-
Export Crystal Report to Excel with Grids
Can anyone tell me how or if it's possible to include the grid lines when exporting from Crystal Reports (version 10) to Excel? I am exporting as "data only" because I need to include field properties (color, bold, etc.). Because of this, I don't see a "Show Gridlines" option on the export. On the Crystal report, I have selected both single line and double line borders for each field on the report, but it's not transferring over to Excel.
Thanks for any help you can provide.I did adjust the col. widths, but on larger col. headings, the text was chopped off. I could get around this by making the field wider on the Crystal report. With having so many cols., this was an issue. And if the detail wasn't the same width as it's corresponding header, the report was not pretty.
This report was an evolution with me trying different things to get everything to fit in the designer until I finally discovered the Image Writer. By exporting as Data Only, it doesn't matter how wide the heading/field is in the designer because the entire text exports. Then I just select the entire worksheet and adjust the col. alignment so that everything shows. I had to play around with things to get my colors and fonts to export - but the grids were the only remaining piece to the puzzle.
As it turns out, the users are happy with the end result without the grids. They can add them manually if they so choose.
Thanks -
hi,
my scenerio is -
i have 5 Bex reports to which i am placing them on single web report.
so in web i will see diferent 5 reports one below another...
now, i want this web report to be transferred to my excel sheet and that to in to single excel sheet....
how this could b achieved?
regards...Hi,
But i had some problem with that code.
If you Right click and view the BW context menu once and then click the "Download to Excel" Button the Context menu also comes up with the Copy and Paste in the Excel Spreadsheet.
I event tried to clear the Windows Clipboard before copying but it didn't work.The context menu vaninishes once if you try to refresh the page, but if you try to programmatically refresh the page you will get an Error: Permission Denied.
Have somebody solved this problem?
Thank you
Arun -
Issue while exporting report in Excel Format
Hello,
I am facing problem while exporting the report in Excel Format. After analysis, I think that it could be due to two reasons, either we are using wrong versions of Jars, or we are using wrong API. Here is the code, approaches and problems we are facing. Please help.
First approach we are using is:
// using basic API
import com.crystaldecisions.reports.sdk.ReportClientDocument;
// get client document from crystal report API and open the report by specifying the report name, with path
ReportClientDocument reportClientDoc = new ReportClientDocument();
reportClientDoc.open( reportPath, 0 );
// give chance to extending classes to configure the report document by POJO or by sql parameter etc, just adding the parameters infromation using ParameterFieldController
configureReportDocument( reportClientDoc, reportMetadata, reportData, reportContext );
// get data source of crystal report
Object reportSource = reportClientDoc.getReportSource();
// export the data - we have also tried with MSExcel format
ReportExportFormat exportFormat = ReportExportFormat.recordToMSExcel;
LOGGER.debug( "exportFormat[" + exportFormat + "]" );
ByteArrayInputStream byteArray = (ByteArrayInputStream) reportClientDoc.getPrintOutputController().export(
exportFormat );
Problem Faced: Specified Excel format is not supported.
Second Approach: We come to know that excel format is supported with new releases and with occa package.
Then we tried with import com.crystaldecisions.sdk.occa.report.application.ReportClientDocument; It ask to set the ReportServer. When we are trying to set the server as
reportClientDoc.setReportAppServer(ReportClientDocument.inprocConnectionString);
Application is unable to find 'ReportClientDocument.inprocConnectionString' property. It seems like we are using some old jars. However we have downloaded the latest released jars for eclipse 2.
Please help for it. Issue is to export the report in excel format, which is currently working fine for PDF. If this problem is related to Jars, please suggest the path to download the latest jars. We also looking for the latest jars like rasapp and rascore etc. But these are not available with Crystal Report for Eclipse 2 release.
Waiting for urgent help. Thanks you..
Regards,
MohitHi,
Send me Environment Details .
Here is the code snippet for exporting report to excel format:
<%@ page import="com.crystaldecisions.sdk.occa.report.application.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.definition.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.data.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.lib.*" %>
<%@ page import="com.crystaldecisions.sdk.framework.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.managedreports.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.infostore.*" %>
<%@ page import="com.crystaldecisions.sdk.occa.report.exportoptions.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%
String username ="Administrator";
String password ="";
String cmsname ="localhost:6400";
String Authen ="secEnterprise";
//connecting to Enterprise
IEnterpriseSession es = CrystalEnterprise.getSessionMgr().logon(username,password,cmsname,Authen);
//get the report App Factory form the Crystal Enterprise
IReportAppFactory appFactory = (IReportAppFactory) es.getService("","RASReportService");
//get the infostore service form the Crystal Enterprise
IInfoStore istore = (IInfoStore) es.getService("","InfoStore");
//get the report by name from crystal Enterprise
IInfoObjects iobjects = istore.query("Select * From CI_INFOOBJECTS Where SI_NAME = 'sampleramz2.rpt' and SI_INSTANCE = 0 ");
//open the report in the report doc object.
ReportClientDocument Doc = appFactory.openDocument((IInfoObject)iobjects.get(0), 0, Locale.ENGLISH);
// WORKING WITH THE PRINT OUTPUT CONTROLLER
//Use the report documents PrintOutputController to export the report to a ByteArrayInputStream
ByteArrayInputStream byteIS = (ByteArrayInputStream)Doc.getPrintOutputController().export(ReportExportFormat.recordToMSExcel);
// EXPORTING THE REPORT
//Create a byte[] (same size as the exported ByteArrayInputStream)
byte[] buf = new byte[2000 * 1024];
int nRead = 0;
//Set response headers to indicate pdf MIME type and inline file
response.reset();
response.setHeader("Content-disposition", "inline;filename=ramz");
response.setContentType("application/xls");
//Send the Byte Array to the Client
while ((nRead = byteIS.read(buf)) != -1)
response.getOutputStream().write(buf, 0, nRead);
//Flush the output stream
response.getOutputStream().flush();
//Close the output stream
response.getOutputStream().close();
%>
Let me know any information is needed,
Regards,
Rameez -
Need to convert AP Invoice Aging Report in Excel format
Hi,
Need to convert AP Invoice Aging Report in excel format..there was an existing Invoice Aging report in AP and that was in paper format. That we need to convert to rtf template..
There was an other concurrent program called 'Invoice Aging Report (XML) - Reserveed for future use', when i am using that rtf template..to get the report output it was taking more than 1 hr time.
1)Is there any way/patch to get that XML report to be used in 12.1.3 EBS version
2) is there any other way to get the report output faster.
Thanks..Hi,
When submitting the request, you may change the output to Excel and get the output in Excel. Otherwise as you mention if you getting the output in text format, you may download the text format and open the document in excel and use the delimitation to format in excel as per your requirement.
1)Is there any way/patch to get that XML report to be used in 12.1.3 EBS version
2) is there any other way to get the report output faster.
Is your statistics up to date, when did you last run gather schema statistics program in Sysadmin responsibility.
Also what is the record quantity that you are expecting here? Is date range parameter available in the report and if yes, did you try running the report for a day to check the output.
Thanks &
Best Regards, -
How to create a report in excel format having two tab
Hi All,
I have Business requirement where customer wants to create a report in excel format having two tab.
Please let me know if it is possible?
I am using 10.1.4.3.2 version of BIP.
Thanks & Regards,
Edited by: 862749 on May 20, 2013 7:36 PMI have Business requirement where customer wants to create a report in excel format having two tab.
Can anybody suggest if it is possible in BI Publisher or not?yes
look at excel template
also you can use xsl-xml or xsl-fo template
check it for your requirements -
Can we generate from reports to Excel , not only the data but also all the formatting i.e. report heading, fonts, font sizes etc. For example can we export a invoice with formatting and data to excel from reports ?
Hi Do otn Baat ,
There is no system parameter using which we can set mimetype i.e. there is no system parameter called Mimetype. <<Never mind, just specify it. It is not intended for reports , it is for browser (This is only for servlet and jsp run. The details are explained in the link given)
http://www.oracle.com/technology/products/reports/htdocs/getstart/demonstrations/index.html
Here see link
Output to Excel with Oracle9i Report
Do you mean that , in reprots 10g release 2 , we can provide a destination format of excel while running reports? <<Yes.
(I am not sure if I can give all information. So when it is released you can try it out and read the docs to know more about it)
[ All Docs for all versions ]
http://otn.oracle.com/documentation/reports.html
[ Publishing reports to web - 10G ]
http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
[ Building reports - 10G ]
http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
[ Forms Reports Integration whitepaper 9i ]
http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf
--------------------------------------------------------------------------------- -
Fatal Error when exporting Report to Excel
Hi Everyone, I've been trying to export my report to excel. But I have exhausted all possible reasons and I just couldn't figure it out. Can someone please help me. Thanks in advance.
PROGRAM NAME : ZADC_PAYSUMNEW
REPORT ZADC_PAYSUMNEW
NO STANDARD PAGE HEADING
LINE-SIZE 450
LINE-COUNT 65 MESSAGE-ID zmes.
TABLE DECLARATION *
TABLES: cskt,
csks,
pa0009,
pcl1,
pcl2,
pernr,
t512t,
t549a,
t527x,
zhrprtype.
INFOTYPES DECLARATION
INFOTYPES: 0001, 0002.
INCLUDE DECLARATION
INCLUDE: rpc2rx00.
INCLUDE: rpc2rxx0.
INCLUDE: rpppxd00.
INTERNAL TABLE DECLARATION
DATA: BEGIN OF itab OCCURS 0,
khinr LIKE csks-khinr,
kostl LIKE p0001-kostl,
ltext(40),
p_date LIKE pc261-inper,
basic(7) TYPE p DECIMALS 2,
pera(7) TYPE p DECIMALS 2,
longp(7) TYPE p DECIMALS 2,
trall(6) type p decimals 2,
srvaw(6) TYPE p DECIMALS 2,
chall(7) TYPE p DECIMALS 2,
leave(7) TYPE p DECIMALS 2,
meal(7) TYPE p DECIMALS 2,
saldf(7) TYPE p DECIMALS 2,
sipps(7) TYPE p DECIMALS 2,
sipgs(7) TYPE p DECIMALS 2,
subs(7) TYPE p DECIMALS 2,
hzard(7) TYPE p DECIMALS 2,
lallw(7) TYPE p DECIMALS 2,
medps(7) TYPE p DECIMALS 2,
medgs(7) TYPE p DECIMALS 2,
pcontps(7) TYPE p DECIMALS 2,
pcontgs(7) TYPE p DECIMALS 2,
pagibps(6) TYPE p DECIMALS 2,
pagibgs(6) TYPE p DECIMALS 2,
lwop(7) TYPE p DECIMALS 2,
npay(7) TYPE p DECIMALS 2,
otime(7) TYPE p DECIMALS 2,
ec(7) TYPE p DECIMALS 2,
fr_date like sy-datum,
to_date like sy-datum,
END OF itab.
DATA: BEGIN OF jtab OCCURS 0,
khinr LIKE csks-khinr,
kostl LIKE p0001-kostl,
ltext(40),
basic(7) TYPE p DECIMALS 2,
pera(7) TYPE p DECIMALS 2,
longp(7) TYPE p DECIMALS 2,
trall(6) type p decimals 2,
srvaw(6) TYPE p DECIMALS 2,
chall(7) TYPE p DECIMALS 2,
leave(7) TYPE p DECIMALS 2,
meal(7) TYPE p DECIMALS 2,
saldf(7) TYPE p DECIMALS 2,
sipps(7) TYPE p DECIMALS 2,
sipgs(7) TYPE p DECIMALS 2,
subs(7) TYPE p DECIMALS 2,
hzard(7) TYPE p DECIMALS 2,
lallw(7) TYPE p DECIMALS 2,
medps(7) TYPE p DECIMALS 2,
medgs(7) TYPE p DECIMALS 2,
pcontps(7) TYPE p DECIMALS 2,
pcontgs(7) TYPE p DECIMALS 2,
pagibps(6) TYPE p DECIMALS 2,
pagibgs(6) TYPE p DECIMALS 2,
lwop(7) TYPE p DECIMALS 2,
npay(7) TYPE p DECIMALS 2,
otime(7) TYPE p DECIMALS 2,
ec(7) TYPE p DECIMALS 2,
END OF jtab.
DATA: it_list TYPE STANDARD TABLE OF itab WITH HEADER LINE.
CONSTANTS DECLARATION
CONSTANTS: basic TYPE pc207-lgart VALUE '0401',
basic2 TYPE pc207-lgart VALUE '0402',
basic3 TYPE pc207-lgart VALUE '0403',
PERA TYPE pc207-lgart VALUE '3104',
PERA2 TYPE pc207-lgart VALUE '3110',
longp TYPE pc207-lgart VALUE '1601',
longp2 TYPE pc207-lgart VALUE '1603',
trall TYPE pc207-lgart VALUE '3109',
srvaw TYPE pc207-lgart VALUE '2117',
leave TYPE pc207-lgart VALUE '2118',
chall TYPE pc207-lgart VALUE '3105',
chall2 TYPE pc207-lgart VALUE '3111',
chall3 TYPE pc207-lgart VALUE '3112',
meal TYPE pc207-lgart VALUE '3102',
saldf TYPE pc207-lgart VALUE '4103',
sipps TYPE pc207-lgart VALUE '/090',
sipps2 TYPE pc207-lgart VALUE '1121',
subs TYPE pc207-lgart VALUE '3101',
hzard TYPE pc207-lgart VALUE '1602',
lallw TYPE pc207-lgart VALUE '3103',
medps TYPE pc207-lgart VALUE '/313',
medgs TYPE pc207-lgart VALUE '/314',
pcontps TYPE pc207-lgart VALUE '/093',
pcontps2 TYPE pc207-lgart VALUE '1327',
pcontps3 TYPE pc207-lgart VALUE '1120',
pagibps TYPE pc207-lgart VALUE '/326',
pagibps2 TYPE pc207-lgart VALUE '1326',
lwop TYPE pc207-lgart VALUE '1102',
otime TYPE pc207-lgart VALUE '0101',
otime2 TYPE pc207-lgart VALUE '0102',
otime3 TYPE pc207-lgart VALUE '0103',
otime4 TYPE pc207-lgart VALUE '0104',
npay TYPE pc207-lgart VALUE '/559'.
DATA DECLARATION
DATA: BEGIN OF COMMON PART buffer.
INCLUDE: rpppxd10.
DATA: END OF COMMON PART buffer.
*Table data containing directory to PCL2 payroll results file DATA:
DATA: BEGIN OF rgdir OCCURS 100.
INCLUDE STRUCTURE pc261.
DATA: END OF rgdir.
DATA: BEGIN OF evpdir OCCURS 100.
INCLUDE STRUCTURE pc261.
DATA: END OF evpdir.
DATA: country LIKE t001p-molga,
lname LIKE t527x-orgtx,
filename2(128),
p_date LIKE pc261-inper,
w_basic LIKE pc207-lgart,
w_basic2 LIKE pc207-lgart,
w_basic3 LIKE pc207-lgart,
w_pera LIKE pc207-lgart,
w_pera2 LIKE pc207-lgart,
w_longp LIKE pc207-lgart,
w_longp2 LIKE pc207-lgart,
w_trall LIKE pc207-lgart,
w_srvaw LIKE pc207-lgart,
w_leave LIKE pc207-lgart,
w_chall LIKE pc207-lgart,
w_chall2 LIKE pc207-lgart,
w_chall3 LIKE pc207-lgart,
w_meal LIKE pc207-lgart,
w_saldf LIKE pc207-lgart,
w_sipps LIKE pc207-lgart,
w_sipps2 LIKE pc207-lgart,
w_subs LIKE pc207-lgart,
w_hzard LIKE pc207-lgart,
w_lallw LIKE pc207-lgart,
w_medps LIKE pc207-lgart,
w_medgs LIKE pc207-lgart,
w_pcontps LIKE pc207-lgart,
w_pcontps2 LIKE pc207-lgart,
w_pcontps3 LIKE pc207-lgart,
w_pagibps LIKE pc207-lgart,
w_pagibps2 LIKE pc207-lgart,
w_lwop LIKE pc207-lgart,
w_otime LIKE pc207-lgart,
w_otime2 LIKE pc207-lgart,
w_otime3 LIKE pc207-lgart,
w_otime4 LIKE pc207-lgart,
w_npay LIKE pc207-lgart,
tempgs(7) TYPE p DECIMALS 2,
ctr-basic(7) TYPE p DECIMALS 2,
ctr-pera(7) TYPE p DECIMALS 2,
ctr-longp(7) TYPE p DECIMALS 2,
ctr-trall(6) TYPE p DECIMALS 2,
ctr-srvaw(6) TYPE p DECIMALS 2,
ctr-leave(7) TYPE p DECIMALS 2,
ctr-chall(7) TYPE p DECIMALS 2,
ctr-meal(7) TYPE p DECIMALS 2,
ctr-saldf(7) TYPE p DECIMALS 2,
ctr-sipps(7) TYPE p DECIMALS 2,
ctr-sipgs(7) TYPE p DECIMALS 2,
ctr-subs(7) TYPE p DECIMALS 2,
ctr-hzard(7) TYPE p DECIMALS 2,
ctr-lallw(7) TYPE p DECIMALS 2,
ctr-medps(7) TYPE p DECIMALS 2,
ctr-medgs(7) TYPE p DECIMALS 2,
ctr-pcontps(7) TYPE p DECIMALS 2,
ctr-pcontgs(7) TYPE p DECIMALS 2,
ctr-pagibps(6) TYPE p DECIMALS 2,
ctr-pagibgs(6) TYPE p DECIMALS 2,
ctr-lwop(7) TYPE p DECIMALS 2,
ctr-otime(7) TYPE p DECIMALS 2,
ctr-npay(7) TYPE p DECIMALS 2,
ctr-ec(7) TYPE p DECIMALS 2.
DATA: BEGIN OF ph-version.
INCLUDE STRUCTURE pc201_pay. "XTWPH9K008656
DATA: END OF ph-version.
DATA: fr_date LIKE sy-datum,
to_date LIKE sy-datum.
SELECT-OPTIONS and PARAMETERS
SELECT-OPTIONS: p_status FOR rgdir-srtza DEFAULT 'A'.
DATA: DATE1(15),
mon(9).
DEFINITION
DEFINE rp-imp-c2-rx2.
clear:
orx-version, "OBJECTS_FOR_CLEAR
rt, rt[].
import
ph-version to orx-version "OBJECTS_FOR_IMPORT
rt
from database pcl2(ph) id rx-key using pcl2_exp_imp.
rp-imp-rx-subrc = sy-subrc.
if sy-subrc eq 0 and orx-version-number ne ph-version-number.
rp-imp-rx-subrc = 8.
endif.
END-OF-DEFINITION.
TYPE-POOLS: slis.
DATA: g_repid LIKE sy-repid,
gt_fieldcat TYPE slis_t_fieldcat_alv,
gt_events TYPE slis_t_event,
gt_top TYPE slis_t_listheader,
gt_eol TYPE slis_t_listheader,
gt_list_top_of_page TYPE slis_t_listheader,
gt_list_end_of_list TYPE slis_t_listheader,
gs_layout TYPE slis_layout_alv,
d_f2code LIKE sy-ucomm VALUE '&ETA'.
CONSTANTS: fn_top TYPE slis_formname VALUE 'TOP_OF_PAGE',
fn_eol TYPE slis_formname VALUE 'END_OF_LIST'.
DATA: it_alv_out TYPE STANDARD TABLE OF itab WITH HEADER LINE.
INITIALIZATION.
g_repid = sy-repid.
PERFORM f_fieldcat_init USING gt_fieldcat[].
PERFORM eventtab_build USING gt_events[].
START-OF-SELECTION.
START-OF-SELECTION.
fr_date = to_date = pn-endda.
fr_date+6(2) = '01'.
SELECT SINGLE * FROM t549a
WHERE abkrs = pnpxabkr.
GET PERNR.
CLEAR: itab, lname.
PERFORM get_rt_tab.
END-OF-SELECTION.
PERFORM display_grid.
INCLUDE rpppxm00.
USING DATM
FORM get_rt_tab *
FORM get_rt_tab.
rp_provide_from_last p0001 space pn-begda pn-endda.
rp_provide_from_last p0002 space pn-begda pn-endda.
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
persnr = p0001-pernr
IMPORTING
molga = country
TABLES
in_rgdir = rgdir
EXCEPTIONS
no_record_found = 1
OTHERS = 2.
IF sy-subrc = 0.
SELECT single ltext FROM cskt
INTO itab-ltext
WHERE kostl = p0001-kostl
AND datbi = '99991231'.
SELECT SINGLE * FROM csks
WHERE kostl = p0001-kostl
AND kokrs = 'GSIS'
AND datbi = '99991231'.
IF sy-subrc = 0.
MOVE: csks-kostl TO itab-kostl,
csks-khinr TO itab-khinr.
ENDIF.
p_date = pn-paper.
regular payroll run.
CALL FUNCTION 'CD_EVALUATION_PERIODS'
EXPORTING
bonus_date = '00000000'
inper_modif = t549a-permo
inper = p_date
pay_type = ' '
pay_ident = ' '
TABLES
rgdir = rgdir
evpdir = evpdir
EXCEPTIONS
no_record_found = 1
OTHERS = 2.
IF sy-subrc = 0.
LOOP AT evpdir WHERE srtza IN p_status and FPPER eq pn-begda+(6).
rx-key-pernr = p0001-pernr.
rx-key-seqno = evpdir-seqnr.
rp-imp-c2-rx2.
IF rp-imp-rx-subrc = 0.
PERFORM rt_to_itab.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM.
FORM PRINT_RX *
FORM print_rx.
LOOP AT rt.
PERFORM re512t USING country rt-lgart.
ENDLOOP.
ENDFORM.
FORM RE512T *
--> VALUE(COUNTRY_GROUPING) *
--> VALUE(WTYPE) *
FORM re512t USING value(country_grouping)
value(wtype).
CHECK t512t-sprsl NE sy-langu
OR t512t-molga NE country_grouping
OR t512t-lgart NE wtype.
SELECT SINGLE * FROM t512t
WHERE sprsl EQ sy-langu
AND molga EQ country_grouping
AND lgart EQ wtype.
IF sy-subrc NE 0.
CLEAR t512t.
ENDIF.
ENDFORM.
FORM rt_to_itab *
FORM rt_to_itab.
MOVE: basic TO w_basic,
basic2 TO w_basic2,
basic3 TO w_basic3,
pera TO w_pera,
pera2 TO w_pera2,
longp TO w_longp,
longp2 TO w_longp2,
srvaw TO w_srvaw,
leave TO w_leave,
trall TO w_trall,
chall TO w_chall,
chall2 TO w_chall2,
chall3 TO w_chall3,
meal TO w_meal,
saldf TO w_saldf,
sipps TO w_sipps,
sipps2 TO w_sipps2,
subs TO w_subs,
hzard TO w_hzard,
lallw TO w_lallw,
medps TO w_medps,
medgs TO w_medgs,
pcontps TO w_pcontps,
pcontps2 TO w_pcontps2,
pcontps3 TO w_pcontps3,
pagibps TO w_pagibps,
pagibps2 TO w_pagibps2,
LWOP TO w_lwop,
otime TO w_otime,
otime2 TO w_otime2,
otime3 TO w_otime3,
otime4 TO w_otime4,
npay TO w_npay.
LOOP AT rt WHERE lgart = w_basic or lgart = w_basic2
or lgart = w_basic3.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-basic.
itab-ec = rt-betrg / 100.
if itab-ec > 100.
itab-ec = 100.
ENDIF.
ENDLOOP.
LOOP AT rt WHERE lgart = w_pera.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-pera.
ENDLOOP.
LOOP AT rt WHERE lgart = w_pera2.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-pera.
ENDLOOP.
LOOP AT rt WHERE lgart = w_longp or lgart = w_longp2.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-longp.
ENDLOOP.
LOOP AT rt WHERE lgart = w_trall.
if rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
endif.
ADD: rt-betrg TO itab-trall.
ENDLOOP.
LOOP AT rt WHERE lgart = w_srvaw.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-srvaw.
ENDLOOP.
LOOP AT rt WHERE lgart = w_leave.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-leave.
ENDLOOP.
LOOP AT rt WHERE lgart = w_chall or
lgart = w_chall2 or
lgart = w_chall3.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-chall.
ENDLOOP.
LOOP AT rt WHERE lgart = w_meal.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-meal.
ENDLOOP.
LOOP AT rt WHERE lgart = w_saldf.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-saldf.
ENDLOOP.
LOOP AT rt WHERE lgart = w_sipps or
lgart = w_sipps2.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-sipps.
itab-sipgs = itab-sipps / 9 * 12.
ENDLOOP.
LOOP AT rt WHERE lgart = w_subs.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-subs.
ENDLOOP.
LOOP AT rt WHERE lgart = w_hzard.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-hzard.
ENDLOOP.
LOOP AT rt WHERE lgart = w_lallw.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-lallw.
ENDLOOP.
LOOP AT rt WHERE lgart = w_medps.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-medps.
ENDLOOP.
LOOP AT rt WHERE lgart = w_medgs.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
MOVE: rt-betrg TO tempgs.
itab-medgs = itab-medps.
ENDLOOP.
LOOP AT rt WHERE lgart = w_pcontps OR
lgart = w_pcontps2 OR
lgart = w_pcontps3.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-pcontps.
ENDLOOP.
itab-pcontgs = itab-pcontps * 9.
LOOP AT rt WHERE lgart = w_pagibps OR
lgart = w_pagibps2.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-pagibps.
ENDLOOP.
LOOP AT rt WHERE lgart = w_pagibps.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-pagibgs.
ENDLOOP.
LOOP AT rt WHERE lgart = w_lwop.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-lwop.
ENDLOOP.
LOOP AT rt WHERE lgart = w_otime or
lgart = w_otime2 or
lgart = w_otime3 or
lgart = w_otime4.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-otime.
ENDLOOP.
LOOP AT rt WHERE lgart = w_npay.
IF rt-betrg < 0.
rt-betrg = abs( rt-betrg ).
ENDIF.
ADD: rt-betrg TO itab-npay.
ENDLOOP.
COLLECT itab.
CLEAR: itab.
REFRESH rt.
ENDFORM. " rt_to_itab
*& Form f_fieldcat_init
text
-->P_GT_FIELDCAT[] text
FORM f_fieldcat_init USING rt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 1.
ls_fieldcat-reptext_ddic = ' FXNAL Group'.
ls_fieldcat-fieldname = 'KHINR'.
ls_fieldcat-ref_tabname = 'ITAB'.
ls_fieldcat-outputlen = 12.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 2.
ls_fieldcat-reptext_ddic = ' OFFICE'.
ls_fieldcat-fieldname = 'LTEXT'.
ls_fieldcat-ref_tabname = 'ITAB'.
ls_fieldcat-outputlen = 40.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 3.
ls_fieldcat-reptext_ddic = ' RC #'.
ls_fieldcat-fieldname = 'KOSTL'.
ls_fieldcat-ref_tabname = 'ITAB'.
ls_fieldcat-outputlen = 5.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 4.
ls_fieldcat-reptext_ddic = 'Basic Salary'.
ls_fieldcat-tabname = 'ITAB'.
ls_fieldcat-fieldname = 'BASIC'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 5.
ls_fieldcat-reptext_ddic = 'PERA Allow'.
ls_fieldcat-tabname = 'ITAB'.
ls_fieldcat-fieldname = 'PERA'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 6.
ls_fieldcat-reptext_ddic = 'Longevity Pay'.
ls_fieldcat-tabname = 'ITAB'.
ls_fieldcat-fieldname = 'LONGP'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 7.
ls_fieldcat-reptext_ddic = 'Service Award'.
ls_fieldcat-tabname = 'ITAB'.
ls_fieldcat-fieldname = 'SRVAW'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 8.
ls_fieldcat-reptext_ddic = 'Child Allowance'.
ls_fieldcat-tabname = 'ITAB'.
ls_fieldcat-fieldname = 'CHALL'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 9.
ls_fieldcat-reptext_ddic = 'Leave Mone'.
ls_fieldcat-tabname = 'ITAB'.
ls_fieldcat-fieldname = 'LEAVE'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 10.
ls_fieldcat-reptext_ddic = 'Over-time'.
ls_fieldcat-tabname = 'ITAB'.
ls_fieldcat-fieldname = 'OTIME'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 11.
ls_fieldcat-reptext_ddic = 'Meal Subsidy'.
ls_fieldcat-tabname = 'ITAB'.
ls_fieldcat-fieldname = 'MEAL'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 12.
ls_fieldcat-reptext_ddic = 'Salary Diff.'.
ls_fieldcat-tabname = 'ITAB'.
ls_fieldcat-fieldname = 'SALDF'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 13.
ls_fieldcat-reptext_ddic = 'Subsistence'.
ls_fieldcat-tabname = 'ITAB'.
ls_fieldcat-fieldname = 'SUBS'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 14.
ls_fieldcat-reptext_ddic = 'Hazard Pay'.
ls_fieldcat-tabname = 'ITAB'.
ls_fieldcat-fieldname = 'HZARD'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO rt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-col_pos = 15.
ls_fieldcat-reptext_ddic = 'Laundry Allow'.
ls_fieldcat-tabname = 'ITAB'.
ls_fieldcat-fieldname = 'LALLW'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-outputlen = 15.
APPEND ls_fieldcat TO rt_fieldcat.
ENDFORM. " f_fieldcat_init
*& Form display_grid
text
--> p1 text
<-- p2 text
FORM display_grid.
SORT itab BY kostl khinr.
LOOP AT itab.
AT NEW khinr.
MOVE-CORRESPONDING itab TO jtab.
APPEND jtab.
ENDAT.
ENDLOOP.
PERFORM my_top USING gt_top[].
PERFORM build_layout USING gs_layout.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = g_repid
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
it_events = gt_events[]
TABLES
t_outtab = itab.
ENDFORM. " display_grid
*& Form eventtab_build
text
-->P_GT_EVENTS[] text
FORM EVENTTAB_BUILD USING my_events TYPE SLIS_T_EVENT.
DATA: ls_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 1
IMPORTING
et_events = my_events.
*TOP OF PAGE
READ TABLE my_events
WITH KEY NAME = slis_ev_top_of_page
INTO LS_EVENT.
IF SY-SUBRC = 0.
MOVE fn_top TO ls_event-form.
APPEND ls_event TO my_events.
ENDIF.
CLEAR ls_event.
*END OF LIST
READ TABLE my_events
WITH KEY name = slis_ev_end_of_list
INTO ls_event.
IF sy-subrc = 0.
MOVE fn_eol TO ls_event-form.
APPEND ls_event TO my_events.
ENDIF. " SY-SUBRC for READ TABLE
ENDFORM. " eventtab_build
*& Form top_comment
text
-->P_MYTOP[] text
FORM top_comment USING my_top_of_page TYPE slis_t_listheader.
DATA: it_t247 LIKE t247 OCCURS 0 WITH HEADER LINE.
DATA: ls_line TYPE slis_listheader,
li_recs TYPE i,
lc_name(60) TYPE c,
lc_from(30) TYPE c,
lc_to(30) TYPE c.
CALL FUNCTION 'MONTH_NAMES_GET'
TABLES
month_names = it_t247.
Company Name
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = TEXT-001.
APPEND ls_line TO my_top_of_page.
CLEAR ls_line.
ls_line-typ = 'S'.
ls_line-info = TEXT-002.
APPEND ls_line TO my_top_of_page.
Date
CLEAR lc_name.
CONCATENATE sy-datum+6(2) ',' INTO lc_name.
READ TABLE it_t247 WITH KEY mnr = sy-datum+4(2).
CONCATENATE text-003 it_t247-ltx lc_name sy-datum(4)
INTO lc_name SEPARATED BY space.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = lc_name.
APPEND ls_line TO my_top_of_page.
ENDFORM. " top_comment
*& Form build_layout
text
-->P_GS_LAYOUT text
FORM build_layout USING my_layout TYPE slis_layout_alv.
my_layout-f2code = d_f2code.
my_layout-reprep = 'X'.
my_layout-confirmation_prompt = 'X'.
my_layout-flexible_key = 'X'.
ENDFORM. " build_layout
*& Form TOP_OF_PAGE
Writes comments on top of page
FORM top_of_page.
DATA: ls_line TYPE slis_listheader,
lc_name(60) TYPE c.
IF sy-ucomm = '&RNT_PREV'.
READ TABLE gt_top INTO ls_line INDEX 2.
lc_name = ls_line-info.
WRITE 'Page:' TO lc_name+45(5).
WRITE sy-pagno TO lc_name+52(5).
ls_line-typ = 'H'.
ls_line-info = lc_name.
MODIFY gt_top FROM ls_line INDEX 2.
ENDIF.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_top.
ENDFORM. " TOP_OF_PAGE
*& Form my_top
text
-->P_GT_TOP[] text
FORM my_top USING top TYPE slis_t_listheader.
DATA: it_t247 LIKE t247 OCCURS 0 WITH HEADER LINE.
DATA: ls_line TYPE slis_listheader,
li_recs TYPE i,
lc_name(60) TYPE c,
lc_from(30) TYPE c,
lc_to(30) TYPE c.
CALL FUNCTION 'MONTH_NAMES_GET'
TABLES
month_names = it_t247.
Company Name
CLEAR lc_name.
WRITE text-001 TO lc_name.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = lc_name.
APPEND ls_line TO top.
**Report Name
CLEAR lc_name.
WRITE text-002 TO lc_name.
CLEAR ls_line.
ls_line-typ = 'H'.
ls_line-info = lc_name.
APPEND ls_line TO top.
Range of date
CLEAR lc_name.
lc_name = p_date+4(2).
READ TABLE it_t247 WITH KEY mnr = p_date+4(2).
CONCATENATE: text-003 it_t247-ltx sy-datum(4)
INTO lc_name SEPARATED BY SPACE.
ls_line-typ = 'H'.
ls_line-info = lc_name.
APPEND ls_line TO top.
ENDFORM. " my_top
*& Form END_OF_LIST
Writes signature line at end of list
FORM end_of_list.
IF sy-ucomm = '&RNT_PREV' OR sy-ucomm = 'AUSW'.
REFRESH gt_eol.
PERFORM my_eol USING gt_eol[].
ELSE.
REFRESH gt_eol.
ENDIF.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_eol
i_end_of_list_grid = 'X'.
ENDFORM. " END_OF_LIST
*& Form my_eol
text
-->P_GT_EOL[] text
FORM my_eol USING eol TYPE slis_t_listheader.
DATA: ls_line TYPE slis_listheader,
lc_name(60) TYPE c.
Signature Line
CLEAR lc_name.
lc_name = '.'.
ls_line-typ = 'H'.
ls_line-info = lc_name.
APPEND ls_line TO eol.
CLEAR lc_name.
ls_line-typ = 'H'.
ls_line-info = lc_name.
APPEND ls_line TO eol.
CLEAR ls_line.
ls_line-typ = 'H'.
WRITE 'Submitted By:' TO lc_name(28).
WRITE 'Noted By:' TO lc_name+30(28).
ls_line-info = lc_name.
APPEND ls_line TO eol.
CLEAR: lc_name, ls_line-key.
lc_name = '.'.
ls_line-typ = 'H'.
ls_line-info = lc_name.
APPEND ls_line TO eol.
CLEAR lc_name. CLEAR ls_line.
WRITE sy-uline(28) TO lc_name(28).
WRITE sy-uline(28) TO lc_name+30(28).
ls_line-typ = 'H'.
ls_line-info = lc_name.
APPEND ls_line TO eol.
ENDFORM. " my_eol1.U are not getting the data into Excel when u client Excel Buttton from the ALV display ?
2.if yes then u will get one message stating that templet is Missing like this ?
Regards
prabhu -
i am having code which create report in excel.but it prints only single page. if content is more than size of template than insted of tacking new page it prints only single page.Please help me out.
Anyone has material for learning activeX in labview? Please mail me on [email protected]
PBP (CLAD)
Labview 6.1 - 2014
KUDOS ARE WELCOMED.
If your problem get solved then mark as solution.Hi thanks for reply.....
PBP (CLAD)
Labview 6.1 - 2014
KUDOS ARE WELCOMED.
If your problem get solved then mark as solution. -
Cells merge issue when extracting webi report in excel format
Hi Experts,
We have some WEBI reports in BO XI 3.1.
The reports have header where we are showing report name and some values which user selects in prompt.
Now the issue is that when we save our webi report in excel format, many cells get merge.
I have read many post on scn which suggest some solutions like changing the autofit width option to no and aligning the header width with colums.
Tried both the option but no success.
Is there any other way to achieve this.
Thanks in advance,
Regards,
RishabhHi,
We managed to find the workaround for this merge cell issue.
Sharing it might be helpful for someone.
- Align the report name and other block in report in such a way that the ends are in line with the end point of any column. The only limitation is that when applying pivot to the excel output we neet to click on any of the ccolumn so that excel identify the data set.
- Second workaround is to break the webi document in two parts report1 will contain the report name and the block to show the prompt values selected by the user where as report2 will contain the table withactual data. The only limitation with this workaround is that when exporting the repot output to excel we will get two tabs in the excel sheet one containing the prompt values and secont tab containing the actual data.
Regards,
RS -
Not able to export web analysis report to excel smart view from workspace
Not able to export web analysis report to excel smart view from workspace.
Error :Web launch operation has been cancelled.
Can anyone help me to resolve this issuesI realized that I can put a block in WebI and then I can pull that in excel alongside of static header, after putting the question.
My interest to know whether it is by design in XI 3.0 or it is an issue. But by the replies it seems to me like it is by design.
@Anis: I can't go for header as part of Body. Because this report is viewed in Web by many other users. I can't have separate report for Live office, it is a restriction for me. If I use the header in body, it wont look good I guess. -
Help me to download my report in excel format.
Here is my code below. On selection screen I am giving three inputs.
And There are two radio buttons present on my selection screen.
first one is for display the report.
second button name is generate(to export the report).
Clicking on the generate radio button will show the report.
There should be a standard button on the toolbar called GENERATE.
Clicking on that button will show a popup window asking to download the report either in .xls format or in .csv format.
==========================================================
My report is being displayed perfectly.But not getting how to downlaod the report in excel and csv format. Would u plz guide me what should I write within the export_report function of my program so that I can download the report. Kindly guide.
REPORT ZMYREPORT.
TYPE-POOLS: SLIS.
TYPES: BEGIN OF t_afko,
aufnr type aufnr,
gamng type gamng,
plnbez type matnr,
END OF t_afko.
TYPES: BEGIN OF t_mara,
matnr TYPE matnr,
mtart type mtart,
pstat type pstat_d,
END OF t_mara.
TYPES: BEGIN OF t_output,
aufnr type aufnr, "Production order
gamng type gamng, "move number
mtart type mtart, "size/fit
pstat type pstat_d, "Variant
quantity type meng8, "Quantity
barcode(35) type c, "barcode
END OF t_output.
INTERNAL TABLES, WORK AREAS AND VARIABLES
*For work area.
DATA:
gwa_afko type t_afko, "work area for t_afko table
gwa_mara type t_mara, "work area for t_mara table
gwa_output type t_output, "work area for t_output table
gwa_output1 type t_output, "second work area for t_output table
gwa_fieldcat type slis_fieldcat_alv, "work area for slis_fieldcat_alv
gwa_top type slis_listheader, "work area for slis_listheader
wa_variant type disvariant, "work area for variant
wa_Variant1 type disvariant, "work area for variant
*For internal tables.
gi_afko TYPE STANDARD TABLE OF t_afko,
gi_mara TYPE STANDARD TABLE OF t_mara,
gi_output TYPE STANDARD TABLE OF t_output,
gi_fieldcat TYPE STANDARD TABLE OF slis_fieldcat_alv,
gi_top TYPE slis_t_listheader,
gi_download TYPE TABLE OF t_download,
*Variables for screen-input.
v_aufnr like caufvd-aufnr, "for production order
v_txt04 like tj02t-txt04, "for production order status
v_plnbez like afko-plnbez. "for article
*For constants.
CONSTANTS: quantity(1) type c value '1',
lv_save(01) TYPE c VALUE 'A',
c_csv TYPE char1 VALUE '|'.
S E L E C TI O N S C R E E N *
SELECTION-SCREEN:
BEGIN OF block inputpath1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: s_aufnr for v_aufnr,
s_txt04 for v_txt04,
s_plnbez for v_plnbez.
SELECTION-SCREEN: END OF block inputpath1.
SELECTION-SCREEN:
BEGIN OF block inputpath2 WITH FRAME TITLE TEXT-002.
PARAMETERS:
p_disp RADIOBUTTON GROUP rb DEFAULT'X', "Button to display report
p_gen RADIOBUTTON GROUP rb. "button for generate option
SELECTION-SCREEN: END OF block inputpath2.
SELECTION-SCREEN:
BEGIN OF block inputpath3 WITH FRAME TITLE TEXT-003.
PARAMETERS:layout TYPE disvariant.
SELECTION-SCREEN: END OF block inputpath3.
I-N-I-T-I-A-L-I-Z-A-T-I-O-N *
INITIALIZATION.
DATA: g_repid LIKE sy-repid,
g_uname LIKE sy-uname.
g_repid = sy-repid.
AT SELECTION SCREEN *
*Function module for variant.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR layout.
wa_variant-username = g_uname.
wa_variant-report = g_repid.
*Display all existing variants
DATA: lv_exit(1) TYPE c.
*Code for variant part.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = wa_variant
i_save = lv_save
IMPORTING
e_exit = lv_exit
es_variant = wa_variant1
EXCEPTIONS
not_found = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
layout = wa_variant-variant.
ELSE.
IF lv_exit = space.
layout = wa_variant1-variant.
ENDIF.
ENDIF.
MAIN PROGRAM *
AT SELECTION-SCREEN .
*For validating the user inputs on selection screen.
PERFORM validate_input.
START-OF-SELECTION *
START-OF-SELECTION .
SET PF-STATUS 'ZGUI1'.
IF p_disp = 'X'. "If the display radio button is checked.
perform zselection. "Data is fetched from tables.
ENDIF.
END-OF-SELECTION *
END-OF-SELECTION.
IF p_disp = 'X'.
PERFORM buildcat.
PERFORM display_report.
ELSEIF p_gen = 'X'.
PERFORM display_report.
PERFORM export_report.
ENDIF.
*& Form validate_input
Checking input data validation on the display screen. *
form validate_input.
*Local variables for input validation.
DATA: lv_aufnr type aufnr,
lv_txt04 type J_TXT04,
lv_plnbez type matnr.
IF s_aufnr[] is not initial.
SELECT aufnr up to 1 rows
FROM aufk
INTO lv_aufnr
WHERE aufnr IN s_aufnr.
ENDSELECT.
IF lv_aufnr IS INITIAL.
MESSAGE e001(zmssg).
ENDIF.
ENDIF.
IF s_txt04[] is not initial.
SELECT txt04 up to 1 rows
FROM TJ02T
INTO lv_txt04
WHERE txt04 IN s_txt04.
ENDSELECT.
IF lv_txt04 IS INITIAL. "this depicts that if s_txt04 is initial.
Message e002(zmssg).
ENDIF.
ENDIF.
IF s_plnbez[] is not initial.
SELECT plnbez up to 1 rows
FROM afko
INTO lv_plnbez
WHERE plnbez IN s_plnbez.
ENDSELECT.
IF lv_plnbez IS INITIAL. "this depicts that if s_plnbez is initial.
Message e003(zmssg).
ENDIF.
ENDIF.
endform. " validate_input
*& Form zselection
Fetches data *
form zselection .
SELECT aufnr "production order
gamng "move number
plnbez
FROM afko
INTO TABLE gi_afko
WHERE aufnr IN s_aufnr
AND plnbez IN s_plnbez.
SELECT matnr
mtart "size/fit
pstat "variant
FROM mara
INTO TABLE gi_mara
WHERE matnr IN s_plnbez.
Populating final data *
LOOP AT gi_afko INTO gwa_afko.
READ TABLE gi_mara INTO gwa_mara with key matnr = gwa_afko-plnbez.
IF sy-subrc IS INITIAL.
*Moving t_mara and t_afko data from their work area to work area of t_output.
MOVE gwa_mara-mtart TO gwa_output-mtart.
MOVE gwa_mara-pstat TO gwa_output-pstat.
MOVE gwa_afko-aufnr TO gwa_output-aufnr.
MOVE gwa_afko-gamng TO gwa_output-gamng.
APPEND gwa_output TO gi_output.
ENDIF.
ENDLOOP.
*Populating the quantity field
LOOP AT gi_output INTO gwa_output.
gwa_output-quantity = '1'.
MODIFY gi_output FROM gwa_output INDEX sy-tabix TRANSPORTING quantity.
*Concategnating aufnr, pstat into barcode
CONCATENATE gwa_output-aufnr gwa_output-pstat INTO gwa_output-barcode .
MODIFY gi_output FROM gwa_output INDEX sy-tabix TRANSPORTING barcode.
ENDLOOP.
endform. " zselection
*& Form buildcat
text
form buildcat.
CLEAR gwa_fieldcat.
gwa_fieldcat-fieldname = 'AUFNR'.
gwa_fieldcat-seltext_l = 'PRODUCTION ORDER'.
gwa_fieldcat-tabname = 'GI_OUTPUT'.
gwa_fieldcat-emphasize = 'C201'.
gwa_fieldcat-col_pos = 1.
APPEND gwa_fieldcat TO gi_fieldcat.
CLEAR gwa_fieldcat.
gwa_fieldcat-fieldname = 'GAMNR'.
gwa_fieldcat-seltext_l = 'MOVE NUMBER'.
gwa_fieldcat-tabname = 'GI_OUTPUT'.
gwa_fieldcat-emphasize = 'C201'.
gwa_fieldcat-col_pos = 2.
APPEND gwa_fieldcat TO gi_fieldcat.
CLEAR gwa_fieldcat.
gwa_fieldcat-fieldname = 'MTART'.
gwa_fieldcat-seltext_l = 'SIZE/FIT'.
gwa_fieldcat-tabname = 'GI_OUTPUT'.
gwa_fieldcat-emphasize = 'C201'.
gwa_fieldcat-col_pos = 3.
APPEND gwa_fieldcat TO gi_fieldcat.
CLEAR gwa_fieldcat.
gwa_fieldcat-fieldname = 'PSTAT'.
gwa_fieldcat-seltext_l = 'VARIANT'.
gwa_fieldcat-tabname = 'GI_OUTPUT'.
gwa_fieldcat-emphasize = 'C201'.
gwa_fieldcat-col_pos = 4.
APPEND gwa_fieldcat TO gi_fieldcat.
CLEAR gwa_fieldcat.
gwa_fieldcat-fieldname = 'QUANTITY'.
gwa_fieldcat-seltext_l = 'QUANTITY'.
gwa_fieldcat-tabname = 'GI_OUTPUT'.
gwa_fieldcat-emphasize = 'C201'.
gwa_fieldcat-col_pos = 5.
APPEND gwa_fieldcat TO gi_fieldcat.
CLEAR gwa_fieldcat.
gwa_fieldcat-fieldname = 'BARCODE'.
gwa_fieldcat-seltext_l = 'BARCODE'.
gwa_fieldcat-tabname = 'GI_OUTPUT'.
gwa_fieldcat-emphasize = 'C201'.
gwa_fieldcat-col_pos = 6.
APPEND gwa_fieldcat TO gi_fieldcat.
endform. " buildcat
*& Form top
text
FORM top .
REFRESH gi_top.
gwa_top-typ = 'H'.
gwa_top-info = My alv report'.
APPEND gwa_top TO gi_top.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gi_top
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. "top
*& Form display_report
form display_report .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = g_repid
I_CALLBACK_PF_STATUS_SET = 'PF-STATUS'
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'TOP'
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 = gi_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT = wa_variant1
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gi_output
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endform. " display_report
*& Form export_report
text
form export_report.
endform.Hi Cinthia,
Check this Link.
How Can we genarate Excel file without GUI_DOWNLOAD
Reward points if useful.
Regards,
Abhishek -
Subject: How to get MB5B report in excel format
Dear experts,
Please help me how I get automatically MB5B Report in excel format. In Layout there is no option to convert excel format.
regards,
rss
Edited by: rs_sharma on Jun 26, 2011 10:16 AMDear experts,
Please help me how I get automatically MB5B Report in excel format. In Layout there is no option to convert excel format.
regards,
rss
Edited by: rs_sharma on Jun 26, 2011 10:16 AM -
How can i convert oracle report in excel format using 8i
hi,
I want to convert oracle report in excel format using 6i reports. please give the solution with emp table.
millons of thanks in advance.You'll have to use the destype DELIMITEDDATA to render your Report in CSV format. Then set the mime type to Excel. I don't know the exact syntax, so please do a search in metalink for "reports excel" for examples and more info.
Regards,
Martin Malmstrom -
Unable to print xml publisher report in excel format in R12
Hi All,
We are unable to print xml publisher report in excel format in R12. We were able to see the excel output but it's printing junk characters while printing and it's printing without any issue with PDF format.
Please let me know how to fix this issue.
Thanks,
RajaHi Raja,
I presume you have gone through the debugging process of testing your template locally first to get the expected result.....
If yes, this note might probably be helpful "Changing Output Format to RTF or Excel in XML Publisher Request Does Not Display Output Correctly (Doc ID 404512.1)"
Good Luck,
Lamine Balde
Maybe you are looking for
-
Trying to run Tiger on an external drive for Pro Tools LE on a new iMac...
okay, i am buying an mbox2 that runs pro tools LE (which, as we all know, is not yet supported by leopard), and i am also buying an iMac 20-inch 2.0GHz Intel Core 2 Duo, ATI Radeon HD 2400 XT with 128MB memory (with leopard pre-installed). i've read
-
I have MBA 2012. I would like to install on USB stick Windows 7 and use USB as the exteranal drive. The reason for this is that I don't have enough space on MBA to make partition for Windows. Could you describe steps how to do it? Thank you!
-
Desktop PDF printer in online trial version?
The Create Adobe PDF Online signup page says you can add a desktop PDF printer option with the subscription to online PDF creation. Does this option work with the trial version? If so, how?
-
When I setup my account for itunes connect I did so with what was my then current LLC and for ebook publishing. But, now I have anewer LLC that I would like to use and I also want to use the account for app publishing. Unfortunately the help systems
-
Please let us edit our own posts!
For example, I made a post with a tip for setting default zoom level in safari, and I want to add an addendum to my post for some additional hint to people having trouble implementing my suggestion. But I can't edit my original post. I can only reply