Japanese character problem while downloading file to application server
Hello All,
We are facing a strange problem while downloading a file to application server when file contains japanese text.
We are downloading vendor and customer information in a flat file format on application server. When the login language is EN program show ouput in a properly formatted manner.
When the login language is JA (japanese) program does download file with customer vendor data. I can see the description is japanese language but the formatting is gone for a toss.
We are facing similar issue with other programs downloading files on the application server.
I am using OPEN DATASET........ENCODING DEFAULT. and working on unicode enabaled ECC 6.0 system
Quick help appriciated.
Thanks!
Hi
Sometimes this also happens because of your desktop setting.Make sure that your OS also supports the JAPANESSE language.
Ask your technical support team to enable them in your desktop.
Thanks & Regards
Jyo
Similar Messages
-
Error in PDF Conversion while downloading file from application server
Hi,
I am facing a problem in which i have to download file from application server which is a PDF file (output of SAP Script). I am downloading this file using following code in BSP technology:
* event handler for data retrieval
EMPCD = REQUEST->GET_FORM_FIELD( 'emp' ).
MONTH = REQUEST->GET_FORM_FIELD( 'mn' ).
YEAR = REQUEST->GET_FORM_FIELD( 'yr' ).
W_IND = 'N' .
DATA : wa_zform16 type zform16.
DATA : file_path type string.
DATA : l_pdf_len type string.
DATA STR TYPE STRING.
DATA: OUTPUT TYPE STRING ,
L_XSTRING TYPE XSTRING ,
APP_TYPE TYPE STRING.
DATA: PDF_TABLE TYPE RCL_BAG_TLINE.
DATA PHY_NAME_OUT TYPE SAPB-SAPPFAD.
concatenate '/usr/sap/put/form16/' EMPCD '_' YEAR '.PDF' into file_path
*PHY_NAME_OUT = '/usr/sap/put/form16/01000200_2007.PDF'.
PHY_NAME_OUT = file_path.
OPEN DATASET PHY_NAME_OUT FOR INPUT IN TEXT MODE ENCODING default.
IF SY-SUBRC IS INITIAL.
DO.
READ DATASET PHY_NAME_OUT INTO STR.
IF SY-SUBRC IS INITIAL.
CONCATENATE
OUTPUT
STR
CL_ABAP_CHAR_UTILITIES=>CR_LF
INTO OUTPUT.
ELSE.
EXIT.
ENDIF.
ENDDO.
APP_TYPE = 'APPLICATION/PDF'.
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
TEXT = OUTPUT
MIMETYPE = 'APPLICATION/PDF'
* MIMETYPE = 'APPLICATION/PDF;charset=utf-16le'
IMPORTING
BUFFER = L_XSTRING.
CALL METHOD CL_BSP_UTILITY=>DOWNLOAD
EXPORTING
OBJECT_S = L_XSTRING
CONTENT_TYPE = APP_TYPE
CONTENT_DISPOSITION = 'attachment;filename=webforms.pdf'
RESPONSE = _M_RESPONSE
NAVIGATION = NAVIGATION.
Result of this code is : there is a pop up asking to open or save pdf format and process is complete, but i have problem in downloaded file.
At the time of creation i have put BMP image for signature in PDF file and it is working fine but when i upload that file in Application server and then download it with above used code it save the PDF file but when i open that file so whereever i have used signature that page gives error and could not display that scanned signature.
Can anyone please help me in this regard.
or is there any possibility from which i can download that file just like File transfer from BSP.
Keep in mind that i am using BSP technology so all GUI based function module to download file are not working.
waiting for your reply.....
Regards,
GaganHi Raja,
I have standard sap form for TDS Certificate on which i have include an BMP image for digital signature and download that script into pdf format.While i download that PDF looks ok but it is not working in BSP.
Regards,
Gagan -
While downloading file to application server its overwriting the earlier fi
hi if i am using below code with date time stamp the file is downloaded to the application server correctly and each time i execut eht program a difference file is generated as date time stamp differs each time but
whne i remove the date time stamp ie sy-datum and sy-uzeit as we dont need to display the date time stamp with the file each time i execute the program a file is generated but it overwrites the ealier existing file please suggest as each time it shoul generate a new file....
Concatenate file name sy-datum sy-uzeit '.txt' into v_datetimefile
file on Appplication Server is selected
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
CLIENT = SY-MANDT
logical_filename = 'ZFILE'Hi,
first of all decide you have to overwrite the existing file or you want to create the new, i think the answer is there in your query itself, if you want to create new then concatenate the date and time, else don't do that.
below are the additions we can use while opening the data set.
FOR INPUT
FOR OUTPUT
FOR APPENDING
IN BINARY MODE
IN TEXT MODE
AT POSITION p
TYPE ctrl
MESSAGE mess
FILTER f
Reward if useful.
Thanks,
Sreeram. -
Problem while uploading file from application server to internal tab in BG
Hi all,
When i see the file in application server.data is like this
#################00\);_(#####}#-#}###############################00\);_(#####}#-#}###############################00\);_(*#####}#-#}#########
###################}###}#############A#############???#00\);_(*#################;_(@_) ########???# ########???# ########???###
#######???#########}###}#############)##############}##00\);_(*#################;_(@_) ############ ############ ##############
###################}#A#}#############:##############}##00\);_(#################;_(@_) }###}##############################00\);_(*##########
#######???#########}#-#}#############F#################00\);_(#####}###}#############@#################00\);_(#################;_(@_) #####
###################}#-#}#############3#################00\);_(#####}#U#}#############E#################00\);_(#################;_(@_) #####
Because the csv which is uploaded has dropdowns and some formattings.
when download from tcode cg3y i am getting correct file
When try to use open(binary mode) and read dataset i getting data as it is (junk).
i need to process in background.
Any help.
Rhea.upload file to string format
begin of ty_tab,
string type char200,
end of ty_tab.
loop at ty_tab into string
use statement replace string into tab deliminated fromat(particular occurance in string)
now call class to break string at tab into fields
endloop.
DATA : BEGIN OF i_data OCCURS 0,
data(200) TYPE c, "To hold Upload file data
END OF i_data.
OPEN DATASET v_str FOR INPUT
IN TEXT MODE
ENCODING DEFAULT IGNORING CONVERSION ERRORS.
IF sy-subrc EQ 0.
DO.
*Read a line from input file
READ DATASET v_str INTO i_data-data.
IF sy-subrc NE 0.
EXIT.
ENDIF.
*Append record to an internal table
APPEND i_data.
CLEAR: i_data.
ENDDO.
*Close the file
CLOSE DATASET v_str.
*---Start of inserti
LOOP AT i_data.
REPLACE ALL OCCURRENCES OF '"' IN i_data WITH '#'.
SPLIT i_data AT cl_abap_char_utilities=>horizontal_tab
INTO i_doc-pvaudt
i_doc-pvpate
i_doc-vecatc
i_doc-vhvend
i_doc-vhidt8
i_doc-vhinvn
i_doc-vhhexp
i_doc-vhiref. -
Problem while downloading data from Application server.
Hi
I have create a file on the application server.
When i tried to download the file from application server into Excel file , all the fields in the file appear in the same column.
How can place the fields separately in different columns in the Excel.
Thanks
Subha
Edited by: subhacp on Sep 5, 2011 8:32 AMHi,
Try to use below function module where you need not to do anything new, just give path of the directory where you want to store on your workstation in the parameter I_FILE_FRONT_END and give path of your application server from where you want to pick file which is in .XLS format in the FM parameter I_FILE_APPL .
It will simply copy the file from Apllication server to your workstation in the same format and with the same characters.
CALL FUNCTION 'C13Z_FILE_DOWNLOAD_BINARY'
EXPORTING
I_FILE_FRONT_END = pr_down
I_FILE_APPL = l_w_file
I_FILE_OVERWRITE = 'X'
* IMPORTING
* E_FLG_OPEN_ERROR =
* E_OS_MESSAGE =
EXCEPTIONS
FE_FILE_OPEN_ERROR = 1
FE_FILE_EXISTS = 2
FE_FILE_WRITE_ERROR = 3
AP_NO_AUTHORITY = 4
AP_FILE_OPEN_ERROR = 5
AP_FILE_EMPTY = 6
OTHERS = 7
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Hope it will solve your query. -
Problem with Dataset While downloading file to Application server
Hi friends,
My report downloading some data to Application server in Unix Environment. When i am seeing that dataset, contents of the last field getting truncated. I specified length of the file which is greater than the record length, but still values are truncated. Its very urgent please send me the solution ASAP.
Thanks & Regrads,
Ramesh.Please provide me a solution
-
Problem in Downloading File from Application Server
Hi All,
We have an Requirement that, iam putting the Flat File
( Output Of a Report ) in to the
Application Server(AL11) By using the OpendataSet, Transer , Close DataSet.
When iam trying to Downloading the Flat File through the FM, GUI_DOWNLOAD, the Data is coming Correctly.
But the Problem is , when trying to Downloading through AL11 i.e System -> List -> Local File it is not coming Correctly.
( Java People is going to Connect with the Application Server for the Flat File )
Kindly Clarify the Problem.
Points will be Rewarded.
Regards,
Kiran.IHi nl,
1. this program will display
selection screen
and ask two things :
a) application server filename
b) local file name
2. then it will download the file
(the file name is CASE Sensitivie)
3. just try it (just copy paste )
*& Report YBCR_FILEDOWNLOAD *
REPORT ybcr_filedownload .
DATA
DATA : file_name TYPE string.
DATA : BEGIN OF itab OCCURS 0,
ln(255) TYPE c,
END OF itab.
SCREEN
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : appfn(150) TYPE c LOWER CASE OBLIGATORY.
PARAMETERS : p_file LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
OPEN DATASET appfn FOR INPUT IN TEXT MODE ENCODING DEFAULT .
IF sy-subrc <> 0.
MESSAGE s999(yhr) WITH 'COULD NOT OPEN FILE ON APP SERVER'.
LEAVE LIST-PROCESSING.
ENDIF.
DO.
READ DATASET appfn INTO itab.
IF sy-subrc = 0.
APPEND itab.
ELSE.
EXIT.
ENDIF.
ENDDO.
file_name = p_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = file_name
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = ' '
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
TABLES
data_tab = itab
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
regards,
amit m. -
Special characters downloading file into application server
Dear Friends,
i have to download records into excel sheet through back ground job, while downloading records into applications server.
all records are downloading properly up to here fine but some special characters also downloading. i had downloaded same records in debugging mode from the same internal table here no special characters.
i found that the structure(standard ( /SCWM/S_LIME_ALL_MON )) which is being used in that some fields are defined as RAW data type this may be the problem.but i tried to convert them using some function modules no result getting dump only.
i am using data sets to download data into application server here gui_download will not work because it is back ground job.
can any one please help me in this. its urgent...
please please help me in this it has been pending since DEC-01-11.
extra characters like ( #v#M?LQia#####
#v#M?LQia#####
#v#)
my code
open DATASET LV_FLNAM for OUTPUT in LEGACY BINARY MODE .
IF sy-subrc EQ C_ZERO.
LOOP AT LT_TAB INTO WA_TAB.
transfer WA_TAB to LV_FLNAM.
ENDLOOP.
CLOSE DATASET LV_FLNAM.
ENDIF.
Edited by: sairam.kusuma on Dec 16, 2011 6:26 AM
Edited by: sairam.kusuma on Dec 16, 2011 6:38 AM
Edited by: sairam.kusuma on Dec 16, 2011 6:39 AMTYPES:BEGIN OF ty_stru,
LGTYP TYPE /SCWM/LGTYP,
LGPLA TYPE /SCWM/LGPLA,
MATNR TYPE /SCWM/DE_MATNR,
MAKTX TYPE /SCWM/DE_UI_MAKTX,
QUAN(13) TYPE C,"/SCWM/DE_UI_QUAN,
UNIT TYPE /SCWM/DE_BASE_UOM,
CAT TYPE /SCWM/DE_CAT,
CAT_TXT TYPE /SCWM/DE_CAT_TXT,
CHARG TYPE /SCWM/DE_CHARG,
OWNER TYPE /LIME/OWNER,
ENTITLED TYPE /SCWM/DE_ENTITLED,
UI_WDATT TYPE /SCWM/DE_UI_WDATT,
UI_WDATU TYPE /SCWM/DE_UI_WDATU,
SKZSI TYPE /SCWM/LQUA_SKZSI,
QUANA(13) TYPE C,"/SCWM/DE_UI_QUAN_PACKED,
ALTME TYPE /SCWM/DE_AUNIT,
ITMNO TYPE /SCDL/DL_ITEMNO,
WEIGHT(15) TYPE C,"/SCWM/DE_NWEIGHT,
UNIT_W TYPE /SCWM/DE_WGT_UOM,
VOLUM(15) TYPE C,"/SCWM/DE_NVOLUME,
UNIT_V TYPE /SCWM/DE_VOL_UOM,
CAPA(15) TYPE C,"/SCWM/DE_CAPAUSE,
SN_STOCK TYPE /SCWM/DE_SER_STOCK,
END OF ty_stru.
DATA: LV_LGNUM TYPE /SCWM/LGNUM VALUE 'R10',
LV_FLNAM TYPE rlgrap-filename VALUE '/tmp/RAMA.xls'.
CONSTANTS: C_ZERO TYPE I VALUE '0'.
DATA: LT_TAB TYPE STANDARD TABLE OF /SCWM/S_LIME_ALL_MON,
WA_TAB TYPE /SCWM/S_LIME_ALL_MON,
i_stru TYPE STANDARD TABLE OF ty_stru,"
wa_stru TYPE ty_stru.
REFRESH LT_TAB.
CLEAR: WA_TAB.
*this is modified function module from /SCWM/S_LIME_ALL_MON
CALL FUNCTION 'ZEWM_F_PHYSICAL_INVENTORY_STOC'
EXPORTING
IV_LGNUM = LV_LGNUM
IV_VARIANT =
IV_MODE = '1'
IT_DATA_PARENT =
IMPORTING
ET_DATA = LT_TAB
EV_RETURNCODE =
EV_VARIANT =
CHANGING
CT_TAB_RANGE =
i have to download what are the fields defined as structure.
1)when ever i am using the internal table(LT_TAB) to download getting specials characters(####) with all records for the fields QUAN, QUANA, WEGHT,VOLUM and CAPA.
open DATASET LV_FLNAM for OUTPUT in LEGACY BINARY MODE .
IF sy-subrc EQ C_ZERO.
CLEAR: WA_stru,
wa_tab.
LOOP AT LT_TAB INTO WA_TAB.
transfer WA_TAB to LV_FLNAM.
CLEAR: WA_TAB.
ENDLOOP.
CLOSE DATASET LV_FLNAM.
ENDIF.
2)if i take another internal table with converting them as char file is downloading with out special characters but it is downloading single line only but not the hole data.
if i have the below code getting only single line records not total records without special characters.
open DATASET LV_FLNAM for OUTPUT in LEGACY BINARY MODE .
IF sy-subrc EQ C_ZERO.
CLEAR: WA_stru,
wa_tab.
LOOP AT LT_TAB INTO WA_TAB.
wa_stru-LGTYP = wa_tab-LGTYP.
wa_stru-LGPLA = wa_tab-LGPLA.
wa_stru-MATNR = wa_tab-MATNR.
wa_stru-MAKTX = wa_tab-MAKTX.
wa_stru-QUAN = wa_tab-QUAN.
wa_stru-UNIT = wa_tab-UNIT.
wa_stru-CAT = wa_tab-CAT.
wa_stru-CAT_TXT = wa_tab-CAT_TXT.
wa_stru-CHARG = wa_tab-CHARG.
wa_stru-OWNER = wa_tab-OWNER.
wa_stru-ENTITLED = wa_tab-ENTITLED.
wa_stru-UI_WDATT = wa_tab-UI_WDATT.
wa_stru-UI_WDATU = wa_tab-UI_WDATU.
wa_stru-SKZSI = wa_tab-SKZSI.
wa_stru-QUANA = wa_tab-QUANA.
wa_stru-ALTME = wa_tab-ALTME.
wa_stru-ITMNO = wa_tab-ITMNO.
wa_stru-WEIGHT = wa_tab-WEIGHT.
wa_stru-UNIT_W = wa_tab-UNIT_W.
wa_stru-VOLUM = wa_tab-VOLUM.
wa_stru-UNIT_V = wa_tab-UNIT_V.
wa_stru-CAPA = wa_tab-CAPA.
wa_stru-SN_STOCK = wa_tab-SN_STOCK.
transfer WA_stru to LV_FLNAM.
CLEAR: WA_stru.
ENDLOOP.
CLOSE DATASET LV_FLNAM.
ENDIF. -
Downloading file from application server to presentation server
Hi,
We have a requirment to download file from application server to presentation server. The problem is while down loading, some of the filds showing some junk values. Instead of that junk values we have some Russian texts there. These Russian texts only coming as junk all other data is correct. The file in the appplication server is in .dbf format. We are downloading using WS_DOWNLOAD. file type is BIN and code page we didn't specified.
Thanks in Advance
Jijeesh.P.G
Message was edited by: Jijeesh.P.G
Jijeesh P Ghi jijeesh,
Welcome to SDN.
u can use to download file from application server to presentation server using the t/c CG3Y. in that it will ask the source file path and the target file path.
if u want to find the source file path in the application server, u can use the transaction AL11 to find that one.
Regards....
Arun.
Reward points if useful. -
Error occurred while downloading files from Administration Server...
Hi guys,
If i already have my application deployed and exploded in ../tmp/_WL_user , when I restart the managed server it will try to download again the files from the upload directory in the Administration Servers? (I'm using stage mode).
Sometimes I got the following error:
Caused By: java.io.IOException: [DeploymentService:290066]Error occurred while downloading files from Administration Server for deployment request "0". Underlying error is: "null"
and I already have the war exploded in /tmp/_WL_user
the staging mode is not only for the first deployment? when i don't have the war exploded in /tmp/_WL_user?
I've some confusion related to the process or deployment/startup of the managed servers.
ThanksHi,
when you get following error * DeploymentService:290066 * then that means
A service on the machine is preventing the WebLogic Server remote instance from downloading the configuration file. This can be Hosts Intrusion Prevention (HIPS) agents or any other agent causing this issue.
Disable the agent interfering with the download process to fix this issue.
Regards,
Kal -
How to download file from application server
Hi Experts,
I developed report and execute in background mode. for this i used Open dataset transfer and close dataset . i got the requried output . But in this case user want downloaded file on presentation server so can anyone tell me How to download file from application server?
i know it is possible through Tcode CG3Y. but i want code in program.This code will download a file to your Client package by package, so it will also work for huge files.
*& Report ZBI_DOWNLOAD_APPSERVER_FILE
REPORT zbi_download_appserver_file.
PARAMETERS: lv_as_fn TYPE sapb-sappfad
DEFAULT '/usr/sap/WBP/DVEBMGS00/work/ZBSPL_R01.CSV'.
PARAMETERS: lv_cl_fn TYPE string
DEFAULT 'C:\Users\atsvioli\Desktop\Budget Backups\ZBSPL_R01.CSV'.
START-OF-SELECTION.
CONSTANTS blocksize TYPE i VALUE 524287.
CONSTANTS packagesize TYPE i VALUE 8.
TYPES ty_datablock(blocksize) TYPE x.
DATA lv_fil TYPE epsf-epsfilnam.
DATA lv_dir TYPE epsf-epsdirnam.
DATA ls_data TYPE ty_datablock.
DATA lt_data TYPE STANDARD TABLE OF ty_datablock.
DATA lv_block_len TYPE i.
DATA lv_package_len TYPE i.
DATA lv_subrc TYPE sy-subrc.
DATA lv_msgv1 LIKE sy-msgv1.
DATA lv_processed_so_far TYPE p.
DATA lv_append TYPE c.
DATA lv_status TYPE string.
DATA lv_filesize TYPE p.
DATA lv_percent TYPE i.
"Determine size
SPLIT lv_as_fn AT '/' INTO lv_dir lv_fil.
CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'
EXPORTING
file_name = lv_fil
dir_name = lv_dir
IMPORTING
file_size_long = lv_filesize.
"Open the file on application server
OPEN DATASET lv_as_fn FOR INPUT IN BINARY MODE MESSAGE lv_msgv1.
IF sy-subrc <> 0.
MESSAGE e048(cms) WITH lv_as_fn lv_msgv1 RAISING file_read_error.
EXIT.
ENDIF.
lv_processed_so_far = 0.
DO.
REFRESH lt_data.
lv_package_len = 0.
DO packagesize TIMES.
CLEAR ls_data.
CLEAR lv_block_len.
READ DATASET lv_as_fn INTO ls_data MAXIMUM LENGTH blocksize LENGTH lv_block_len.
lv_subrc = sy-subrc.
IF lv_block_len > 0.
lv_package_len = lv_package_len + lv_block_len.
APPEND ls_data TO lt_data.
ENDIF.
"End of file
IF lv_subrc <> 0.
EXIT.
ENDIF.
ENDDO.
IF lv_package_len > 0.
"Put file to client
IF lv_processed_so_far = 0.
lv_append = ' '.
ELSE.
lv_append = 'X'.
ENDIF.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = lv_package_len
filename = lv_cl_fn
filetype = 'BIN'
append = lv_append
show_transfer_status = abap_false
TABLES
data_tab = lt_data.
lv_processed_so_far = lv_processed_so_far + lv_package_len.
"Status display
lv_percent = lv_processed_so_far * 100 / lv_filesize.
lv_status = |{ lv_percent }% - { lv_processed_so_far } bytes downloaded of { lv_filesize }|.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING "percentage = lv_percent - will make it fash
text = lv_status.
ENDIF.
"End of file
IF lv_subrc <> 0.
EXIT.
ENDIF.
ENDDO.
"Close the file on application server
CLOSE DATASET lv_as_fn. -
I want to put header while stroing file in application server
Hi Guru,
Can anybody tell how to put header while stroing file in application server.
in the below pgm data is coming i want to put heading .if we see in al11 transaction the header should come .plese give on eg in the code itself.its urgent
eg:
material number
100
200
declarations...................................................
tables: bkpf. " Accounting Document Header
*"Selection screen elements............................................
parameters:
p_burks like bkpf-bukrs. " Company Code
select-options:
s_gjahr for bkpf-gjahr. " Fiscal year
Type declaration of the structure to hold Accounting Document Header*
data:
begin of fs_bkpf,
bukrs type bkpf-bukrs, " Company Code
belnr type bkpf-belnr, " Accounting Document Number
gjahr type bkpf-gjahr, " Fiscal year
blart type bkpf-blart, " Document type
bldat type bkpf-bldat, " Document date in document
end of fs_bkpf.
Internal table to hold Accounting Document Header *
data:
t_bkpf like standard table
of fs_bkpf.
Type declaration of the structure to hold file data *
data:
begin of fs_table,
str type string,
end of fs_table.
Internal table to hold file data *
data:
t_table like standard table
of fs_table.
field-symbols: <fs>.
*" Data declarations...................................................
Work variables *
data:
w_char(50) type c,
w_file_name(50) type c value 'YH645_050103'.
select bukrs " Company Code
belnr " Accounting Document Number
gjahr " Fiscal year
blart " Document type
bldat " Document date in document
from bkpf
into table t_bkpf
where bukrs eq p_burks
and gjahr in s_gjahr.
if sy-subrc eq 0.
loop at t_bkpf into fs_bkpf.
do.
assign component sy-index of structure fs_bkpf to <fs>.
if sy-subrc ne 0.
exit.
else.
move <fs> to w_char.
if sy-index eq 1.
fs_table-str = <fs>.
else.
concatenate fs_table-str ',' w_char into fs_table-str.
endif. " IF SY-INDEX...
endif. " IF SY-SUBRC...
enddo. " DO...
append fs_table to t_table.
endloop. " LOOP AT T_KNA1...
endif. " IF SY-SUBRC...
open dataset w_file_name for output in text mode encoding default.
loop at t_table into fs_table.
transfer fs_table-str to w_file_name.
endloop. " LOOP AT T_TABLE...Hi,
may i know what kind of heading you want to display?
like date, filename, time etc
then modify the below code:
*& Form send_statistic
Create the status Report on application Server
---> pv_rlines - Total No of Records in Internal table *
---> pv_slines - Total No of Successful records *
---> pv_elines - Total No of Errornous records *
---> pv_path - File Path where the file to be created *
---> pv_flag - Flag to check for A/c group *
FORM sub_send_statistic USING pv_rlines TYPE int4
pv_slines TYPE int4
pv_elines TYPE int4
pv_path TYPE salfile-longname
pv_name TYPE rlgrap-filename
pv_flag TYPE char1.
CLEAR : i_tab,
wa_tab.
Convert date to MM/DD/YYYY format
PERFORM date_convert.
Convert Time to HH:MM:SS format
CONCATENATE sy-uzeit+0(2)
c_colon
sy-uzeit+2(2)
c_colon
sy-uzeit+4(2)
INTO v_time1.
Build the Output File name
IF p_sold = c_x
AND pv_flag = c_x.
CONCATENATE c_objid
c_us
c_z001
c_us
sy-datum
c_us
sy-uzeit
INTO v_file.
ENDIF. " IF p_sold = c_x
IF p_cons = c_x.
CONCATENATE c_objid
c_us
c_z008
c_us
sy-datum
c_us
sy-uzeit
INTO v_file.
ELSEIF p_sold = c_x
AND pv_flag <> c_x.
CONCATENATE c_objid
c_us
sy-datum
c_us
sy-uzeit
INTO v_file.
ENDIF. " IF p_cons = c_x
Build the Complete Output File Path
CONCATENATE pv_path
c_slash
v_file
INTO v_outfile.
Populate the data required for output into an internal table and
then transfer the table contents to file on application server
DATA UPLOAD STATISTICS
wa_tab-rec = text-001.
APPEND wa_tab TO i_tab.
CLEAR wa_tab.
TITLE
IF p_sold = c_x
AND pv_flag <> c_x.
sy-title = text-t17.
ENDIF. " IF p_sold = c_x
IF p_sold = c_x
AND pv_flag = c_x.
sy-title = text-t16.
ENDIF. " IF p_sold = c_x
IF p_cons = c_x
AND pv_flag = c_x.
sy-title = text-t19.
ENDIF. " IF p_cons = c_x
wa_tab-rec+0(7) = text-002.
wa_tab-rec+7(60) = sy-title.
APPEND wa_tab TO i_tab.
CLEAR wa_tab.
Date & Time
wa_tab-rec+0(5) = text-012.
CONDENSE v_date NO-GAPS.
wa_tab-rec+6(10) = v_date.
wa_tab-rec+60(10) = text-003.
wa_tab-rec+70(15) = v_time1.
APPEND wa_tab TO i_tab.
CLEAR wa_tab.
Folder Name
wa_tab-rec+0(18) = text-005.
wa_tab-rec+19(72) = pv_path.
APPEND wa_tab TO i_tab.
CLEAR wa_tab.
File Name
wa_tab-rec+0(18) = text-006.
---Begin of addition -Shivakumar - 09-05-2007--
wa_tab-rec+19(72) = pv_name.
---Begin of addition -Shivakumar - 09-05-2007--
APPEND wa_tab TO i_tab.
CLEAR wa_tab.
Records Read
CLEAR v_count.
v_data = pv_rlines.
v_count = STRLEN( v_data ).
CONDENSE v_data NO-GAPS.
wa_tab-rec+0(46) = text-007.
wa_tab-rec+47(4) = v_data.
APPEND wa_tab TO i_tab.
CLEAR : wa_tab,
v_data.
Successfull Records
CLEAR v_count.
v_data = pv_slines.
v_count = STRLEN( v_data ).
CONDENSE v_data NO-GAPS.
wa_tab-rec+0(46) = text-008.
wa_tab-rec+47(4) = v_data.
APPEND wa_tab TO i_tab.
CLEAR : wa_tab,
v_data.
Error Records
CLEAR v_count.
v_data = pv_elines.
v_count = STRLEN( v_data ).
CONDENSE v_data NO-GAPS.
wa_tab-rec+0(46) = text-009.
wa_tab-rec+47(4) = v_data.
APPEND wa_tab TO i_tab.
CLEAR : wa_tab,
v_data.
v_mesg = text-t04.
IF p_sold = c_x
AND pv_flag <> c_x.
MOVE i_tab TO i_file.
ENDIF. " IF p_sold = c_x
IF p_sold = c_x
AND pv_flag = c_x.
MOVE i_tab TO i_file1.
ENDIF. " IF p_sold = c_x
IF NOT i_tab IS INITIAL.
Open the file on Application server to write the report
OPEN DATASET v_outfile
FOR OUTPUT IN TEXT MODE
ENCODING DEFAULT MESSAGE v_mesg.
IF sy-subrc <> 0.
MESSAGE e000(zconversions) WITH v_mesg.
ELSE. " IF sy-subrc <> 0
Transfer details to the file on application server
CLEAR wa_tab.
LOOP AT i_tab INTO wa_tab.
TRANSFER wa_tab-rec TO v_outfile.
CLEAR wa_tab.
ENDLOOP. " LOOP AT i_tab INTO wa_tab
Close the file
CLOSE DATASET v_outfile.
ENDIF. " IF sy-subrc <> 0
ENDIF. " IF NOT i_tab IS INITIAL
ENDFORM. " Create_Report -
Downloading file to application server
Hi,
I have requirement of downlaoding some (.doc,.xls,.txt,.ppt) files into application server from sap r/3,the file will be picked by some other 3rd party application.
I was able to achieve it using OPEN DATA SET and TRANSFER,but the data gets encrytped and the actual file is not copied to application server.(example if its .doc file the same file data should be copied to app server and not the encrypted file data like 5%%#.......6234726&&%212).
The encrypted file again displays like exact file as its uploaded when downloaded from app server.
But the file in app server is encrypted,my requirement is to copy the exact file to app server.
This encryption is happening when is OPEN DATA SET and TRANSFER,even the FM ARCHIVFILE_CLIENT_TO_SERVER is also using OPEN DATA SET and TRANSFER only.
Please suggest me any other way to move file to app server other than OPEN DATA SET and TRANSFER.
Thanks,
Phani.Hi,
If you are downloading the file from application server, you have to use OPEN DATASET CLOSE DATASET.
I think you are making some mistake in your code.
Refer to my code below and let me know if you have any doubt.
*& Form APL_DOWNLOAD
DOWNLOADING FILE TO APPLICATION SERVER.
FORM apl_download .
IF NOT i_output[] IS INITIAL.
IF NOT p_pathdl is initial.
IF v_flag <> c_chk. "IF search help was not called.
CLEAR: v_filename,
v_path.
Building File Name.
CONCATENATE c_mf018
v_date
v_time
c_extn
INTO v_filename.
Conactenating File Name and File Path for Dataset parameter.
CONCATENATE p_pathdl
c_slash
v_filename
INTO v_path.
ELSE. "IF search help was called.
v_path = p_pathdl.
ENDIF.
Local Data Declaration.
DATA v_string TYPE string.
Creating a file of given name at given path on apllication server.
OPEN DATASET v_path FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc = 0.
Building header and transfering it to the file.
CONCATENATE text-004 c_sep text-005 c_sep text-006 c_sep
text-007 c_sep text-008 c_sep text-009 c_sep
text-010 c_sep text-011 c_sep text-012 c_sep
text-013 c_sep text-014 c_sep text-015 c_sep
INTO v_string.
TRANSFER v_string TO v_path.
CLEAR v_string.
Reading data from internal table & transfering to file.
LOOP AT i_output INTO w_output.
CONCATENATE w_output-lifnr c_sep w_output-banksrec c_sep
w_output-bankkrec c_sep w_output-banknrec c_sep
w_output-waers c_sep w_output-bankssnd c_sep
w_output-bankksnd c_sep w_output-chainno c_sep
w_output-chainbankt c_sep w_output-chainbanks c_sep
w_output-chainbankk c_sep w_output-chainbankn
INTO v_string.
TRANSFER v_string TO v_path.
CLEAR: v_string,
w_output.
ENDLOOP.
ELSE.
MESSAGE i000 WITH text-040.
EXIT.
ENDIF.
MESSAGE i000 WITH text-038 v_path.
ELSE.
MESSAGE i000 WITH text-048.
ENDIF.
ELSE.
MESSAGE i000 WITH text-041.
ENDIF.
ENDFORM. " APL_DOWNLOAD -
Background Job - Requirement to download file to application server
Dear All,
If I want to execute one function module in background and the FM is downloading file to application server, the FM is not downloading file to application server. Can you please suggest whether it is possible to download file to application server when it is in background mode? I know it is not possible to download file to presentation server.
Thanks and regards,
AtanuHi,
Yes, it is possible to download a file to application server in background mode. check the path ur sepcifying to the Function module to download the file...in T-Code AL11 check if the path exits.
reward if helpful
Regards,
Rahul -
Problem Reading Flat File from Application server
Hi All,
I want to upload a Flat File which is having a Line Length of 3000.
While uploading it to Application server , only upto 555 length it is getting uploaded .
i am using the code :
DATA: BEGIN OF TB_DATA OCCURS 0,
LINE(3000),
END OF TB_DATA.
*----Uploading the flat file from the Local drive using FM "UPLOAD".
OPEN DATASET TB_FILENAM-DATA FOR OUTPUT IN TEXT MODE." ENCODING DEFAULT.
IF SY-SUBRC NE 0.
WRITE:/ 'Unable to open file:', TB_FILENAM-DATA.
ELSE.
LOOP AT TB_DATA.
TRANSFER TB_DATA TO TB_FILENAM-DATA.
ENDLOOP.
ENDIF.
CLOSE DATASET TB_FILENAM-DATA.
What could be the problem?
Could it be due to any Configuration Problem?
Waiting for your replies.
Thanks and Regards.
SukiYour code looks OK, but you may have touble displaying the full width. Try:
WRITE: /001 TB_FILENAM-DATA+555.
(And don't forget to append your ITAB after each read.)
Rob
Maybe you are looking for
-
Additional Attachment in EMail-Adapter
I would like to build a pdf from an XML-File, that i have attached to the email. I build an conversion routine which build from the xml-File the pdf. This works probably correct. But what is the favourite way to attach a second attachment to the emai
-
I recently upgraded to IE10 on my Windows 7 machine on our network, however IE seems to ignore the PAC file. It works on other machines which are running IE9, just not IE10. I also have a Windows 8 machine with IE10 and it doesn't seem to work either
-
Sorry, reposting under new topic as I posted earlier in wrong thread. My problem is Safari automatically deletes first portions of legitimate website addresses and then I get an error message that Safari cannot find the server. For example i type in
-
Help creating Time Tracking spreadsheet in Numbers
I need to create a spreadsheet to calculate time spent on each of my tasks at work. Can you help me? WHat formulas would I need to use to calculate the time between the start time and finish time? and what would I need to put into the start and finis
-
RSA VPN on 10.4.10
I'm trying to use the built in VPN software with the mac. My company uses RSA Secur-ID as authentication. I'm able to log in just fine, can connect to our exchange servers, but I'm not able to browse the web. We have no restrictions in place, ( I was