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
Similar Messages
-
Tracking file upload and download details
Hi All,
We are using TMG in our place,all users/servers are used to connect the internet with TMG server..
is there a way to track the information of file upload and download details in TMG..
KJSUBBUHi,
Please check the blog below. I haven't try it.
Live monitor for TMG server
Note: Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee
the accuracy of this third-party contact information.
Best Regards,
Joyce
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected] -
Service Manager Portal not displaying VM console and related details
Hi All,
We have deployed private cloud with system center products using Cloud Services Process Pack and we have deployed Service Manger portal for VM provisioning in Cloud
The Service Manger portal does not display VM console and VM details
I have following queries
How to take remote console of VM deployed by end user through service manager portal
How will user come to know quota limit utilized in cloud under his account
The VM are deployed through SCSM portal are in shutdown state how to auto start the VM after provisioning
Please help since we are not able to find any solution for the above
Appreciate if any workaround is available for the same
Thanks
Manzoor AhmedThe component of System Center that is capable to give console access to your VMs, is App Controller.
Once the user are logged in here, they should see their quota, limits and resources available.
Yes, the VMs are powered off by default when using the CSPP. You can edit the runbooks and add a task that will start them after provisioning.
For your information:
Many things has changed since the release of Cloud Service Process Pack. A new set of tools are provided with Windows Azure Pack to have a streamlined Infrastructure as a Service offering within the enterprise. Windows Azure Pack will leverage VMM (in the
same way as SCSM does) but in conjunction with SPF (component within Orchestrator) to give you a framework that is identical to Windows Azure (Microsoft's own cloud) running on-premise.
-kn
Kristian (Virtualization and some coffee: http://kristiannese.blogspot.com ) -
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. -
Download & upload of an excel file
Hi,
I have a requirement where the data needs to be downloaded into an excel file and user will upload the same excel file after making required changes in the data.
I have used 'GUI_DOWNLOAD' to download the data to excel file. I have tried to upload the same excel file using 'ALSM_EXCEL_TO_INTERNAL_TABLE' and 'TEXT_CONVERT_XLS_TO_SAP' function modules. But it is giving exceptions if I upload the same downloaded file directly. If I copy the data in the downloaded file to another excel file and upload this file, it is working.
I have tried using 'GUI_UPLOAD' with field separator which was also specified in 'GUI_DOWNLOAD' but in this case the data is uploaded into the internal table like,.
###&jkj, 0000 .......
Please suggest any other alternative.
Thanks & Regards,
Vishnu PriyaHi,
You may like to give a try to this FM
RH_START_EXCEL_WITH_DATA.it will take care of your formatting problem.
go thru this program..
*& Report RHVERI_EXCEL_DOWNLOAD *
REPORT rhveri_excel_download.
DATA: g_excelpath TYPE string,
g_excelversion TYPE string,
g_codepage TYPE abap_encod, "XMK#754232
g_return_code TYPE i, "XMK#754232
BEGIN OF gt_data OCCURS 0,
f1 TYPE char20,
f2 TYPE char20,
f3 TYPE char20,
f4 TYPE char20,
END OF gt_data.
END-OF-SELECTION.
gt_data-f1 = 'C1'.
gt_data-f2 = 'C2'.
gt_data-f3 = 'C3'.
gt_data-f4 = 'C4'.
APPEND gt_data.
gt_data-f1 = '10'.
gt_data-f2 = '11'.
gt_data-f3 = '12'.
gt_data-f4 = '13'.
APPEND gt_data.
gt_data-f1 = '20'.
gt_data-f2 = '21'.
gt_data-f3 = '22'.
gt_data-f4 = '23'.
APPEND gt_data.
"XMK#754232
gt_data-f1 = 'AEIOU'. "#EC NOTEXT
gt_data-f2 = 'aeiou'. "#EC NOTEXT
gt_data-f3 = '*?#/&§$#'. "#EC *
gt_data-f4 = 'äöüÄÖÜßaé'. "#EC *
APPEND gt_data.
"XMK#754232
CALL FUNCTION 'RH_CHECK_EXCEL_SUPPORT'
IMPORTING
excel_exe_path = g_excelpath
excel_version = g_excelversion
EXCEPTIONS
no_batch = 1
internal_error = 2
excel_not_installed = 3
wrong_frontend_os = 4
OTHERS = 5.
IF sy-subrc <> 0.
WRITE / 'Testaufruf von Excel endete mit Fehlercode:'(002).
WRITE: sy-subrc, / sy-msgv1, sy-msgv2, sy-msgv3, sy-msgv4.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ELSE.
WRITE: / 'Pfad von Excel'(005), g_excelpath.
WRITE: / 'Version von Excel'(006), g_excelversion.
ENDIF.
"XMK#754232
IF cl_abap_char_utilities=>charsize <> 1.
WRITE / 'Unicode system'(007).
CALL METHOD cl_gui_frontend_services=>get_saplogon_encoding
CHANGING
file_encoding = g_codepage
rc = g_return_code
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
g_codepage = '4110'.
ENDIF.
WRITE: / 'Codepage is'(009), g_codepage.
ELSE.
WRITE / 'Non-Unicode system'(008).
ENDIF.
"XMK#754232
CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
EXPORTING
data_filename = 'TEST.DAT'
data_path_flag = 'W'
DATA_ENVIRONMENT =
wait = 'X'
data_table = gt_data[]
EXCEPTIONS
no_batch = 1
excel_not_installed = 2
internal_error = 3
cancelled = 4
download_error = 5
no_authority = 6
file_not_deleted = 7
OTHERS = 8.
IF sy-subrc <> 0.
WRITE / 'Aufruf von Excel endete mit Fehlercode:'(003).
WRITE: sy-subrc, / sy-msgv1, sy-msgv2, sy-msgv3, sy-msgv4.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ELSE.
WRITE / 'Aufruf von Excel lieferte keinen Fehler.'(004).
ENDIF.
Regards,
Amit -
Download SAP data to Excel file in Presentation server
Hi gurus,
I need to download SAP data to excel file. for that im using SAP_CONVERT_TO_XLS_FORMAT function module. I have to download with column header and also date should be in YYMMDD format. Im changing the format in ITAB but when populating to excel leading zero's were removed.(EX. 12102007 is converted to 071012 and it was populated as 71012). can someone explain how to use this function module or give someother solution for this....And if possible explain the parameters of the function module SAP_CONVERT_TO_XLS_FORMAT. Is there any function module for converting date as required format?
Thanks,
AmalHi Amal...
The Problem you are facing is because of Display properties of Microsoft Excel itself. I believe this can not be solver with in SAP. Instead I would suggest you to go for a .csv format. which can also be viewed in Excel.
In any case if you get to find a different solution for this, I would appriciate if you can share it with me :).
Santosh -
On Adobe Acrobat Pro, how do I take a PDF file and convert it into an excel file?
I am not sure how to take a PDF file and change it into an excel file. I have Adobe Acrobat Pro. Thanks!
Using Acrobat XI Pro.
File - Save As Other - Spreadsheet - Microsoft Excel Workbook
Be well... -
HOW TO DOWNLOAD SAP OUTPUT TO EXCEL FILE
Hi SAP Gurus,
I would like to ask if you have any Function Module or codes on how to download SAP Output into Excel file. Thanks! Hope you could help me.You can transfer the contents of internal table to excel using this code..
data: begin of itab occurs 0,
vbeln like vbak-vbeln,
posnr like vbap-posnr,
end of itab.
select vbeln
posnr
from vbap
up to 20 rows
into table itab.
* EXCEL sheet using OLE automation.
INCLUDE OLE2INCL.
* handles for OLE objects
DATA: H_EXCEL TYPE OLE2_OBJECT, " Excel object
H_WORK TYPE OLE2_OBJECT,
H_SHEET TYPE OLE2_OBJECT,
H_CELL TYPE OLE2_OBJECT,
V_COL LIKE SY-TABIX. " column number of the cell
DATA:
V_STEP(30),
V_FILE LIKE RLGRAP-FILENAME.
* tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = 'Creating Excel...'
EXCEPTIONS
OTHERS = 1.
* start Excel
V_STEP = 'Starting Excel'.
CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'.
PERFORM ERR_HDL.
SET PROPERTY OF H_EXCEL 'Visible' = 1.
* CALL METHOD OF H_EXCEL 'OPEN' EXPORTING #1 = 'C:DMC_REC.XLS'.
* PERFORM ERR_HDL.
* tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = 'Adding Data to Excel...'
EXCEPTIONS
OTHERS = 1.
* Get the list of workbooks
V_STEP = 'Preaparing Excel'.
CALL METHOD OF H_EXCEL 'WORKBOOKS' = H_WORK.
PERFORM ERR_HDL.
** Add new workbook (create a file)
CALL METHOD OF H_WORK 'ADD'.
PERFORM ERR_HDL.
* Get the created worksheet
************************Sheet Number
CALL METHOD OF H_EXCEL 'WORKSHEETS' = H_SHEET EXPORTING #1 = 3.
************************Sheet Number
PERFORM ERR_HDL.
* Activate (select) the first sheet
CALL METHOD OF H_SHEET 'ACTIVATE'.
PERFORM ERR_HDL.
* tell user what is going on
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
* PERCENTAGE = 0
TEXT = 'Adding Data to Excel...'
EXCEPTIONS
OTHERS = 1.
* output column headings to active Excel sheet
V_STEP = 'Adding data to Excel'.
LOOP AT ITAB.
V_COL = SY-TABIX.
PERFORM FILL_CELL USING 1 V_COL ITAB-vbeln.
PERFORM FILL_CELL USING 2 V_COL ITAB-posnr.
ENDLOOP.
V_STEP = 'Releasing Excel'.
FREE OBJECT H_EXCEL.
PERFORM ERR_HDL.
H_EXCEL-HANDLE = -1.
*& Form ERR_HDL
* text
* --> p1 text
FORM ERR_HDL.
IF SY-SUBRC <> 0.
WRITE: / 'Error in processing Excel File:', V_STEP.
STOP.
ENDIF.
ENDFORM. " ERR_HDL
*& Form FILL_CELL
* text
* -->P_1 text
* -->P_1 text
* -->P_1 text
FORM FILL_CELL USING ROW COL VAL.
CALL METHOD OF H_EXCEL 'Cells' = H_CELL
EXPORTING #1 = ROW #2 = COL.
PERFORM ERR_HDL.
SET PROPERTY OF H_CELL 'Value' = VAL .
PERFORM ERR_HDL.
ENDFORM. " FILL_CELL -
Logic Needed for MM Report with PR, PO, GR and Invoice details
Hi Experts,
We need to provide a list of below details as columns.
PR, PR creation date, PO, PO creation date, GR, GR creation date, Invoice and Invoice creation date.
Now on the selection screen we'll have Date range. If I give the dat range as 01.01.2011 to 31.12.2011, then the list should be displaying all the details. However, it should first check Invoices in that date range and mention the related details. If there are some GRs (for which invoice is not yet created) for that year, then the related details (PR, PO and GR) of that GR are to be shown. For POs (for which GR itself is not yet created), again details are to be shown (PR and PO details).
Can somebody help me in getting this done in some simpler way? I am thinking of fetching the data from the respective tables for this date range and then from invoice i will be printing and then deleting the corresponding GR, PO and PR. Then will be checking GR , printing the details and deleting corresponding PR and PO.. and so on. But I felt this not that great.
Can anyone suggest some other logic or provide some inputs?
Thanks.Hi,
As per your requirement you can cross the tables i.e. BSET,RSEG,RBKP(For Invoice Header n Item Details).Then now go to the MKPF,MSEG tables (For MIGO Details) and EBAN,EKKO,EKPO(For Purchase Requsitions,Orders Details).... Consider BUDAT as a selection date among the tables RSEG,MKPF,EKKO.
Regards,
Rickky -
TS1646 Itunes will not recognises my bank details and address details
Itunes will not recognises my bank details and address details
Make sure your bank info is the same on your iTunes account and with your bank and that your account is in good status. You can call your bank or iTunes support.
https://expresslane.apple.com/GetproductgroupList.action -
Employee Contact details and Project Details
Hello Experts,
I need some information about the Employee Contact details, its project details. i.e. The tables from which I can retrieve the required data.
Is there any built in BAPI for the same??
Please reply.
Thanks,
PrashantHi Prashant,
Contact details of the employee is hold in info type 105; i.e. table PA0105.
For the project details, if you're using PS module, CNR2 transaction -> Capacity -> HRMS Button is used.
Regards,
Dilek -
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 AMHi
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 -
Run report in Backround and Save it automatic as Excel File
I've created a report program that uses the alv grid. I run it in background, then i want to save it automatic as an excel file.
can y help me
ThanksHi,
When you run a report in background, irespective of the type of report, let it be Normal or ALV report, we have to use JOB FM's, such as JOB_OPEN, JOB_CLOSE. When you run a report in background, the data to be displayed is stored in the spool. So firt, you need to hold the spool data into an internal table, and then pass that internal table to GUI_DOWNLOAD, by hardcoding a path in the local system to download.
Use this FM to hold the spool output in a internal table , RSPO_RETURN_SPOOLJOB.
Hope this is helpful to you. If you need further information, revert back.
Reward all the helpful answers.
Regards
Nagaraj T -
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. -
I don't have any problems creating and filling an excel sheet with data. I use the New Report.vi, Easy Title.vi, and Easy Text.vi to create the file. I then save and dispose properly.
What I don't seem to be able to do is open the exsting file and append data to the end of the sheet.
Thanks in advance for your help.
toddHi Todd,
You can do this by creating a new Excel report with the existing excel file path wired to the "template" input. Then use "Excel Get Last Row.vi" (located under Report Generation\Excel Specific\Excel General) to obtain the location of the last row. Then use that location to input new data into the file.
Hope this helps,
Dan
Maybe you are looking for
-
Regarding order reversal without affecting stock
Dear all, Issue is regarding the prod. order reversal without affecting stock of materials. Scenario is as follows. I have an order of X matl. year 2011 - this order not yet delivered where as the raw materials has been issued by mb1b (261). As this
-
SCCM 2012 Client not installing
I have some machines that are installing fine and some that are failing. Some that do install are hit and miss with installing the endpoint client as well. One one that is failing below is the client log on the machine.. ==========[ ccmsetup started
-
I was wondering if i could use my ipod touch on 10.4 tiger
-
How to set a cursor position in OALV Reports
Hi Experts, I have a created an OALV report and in the output field i've added drop down list with 2 values and for the drop downlist i've added a Double click event. when i select a value from the drop down list and double clicking the field the v
-
When I create a purchase order, if I select the RFQ that I rejected, it gives a warning but I could still order from that vendor. I would like to change it to an error, so that the system will prevent choosing the rejected RFQ in a purchase order. Is