Report is executing in background and need data(output) in excel format
Report is executing in background and need data(output) to get downloaded in excel format in my PC from an internal table;;in any drive i.e. C: or D: .When executing in backround it prompt to user with which location excel file to be saved and the name of file.How to download in background in excel format?
Edited by: PRASHANT BHATNAGAR on Aug 26, 2008 6:24 AM
Hi
Download a report to excel with format (border, color cell, etc)
Try this program...it may help you to change the font ..etc.
Code:
REPORT ZSIRI NO STANDARD PAGE HEADING.
this report demonstrates how to send some ABAP data to an
EXCEL sheet using OLE automation.
INCLUDE OLE2INCL.
handles for OLE objects
DATA: H_EXCEL TYPE OLE2_OBJECT, " Excel object
H_MAPL TYPE OLE2_OBJECT, " list of workbooks
H_MAP TYPE OLE2_OBJECT, " workbook
H_ZL TYPE OLE2_OBJECT, " cell
H_F TYPE OLE2_OBJECT. " font
TABLES: SPFLI.
DATA H TYPE I.
table of flights
DATA: IT_SPFLI LIKE SPFLI OCCURS 10 WITH HEADER LINE.
*& Event START-OF-SELECTION
START-OF-SELECTION.
read flights
SELECT * FROM SPFLI INTO TABLE IT_SPFLI UP TO 10 ROWS.
display header
ULINE (61).
WRITE: / SY-VLINE NO-GAP,
(3) 'Flg'(001) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(4) 'Nr'(002) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Von'(003) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(20) 'Nach'(004) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP,
(8) 'Zeit'(005) COLOR COL_HEADING NO-GAP, SY-VLINE NO-GAP.
ULINE /(61).
display flights
LOOP AT IT_SPFLI.
WRITE: / SY-VLINE NO-GAP,
IT_SPFLI-CARRID COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CONNID COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYFROM COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-CITYTO COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP,
IT_SPFLI-DEPTIME COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
ENDLOOP.
ULINE /(61).
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-007
EXCEPTIONS
OTHERS = 1.
start Excel
CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
SET PROPERTY OF H_EXCEL 'Visible' = 1.
CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'c:\kis_excel.xls'
PERFORM ERR_HDL.
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-008
EXCEPTIONS
OTHERS = 1.
get list of workbooks, initially empty
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
PERFORM ERR_HDL.
add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP.
PERFORM ERR_HDL.
tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-009
EXCEPTIONS
OTHERS = 1.
output column headings to active Excel sheet
PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL USING 1 3 1 'Von'(003).
PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
changes by Kishore - start
CALL METHOD OF H_EXCEL 'Workbooks' = H_MAPL.
CALL METHOD OF H_EXCEL 'Worksheets' = H_MAPL." EXPORTING #1 = 2.
PERFORM ERR_HDL.
add a new workbook
CALL METHOD OF H_MAPL 'Add' = H_MAP EXPORTING #1 = 2.
PERFORM ERR_HDL.
tell user what is going on
SET PROPERTY OF H_MAP 'NAME' = 'COPY'.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
PERCENTAGE = 0
TEXT = TEXT-009
EXCEPTIONS
OTHERS = 1.
output column headings to active Excel sheet
PERFORM FILL_CELL USING 1 1 1 'Flug'(001).
PERFORM FILL_CELL USING 1 2 0 'Nr'(002).
PERFORM FILL_CELL USING 1 3 1 'Von'(003).
PERFORM FILL_CELL USING 1 4 1 'Nach'(004).
PERFORM FILL_CELL USING 1 5 1 'Zeit'(005).
LOOP AT IT_SPFLI.
copy flights to active EXCEL sheet
H = SY-TABIX + 1.
PERFORM FILL_CELL USING H 1 0 IT_SPFLI-CARRID.
PERFORM FILL_CELL USING H 2 0 IT_SPFLI-CONNID.
PERFORM FILL_CELL USING H 3 0 IT_SPFLI-CITYFROM.
PERFORM FILL_CELL USING H 4 0 IT_SPFLI-CITYTO.
PERFORM FILL_CELL USING H 5 0 IT_SPFLI-DEPTIME.
ENDLOOP.
changes by Kishore - end
disconnect from Excel
CALL METHOD OF H_EXCEL 'FILESAVEAS' EXPORTING #1 = 'C:\SKV.XLS'.
FREE OBJECT H_EXCEL.
PERFORM ERR_HDL.
FORM FILL_CELL *
sets cell at coordinates i,j to value val boldtype bold *
FORM FILL_CELL USING I J BOLD VAL.
CALL METHOD OF H_EXCEL 'Cells' = H_ZL EXPORTING #1 = I #2 = J.
PERFORM ERR_HDL.
SET PROPERTY OF H_ZL 'Value' = VAL .
PERFORM ERR_HDL.
GET PROPERTY OF H_ZL 'Font' = H_F.
PERFORM ERR_HDL.
SET PROPERTY OF H_F 'Bold' = BOLD .
PERFORM ERR_HDL.
ENDFORM.
*& Form ERR_HDL
outputs OLE error if any *
--> p1 text
<-- p2 text
FORM ERR_HDL.
IF SY-SUBRC <> 0.
WRITE: / 'Fehler bei OLE-Automation:'(010), SY-SUBRC.
STOP.
ENDIF.
ENDFORM. " ERR_HDL
Regards
Murali Papana
Similar Messages
-
How to display pop up in foreground when report is executing in background
Hi All,
The requirement is:
My report is executing in background and I have to display a pop-up to end user in foreground.
Is there any method to do this.
it is urgent,
Reward points will be awarded to correct answers.
Thanks,
Vishal.Thanks frnds,
ok can we go in this way......I need to display the pop up when the "program -> execute in background" button is clicked or F9 is pressed....just at that time....later the report can be executed in back ground.
Is there a way to do so......just displaying a pop up when one entry in menu bar ic clicked?
Vishal. -
Regarding Download data in MS Excel format and Check box
Hi Friends
In my Project some task is here i.e. select check box of the particular Customer number click on submit button. That time display of those customer details
How we can do this if have any coding of this application can you sent me.
And one more query
One form having some data click on submit button that data will display in Excel format and Download data in MS Excel format
Can you tell me how to work on these two concepts?
Regards
VijayDear Vijay,
Please go through the [Download data in MS Excel format|http://wiki.sdn.sap.com/wiki/display/WDJava/ExporttoExcel(WithoutthirdpartyAPIs)]
to download the table contents to MS Exel.
& Also go through [How to Add Dynamic Checkboxes in a Web Dynpro Java |http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90915916-c158-2c10-6fa0-f0e25f3ccd6b?quicklink=index&overridelayout=true] for check bok UI.
Warm Regards,
Upendra Agrawal -
Report to display PO details and download details in an excel fil
Hi,
I have been asked to develop a report for "Develop report to display PO details and download details in an excel file".
Could any one guide me technically what are the different tables i need to take to generate the report. Treat this is very urgent. Pls provide sample code too....
Thanks in advance....Purchase Order PO
Tcode for creation ME21,ME22,ME23. tables EKKO,EKPO.
refer this program
REPORT ZPOCHANGE.
This is a subroutine perform in the Purchase order Layout sets.
Description : To retreive the details of changed remarks in PO output and to capture the retrival date
Additional features with the previous changed appearing. e.g. from .... to
Note : If the latest modification details required
Please Uncomment the lines mentioned under 'Last Modified Remarks only'
Information
/: PERFORM CHDATE IN PROGRAM ZPOCHANGE
/: USING &EKKO-EBELN&
/: CHANGING &RVDATE2&
/: ENDPERFORM.
/: IF &RVDATE2& EQ ' '.
/ Revision Date: NIL
/: ELSE.
/ Revision Date: &RVDATE2&
/: ENDIF.
Main Window
/E CHANGE_REMARKS
/: PERFORM CHDET IN PROGRAM ZPOCHANGE
/: USING &EKPO-EBELP&
/: USING &EKKO-EBELN&
/: USING &T166T-CHTXT&
/: USING &T166T-CTXNR&
/: CHANGING &ITAB1-F_NEW&
/: CHANGING &ITAB1-F_OLD&
/:ENDPERFORM.
/:IF &ITAB1-F_NEW& NE ' '
= &ITAB1-F_OLD(C)& CHANGED TO &ITAB1-F_NEW(C)&
/:ENDIF
You might need to apply Note 373524 - Message determination and printing
TABLES : CDSHW , "Change documents, formatting table
CDHDR , "Change document header
EKPO , "Purchasing Document Item
EKKO , "Purchasing Document Header
T166C . "Print-Relevant Purchasing Document Changes
DATA : ITAB1 LIKE CDSHW OCCURS 100 WITH HEADER LINE.
DATA : ITAB2 LIKE EKPO OCCURS 100 WITH HEADER LINE.
DATA : DOCUM LIKE EKKO OCCURS 100 WITH HEADER LINE.
DATA : TABKEY LIKE CDSHW-TABKEY.
data : begin of ctab occurs 10,
tname like t166c-tname,
fname like t166c-fname,
TABKEY LIKE CDSHW-TABKEY,
FLAG(3),
end of ctab.
DATA : VAL1(15), VAL2(15).
DATA : M1(20), M2(10), M3(10),M4(5).
DATA : RVDATE(10),RVDATE2(10) , EBELN LIKE EKKO-EBELN, COUNT TYPE I.
Text number for change text(CTXNR), CHANGE TEXT(CHTXT), Purchase order
Number and item number are passed from Layoutset
FORM CHDET *
--> ITAB *
--> OTAB *
FORM CHDET TABLES ITAB STRUCTURE ITCSY
OTAB STRUCTURE ITCSY.
LOOP AT ITAB.
CASE ITAB-NAME.
WHEN 'T166T-CHTXT'.
MOVE ITAB-VALUE TO M1.
WHEN 'T166T-CTXNR'.
MOVE ITAB-VALUE TO M2.
WHEN 'EKKO-EBELN'.
MOVE ITAB-VALUE TO M3.
WHEN 'EKPO-EBELP'.
MOVE ITAB-VALUE TO M4.
ENDCASE.
ENDLOOP.
Throught this function change details are retrived into itab1.
CALL FUNCTION 'ME_CHANGES_READ'
EXPORTING
DOCUMENT_CATEGORY = 'F'
DOCUMENT_NUMBER = M3
TABLES
XCDSHW = itab1.
SELECT SINGLE * FROM T166C WHERE CTXNR = M2.
IF SY-SUBRC = 0.
CONCATENATE M3 M4 INTO TABKEY.
********Last Modified Remarks only**********************
read table ctab with key tname = T166C-TNAME
tabkey = tabkey
fname = T166C-FNAME.
if sy-subrc ne 0.
LOOP AT ITAB1 WHERE TABNAME = T166C-TNAME
AND TABKEY+3(15) = TABKEY
AND FNAME = T166C-FNAME.
*********Last Modified Remarks only**********************
ctab-tname = t166c-tname.
ctab-fname = t166c-fname.
ctab-tabkey = tabkey.
append ctab.
delete itab1.
exit.
endloop.
Captured details are exported to Layoutset
LOOP AT OTAB.
CASE OTAB-NAME.
WHEN 'ITAB1-F_OLD'.
OTAB-VALUE = ITAB1-F_OLD.
MODIFY OTAB.
CLEAR : ITAB1-F_OLD.
WHEN 'ITAB1-F_NEW'.
OTAB-VALUE = ITAB1-F_NEW.
MODIFY OTAB.
CLEAR : ITAB1-F_NEW.
ENDCASE.
endloop.
endif.
******Last Modified Remarks only****************
ENDIF.
clear ctab.
ENDFORM.
FORM CHDATE *
--> ITAB *
--> OTAB *
Form for revision date retrival. PO no. is passed from layoutset
and in the change document header latest modified date is captured
and passed to revision date field in Layoutset.
FORM CHDATE TABLES ITAB STRUCTURE ITCSY
OTAB STRUCTURE ITCSY.
CLEAR : RVDATE, EBELN.
LOOP AT ITAB.
CASE ITAB-NAME.
WHEN 'EKKO-EBELN'.
MOVE ITAB-VALUE TO EBELN.
ENDCASE.
ENDLOOP.
SELECT UDATE INTO CDHDR-UDATE FROM CDHDR WHERE OBJECTCLAS = 'EINKBELEG'
AND OBJECTID = EBELN.
IF RVDATE < CDHDR-UDATE.
RVDATE = CDHDR-UDATE.
ENDIF.
COUNT = COUNT + 1.
ENDSELECT.
LOOP AT OTAB.
CASE OTAB-NAME.
WHEN 'RVDATE2'.
CONCATENATE RVDATE6(2) '.' RVDATE4(2) '.' RVDATE(4) INTO RVDATE2.
IF COUNT = 1.
RVDATE2 = ''.
ENDIF.
MOVE RVDATE2 TO OTAB-VALUE.
MODIFY OTAB.
ENDCASE.
ENDLOOP.
CLEAR : COUNT.
ENDFORM.
Message was edited by:
Karthikeyan Pandurangan -
How to get new and updated data into LO Excel in Xcelsius
Dear Experts,
I have created dashboard on top of webi report by using Live-Office connection. Latest data of webi report is imported into excel and mapped data with components and generated SWF file and exported into server.
To day my webi report has latest instance with new and updated data. But until unless by clicking "Refresh All Objects" i am not getting updated data into excel.
When i am trying to open dashboard in BI Launch Pad/CMC it is showing data whatever exist in excel(i.e yesterday data). But here we need to show data of latest instance of webi report.(i.e New and updated data as of now).
I have selected option "Latest instance: From latest instance scheduled by" in "refresh options".
My Question & Doubts:
1) Is it mandatory to open dashboard every day and need to click on "Refresh All Objects" to get updated data into excel or dashboard.
2) Is there any option to automate this process.
Regards,
PRK.Hi,
Schedule the webi report to get the latest data from the source. To answer your query no is doesn't require to open the dashboard every time to refresh the excel to get the latest data.
Please use the Refresh Before Components are Loaded: Select this option to refresh the data each time the model loads and to use that data as the initial data for the model (using a Reset Button component, it will reset the data to the values from the last time the model was loaded).
You are using the Live Office so here automatic refresh is not possible without touch the swf file, you need to use the refresh but to get the latest data. If you are using QAAWS, Web Service & XML then automatic refresh is possible.
For more information please check the below document for in-depth idea on the design pattern.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b02e31fb-3568-2e10-e78f-92412c3c0a96?overridelayout=t…
Kindly revert for more clarification!!!
--SumanT -
How to run the report and show the output in excel file
salam
how to run the report and show the output in excel file,
how to run the report and print the o/p via printer
how to run the report and send the o/p via mail
thank u allHi,
There are Parameters DESTTYPE, DESFORMAT and DESNAME. You can set these parameters to get as you want.
1) Output in Excel File
ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'FILE');
ADD_PARAMETER(PL_ID, 'DESFORMAT', TEXT_PARAMETER, 'DELIMITED');
ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<file_name>.XLS');2) output to printer
ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'PRINTER');
ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<printer_name>');3) Email - Have to configure SMTP and all. ( i didn't checked it)
ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'MAIL');
ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<email_id>');Regards,
Manu.
If this answer is helpful or correct, please mark it. Thanks. -
XML Publisher report default output in Excel format.
Hi,
We have defined one concurrent program whose output format is text, this concurrent program executable is PL/SQL and in this PL/SQL program we are generating XML data and displaying XML using below fnd_request.
l_conc_id := FND_REQUEST.SUBMIT_REQUEST('GMP','GMPPDROP','', '',FALSE,
p_sequence_num,chr(0),'','','','','','','','','','','',
We have also defined template for this.
Using below fnd_request we are choosing template and data is getting generated in PDF format. Now our requirement is to display the output by default in Excel format.
FND_REQUEST.SUBMIT_REQUEST('XDO','XDOREPPB','', '',FALSE,'',
l_conc_id,554,G_comb_pdr_temp,
G_comb_pdr_locale,'Y','RTF','',scale_report,'','','','','',
When i saw XML Report Publisher concurrent program, there is one parameter for Output Format and i tried passing 'Excel'/EXCEL/excel to this parameter but output is still coming in PDF format.
FND_REQUEST.SUBMIT_REQUEST('XDO','XDOREPPB','', '',FALSE,'',
l_conc_id,554,G_comb_pdr_temp,
G_comb_pdr_locale,'Y','RTF','Excel',scale_report,'','','','','',
I have also tried giving Default Output to EXCEL in template definition but this is also not working.
Your valuable suggestions highly appreciated.
Thanks
VijayHi;
What is EBS version? Please see below which could be helpful for your issue:
Changing Output Format to RTF or Excel in XML Publisher Request Does Not Display Output Correctly [ID 404512.1]
Cannot View BI Publisher (formerly XML Publisher) Report Output In Excel Format or XHTML [ID 359875.1
How is Default Output Type Determined for Reports Submitted Using XML [ID 888972.1]
Also see:
XML PUBLISHER report in Excel out put problem
XML PUBLISHER report in Excel out put problem
Regard
Helios -
Xml report output in excel format without using options tab in EBS
How to get xml publisher report output in excel format without using options tab in EBS?
I am getting XML Publisher report output in excel format by using options tab while submitting the concurrent request .
But i want to get excel output automatically.
Can anyone give idea to get XML publisher Report output in excel without selecting options tab.
Thanks in advance
Sandeep VHey Sandeep,
I am working on a similar format for a report and if possible can you please give me some guidelines. I have initially created reports using XML Publisher, but for those , the output preview format was PDF. So, if I select the preview format as EXCEL will it give me output in Excel and for this to happen, how do I define the rtf template. I believe the working will be same as for PDF, create a rdf report, get output in XML and apply the template to get the data in Excel or there is something different to this.
Thanks,
Sunil -
Hi Experts,
My requriement is I have to send a mail with report output in excel format as an attachment.
I wrote the below subroutine for building excel sheet but I am getting output in the single row. I am using version 4.6
Please help me regarding this. ASAP
FORM BUILD_XLS_DATA .
CONSTANTS: CON_CRET TYPE STRING VALUE '0D', "OK for non Unicode
CON_TAB TYPE STRING VALUE '09'. "OK for non Unicode
CONCATENATE 'Vendor' 'Country' 'Name'
INTO IATTACH SEPARATED BY CON_TAB.
CONCATENATE CON_CRET IATTACH INTO IATTACH.
APPEND IATTACH.
LOOP AT IT_lfa1.
CONCATENATE IT_lfa1-lifnr IT_lfa1-land1 IT_lfa1-name1 INTO IATTACH
SEPARATED BY CON_TAB.
CONCATENATE CON_CRET IATTACH INTO IATTACH.
APPEND IATTACH.
ENDLOOP.
ENDFORM. "build_xls_data
Thanx,
SudhaHi Sudha,
I am sending the standard format of sending a mail along with an attachment in .xls format.
Try this code.
form sendmail.
CLEAR GV_DELIMIT.
GV_DELIMIT = CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
TEMPREAD = LV_LNCNT1.
REFRESH OBJTXT.
CONCATENATE 'The no. of error records are : ' TEMPREAD
INTO OBJTXT-LINE.
APPEND OBJTXT.
CLEAR OBJPACK. REFRESH OBJPACK.
CONCATENATE C_CODE
C_CMMT
C_COMMENT1
INTO OBJTXT-LINE SEPARATED BY GV_DELIMIT.
APPEND OBJTXT.
LOOP AT IT_DATA INTO WA_DATA.
CONCATENATE WA_DATA-ZCODE
WA_DATA-ZCOMMENT
WA_DATA-ZREASON
INTO OBJTXT-LINE SEPARATED BY GV_DELIMIT.
APPEND OBJTXT.
ENDLOOP.
CLEAR GV_DELIMIT.
CLEAR OBJPACK. REFRESH OBJPACK.
CLEAR DOC_CHNG.
TAB_LINES = 0.
OBJHEAD = REJFILE. APPEND OBJHEAD.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-OBJ_NAME = REJFILE.
MOVE TEXT-006 TO
DOC_CHNG-OBJ_DESCR.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = 1. " 3.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
FOR ASCII TO BINARY OBJECT FUNCTION
TOTLINEXFER = 0.
TOTXFER = 0.
BINMAXLEN = 255.
REFRESH OBJBIN.
LV_CR = CL_ABAP_CHAR_UTILITIES=>CR_LF.
TGTMAXLEN = BINMAXLEN.
TGTLEN = 0.
LOOP AT OBJTXT FROM 2.
IF NOT OBJTXT-LINE CP 'The no. of records are '." AND
CONCATENATE OBJTXT-LINE LV_CR INTO BUFFER.
SRCOBJLEN = STRLEN( BUFFER ).
SRCOBJPTR = 0.
WHILE SRCOBJLEN > 0 .
XFERLEN = TGTMAXLEN - TGTLEN.
IF XFERLEN > SRCOBJLEN.
XFERLEN = SRCOBJLEN.
MOVE BUFFERSRCOBJPTR TO OBJBIN-LINETGTLEN.
TGTLEN = TGTLEN + SRCOBJLEN.
SRCOBJLEN = 0.
CLEAR BUFFER.
ELSE.
MOVE BUFFER+SRCOBJPTR(XFERLEN) TO
OBJBIN-LINE+TGTLEN(XFERLEN).
APPEND OBJBIN.
CLEAR OBJBIN-LINE.
TGTLEN = 0.
SRCOBJLEN = SRCOBJLEN - XFERLEN.
SRCOBJPTR = SRCOBJPTR + XFERLEN.
TOTLINEXFER = TOTLINEXFER + 1.
ENDIF.
TOTXFER = TOTXFER + XFERLEN.
ENDWHILE.
ENDIF.
ENDLOOP.
IF TGTLEN > 0.
APPEND OBJBIN.
TOTLINEXFER = TOTLINEXFER + 1.
ENDIF.
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TOTLINEXFER.
OBJPACK-DOC_TYPE = 'XLS'.
OBJPACK-OBJ_NAME = REJFILE.
OBJPACK-OBJ_DESCR = 'Rejected Entries File'.
OBJPACK-DOC_SIZE = TOTXFER.
APPEND OBJPACK.
REFRESH RECLIST.
MAIL1 = Recepient Mail Id
RECLIST-RECEIVER = MAIL1.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST.
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.
Hope this is helpful to you. If you need further information, revert back.
Reward all the helpful answers.
Regards
Nagaraj T -
Transaction CJI3 AND - batch job and output in excel format
We are trying to schedule a batch job and would like to have the output in an excel file. Is there a way to enhance CJI3 and FMEDDW to have the output in a excel file. I've looked at the Layout for creating the disvariant and I know you can have the output in excel format in the foreground, but I'm looking to put an excel file on the SAP DIRECTORY.
Has anyone done this?
Thank you.
LindaTalking about Enhancement Options, I believe you can achieve it using Enhancement Implementation. There must be one towards the end of the program just before the ALV is displayed. You can create an implementation of the implicit enhacement spot and output the file to a location maintained in some VAR (to keep the output location dynamic as we don't have it on the select screen).
My reply is not to the point but I hope you find a way using enhancement spots.
Should you need any help with enhancement implementation, following blog is good enough:
Blog - [Enhancement Framework|http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417800%29ID1759109750DB10206591421434314571End?blog=/pub/wlg/3595]
or you can ask back here.
regards,
Aabhas
Edited by: Aabhas K Vishnoi on Sep 24, 2009 10:40 AM -
Oracle reports output in excel format does not display the graphs
Oracle reports output in excel format does not display the graphs: "linked image cannot be displayed".
The output file in PDF format the graph is supported.Do you have any header and footer on your template?
If you have any header and footer then try to adjust it as of to display full page.
Thanks
Yasar -
Displaying the report output in excel format
Please help me in getting the report output in excel format.
thnksI ran into a BIG problem after passing from 6i rep server to 9i rep server.
On 6i rep server I used to set DESFORMAT='DELIMITED', and that produced reasonable tab-delimited output for reports that did not have group above (all the query groups were from left to right, not a single group having fields displayed above some other group). When deployed on rep server 9i, the same reports produced some unexplainable output: some of the rows were duplicated, but I couldn't figure out any rule.
So, the best thing to get the reports into something that fits in .xls would be to have the output in .xml, that may be imported in Excel. -
Run the Report as a Background job and Get the Output in Excel in Local PC
Hello Gurus,
I have one following requirement.
One should be able to run the report as a background job and it should be possible to get the report in Excel format, also when running the report in background. The excel report should have the same information and look as the current SAPreport.
Please provide some solution.
Any helpful answer get surely awarded.
Thanks a lot,
VarlanirGUI_* WS_* Function In Background, CSV Upload
GUI_* and WS_* function modules do not work in background
When scheduling a job in the background the appropriate statement to read in your file is OPEN DATASET, and the file must be on the file system that the SAP server can see.
At anytime, a user can switch of the Personal Computers even though the job is still running in the background. Therefore GUI_* and WS_* function modules are not designed to work in that way, as they need to access your personal computer file.
To choose the correct download method to used, you can check the value of SY-BATCH in your code,
if it is 'X' use OPEN DATASET and if it is ' ' use WS_UPLOAD.
*-- Open dataset for reading
DATA:
dsn(20) VALUE '/usr/test.dat',
rec(80).
OPEN DATASET dsn FOR INPUT IN TEXT MODE.
IF sy-subrc = 0.
DO.
READ DATASET dsn INTO rec.
IF sy-subrc <> 0.
EXIT.
ELSE.
WRITE / rec.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET dsn.
*-- Open dataset for writing
DATA rec(80).
OPEN DATASET dsn FOR OUTPUT IN TEXT MODE.
TRANSFER rec TO '/usr/test.dat'.
CLOSE DATASET dsn.
What is the difference when we use upload, ws_upload, gui_upload function modules?
UPLOAD, WS_UPLOAD, GUI_UPLOAD, are used in BDC concepts. ie., Batch Data Communication.
Batch Data Conversion is a concept where user can transfer the Data from non SAP to SAP R/3. So , in these various Function Modules are used.
UPLOAD--- upload a file to the presentation server (PC)
WS_UPLOAD---- Load Files from the Presentation Server to Internal ABAP Tables.
WS means Work Station.
This is used upto SAP 4.6 version.
GUI_UPLOAD------- Replaces WS_UPLOAD. Upoad file from presentation server to the app server. From 4.7 SAP version it is replaced.
How to Upload csv file to SAP?
Common File Download Upload Questions:
How you upload the data from text file to sap internal table? From my knowledge its by upload or gui_upload.
How you download the data from sap internal table to text file?
How you upload the data from xls (excel) file to sap internal table how you download the data from sap internal table to xls(excel) file.
You can upload data from presentation server to an internal table using gui_upload. Use gui_download to download from internal table to flat file.
Use fm ALSM_EXCEL_TO_INTERNAL_TABLE to upload data frm excel.
Use function module GUI_UPLOAD
The FILETYPE refer to the type of file format you need: For e.g 'WK1' - Excel format , 'ASC' - Text Format etc.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\test.csv'
FILETYPE = 'ASC'
TABLES
DATA_TAB = itab
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17. -
Sending report outpu executed in Background as mail attachment
Hi all
I am executng ALV Grid report in the background and the output has to send to the customer mail as pdf attachment .
Any Idea .
Regards,Hi,
check this code it will be helpfull to u.
REPORT ZEMAIL_ATTACH .
TABLES: ekko.
PARAMETERS: p_email TYPE somlreci1-receiver
DEFAULT '[email protected]'.
TYPES: BEGIN OF t_ekpo,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
END OF t_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
wa_ekpo TYPE t_ekpo.
TYPES: BEGIN OF t_charekpo,
ebeln(10) TYPE c,
ebelp(5) TYPE c,
aedat(8) TYPE c,
matnr(18) TYPE c,
END OF t_charekpo.
DATA: wa_charekpo TYPE t_charekpo.
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 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.
*START_OF_SELECTION
START-OF-SELECTION.
Retrieve sample data from table ekpo
PERFORM data_retrieval.
Populate table with detaisl to be entered into .xls file
PERFORM build_xls_data_table.
*END-OF-SELECTION
END-OF-SELECTION.
Populate message body text
perform populate_email_message_body.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_message
it_attach
using p_email
'Example .xls documnet attachment'
'XLS'
'filename'
changing gd_error
gd_reciever.
Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM initiate_mail_execute_program.
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT ebeln ebelp aedat matnr
UP TO 10 ROWS
FROM ekpo
INTO TABLE it_ekpo.
ENDFORM. " DATA_RETRIEVAL
*& Form BUILD_XLS_DATA_TABLE
Build data table for .xls document
FORM build_xls_data_table.
CONSTANTS: con_cret TYPE x VALUE '0D', "OK for non Unicode
con_tab TYPE x VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
*constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
LOOP AT it_ekpo INTO wa_charekpo.
CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
wa_charekpo-aedat wa_charekpo-matnr
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
ENDLOOP.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables pit_message
pit_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
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_receiver LIKE sy-subrc.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_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'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = pit_attach[].
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_attachment 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
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
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.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
*& 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 = 'Please find attached a list test ekpo records'.
APPEND it_message.
endform. " POPULATE_EMAIL_MESSAGE_BODY -
PO report with cost center, order and delivery date
Hi,
pls. I just need a report to display the next fields Account Assigment and Delivery Date.
I attempted with standard reports like ME2N, ME2K but it is impossible to display all the information in the same screen.
Thanks a lot for cooperation.
Regards.HI,
Create a Infoset query or ask ababper
Tables EKKN, EKPO, EKKO
Regards,
Pardeep Mlaik
Maybe you are looking for
-
Photoshop Element Editor 12 does not start
Few days ago I installed Photoshop Elements 12. It worked fine, however today I decided to re-roll my system to the version prior to PSE installation. After reinstalling PSE12 I couldn't launch Editor - Organiser works fine. Editor doesn't start if I
-
No Skype Video Calls on the N8
Can anybody give me one good reason why a Video Call cannot be made using Skype on the N8? Surely the N8 is built for such applications with its forward facing camera and excellent specifications... Is somebody not paying somebody royalties somewher
-
ECC-XI-MDM_Urgent!!!
Hi All, I need a very very Urgent help.. Our scenario will start in ECC with a material master being entered in ECC. ERP specific attributes will be maintained in ECC and once the material is saved in ECC it will trigger distribution of that record t
-
Hi, how to skip a level while creating wbs elements hierarchy? Thanks!
-
Hi all, quick question: When you delete a local mail folder all the messages in the folder as well as the local folder is deleted correct? Thanks