No date in downloaded files?
Hi, when i download a new file. It is listed as ¨without a date¨
If it arranged by date, the first archives than appear are from yestarday and today archives are listed in the botton.
MacBook Air OSX 10.9.3.
I've notice this only recently, the last month or so. Downloads no longer are sorted by date, I have to check the undated to find them.
Similar Messages
-
In Firefox 4 how can I cause the date on downloaded files to be the current date? (Some are and some are not. In FF3 the dates were ALWAYS the current ones.)
== This happened ==
Every time Firefox opened
== I upgraded to Firefox 4 (beta)Firefox 3.6.* and earlier set the downloaded file's modification time to the current time. In Firefox 4.0 the behavior has been changed, if a server returns a timestamp telling when the file was last modified (Last-Modified header), it is used instead.
You can revert to the previous behaviour by using the [https://addons.mozilla.org/en-US/firefox/addon/93121/ Download Timestamp] add-on. -
My servlet query data from database and would like to return the data as text file.
How can I return data to the browser as user click a file to download ?
How can I set the file name ? (default name is the servlet name that I don't want it to be)
Which content type should I return to browser to prevent browser to display data immediately but save instead ?
Thank you very much !I am having the same issue. Did you ever discover a way to change the "file name" in the browser. I've tried changing numerous HTTP header fields, to no avail.
Marc -
Java adds extra garbage data to downloaded files?
I have been trying to write a updater to my java program and everytime I download a file it adds data to the end. When downloading a small text file it adds (null) a bunch of times to the bottom of the file. When downloading a 175k text file called large.txt it breaks the format a little bit then adds part of the file to the bottom. If you download a zip file it corrupts it. Does anyone know why java adds crap to the bottom of downloaded files or can someone help me out please?
//testDownload.java
import java.util.*;
import java.io.*;
import java.net.*;
public class testDownload
public static void main(String[] args)
int count = 0;
try
System.out.println("Downloading file");
java.io.BufferedInputStream in = new java.io.BufferedInputStream(
new java.net.URL("http://saveourmacs.com/testfile/test.txt").openStream());
//new java.net.URL("http://saveourmacs.com/testfile/large.txt").openStream());
java.io.FileOutputStream fos = new java.io.FileOutputStream("test.txt");
//java.io.FileOutputStream fos = new java.io.FileOutputStream("large.txt");
java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
byte data[] = new byte[1024];
while(in.read(data,0,1024)>=0)
bout.write(data);
count++;
if (count % 1024 == 0) // every meg
System.out.print (">");
System.out.println();
System.out.println("File downloaded");
bout.close();
in.close();
catch (Exception e)
e.printStackTrace();
//System.exit(-1);
}You always write chunks of 1024 bytes; what if the last chunk read was less than 1024 bytes? Hint: use the return value of the read( ... ) method.
kind regards,
Jos
Edited by: JosAH on May 28, 2009 3:37 PM -
DATA TRANSFER - How to get a SINGLE SPACE in the downloaded file from UNIX?
Hi Experts,
Am sending data from SAP to UNIX/ Application server and text file on desk top as well.
So, I am keeping a single character just SPACE at the END of each record.
Then, When I see the downloaded text file, I found a SINGLE SPACE at the end of each record, fine.
Then, by using CG3Y t code, I downloaded the UNIX file to my desk top.
But, When I see this UNIX downloaded file from UNIX, I did NOT find any SPACE at the end of each record!!!
Am doing every thing same in both cases.
So,
1 - Why its happening in case of UNIX file?
2 - How to get a SINGLE SPACE at the END in the downloaded file from UNIX?
thanqHi,
I don't know if this works:
perform SET_TRAIL_BLANKS(saplgrap) using 'X'.
perform SET_FIXLEN(saplgrap) using '0' '060'. "put length of your line from-to
... download ...
It will put space at the end of your line, according to the length.
Hope it works,
Chang -
Hi ABAP Exterts,
Any one help on this , there is a requirement to download the data into XLSX file only.
I am able to to download the data into XLS file using the FM: GUI_DOWNLOAD in SAP ECC 6.0and also opening the file . But when i download the data into XLSX file . I am able to download the data into GUI_DOWNLOAD. But while opening the file i am getting the below mentioned error.
'Excel cannot open the file 'filename.xlsx' because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file'
Ok buttom is coming not able to open the file.
When i use the FM: SAP_CONVERT_TO_XLS_FORMAT to download the XLS it self it is going abap DUMP that file type error.
Any one help any Function Module or how to download data through abap programing into XLSX file.
Thanks.
Murali.
Message was edited by: Matthew Billingham - adjusted wording...If you want to download your ALV to an .XLXS format file, with all the formatting intact, please try the following code. I have tried to create a custom Function module Z_EXCEL_DOWNLOAD_TEST wherein I pass all the callback variables, the final ALV internal table and all the ALV details like field catalog, sort, layout, event list and so on, along with the concatenated file path and file name in I_FILE. I have used a custom class ZCL_SALVEXPORT_XML which is a copy of the standard class CL_SALV_EXPORT_XML_DIALOG, with few modifications in Method: EXECUTE and Method: DOWNLOAD. The methods where I have modified the code are also shown at the end.
****************Global declarations***********************
TYPE-POOLS: slis,
kkblo.
TYPES: t_fccls(1) TYPE c OCCURS 0.
TYPES: BEGIN OF ty_nosum,
fieldname TYPE kkblo_fieldname, "Field name
tabname TYPE kkblo_tabname, "Table name
fieldname_dep TYPE kkblo_fieldname, "Field name
tabname_dep TYPE kkblo_tabname, "Table name
index TYPE sy-index, "Index
END OF ty_nosum.
TYPES: t_nosum TYPE TABLE OF ty_nosum INITIAL SIZE 0 WITH NON-UNIQUE DEFAULT KEY.
TYPES: BEGIN OF ty_dep_field,
s_dep_fieldcat TYPE kkblo_fieldcat, "Field cat
t_ref_fieldcat TYPE kkblo_t_fieldcat, "Field cat
END OF ty_dep_field.
TYPES: BEGIN OF ty_ref_field,
s_ref_fieldcat TYPE kkblo_fieldcat, "Field cat
s_dep_fieldcat TYPE kkblo_fieldcat, "Field cat
END OF ty_ref_field.
TYPES: t_dep_field TYPE ty_dep_field OCCURS 0. "
TYPES: t_ref_field TYPE ty_ref_field OCCURS 0.
TYPES: BEGIN OF ty_memory,
object(20) TYPE c, "Object
memcount(4) TYPE c, "count
END OF ty_memory.
*ALV Customer Wrapper
TYPES: BEGIN OF ty_type_header_info,
tabname TYPE kkblo_tabname, "Table name
fieldname TYPE kkblo_fieldname, "Field name
sequence TYPE i, "Sequence
field TYPE char80, "Field
pagno TYPE sypagno, "Page num
linno TYPE sy-linno, "Current Line in List
colno TYPE sy-colno, "Current List Column
END OF ty_type_header_info,
t_type_header_info TYPE SORTED TABLE OF ty_type_header_info
WITH UNIQUE KEY tabname fieldname.
TYPES: BEGIN OF ty_type_row_info,
tabname TYPE kkblo_tabname, "Table name
tabindex TYPE syindex, "Index
field TYPE char80, "Field name
pagno TYPE sypagno, "Page num
linno TYPE sy-linno, "Current Line in List
colno TYPE sy-colno, "Current List Column
END OF ty_type_row_info,
t_type_row_info TYPE SORTED TABLE OF ty_type_row_info
WITH UNIQUE KEY tabname tabindex.
TYPES: BEGIN OF ty_type_sel_header,
tabname TYPE kkblo_tabname, "table name
fieldname TYPE kkblo_fieldname, "field name
END OF ty_type_sel_header,
t_type_sel_header TYPE SORTED TABLE OF ty_type_sel_header
WITH UNIQUE KEY tabname fieldname.
TYPES: BEGIN OF ty_type_sel_row,
tabname TYPE kkblo_tabname,
tabindex TYPE syindex,
END OF ty_type_sel_row,
t_type_sel_row TYPE SORTED TABLE OF ty_type_sel_row
WITH UNIQUE KEY tabname tabindex.
TYPES: BEGIN OF ty_type_sel_cell,
tabname TYPE kkblo_tabname,
tabindex TYPE syindex,
fieldname TYPE kkblo_fieldname,
END OF ty_type_sel_cell.
TYPES: BEGIN OF ty_type_selections,
t_row_info TYPE t_type_row_info,
t_header_info TYPE t_type_header_info,
t_selected_headers TYPE t_type_sel_header,
t_selected_rows TYPE t_type_sel_row,
s_current_cell TYPE ty_type_sel_cell,
set_headers TYPE sap_bool,
set_rows TYPE sap_bool,
set_current_cell TYPE sap_bool,
END OF ty_type_selections.
TYPES: BEGIN OF ty_stack3,
r_grid TYPE REF TO cl_gui_alv_grid, "Y6DK050176
r_salv_adapter TYPE REF TO if_salv_adapter,
s_selections TYPE ty_type_selections,
r_print_state TYPE REF TO if_alv_print_parameter_proxy, "Y6DK075821
suppress_empty_data TYPE abap_bool,
END OF ty_stack3.
TYPES: t_stack3 TYPE ty_stack3 OCCURS 0.
TYPES: BEGIN OF ty_stack,
i_callback_program TYPE sy-repid,
i_callback_user_command TYPE kkblo_formname,
i_callback_top_of_page TYPE kkblo_formname,
i_callback_top_of_list TYPE kkblo_formname,
i_callback_end_of_page TYPE kkblo_formname,
i_callback_end_of_list TYPE kkblo_formname,
i_callback_pf_status_set TYPE kkblo_formname,
i_callback_fieldcat_save TYPE kkblo_formname,
i_callback_layout_save TYPE kkblo_formname,
i_tabname TYPE kkblo_tabname,
i_tabname_slave TYPE kkblo_tabname,
is_keyinfo TYPE kkblo_keyinfo,
is_layout TYPE kkblo_layout,
it_fieldcat TYPE kkblo_t_fieldcat,
i_fctype(1) TYPE c,
it_excluding TYPE kkblo_t_extab,
it_special_groups TYPE kkblo_t_sp_group,
it_sort TYPE kkblo_t_sortinfo,
it_except_qinfo TYPE kkblo_t_qinfo,
is_sel_hide TYPE kkblo_sel_hide,
t_columns TYPE kkblo_t_columns,
t_filter TYPE kkblo_t_filter,
s_lprint TYPE kkblo_lprint,
print_line_break TYPE char1,
t_isetab TYPE kkblo_seldis,
t_fccls TYPE t_fccls,
t_sfinfo TYPE kkblo_t_sfinfo,
t_ref_field TYPE t_ref_field,
t_dep_field TYPE t_dep_field,
flg_default_status(1) TYPE c,
flg_selections TYPE char1,
flg_allow_no_selection TYPE char1,
flg_input TYPE char1,
flg_called TYPE char1,
flg_popup TYPE char1,
flg_endlist TYPE char1,
listtype TYPE char1,
actcols TYPE i,
is_list TYPE char1,
END OF ty_stack.
TYPES: t_stack TYPE ty_stack OCCURS 0.
TYPES: BEGIN OF ty_stack2,
button_col1(20) TYPE c,
button_col2(20) TYPE c,
button_col3(20) TYPE c,
button_col4(20) TYPE c,
button_col5(20) TYPE c,
s_header TYPE kkblo_header,
t_sfinfo_slave TYPE kkblo_t_sfinfo,
t_suminfo TYPE kkblo_t_sfinfo,
t_sfsave TYPE kkblo_t_sfinfo,
t_nosum TYPE t_nosum,
window_title TYPE rsmpe-tittext, " Item_selection
flg_scroll_to_line(1) TYPE c, " Item_selection
flg_top_of_page(1) TYPE c,
flg_subtot(1) TYPE c,
flg_output_in_progress(1) TYPE c,
flg_grouplevels(1) TYPE c,
flg_groupedit(1) TYPE c,
flg_calculate_totals(1) TYPE c,
sumlevel TYPE sy-tabix,
memory_stack1 TYPE ty_memory,
memory_stack2 TYPE ty_memory,
memory_outtab TYPE ty_memory,
t_colmark TYPE kkblo_t_colmark,
t_rowmark TYPE kkblo_t_rowmark,
it_event_exit TYPE kkblo_t_event_exit,
t_groups TYPE kkblo_t_grouplevels,
t_filter_groups TYPE kkblo_t_grouplevels,
s_subtot_options TYPE kkblo_subtot_options,
flg_append_mode(1) TYPE c,
is_reprep_id TYPE kkblo_reprep_id,
i_callback_before_line_output TYPE kkblo_formname,
i_callback_after_line_output TYPE kkblo_formname,
i_callback_foreign_top_of_page TYPE kkblo_formname,
i_callback_foreign_end_of_page TYPE kkblo_formname,
i_callback_list_modify TYPE kkblo_formname,
i_callback_top_of_coverpage TYPE kkblo_formname,
i_callback_end_of_coverpage TYPE kkblo_formname,
i_callback_grouplevel_change TYPE kkblo_formname,
i_callback_item_data_expand TYPE kkblo_formname,
i_callback_header_transport TYPE kkblo_formname,
i_callback_reprep_sel_modify TYPE kkblo_formname,
i_callback_subtotal_text TYPE kkblo_formname,
END OF ty_stack2.
TYPES: t_stack2 TYPE TABLE OF ty_stack2 INITIAL SIZE 0.
** *--- iTables
DATA: it_stack TYPE t_stack WITH HEADER LINE.
DATA: it_stack2 TYPE t_stack2 WITH HEADER LINE.
***ALV Customer Wrapper
DATA: it_stack3 TYPE t_stack3 WITH HEADER LINE.
CONSTANTS: BEGIN OF c_con_listtype,
simple(1) TYPE c VALUE 'S',
hier_sequ(1) TYPE c VALUE 'H',
matrix(1) TYPE c VALUE 'M',
END OF c_con_listtype.
DATA: gv_callback_program1 TYPE sy-repid,
gv_callback_user_command1 TYPE kkblo_formname,
gv_callback_top_of_page1 TYPE kkblo_formname,
gv_callback_top_of_list1 TYPE kkblo_formname,
gv_callback_end_of_page1 TYPE kkblo_formname,
gv_callback_end_of_list1 TYPE kkblo_formname,
gv_callback_pf_status_set1 TYPE kkblo_formname,
gv_callback_layout_save1 TYPE kkblo_formname,
gv_callback_fieldcat_save1 TYPE kkblo_formname,
gv_callback_grouplevel_change1 TYPE kkblo_formname,
gv_callback_before_line_otput1 TYPE kkblo_formname,
gv_callback_after_line_otput1 TYPE kkblo_formname,
gv_callback_foreign_top_of_pg1 TYPE kkblo_formname,
gv_callback_foreign_end_of_pg1 TYPE kkblo_formname,
gv_callback_list_modify1 TYPE kkblo_formname,
gv_callback_top_of_coverpge1 TYPE kkblo_formname,
gv_callback_end_of_coverpge1 TYPE kkblo_formname,
gv_callback_item_data_expand1 TYPE kkblo_formname,
gv_callback_header_transport1 TYPE kkblo_formname,
gv_callback_reprep_sel_modify1 TYPE kkblo_formname,
gv_callback_subtotal_text1 TYPE kkblo_formname,
gv_layout1 TYPE kkblo_layout,
gv_fieldcat1 TYPE kkblo_t_fieldcat,
gv_fctype1 TYPE c,
gv_event_exit1 TYPE kkblo_t_event_exit,
gv_excluding1 TYPE kkblo_t_extab,
gv_special_groups1 TYPE kkblo_t_sp_group,
gv_sort1 TYPE kkblo_t_sortinfo,
gv_filter1 TYPE kkblo_t_filter,
gv_except_qinfo1 TYPE slis_t_qinfo_alv,
gv_sel_hide1 TYPE slis_sel_hide_alv,
gv_reprep_id1 TYPE slis_reprep_id,
gv_screen_start_column1 TYPE i,
gv_salv_adapter1 TYPE REF TO if_salv_adapter,
gv_suppress_empty_data1 TYPE sap_bool.
FUNCTION z_excel_download_test.
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_BYPASSING_BUFFER) TYPE CHAR01 OPTIONAL
*" REFERENCE(I_BUFFER_ACTIVE) OPTIONAL
*" REFERENCE(I_CALLBACK_PROGRAM) TYPE SY-REPID OPTIONAL
*" REFERENCE(I_CALLBACK_USER_COMMAND) OPTIONAL
*" REFERENCE(I_CALLBACK_TOP_OF_PAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_TOP_OF_LIST) OPTIONAL
*" REFERENCE(I_CALLBACK_END_OF_PAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_END_OF_LIST) OPTIONAL
*" REFERENCE(I_CALLBACK_PF_STATUS_SET) OPTIONAL
*" REFERENCE(I_CALLBACK_LAYOUT_SAVE) OPTIONAL
*" REFERENCE(I_CALLBACK_FIELDCAT_SAVE) OPTIONAL
*" REFERENCE(I_CALLBACK_GROUPLEVEL_CHANGE) OPTIONAL
*" REFERENCE(I_CALLBACK_BEFORE_LINE_OUTPUT) OPTIONAL
*" REFERENCE(I_CALLBACK_AFTER_LINE_OUTPUT) OPTIONAL
*" REFERENCE(I_CALLBACK_FOREIGN_TOP_OF_PAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_FOREIGN_END_OF_PAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_LIST_MODIFY) OPTIONAL
*" REFERENCE(I_CALLBACK_TOP_OF_COVERPAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_ITEM_DATA_EXPAND) OPTIONAL
*" REFERENCE(I_CALLBACK_END_OF_COVERPAGE) OPTIONAL
*" REFERENCE(I_CALLBACK_HEADER_TRANSPORT) OPTIONAL
*" REFERENCE(I_CALLBACK_REPREP_SEL_MODIFY) OPTIONAL
*" REFERENCE(I_CALLBACK_SUBTOTAL_TEXT) OPTIONAL
*" REFERENCE(I_TABNAME) TYPE SLIS_TABNAME OPTIONAL
*" REFERENCE(I_FCTYPE) DEFAULT 'R'
*" REFERENCE(IT_EXCEPT_QINFO) TYPE SLIS_T_QINFO_ALV OPTIONAL
*" REFERENCE(IS_SEL_HIDE) TYPE SLIS_SEL_HIDE_ALV OPTIONAL
*" REFERENCE(IS_REPREP_ID) TYPE SLIS_REPREP_ID OPTIONAL
*" REFERENCE(I_SCREEN_START_COLUMN) DEFAULT 0
*" REFERENCE(I_OO_ALV) OPTIONAL
*" REFERENCE(IR_SALV_ADAPTER) TYPE REF TO IF_SALV_ADAPTER OPTIONAL
*" REFERENCE(I_SUPPRESS_EMPTY_DATA) TYPE SAP_BOOL DEFAULT
*" ABAP_FALSE
*" REFERENCE(I_FILE) TYPE STRING OPTIONAL
*" REFERENCE(IT_FIELDCAT) TYPE SLIS_T_FIELDCAT_ALV OPTIONAL
*" REFERENCE(IS_LAYOUT) TYPE SLIS_LAYOUT_ALV OPTIONAL
*" REFERENCE(IT_SORT) TYPE SLIS_T_SORTINFO_ALV OPTIONAL
*" REFERENCE(IT_FILTER) TYPE SLIS_T_FILTER_ALV OPTIONAL
*" REFERENCE(IT_EXCLUDING) TYPE SLIS_T_EXTAB OPTIONAL
*" REFERENCE(IT_SPECIAL_GROUPS) TYPE SLIS_T_SP_GROUP_ALV OPTIONAL
*" REFERENCE(IS_KEYINFO) TYPE SLIS_KEYINFO_ALV OPTIONAL
*" REFERENCE(IT_EVENT_EXIT) TYPE SLIS_T_EVENT_EXIT OPTIONAL
*" REFERENCE(IS_LIST_SCROLL) TYPE SLIS_LIST_SCROLL OPTIONAL
*" REFERENCE(IS_PRINT) TYPE SLIS_PRINT_ALV OPTIONAL
*" REFERENCE(IS_LINEINFO) TYPE SLIS_LINEINFO OPTIONAL
*" REFERENCE(I_REPID) TYPE SYREPID OPTIONAL
*" TABLES
*" T_OUTTAB TYPE STANDARD TABLE OPTIONAL
*********** Local data declarations******************
DATA: gv_list TYPE char1.
DATA: gv_fcat_complete TYPE sap_bool.
DATA: gv_buffer_active TYPE char01,
wa_variant TYPE disvariant.
DATA: gv_controller TYPE REF TO cl_salv_export_c8r.
DATA: gv_xml TYPE xstring.
DATA: gv_s_xml_choice TYPE if_salv_bs_xml=>s_type_xml_choice.
DATA: gv_t_xml_choice TYPE if_salv_bs_xml=>t_type_xml_choice.
DATA: gv_param_lvc TYPE if_salv_export=>s_type_param_lvc.
DATA: gv_data TYPE REF TO data.
DATA: gv_result_data TYPE REF TO cl_salv_ex_result_data_table.
DATA: gv_flavour TYPE string.
DATA: gv_version TYPE string.
DATA: -
How to download internal table data to .xlsx file ?
Hello All,
I am using SAP ECC 6.0. I need to download internal table data to .xlsx file.
I tried GUI_DOWNLOAD, all the data are getting transferred to the .xlsx file, but while opening I am getting the below error.
Excel cannot open the file "download.xlsx" because file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.
Though Microsoft office 2007 is installed in my system.
Please help <removed by moderator>.
Edited by: Thomas Zloch on Oct 24, 2011 10:55 AMHi,
Please find the below code to download data into excel file.
DATA: ld_filename TYPE string,
ld_path TYPE string,
ld_fullpath TYPE string,
ld_result TYPE i.
Display save dialog window
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = ' '
DEFAULT_EXTENSION = 'XLS'
default_file_name = 'accountsdata'
INITIAL_DIRECTORY = 'c:\temp\'
CHANGING
filename = ld_filename
path = ld_path
fullpath = ld_fullpath
user_action = ld_result.
Check user did not cancel request
CHECK ld_result EQ '0'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = ld_fullpath
filetype = 'ASC'
APPEND = 'X'
write_field_separator = 'X'
CONFIRM_OVERWRITE = 'X'
TABLES
data_tab = it_datatab[] "need to declare and populate
EXCEPTIONS
file_open_error = 1
file_write_error = 2
OTHERS = 3.
Thanks and Regards
Chitra -
When I try to download a software up date for another program in Binary File (eg. C Cleaner or a Microsoft file) in Firefox they all just come up in the download window as 'Canceled'? When I go to the destination folder the download file icon is there with 0 Kb's for size...Then when I click 'RETRY' the download it appears to download fully, but when I go into the destination folder the downloaded file is not there? I need to know if there is something in the Firefox options to resolve this problem or much more!!
If all .exe files are blocked, antivirus software is most likely configured to block them. See if you can download these with your antivirus and/or security software disabled.
-
Download file format(different length data on one column)
Hi all,
i am just writing a report to download the delivery data to a file.the file have 3 columns.the length of the column data in every row varies.
let my file structure is like
first line of my file contains,
delivery no(22),delivery date(8),delivery type(5)
2nd line of the file contains,
shipper num(48),customer PO num(20),material num(15)
In the first column of this file contains delivery number(length-22)& shipper number(length-48).but the length of both the data will be different i.e i have to assign the length of delivery num as 22 & length of shipper num as 48.but they will appear in one column. how it will be possible.
is there any command to make the file format like this?
ur help is highly appreaciated.it's urgent.
Regards
pabitrawhatever record you will populate(i mean it may be either delivery no or shipment no etc..)define your internal table with the highest length(in this case 48).
as both values are CHARacters, there is no problem even if you populate Delivery no(of 10 chars) to 48 char field.
spaces will be truncated.
data:begin of itab,
col1<b>(48) type c</b>,
col2,
col3,
end of itab.
*--when you are populating Delivery no:
ITAB-COL1+0(10) = V_DELIVERYNO.
CONDENSE ITAB-COL1+0(10) NO-GAPS.
*--when you are populating SHIPMENT no:
ITAB-COL1+0(48) = V_shipment.
CONDENSE ITAB-COL1+0(48) NO-GAPS.
i guess,there wont be any problems,if you use this logic.
Regards
srikanth -
How to delimited text file data being downloaded in Application server
Hi All,
How to delimited or having a tab between each fields in the data being downloaded to Application server. Please provide an example of code or how i should make changes to my below coding. Thanks.
eg. the out file in application server.
Field1#Field2#Field3
what I currently get was as below:-
Field1Field2Field3
My coding:
FORM download_outfile.
DATA : xfer(400).
IF rb_locl EQ 'X'.
DESCRIBE TABLE itab LINES sy-tfill.
IF sy-tfill GT 0.
CALL FUNCTION 'WS_DOWNLOAD'
EXPORTING
filename = p_file
filetype = 'DAT'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_write_error = 2
invalid_filesize = 3
invalid_table_width = 4
invalid_type = 5
no_batch = 6
unknown_error = 7
OTHERS = 8.
IF sy-subrc EQ 0.
WRITE : / 'download done.
ELSE.
WRITE : / '4)Error occured'.
ENDIF.
ENDIF.
ELSE.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE.
DATA : l_subrc LIKE sy-subrc.
LOOP AT itab.
MOVE itab TO xfer.
TRANSFER xfer TO p_file.
IF sy-subrc NE 0.
l_subrc = sy-subrc.
ENDIF.
ENDLOOP.
IF l_subrc EQ 0.
WRITE :/ 'download done.
ELSE.
WRITE :/ 'error occurred.
ENDIF.
CLOSE DATASET p_file.
ENDIF.
ENDFORMHi,
Please check this sample codes.
OPEN DATASET P_DOWN FOR OUTPUT IN TEXT MODE. " P_DOWN is the file to download
IF SY-SUBRC = 0.
CLEAR V_STRING.
*-- Download to the file
LOOP AT IT_DOWN.
CONCATENATE IT_DOWN-DISTTYPE
IT_DOWN-O_CITY
IT_DOWN-O_REGIO
IT_DOWN-O_PSTLZ
IT_DOWN-O_CTRY
IT_DOWN-D_CITY
IT_DOWN-D_REGIO
IT_DOWN-D_PSTLZ
IT_DOWN-D_CTRY
IT_DOWN-DISTANCE
INTO V_STRING
SEPARATED BY '09'. " here 09 is the tab delimeter
TRANSFER V_STRING TO P_DOWN.
CLEAR V_STRING.
ENDLOOP.
Regards,
Ferry Lianto -
How to download the script data into pdf file
how to download the script data into pdf file
i have one option to download the script data to pdf file --->rstxpdft4 program.
i have one doubt how to use this proogram.or any function module to download the script data to pdf file.
Thanks and regards,
Sri.Hi Sri Sai,
I know one method to convert the sapscript to pdf file :
first generate a Spool Request for the required Sapscript
then goto transaction SP01 and copy the generated Spool Request number
now execute the SAP report RSTXPDFT4
here enter the copied Spool request number and the target directory into the parameters
execute the report
required pdf file will be generated into the target directory
i hope it will help you out
Please refer this simple program:
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
Reward points if found helpful....
Cheers,
Eshwar. -
Problem in Download data into Excel File
Hi Friends,
I have one doubt on WDJ.
I have got the data from the Back and display the data into Table UI Element. Depending upon po_status equals to OA Pending that time conf_Ship_date Column is Empty. That time we can Select All Checkbox Click on Download Button Excel file is not download. Why it not download? Conf_Ship_date Column is Empty. Conf_Ship_date Column is data available that time data download into Excel File.
My Req: if Conf_Ship_date Column is empty that time click on Download that data will download in to Excel. In Excel Conf_Ship_date Column will display in NULL or 00.00.0000 Like this also.
Code:ExcelEle.setConf_Shp_Date(StockEle.getConf_Shp_Date());
This means I am getting date from PoDetails_OutTab(StockEle)this node and add this date to PoDetails_ExcelData(ExcelEle) this node.Finally the date will available in PoDetails_ExcelData this node. By Using this node I will download data.
How to do this work?
Regards
VijayHi Arun,
For Example in Table 4 rows and 14 columns data is available. Select all check boxes click on download button total 4 rows and 14 columns data is downloaded.
Table 4 rows and 14 columns data is available. But in some cells data not available in that time I m getting null values from ECC System. That time I am not able to download.
In Particularly this problem I am getting only date colums.
So now I have develop this code
public void onActiondownloadToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActiondownloadToExcel(ServerEvent)
IPrivatePO_Details_ResultView.IPoDetails_ExcelDataNode ExcelNode = wdContext.nodePoDetails_ExcelData();
IPrivatePO_Details_ResultView.IPoDetails_ExcelDataElement ExcelEle;
IPrivatePO_Details_ResultView.IPoDetails_OutTabNode StockNode = wdContext.nodePoDetails_OutTab();
IPrivatePO_Details_ResultView.IPoDetails_OutTabElement StockEle ;
for(int i = 0 ;i<StockNode.size();i++)
StockEle = StockNode.getPoDetails_OutTabElementAt(i);
if(StockEle.getCheckBox()== true)
ExcelEle = ExcelNode.createPoDetails_ExcelDataElement();// Create Element
if(StockEle.getConf_Shp_Date()==null)
java.sql.Date deliverydate1=new java.sql.Date(0,0,0);
ExcelEle.setConf_Shp_Date(deliverydate1);
else
ExcelEle.setConf_Shp_Date(StockEle.getConf_Shp_Date());
By using this code i have to download total Records but in this Conf_Shp_Date colums i am getting 31-12.1899 this output in Excel. But i need in Excel to print Null or 00.00.0000 like
ExcelEle.setQuantity(StockEle.getQuantity());
ExcelEle.setDeliv_Date(StockEle.getDeliv_Date());
if(StockEle.getExpt_Shp_Date()==null)
java.sql.Date deliverydate2=new java.sql.Date(0,0,0);
ExcelEle.setExpt_Shp_Date(deliverydate2);
else
ExcelEle.setExpt_Shp_Date(StockEle.getExpt_Shp_Date());
ExcelEle.setVendor_Material(StockEle.getVendor_Material());
ExcelNode.addElement(ExcelEle);
if(ExcelNode.size()>0)
wdThis.wdGetCO_POPendingController().downloadData(wdContext.nodePoDetails_ExcelData());// This is for Downalod data Method
wdThis.wdGetCO_POPendingController().DownLoadToExcel();// This is for Open Popup Window
wdContext.nodePoDetails_ExcelData().invalidate();
else
wdComponentAPI.getMessageManager().reportException("Please select any one po item from the table",true);
//@@end
Regards
Vijay
Edited by: KalluriVijay on May 18, 2010 10:05 AM -
Urgent!!!Need code to fetch all sales order data and download to flat file
urgent!!!Need code to fetch all sales order data and download to flat file
D A T A B A S E T A B L E S *
TABLES: vbak, "Sales Document: Header Data
VBAP, "Sales Document: Item Data
MARA,VAPMA,VBPA,VBLB,VBEP,
VBKD. "Murali Poli .
I N T E R N A L T A B L E S *
Internal table to hold the Delphi material numbers file
DATA: BEGIN OF tbl_matnr OCCURS 0,
matnr LIKE mara-matnr, "Material number
END OF tbl_matnr.
Internal table to hold customer cross ref data
DATA: BEGIN OF TBL_CUST_SA OCCURS 0,
OLD_KUNNR LIKE KNA1-KUNNR, "Old Customer
OLD_VKORG LIKE A004-VKORG, "Old Sales organisation
OLD_VTWEG LIKE A004-VTWEG, "Old Distribution channel
NEW_KUNNR LIKE KNA1-KUNNR, "New Customer
NEW_VKORG LIKE A004-VKORG, "New Sales organisation
NEW_VTWEG LIKE A004-VTWEG, "New Distribution channel
PARVW LIKE VBPA-PARVW , "Partner function
END OF TBL_CUST_SA.
Internal table to check the material numbers of the input file
DATA: tbl_mara LIKE tbl_matnr OCCURS 0 WITH HEADER LINE.
Work area to hold the header record
DATA: BEGIN OF w_sa_header,
recordtype(1), "Record type
schedulingagreement(4), "SA Type
contractreference(10), "Contract Reference
salesorg(4), "Sales Organization
distrchannel(2), "Distribution channel
division(2), "Sales division
PONUMBER(35), "Purchase order number"gsbhondave
soldtoparty(12), "Sold-to party
shiptoparty(12), "Ship-to party
collectivenumber(10), "Collective number
description(40), "Description
roundqty(13), "Rounding Qty
pdsi(4), "PDI
correctiondeliverydate(8), "Correction Delivery Dt
correctionqty(13), "Correction Qty
cumulativereceivedqty(13), "Cumulative Received Qty
forecastdeliveryschedule(17), "Forecast Delivery Schedule
forecastdelscheddate(8), "Forecast Delivery Schedule Dt
jitdeliveryschedule(17), "JIT Delivery Schedule
jitdeliveryscheduledate(8), "JIT Delivery Schedule Dt
materialnumber(18), "Material number
plant(4), "Plant
item_category(4), "Item Category
suppliercode(15), "Supplier code
scac(4), "SCAC
deloc(12), "DELOC
pkg_id(12), "Packaging ID
catno(30), "Ultimate Cust Part
lgort(4), "Storage Location
vstel(4), "Shipping point
Adding fields by Murali Poli
VSBED(2), "Shipping conditions
INCO1(3), "Incoterms (part 1)
INCO2(28), "Incoterms (part 2)
ZECN(1), "Engineering Change Letter
End of Adding fields by Murali Poli
END OF w_sa_header.
Work area to hold the forecast record
DATA: BEGIN OF w_sa_forecast,
recordtype(1), "Record Type
dateformat(1), "Date format
forecastdate(8), "Forecast date
forecastorderqty(13), "Order Qty
END OF w_sa_forecast.
Work area to hold the jit record
DATA: BEGIN OF w_sa_jit,
recordtype(1), "Record Type
dateformat(1), "Date format
jitdate(8), "JIT date
jittime(6), "JIT Time
jitorderqty(13), "Order Qty
END OF w_sa_jit.
Internal table to hold the Extracted data
DATA: BEGIN OF tbl_record OCCURS 0,
record_type,
DATA(400), " changed from 325 to 400
END OF tbl_record.
Internal table to capture the errors
DATA: BEGIN OF tbl_error OCCURS 0,
error_text(135),
END OF tbl_error.
Internal table to hold the records of VBAP_VAPMA
DATA: BEGIN OF tbl_vbap_vapma OCCURS 0,
VBELN LIKE VAPMA-VBELN, "Sales and distribution document number
POSNR LIKE VAPMA-POSNR, "Item number
AUART LIKE VAPMA-AUART, "SA Type
VKORG LIKE VAPMA-VKORG, "Sales Organization
VTWEG LIKE VAPMA-VTWEG, "Distribution channel
SPART LIKE VAPMA-SPART, "Division
KUNNR LIKE VAPMA-KUNNR, "Sold-to
plavo like vbap-plavo, "PDI
MATNR LIKE VAPMA-MATNR, "Material number
WERKS LIKE VAPMA-WERKS, "Plant
TRVOG LIKE VAPMA-TRVOG, "Transaction group
VBTYP LIKE VBAK-VBTYP, "SD document category "Murali Poli
VSBED LIKE VBAK-VSBED, "Shipping conditions "Murali Poli
BSTNK LIKE VBAK-BSTNK, " Purchase order number " gsbhondave
KTEXT LIKE VBAK-KTEXT,
VGBEL LIKE VBAP-VGBEL, "Reference document no
ABLFZ LIKE VBAP-ABLFZ, "Rounding qty
PSTYV LIKE VBAP-PSTYV, "Item category
LGORT LIKE VBAP-LGORT, "Storage location
VSTEL LIKE VBAP-VSTEL, "Shipping point
END OF TBL_VBAP_VAPMA.
DATA: BEGIN OF TBL_VBAP OCCURS 0,
VBELN LIKE VAPMA-VBELN,
POSNR LIKE VAPMA-POSNR,
VGBEL LIKE VBAP-VGBEL,
ABLFZ LIKE VBAP-ABLFZ,
PSTYV LIKE VBAP-PSTYV,
LGORT LIKE VBAP-LGORT,
VSTEL LIKE VBAP-VSTEL,
END OF TBL_VBAP.
Adding by Murali Poli
DATA:BEGIN OF TBL_VBKD OCCURS 0,
VBELN LIKE VBKD-VBELN,
POSNR LIKE VBKD-POSNR,
INCO1 LIKE VBKD-INCO1,
INCO2 LIKE VBKD-INCO2,
END OF TBL_VBKD.
End by Murali Poli
Internal table to hold temporarily the records of VBAP_VAPMA
DATA: tbl_vbap_vapma_temp LIKE tbl_vbap_vapma OCCURS 0 WITH HEADER LINE.
Internal table to hold the records of VBPA
DATA: BEGIN OF tbl_vbpa OCCURS 0,
vbeln LIKE vbpa-vbeln, "Sales and distribution
"document number
posnr LIKE vbpa-posnr, "Item number
parvw LIKE vbpa-parvw, "SP Partner type
kunnr LIKE vbpa-kunnr, "Customer number
lifnr LIKE vbpa-lifnr, "SCAC code "DN3K923909
END OF tbl_vbpa.
Internal table to hold the records of VBLB (Forecast)
DATA: BEGIN OF tbl_vblb_forecast OCCURS 0,
vbeln LIKE vblb-vbeln,
posnr LIKE vblb-posnr,
abart LIKE vblb-abart, "Release type
abefz LIKE vblb-abefz, "Cumulative Quantity
"Received by Customer
labnk LIKE vblb-labnk, "Delivery schedule
abrdt LIKE vblb-abrdt, "Deivery date
gjkun LIKE vblb-gjkun, "Current fiscal year
vjkun LIKE vblb-vjkun, "Previous fiscal year
END OF tbl_vblb_forecast.
Internal table to hold the records of VBLB (JIT)
DATA: BEGIN OF tbl_vblb_jit OCCURS 0,
vbeln LIKE vblb-vbeln,
posnr LIKE vblb-posnr,
abart LIKE vblb-abart, "Release type
abefz LIKE vblb-abefz, "Cumulative Quantity
"Received by Customer
labnk LIKE vblb-labnk, "Delivery schedule
abrdt LIKE vblb-abrdt, "Deivery date
gjkun LIKE vblb-gjkun, "Current fiscal year
vjkun LIKE vblb-vjkun, "Previous fiscal year
END OF tbl_vblb_jit.
Internal table to hold the Forecast Schedule lines
DATA: BEGIN OF tbl_vbep_forecast OCCURS 0,
vbeln LIKE vbep-vbeln, "Sales document
posnr LIKE vbep-posnr, "Item number
etenr LIKE vbep-etenr, "Schedule line
edatu LIKE vbep-edatu, "Schedule line date
ezeit LIKE vbep-ezeit, "Arrival time "DN3K923909
wmeng LIKE vbep-wmeng, "Order quantity in sales units
prgrs LIKE vbep-prgrs, "Date type (day, week, month, interval)
abart LIKE vbep-abart, "Release type "DN3K923909
END OF tbl_vbep_forecast.
Internal table to hold the JIT Schedule lines
DATA: BEGIN OF tbl_vbep_jit OCCURS 0,
vbeln LIKE vbep-vbeln, "Sales document
posnr LIKE vbep-posnr, "Item number
etenr LIKE vbep-etenr, "Schedule line
edatu LIKE vbep-edatu, "Schedule line date
ezeit LIKE vbep-ezeit, "Arrival time
wmeng LIKE vbep-wmeng, "Order quantity in sales units
prgrs LIKE vbep-prgrs, "Date type (day, week, month, interval)
abart LIKE vbep-abart, "Release type "DN3K923909
END OF tbl_vbep_jit.
Internal table for Long texts
DATA: tbl_tline LIKE tline OCCURS 0 WITH HEADER LINE.
V A R I A B L E S *
DATA: v_count TYPE i,
V_REPID LIKE SY-REPID,
w_eins LIKE vbap-umvkz VALUE 1,
v_cumulative_deli_qty LIKE vblb-abefz,
v_text_name LIKE thead-tdname,
v_week LIKE scal-week,
v_count_h TYPE i, "Count of header records
v_count_f TYPE i, "Count of Forecast records
v_count_j TYPE i, "Count of JIT records
v_count_t TYPE i. "Count of Shipping instructions
TYPES: unixfile LIKE rlgrap-filename,
unixdir LIKE rlgrap-filename.
DATA: v_file1 TYPE unixfile,
v_file2 TYPE unixfile.
DATA: tbl_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE.
*data tbl_cust_sa.
S E L E C T - O P T I O N S / P A R A M E T E R S *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
Valid-to date
PARAMETER:
p_gueen like vbak-gueen obligatory,
Correction Delivery date
P_DELDT LIKE VBAK-GUEEN OBLIGATORY.
Begin of Changes - TIR-40266
Plant
SELECT-OPTIONS: s_werks FOR vbap-werks.
*SD document category
SELECT-OPTIONS: S_VBTYP FOR VBAK-VBTYP OBLIGATORY." Murali Poli
Sales organization
SELECT-OPTIONS: S_VKORG FOR VBAK-VKORG OBLIGATORY.
End of Changes - TIR-40266
SELECTION-SCREEN SKIP 1.
PARAMETER: r1 RADIOBUTTON GROUP rg1.
Material numbers file
PARAMETER: P_FILE1 LIKE RLGRAP-FILENAME.
PARAMETER: P_FILE6 LIKE RLGRAP-FILENAME.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(32) text-003.
SELECTION-SCREEN POSITION 33.
SD SA Extract file
PARAMETER: P_FILE2 LIKE RLGRAP-FILENAME
DEFAULT 'C:\sd_sa_extract.txt'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP 2.
PARAMETER: r2 RADIOBUTTON GROUP rg1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(32) text-004.
SELECTION-SCREEN POSITION 33.
PARAMETER: p_path1 TYPE unixdir OBLIGATORY DEFAULT '/tmp/'.
SELECTION-SCREEN END OF LINE.
Material numbers file
PARAMETER: PU_FILE1 LIKE RLGRAP-FILENAME.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(32) text-003.
SELECTION-SCREEN POSITION 33.
SD SA Extract file
PARAMETER: PU_FILE2 LIKE RLGRAP-FILENAME.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(64) text-005.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
A T S E L E C T I O N S C R E E N E V E N T S *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
v_repid = syst-repid.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = v_repid
CHANGING
file_name = p_file1
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e009.
Message shown as 'Error while getting the file name'
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE6.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = v_repid
CHANGING
FILE_NAME = P_FILE6
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e009.
Message shown as 'Error while getting the file name'
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file2.
v_repid = syst-repid.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = v_repid
CHANGING
file_name = p_file2
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e009.
Message shown as 'Error while getting the file name'
ENDIF.
AT SELECTION-SCREEN ON RADIOBUTTON GROUP rg1.
IF r1 = 'X'.
IF p_file1 = '' OR p_file2 = ''.
MESSAGE w000 WITH 'Please select a PC file'.
ENDIF.
LOOP AT SCREEN.
IF screen-name = 'P_FILE1' OR
screen-name = 'P_FILE2'.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF r2 = 'X'.
PERFORM get_value USING 'P_PATH1' CHANGING p_path1.
PERFORM get_value USING 'PU_FILE1' CHANGING pu_file1.
PERFORM get_value USING 'P_PATH1' CHANGING p_path1.
PERFORM get_value USING 'PU_FILE2' CHANGING pu_file2.
IF pu_file1 = '' OR pu_file2 = ''.
MESSAGE w000 WITH 'Please select a UNIX file'.
LOOP AT SCREEN.
IF screen-name = 'PU_FILE1' OR
screen-name = 'PU_FILE2'.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pu_file1.
PERFORM get_value USING 'P_PATH1' CHANGING p_path1.
PERFORM get_value USING 'PU_FILE1' CHANGING pu_file1.
PERFORM popup_unix_filename CHANGING p_path1 pu_file1.
PERFORM set_value USING 'P_PATH1' p_path1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pu_file2.
PERFORM get_value USING 'P_PATH1' CHANGING p_path1.
PERFORM get_value USING 'PU_FILE2' CHANGING pu_file2.
PERFORM popup_unix_filename CHANGING p_path1 pu_file2.
PERFORM set_value USING 'P_PATH1' p_path1.
T O P - O F - P A G E *
TOP-OF-PAGE.
PERFORM delphi_header(z_delphi_header_footer)
USING
'E & S SD SCHEDULING AGREEMENTS EXTRACT DATA'(016)
space
sy-linsz.
S T A R T - O F - S E L E C T I O N *
START-OF-SELECTION.
IF r1 = 'X'.
PERFORM upload_data_from_pc_files.
ELSEIF r2 = 'X'.
PERFORM upload_data_from_unix_files.
ENDIF.
PERFORM check_input_data.
PERFORM get_sd_sa_data.
E N D - O F - S E L E C T I O N *
END-OF-SELECTION.
PERFORM process_data.
S U B - R O U T I N E S *
*& Form get_value
FORM get_value USING value(p_fieldname)
CHANGING value(p_fieldvalue).
IF v_repid IS INITIAL.
v_repid = syst-repid.
ENDIF.
REFRESH: tbl_dynpfields.
CLEAR: tbl_dynpfields.
tbl_dynpfields-fieldname = p_fieldname.
APPEND tbl_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = v_repid
dynumb = '1000'
TABLES
dynpfields = tbl_dynpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF syst-subrc = 0.
READ TABLE tbl_dynpfields INDEX 1.
p_fieldvalue = tbl_dynpfields-fieldvalue.
ENDIF.
REFRESH: tbl_dynpfields.
ENDFORM. " get_value
FORM POPUP_UNIX_FILENAME *
Pops up dialog box to explore the unix filesystem and select a file *
--> VALUE(P_PATH) Path where to start exploring from *
--> VALUE(P_FILENAME) Default filename in the dialog box *
FORM popup_unix_filename CHANGING value(p_path) TYPE unixdir
value(p_filename) TYPE unixfile.
DATA: v_length TYPE i,
v_filename TYPE unixfile,
v_directory LIKE draw-filep,
v_file LIKE draw-filep.
IF p_filename(1) = '/' OR
p_path IS INITIAL.
v_filename = p_filename.
ELSE.
v_length = strlen( p_path ) - 1.
IF p_path+v_length(1) <> '/'.
CONCATENATE p_path '/' INTO p_path.
ENDIF.
CONCATENATE p_path p_filename INTO v_filename.
ENDIF.
CALL FUNCTION 'Z_UNIX_FILENAME_GET'
EXPORTING
def_filename = v_filename
mask = ',*.'
mode = 'G'
title = 'Get UNIX file...'
IMPORTING
filename = v_filename
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
CHECK syst-subrc = 0.
CALL FUNCTION 'CV120_SPLIT_PATH'
EXPORTING
pf_path = v_filename
IMPORTING
pfx_path = v_directory
pfx_file = v_file
EXCEPTIONS
OTHERS = 1.
CHECK syst-subrc = 0.
IF v_directory = p_path.
p_filename = v_file.
ELSE.
p_filename = v_filename.
ENDIF.
ENDFORM.
FORM SET_VALUE *
Sets the value of a field on the selection screen. *
--> VALUE(P_FIELDNAME) Name of the field on the selection screen*
--> VALUE(P_FIELDVALUE) Value of the field *
FORM set_value USING value(p_fieldname)
value(p_fieldvalue).
IF v_repid IS INITIAL.
v_repid = syst-repid.
ENDIF.
CLEAR: tbl_dynpfields.
tbl_dynpfields-fieldname = p_fieldname.
tbl_dynpfields-fieldvalue = p_fieldvalue.
APPEND tbl_dynpfields.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = v_repid
dynumb = '1000'
TABLES
dynpfields = tbl_dynpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
ENDFORM.
*& Form upload_data_from_pc_files
This subroutine is used to upload the data from input files
FORM upload_data_from_pc_files.
REFRESH: tbl_matnr.
CLEAR: tbl_matnr.
Upload the data from Delphi Materials file
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_file1
filetype = 'DAT'
TABLES
data_tab = tbl_matnr
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE e008 WITH 'Materials file'.
Message shown as "Error while reading Materials file"
ENDIF.
IF sy-subrc = 0 AND tbl_matnr[] IS INITIAL.
MESSAGE e013 WITH 'Materials'.
Message shown as "No records found in Materials file"
ENDIF.
DELETE tbl_matnr WHERE matnr = ''.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_FILE6
filetype = 'DAT'
TABLES
DATA_TAB = TBL_CUST_SA
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE E008 WITH 'Customer/Sales Area Cross Reference file'.
Message shown as "Error while reading Materials file"
ENDIF.
ENDFORM. " upload_data_from_pc_files
*& Form upload_data_from_unix_files
This subroutine is used to upload the data from UNIX files
FORM upload_data_from_unix_files.
REFRESH: tbl_matnr.
CLEAR: tbl_matnr.
Get the complete filename for the Materials file
PERFORM get_full_filename USING pu_file1 CHANGING v_file1.
Open the Materials file
PERFORM open_dataset USING v_file1 'I' 'T' 1.
CHECK syst-subrc = 0.
Read the materials file
DO.
READ DATASET v_file1 INTO tbl_matnr.
IF syst-subrc <> 0.
EXIT.
ENDIF.
Populate the read data into the internal table
APPEND tbl_matnr.
ENDDO.
PERFORM close_dataset USING v_file1.
ENDFORM. " upload_data_from_unix_files
FORM GET_FULL_FILENAME *
Uses the logical path if necessary to get the full filename *
If the filename already has a directory specified, that itself will *
be the full filename *
Else the logical path for Conversions will be prefixed to the given *
filename *
FORM get_full_filename USING value(p_file) TYPE unixfile
CHANGING value(p_fullfile) TYPE unixfile.
DATA: v_length TYPE i.
IF p_file(1) = '/' OR
p_path1 IS INITIAL.
p_fullfile = p_file.
ELSE.
v_length = strlen( p_path1 ) - 1.
IF p_path1+v_length(1) = '/'.
CONCATENATE p_path1 p_file INTO p_fullfile.
ELSE.
CONCATENATE p_path1 '/' p_file INTO p_fullfile.
ENDIF.
ENDIF.
ENDFORM.
FORM OPEN_DATASET *
Opens dataset in the specified mode *
--> VALUE(P_FILE) Name of file to be opened *
--> VALUE(P_IOMODE) 'I' for Input / 'O' for Output *
--> VALUE(P_BTMODE) 'T' for Text / 'B' for Binary *
--> VALUE(P_LEVEL) If set to > 1, will write error message to *
list Else will supress the error message but *
will be available in SYST-MSGV1 *
FORM open_dataset USING value(p_file) TYPE unixfile
value(p_iomode) TYPE c
value(p_btmode) TYPE c
value(p_level) TYPE i.
DATA: v_rc LIKE syst-subrc,
v_msg(100),
v_listmsg(100).
IF p_iomode = 'O'.
IF p_btmode = 'B'.
OPEN DATASET p_file FOR OUTPUT IN BINARY MODE MESSAGE v_msg.
ELSE.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE MESSAGE v_msg.
ENDIF.
ELSE.
IF p_btmode = 'B'.
OPEN DATASET p_file FOR INPUT IN BINARY MODE MESSAGE v_msg.
ELSE.
OPEN DATASET p_file FOR INPUT IN TEXT MODE MESSAGE v_msg.
ENDIF.
ENDIF.
IF syst-subrc <> 0.
v_rc = syst-subrc.
syst-msgv1 = v_msg.
IF p_level > 0.
CONCATENATE 'Unable to open' p_file
INTO v_listmsg
SEPARATED BY space.
IF p_iomode = 'O'.
CONCATENATE v_listmsg 'for Output'
INTO v_listmsg
SEPARATED BY space.
ELSE.
CONCATENATE v_listmsg 'for Input'
INTO v_listmsg
SEPARATED BY space.
ENDIF.
IF p_iomode = 'B'.
CONCATENATE v_listmsg 'in Binary mode'
INTO v_listmsg
SEPARATED BY space.
ELSE.
CONCATENATE v_listmsg 'in Text mode'
INTO v_listmsg
SEPARATED BY space.
ENDIF.
WRITE: / v_listmsg.
WRITE: /3 '--', v_msg.
syst-subrc = v_rc.
ENDIF.
ENDIF.
ENDFORM.
FORM CLOSE_DATASET *
Closes dataset *
--> VALUE(P_FILE) Name of the file to be closed *
FORM close_dataset USING value(p_file) TYPE unixfile.
CLOSE DATASET p_file.
ENDFORM.
*& Form check_input_data
This subroutine is used to check the data from X Ref files
FORM check_input_data.
DESCRIBE TABLE tbl_matnr LINES v_count.
Use the material conversion routine to pad the material numbers
with zeroes
LOOP AT tbl_matnr.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = tbl_matnr-matnr
IMPORTING
output = tbl_matnr-matnr
EXCEPTIONS
length_error = 1
OTHERS = 2.
TRANSLATE tbl_matnr-matnr TO UPPER CASE.
MODIFY tbl_matnr.
ENDLOOP.
Get the materials from SAP database using the input materials
IF NOT tbl_matnr[] IS INITIAL.
SORT tbl_matnr BY matnr.
SELECT matnr FROM mara
INTO TABLE tbl_mara
FOR ALL ENTRIES IN tbl_matnr
WHERE matnr = tbl_matnr-matnr.
SORT tbl_mara BY matnr.
ENDIF.
Check the existence of input materials in SAP database
LOOP AT tbl_matnr.
READ TABLE tbl_mara WITH KEY matnr = tbl_matnr-matnr
BINARY SEARCH.
IF sy-subrc <> 0.
CONCATENATE 'Material' tbl_matnr-matnr 'does not exist'
INTO tbl_error-error_text
SEPARATED BY space.
APPEND tbl_error.
CLEAR tbl_error.
DELETE tbl_matnr.
ENDIF.
ENDLOOP.
ENDFORM. " check_input_data
*& Form get_sd_sa_data
This subroutine is used to get the SD Scheduling data from database
FORM get_sd_sa_data.
*begin of changes - DN3K923909
DATA: tbl_vbep LIKE tbl_vbep_forecast OCCURS 0 WITH HEADER LINE,
tbl_vblb LIKE tbl_vblb_forecast OCCURS 0 WITH HEADER LINE.
*end of changes - ND3K923909
REFRESH: tbl_vbap_vapma, tbl_vbpa, tbl_vblb_forecast,
tbl_vblb_jit, tbl_vbep_forecast, tbl_vbep_jit.
CLEAR: tbl_vbap_vapma, tbl_vbpa, tbl_vblb_forecast,
tbl_vblb_jit, tbl_vbep_forecast, tbl_vbep_jit.
Get the Scheduling Agreements
SELECT avbeln aposnr
a~vgbel
AAUART avkorg avtweg aspart a~kunnr
a~ablfz
A~MATNR
a~pstyv
a~werks
a~lgort
a~vstel
ATRVOG BVBTYP BVSBED BBSTNK B~KTEXT
FROM VAPMA AS A INNER JOIN VBAK AS B
ON bvbeln = avbeln
INTO TABLE tbl_vbap_vapma
FOR ALL ENTRIES IN tbl_mara
WHERE a~matnr = tbl_mara-matnr
Begin of Changes - TIR-40266
AND a~vkorg IN s_vkorg
AND a~werks IN s_werks
End of Changes - TIR-40266
AND A~TRVOG = '3'
AND B~VBTYP IN S_VBTYP. "Murali Poli
and a~abgru = ''
and b~gueen >= p_gueen.
SORT tbl_vbap_vapma BY vbeln posnr.
IF NOT tbl_vbap_vapma[] IS INITIAL.
SELECT VBELN POSNR VGBEL ABLFZ PSTYV LGORT VSTEL FROM VBAP
INTO TABLE TBL_VBAP FOR ALL ENTRIES IN TBL_VBAP_VAPMA
WHERE VBELN = TBL_VBAP_VAPMA-VBELN
AND POSNR = TBL_VBAP_VAPMA-POSNR.
LOOP AT TBL_VBAP_VAPMA.
READ TABLE TBL_VBAP WITH KEY VBELN = TBL_VBAP_VAPMA-VBELN
POSNR = TBL_VBAP_VAPMA-POSNR.
IF SY-SUBRC = 0 .
TBL_VBAP_VAPMA-VBELN = TBL_VBAP-VBELN.
TBL_VBAP_VAPMA-POSNR = TBL_VBAP-POSNR.
TBL_VBAP_VAPMA-VGBEL = TBL_VBAP-VGBEL.
TBL_VBAP_VAPMA-ABLFZ = TBL_VBAP-ABLFZ.
TBL_VBAP_VAPMA-PSTYV = TBL_VBAP-PSTYV.
TBL_VBAP_VAPMA-LGORT = TBL_VBAP-LGORT.
TBL_VBAP_VAPMA-VSTEL = TBL_VBAP-VSTEL.
MODIFY TBL_VBAP_VAPMA .
ENDIF.
ENDLOOP.
tbl_vbap_vapma_temp[] = tbl_vbap_vapma[].
*--Begin of UnCommentDIR-51476-DN3K932648
-------------- Begin of Comment ----------- CCR-50124 DN3K928457
SORT tbl_vbap_vapma_temp BY vbeln.
DELETE ADJACENT DUPLICATES FROM tbl_vbap_vapma COMPARING vbeln.
-------------- End of Comment ----------- CCR-50124 DN3K928457
*--End of UnCommentDIR-51476-DN3K932648
*--Begin of CommentDIR-51476-DN3K932648
-------------- Begin of Insert ----------- CCR-50124 DN3K928457
Duplicate Line Items are being deleted.
SORT tbl_vbap_vapma BY vbeln posnr.
DELETE ADJACENT DUPLICATES FROM tbl_vbap_vapma COMPARING vbeln posnr.
The field for contract in SA is being modified for uniqueness
loop at tbl_vbap_vapma.
clear: v_vgbel, v_posnr.
v_vgbel = tbl_vbap_vapma-vgbel.
v_posnr = tbl_vbap_vapma-posnr.
if not v_vgbel is initial .
shift v_vgbel left deleting leading v_zero.
shift v_posnr left deleting leading v_zero.
v_posnr = v_posnr / 10.
condense: v_vgbel, v_posnr.
if v_posnr le 9.
concatenate v_vgbel '0' v_posnr into v_vgbel.
else.
concatenate v_vgbel v_posnr into v_vgbel.
endif.
endif.
tbl_vbap_vapma-vgbel = v_vgbel.
modify tbl_vbap_vapma.
endloop.
-------------- End of Insert ----------- CCR-50124 DN3K928457
*--End of CommentDIR-51476-DN3K932648
Get the Partner details
select vbeln posnr parvw kunnr
*Start of Murali Poli
SELECT VBELN POSNR INCO1 INCO2
INTO TABLE TBL_VBKD
FROM VBKD
FOR ALL ENTRIES IN TBL_VBAP_VAPMA
WHERE VBELN = TBL_VBAP_VAPMA-VBELN.
and posnr = tbl_vbap_vapma-posnr.
*End of Murali Poli
SELECT vbeln posnr parvw kunnr lifnr "DN3K923909
INTO TABLE tbl_vbpa
FROM vbpa
FOR ALL ENTRIES IN tbl_vbap_vapma_temp
WHERE vbeln = tbl_vbap_vapma_temp-vbeln
AND parvw IN ('WE', 'SP').
*begin of changes - DN3K923909
select vbeln posnr abart abefz labnk abrdt gjkun vjkun
into table tbl_vblb_forecast
from vblb
for all entries in tbl_vbap_vapma
where vbeln = tbl_vbap_vapma-vbeln
and posnr = tbl_vbap_vapma-posnr
and abrli = '0000'
and abart = '1'.
SELECT vbeln posnr abart abefz labnk abrdt gjkun vjkun
INTO TABLE tbl_vblb
FROM vblb
FOR ALL ENTRIES IN tbl_vbap_vapma
WHERE vbeln = tbl_vbap_vapma-vbeln
AND posnr = tbl_vbap_vapma-posnr
AND abrli = '0000'
AND abart IN ('1','2').
SELECT vbeln posnr etenr edatu ezeit wmeng prgrs abart
INTO TABLE tbl_vbep
FROM vbep
FOR ALL ENTRIES IN tbl_vbap_vapma
WHERE vbeln = tbl_vbap_vapma-vbeln
AND posnr = tbl_vbap_vapma-posnr
AND abart IN ('1','2').
Get the current Forecast delivery schedule
tbl_vblb_forecast[] = tbl_vblb[].
DELETE tbl_vblb_forecast WHERE abart = '2'.
Get the current Forecast Schedule lines
tbl_vbep_forecast[] = tbl_vbep[].
DELETE tbl_vbep_forecast WHERE abart = '2'.
Get the current JIT delivery Schedule
select vbeln posnr abart abefz labnk abrdt gjkun vjkun
into table tbl_vblb_jit
from vblb
for all entries in tbl_vbap_vapma
where vbeln = tbl_vbap_vapma-vbeln
and posnr = tbl_vbap_vapma-posnr -
Zone information on download files - no longer in alternate data stream on Windows 7 or IE 8 ?
Hi,
In Windows XP and Vista, when IE (or messenger) download a file an alternate data steam named "Zone.Identifer" is created to store information about the zone the file orginated from. This was how Windows knew which files should have that "This file
came from another computer and might be blocked" with an "Unblock" button in the properites for such files. Of course, this only works if downloading to an NTFS volume.
Vista also added the /R option for DIR, which allows us to see the alternate data streams. I can easily confirm this behavior on my home PC, which is Vista.
But on my Windows 7 desktop at the office, there do not seem to be any alternate data streams on downloaded files. DIR /R shows no Zone.Identifier ADS for downloaded files, and "This file came from another computer and might be blocked" is not displayed
in the downloaded file properties.
Nonetheless, downloaded files are preserving zone information. If I download an HTML file from our Intranet, and then open the downloaded file in IE, it shows as being in the Intranet zone. If I then copy that file to a FAT partition and back
to my desktop, it then shows as being in the local Computer zone. So there is metadata that was removed by copying to/from FAT.
Any ideas what is happening here? How is the zone information being stored, if it is not in an ADS any more?HMM I have the same problem. My researches suggest that the Zone.Identifier ADS is still being used for the internet zone, but not the Intranet zone. I too can get an intranet location out of IE, but not by querying Zone.Identifier eg using Powershell. This
issue is present in XP as well as Win 7. It appears to extend to trusted zone ids.
One hypothesis is that this is being stored in hidden form to prevent zone ids that decrease security being applied by malware.
I had thought that maybe the intranet zone id was only present during download - but your experiment suggests otherwise. -
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
Maybe you are looking for
-
How can I display a Movie clip from library on stage in AS3?
Hi, I have a movie clip in my library and I would like to display it on the stage using AS3. do I have to define it as a variable?Do I need to use this code: addchild(movieclip); can I use the 'x' and 'y' to position it? What would the code look li
-
Preview slideshow will not play pictures in order.
I'm looking a cd for work with jpgs. The slideshow won't show them in numerical order. Any thoughts? Thanks.
-
I am in desperate need of wisdom and insight. I have a simple Captivate simulation in which users tab from field to field and enter data. It works fine when we run it locally, but when we post it to our LMS (which displays programs in a frameset), th
-
Integration between OSA and ECM
Hi How does the integration between OSA 5.00 and Enterprise Compensation Management works? Could you please explain in detail? it would be great helpful if you could explain it technically. What information goes from OSA and in which table it get upd
-
Journal Batch Workflow - Super user
Hi, We have recently implemented Journal Batch (Internal name - GLBATCH) workflow for Journal approval before posting. We would like to setup a super user, who can approve all the Journal Batch Notifications. We thought of providing Workflow Administ