File from application server -Read and process and delete the file .
Hi All,
I writing a ZEE program which will read the file from application server(file will be in text delimat format) and moving the data to internal table and uploadind data base.The part which iam facing problem is -
> I hve read the file from application server like below ,
OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
EXIT.
ELSE.
DO.
CLEAR: wa_string, wa_uploadtxt.
READ DATASET ld_file INTO wa_string.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
wa_uploadtxt-name2
wa_uploadtxt-age.
Spliting part i having problem .i need to seperate each field which is seperate from tab delimite and pass it into respective fields of internal table .
Second if another file come to the appicaltion server , wether my first file will be there ? or should i need to delete the first file after redaing how should i proceed further ?.
Regards
SRIRAM...
THANKS In ADVANCE
HI,
1.
OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
EXIT.
ELSE.
DO.
CLEAR: wa_string, wa_uploadtxt.
READ DATASET ld_file INTO wa_string.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT wa_string AT cl_abap_char_utilities=>horizontal_tab INTO wa_uploadtxt-name1
wa_uploadtxt-name2
wa_uploadtxt-age.
APPEND wa_uploadtxt TO itab.
ENDDO.
CLOSE DATASET ld_file.
ENDIF.
2. If the another file get's generated in the application server with same file name then the data in old file get's over written with the new data. You are not required to delete the file.
Similar Messages
-
Application to Read and Write the Configuration Data from a xml file
Hi,
I have to develop a Webdynpro application that will do the following:
Read the Configuration data from an xml file
If stored in a file , and the file is not found, prompt the user to provide the file location.
Pre-Populate the screen(table) with the configuration data
Allow the user to edit the data
Store the configuration data when the user hits the Save button
The config xml file details are as follows:
Regardless of the location of the configuration data, the following fields will be stored
Application (string) will always contain u201CSFA_EDOCSu201D
Key (string) eg LDAP_USER, DB_PREFIX, etc.
Type (character) u201CPu201D = Plain Text, u201CEu201D = Encrypted
Value (string)
Since I am new to WD, I would require help on this.
Please help.Its Urgent.
Regards,
Vaishali.
Edited by: vaishali dhayalan on Sep 19, 2008 8:29 AMHi,
I have to develop a Webdynpro application that will do the following:
Read the Configuration data from an xml file
If stored in a file , and the file is not found, prompt the user to provide the file location.
Pre-Populate the screen(table) with the configuration data
Allow the user to edit the data
Store the configuration data when the user hits the Save button
The config xml file details are as follows:
Regardless of the location of the configuration data, the following fields will be stored
Application (string) will always contain u201CSFA_EDOCSu201D
Key (string) eg LDAP_USER, DB_PREFIX, etc.
Type (character) u201CPu201D = Plain Text, u201CEu201D = Encrypted
Value (string)
Since I am new to WD, I would require help on this.
Please help.Its Urgent.
Regards,
Vaishali.
Edited by: vaishali dhayalan on Sep 19, 2008 8:29 AM -
Transfer a xml file from application server to another server using FTP
Hi experts,
I am stuck in this situtaion.
My interface generates a xml file on an application server.
Now i need to read the xml file generated and transfer it to another system using FTP.
I can use READ DATASET to read the file from the application server.
And use the below function modules to transfer it to another system
HTTP_SCRAMBLE.
FTP_CONNECT
CONCATENATE 'put' src_file_dest into variable.
FTP_COMMAND with command = variable.
FTP_DISCONNECT.
Now my question is:
- Is it correct????
- I am getting an cerror = 3 while using FTP_CONNECT. is it an authorization issue???
if yes, what is the issue???
- How to connect the file read from READ DATASET to the FTP Function Modules ????
Thanks and Regards
Gaurav RaghavTry the following set of FTP commands..
This code gets the file (NOT the content) from the server and sends it to the FTP.
*********start send file to FTP********************
* FTP commands : 1. ascii
* 2. cd
* 3. lcd
* 4. put
call function 'HTTP_SCRAMBLE'
exporting
source = x_pwd
sourcelen = dstlen
key = key
importing
destination = destin.
clear pass.
pass = destin.
call function 'FTP_CONNECT'
exporting
user = x_user
* PASSWORD = X_PWD
password = pass
host = x_host
rfc_destination = x_dest
importing
handle = hdl.
* COMMAND ascii -->
refresh : x_result.
call function 'FTP_COMMAND'
exporting
handle = hdl
command = cmd_ascii
compress = compress
tables
data = x_result
exceptions
command_error = 1
tcpip_error = 2.
*command cd SAP\ -->
split x_file at '\' into dummy ftp_file.
concatenate x_cmd1 dummy into dummy2 separated by space.
concatenate dummy2 '\' into cmd_cd.
refresh : x_result.
call function 'FTP_COMMAND'
exporting
handle = hdl
command = cmd_cd
compress = compress
tables
data = x_result
exceptions
command_error = 1
tcpip_error = 2.
constants: winslash(1) value '\',
unixslash(1) value '/'.
call 'C_SAPGPARAM' id 'NAME' field 'DIR_HOME'
id 'VALUE' field tempdir.
* command lcd SERVER\usr\....\DIR_HOME --?
concatenate 'lcd' tempdir into cmd_lcd separated by space.
refresh : x_result.
call function 'FTP_COMMAND'
exporting
handle = hdl
command = cmd_lcd
compress = compress
tables
data = x_result
exceptions
command_error = 1
tcpip_error = 2.
* COMMAND put file -->
concatenate 'put' ftp_file into cmd_put separated by space.
refresh : x_result.
call function 'FTP_COMMAND'
exporting
handle = hdl
command = cmd_put
compress = compress
tables
data = x_result
exceptions
command_error = 1
tcpip_error = 2.
* command ls -->
refresh : x_result.
call function 'FTP_COMMAND'
exporting
handle = hdl
command = cmd2
compress = compress
tables
data = x_result
exceptions
command_error = 1
tcpip_error = 2.
call function 'FTP_DISCONNECT'
exporting
handle = hdl.
******* end send file to FTP*****
Edited by: Iria Koutsogianni on Jan 19, 2009 11:50 AM -
Read xml filr from application server
Hi I want to read an XML file from application server. can anyone please give me the sample code?
Please its very urgent,
ThanksHello
The following sample report <b>ZUS_SDN_BCCIIXMLT2</b> (modified from BCCIIXMLT2) shows how to upload an XML file from the application server.
If the structure of the XML is according to the structure of a DDIC structure then you can directly convert the XML into the DDIC record using the transformation ID (= identical) which is used to convert ABAP to XML and vice versa.
* BCCIIXMLT2 - sample program
* This sample program shows how to read an XML document from a file
* in the appserver's file system, parse the document into a DOM
* representation and display the content as a list.
* Additionally the DOM representation is rendered back into an XML
* stream and stored as an output XML file on the appserver machine.
* This sample program uses ABAP strings to represent the XML input
* and output streams. See BCCIIXMLT1 for using internal tables.
REPORT zus_sdn_bcciixmlt2 MESSAGE-ID bcciixmlt3_msg LINE-SIZE 1000.
DATA:
gd_rc TYPE sysubrc,
go_doc TYPE REF TO cl_xml_document.
START-OF-SELECTION.
PARAMETERS: filename(80) TYPE c
DEFAULT 'tempIDoc_430040.xml'. "#EC NOTEXT
*-- read the XML document from a dataset into a string
DATA: inputstring TYPE xstring.
OPEN DATASET filename FOR INPUT IN BINARY MODE.
IF sy-subrc NE 0.
MESSAGE e000.
ENDIF.
READ DATASET filename INTO inputstring.
CLOSE DATASET filename.
CREATE OBJECT go_doc.
CALL METHOD go_doc->parse_xstring
EXPORTING
stream = inputstring
RECEIVING
retcode = gd_rc.
CALL METHOD go_doc->display
* EXPORTING
* WITH_BDN = SPACE
*-- create the main factory
DATA: pixml TYPE REF TO if_ixml.
pixml = cl_ixml=>create( ).
*-- create the initial document
DATA: pdocument TYPE REF TO if_ixml_document.
pdocument = pixml->create_document( ).
*-- create the stream factory
DATA: pstreamfactory TYPE REF TO if_ixml_stream_factory.
pstreamfactory = pixml->create_stream_factory( ).
*-- create a stream for the input (string)
DATA: pistream TYPE REF TO if_ixml_istream.
pistream = pstreamfactory->create_istream_xstring( inputstring ).
*-- create the parser
DATA: pparser TYPE REF TO if_ixml_parser.
pparser = pixml->create_parser( stream_factory = pstreamfactory
istream = pistream
document = pdocument ).
*-- parse the stream
IF pparser->parse( ) NE 0.
IF pparser->num_errors( ) NE 0.
DATA: count TYPE i.
count = pparser->num_errors( ).
WRITE: count, ' parse errors have occured:'. "#EC NOTEXT
DATA: pparseerror TYPE REF TO if_ixml_parse_error,
i TYPE i.
DATA: index TYPE i VALUE 0.
WHILE index < count.
pparseerror = pparser->get_error( index = index ).
i = pparseerror->get_line( ).
WRITE: 'line: ', i. "#EC NOTEXT
i = pparseerror->get_column( ).
WRITE: 'column: ', i. "#EC NOTEXT
DATA: string TYPE string.
string = pparseerror->get_reason( ).
WRITE: string.
index = index + 1.
ENDWHILE.
ENDIF.
ENDIF.
*-- we don't need the stream any more, so let's close it...
CLEAR pistream.
*-- just for fun: render the DOM back into an output stream/xstring
DATA: postream TYPE REF TO if_ixml_ostream,
outputstring TYPE xstring.
postream = pstreamfactory->create_ostream_xstring( outputstring ).
CALL METHOD pdocument->render( ostream = postream ).
*-- write the XML document as a dataset
DATA: dsn(80) TYPE c.
CONCATENATE filename '.out' INTO dsn. "#EC NOTEXT
OPEN DATASET dsn FOR OUTPUT IN BINARY MODE.
TRANSFER outputstring TO dsn.
CLOSE DATASET dsn.
*-- print the whole DOM tree as a list...
DATA: pnode TYPE REF TO if_ixml_node.
pnode = pdocument.
PERFORM print_node USING pnode.
* FORM print_node *
FORM print_node USING value(pnode) TYPE REF TO if_ixml_node.
DATA: indent TYPE i.
DATA: ptext TYPE REF TO if_ixml_text.
DATA: string TYPE string.
indent = pnode->get_height( ) * 2.
CASE pnode->get_type( ).
WHEN if_ixml_node=>co_node_element.
string = pnode->get_name( ).
WRITE: AT /indent '<', string, '> '. "#EC NOTEXT
WHEN if_ixml_node=>co_node_text.
ptext ?= pnode.
IF ptext->ws_only( ) IS INITIAL.
string = pnode->get_value( ).
WRITE: AT /indent string.
ENDIF.
ENDCASE.
pnode = pnode->get_first_child( ).
WHILE NOT pnode IS INITIAL.
PERFORM print_node USING pnode.
pnode = pnode->get_next( ).
ENDWHILE.
ENDFORM. "print_node
Regards
Uwe -
How to delete a file from application server?
Hi gurus,
i want delete a file from application server . can any one tell me the BAPI/Fm .
thanks in advanceSee the replies of the thread;
How to delete File from the Application Server,ABAP
But i can smell something fishy in both The specified item was not found. and The specified item was not found. style of posting questions. Also both of you have similar questions in your profile....
Hmmm, Mods have to take care of the Rest...
Regards
Karthik D -
Deleting file from application server
can any one tell me how to delete file from application server?
Hi,
Use statement
delete dataset 'tmpfile.txt'.
\tmp\file.txt is the file path on application server which you want to delete.
Regards
Sailaja. -
How to Upload Smartforms from Application Server
Hi Guys,
I have to upload the SMARTFORMS in to the System.That can be done as follows:
1- Tcode - Smartforms
2- Utilities -> Upload form
3- Give form Name
4- Give path of Form on presentation server and upload.
But I have to give the path of Form from the Application Server. As i have all the forms to be uploaed in New system on the Application Server.
I will be writing the program to program to read XML file(smartform) from application server to internal table and then upload it in the System.
Please let me know if it is possible to upload Smartforms from Application Server?
Regards
SandeepVinod,
Thanks for the reply.
But Actually I want to Automate this process of Uploading the Smartforms.
So I want to directly upload it from Application server.
As it is not possible to upload the Smartforms from Presentation Server Automatically.
In this human Intervention will be required. -
Uploading and reading file from application server
Hi
My problem is when am uploading a file to application server it is getting stored in
usr/sap/transyp1/prod/in directory
after that i want to read that file from application server to update database
when using below code it is showing some other directory in f4 help
DATA: lv_hostname TYPE msxxlist-name.
DATA: lv_server TYPE bank_dte_jc_servername.
PARAMETERS: p_file TYPE rlgrap-filename.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'BANK_API_SYS_GET_CURR_SERVER'
IMPORTING
e_server = lv_server.
lv_hostname = lv_server.
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = 'P_FILE'
dyname = sy-cprog
dynumb = '1000'
filetype = 'P'
location = 'A'
server = lv_hostname.
experts could you please help me out
Thanks & Regards
Nagesh.ParuchuriUser Transaction file. You will get all logical file path names.
used following fucntion module to read file name and use command open dataset to read the file.
CALL FUNCTION 'FILE_GET_NAME'
EXPORTING
CLIENT = SY-MANDT
LOGICAL_FILENAME = C_LOGICAL_FILENAME
OPERATING_SYSTEM = SY-OPSYS
PARAMETER_1 = P_IN_FILENAME
IMPORTING
FILE_NAME = P_OUT_FILENAME
EXCEPTIONS
FILE_NOT_FOUND = 1
OTHERS = 2.
OPEN DATASET P_OPEN_FILE ENCODING UTF-8 IN TEXT MODE FOR OUTPUT.
IF SY-SUBRC <> 0.
MESSAGE E000(38) WITH 'Error in Opening file: ' V_PHY_FILENAME.
ENDIF. -
What are the commands available to read a file from application server and
What are the commands available to read a file from application server and store the file into an internal table?
Hi,
To read a file from an Application Server to an Object there is a command in ABAP called <b>READ DATASET</b>. After that file is transported to that object you have to do a loop and put that data in an Internal Table.
This statement exports data from the file specified in dset into the data object dobj. For dobj, variables with elementary data types and flat structures can be specified. In Unicode programs, dobj must be character-type if the file was opened as a text file.
For dset, a character-type data object is expected - that is, an object that contains the platform-specific name of the file. The content is read from the file starting from the current file pointer. After the data transfer, the file pointer is positioned after the section that was read. Using the MAXIMUM LENGTH addition, the number of characters or bytes to be read from the file can be limited. Using ACTUAL LENGTH, the number of characters or bytes actually used can be determined.
In a Unicode program, the file must be opened with an arbitrary access type; otherwise, an exception that cannot be handled will be triggered.
If the file has not yet been opened in anon-Unicode program, it will be implicitly opened as a binary file for read access using the statement
OPEN DATASET dset FOR INPUT IN BINARY MODE.
. If a non-existing file is accessed, an exception that can be handled can be triggered.
Influence of Access Type
Files can be read independently of the access type. Whether data can be read or not depends solely on the position of the file pointer. If the latter is at the end of the file or after the file, no data can be read and sy-subrc will be set to 4.
Influence of the Storage Type
The import function will take place irrespective of the storage type in which the file was opened with the statement OPEN DATASET.
If the file was opened as a text file or as a legacy text file, the data is normally read from the current position of the file pointer to the next end-of-line marking, and the file pointer is positioned after the end-of-line marking. If the data object dobj is too short for the number of read characters, the superfluous characters and bytes are cut off. If it is longer, it will be filled with blanks to the right.
If the file was opened as a binary file or as a legacy-binary file, as much data is read that fits into the data object dobj. If the data object dobj is longer than the number of exported characters, it is filled with hexadecimal 0 on the right.
If the specified storage type makes conversion necessary, this is executed before the assignment to the data object dobj. Afterwards, the read data is placed, byte by byte, into the data object.
System Fields
sy-subrc Meaning
0 Data was read without reaching end of file.
4 Data was read and the end of the file was reached or there was an attempt to read after the end of the file.
Thanks,
Samantak.
<b>Rewards points for useful answers.</b> -
Reading XML file from application server and put into internal table-4.6C
Dear All,
Is there any way of reading XML file from application server to SAP? I am using 4.6C. Function module SCMS_STRING_TO_XSTRING function module is not available. Please suggest.
Thanks and regards,
AtanuHi Atanu!
Simply use the XSLT transformation 'ID'.
FIELD-SYMBOLS <ls_result> TYPE ANY.
CREATE DATA lref_data TYPE (your_structure).
ASSIGN lref_data->* TO <ls_result>.
CALL TRANSFORMATION id
SOURCE XML xmlstr
RESULT result = <ls_result>.
"xmlstr" contains your XML file. Just read it into it via standard I/O operations. "<ls_result>" will contain your DDIC formatted content.
Best regards
Torsten -
Use of Open and close data set in to pick up files from application server
Hi,
As per my earlier posts i m making a programm which will pick excel sheet from application server and make auto PR by bapi and this all process will be handle by background processing (SM36, SM37). My concer is all proces are working fine but my files are not been picked by application server , when run on my own machine everything is working fine.I never used OPENDATA SET command before , so i have no idea how it will be used , can anyone provide me details with my set of codes where it should be used ....
sou_dir_name = 'Y:\Sucess\'.
tar_dir_name = 'Y:\destination\'.
Open dataset sou_dir_name for input in text mode encoding default.
if sy-subrc eq 0.
do.
read dataset sou_dir_name into file_table.
if sy-subrc ne 0.
exit. " end of file.
enddo.
endif.
CALL FUNCTION 'TMP_GUI_DIRECTORY_LIST_FILES'
EXPORTING
DIRECTORY = sou_dir_name
FILTER = '.'
IMPORTING
FILE_COUNT = file_count
DIR_COUNT = dir_count
TABLES
FILE_TABLE = file_table
DIR_TABLE = dir_table
EXCEPTIONS
CNTL_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
ENDIF.
loop at file_table into wa_file_table.
clear : strr , str1 , str2 , str3 .
strr = wa_file_table-PATHNAME .
concatenate sou_dir_name strr into str1 .
concatenate tar_dir_name strr into str2 . " success
concatenate tar_dir_name1 strr into str3 . " failed
FILE = STR1 .
*start-of-selection.
*& Function For Retrieve Data From Excel
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = FILE
i_begin_col = col_start
i_begin_row = row_start
i_end_col = col_end
i_end_row = row_end
tables
intern = excel_bdcdata
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF sy-subrc NE 0.
WRITE : / 'File Error'.
EXIT.
ENDIF.
loop at excel_bdcdata.
translate excel_bdcdata to upper case .
move excel_bdcdata-col to it_index.
assign component it_index of structure wa_file to <fs> .
move excel_bdcdata-value to <fs>.
at end of row.
append wa_file to it_file .
clear wa_file.
endat.
endloop.Parsing XML data:
http://help.sap.com/saphelp_nw04/helpdata/en/86/8280ba12d511d5991b00508b6b8b11/frameset.htm
or alternatively check out ABAP online help for "CALL TRANSFORMATION".
For creating the material master look at BAPI_STANDARDMATERIAL_CREATE.
Thomas -
Infopackage-Load Many Files from Application Server and later Archive/Move
Hi All..
I have a doubt, I have a requirement of take many files to load into BI 7.0.. I used the infopackage before with option:
Load Binary File From Application server
I load information successfully... only with one file ...but If I can load many files (with different names) like the next list.. I think it's not a good idea modify the file name (path) on infopackage each time).. :
*All of this files will be on one server that itu2019s map into AL11.. Like
Infopfw
BW_LOAD_20090120.txt
BW_LOAD_20090125.txt
BW_LOAD_OTHER_1.txt
u2026.
Etc..
This directory it's not in BW server.. It's other server..but I can load form this location (one file by one)
Could you help me with this questions:
- How can I Use an infopackage with routine that take all the files..one by oneu2026 in order of creation dateu2026and load into Target? Is it possible?.. I have some knowledge of ABAP.. but I don´t know exactly how I can say to system this logicu2026
- In addition is it possible move this files to other locationu2026 like into Infopfwarchive u2026 just to have an history of files loaded.
I saw that in infopackage you have an option to create a routine.. in ABAP codeu2026 Iu2019m a little bit confused because I donu2019t know how I can specify all the path..
I try with:
Infopfw
InfopfwFile.csv
Infopfw
This is the abap code that automatically you see and you need to modifyu2026
Create a routine for file name
This routine will be called by the adapter,
when the infopackage is executed.
p_filename =
p_subrc = 0.
Thank you for your ideas or recommendations.
AlHi Reddy, thank you for your answer
I have some doubuts.. when you explain me the option:
All the above files are appending dates at the end of the file....
You can load the files through infopackage by using Routines and pick the files based on date at the end of the file..***
I need to ask you if you think that when you know the date of the file and the infopackage pick each file... thi can work for many files??... or how it's possible control this process?
About this option, I want to ask you If when you menction Unix code... where it's programed this code?.. in the routine of BW Infopackage??
****Or
Create two folders in your BW in Application server level, in AL11 (ask Basis team)
I call it is F1 and F2 folders.
First dump the files into F1 I assume that the file name in F1 is "BW_LOAD_20090120.txt", using Unix code you rename the file and then keep in the same foleder F1 or move to F2.
Then create InfoPackage and fix the file name (i.e. you renamed), so you don't need to change everyday your file name at infopackage level.Because in AL11 everyday the file are overwrite.
To I get BW_LOAD_20090120.txt file in F1, then I renamed to BW_LOAD.txt and loaded into BW, then tomorrow I get BW_LOAD_20090125.txt in F1, then I renamed to BW_LOAD.txt....
so in this way it will work.You need to schedule the Ubix script in AL11.
This is the way how to handle the application server...I'm using the same logic.
Thank you soo much.
Al -
Read application server directory and file
Hi,
I'm using the FM "RZL_READ_DIR_LOCAL" to retrieve the application server directory and filename. The returned result contain all the directory name and filename. Is there any other FM can separate the result into directory and file??
Regards,
Kithi
Ya One more FM is there - Call Function Gui Upload.
It will read the file from the app server.
See this Example:-
Refer this:
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3ca6358411d1829f0000e829fbfe/frameset.htm
ABAP code for uploading a TAB delimited file into an internal table. See code below for structures.
*& Report ZUPLOADTAB * &----
*& Example of Uploading tab delimited file *
REPORT zuploadtab .
PARAMETERS: p_infile LIKE rlgrap-filename
OBLIGATORY DEFAULT '/usr/sap/'..
DATA: ld_file LIKE rlgrap-filename.
*Internal tabe to store upload data
TYPES: BEGIN OF t_record,
name1 like pa0002-VORNA,
name2 like pa0002-name2,
age type i,
END OF t_record.
DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
wa_record TYPE t_record.
*Text version of data table
TYPES: begin of t_uploadtxt,
name1(10) type c,
name2(15) type c,
age(5) type c,
end of t_uploadtxt.
DATA: wa_uploadtxt TYPE t_uploadtxt.
*String value to data in initially.
DATA: wa_string(255) type c.
constants: con_tab TYPE x VALUE '09'.
*If you have Unicode check active in program attributes then you will
*need to declare constants as follows:
*class cl_abap_char_utilities definition load.
*constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
*START-OF-SELECTION
START-OF-SELECTION.
ld_file = p_infile.
OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
ELSE.
DO.
CLEAR: wa_string, wa_uploadtxt.
READ DATASET ld_file INTO wa_string.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
wa_uploadtxt-name2
wa_uploadtxt-age.
MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
APPEND wa_upload TO it_record.
ENDIF.
ENDDO.
CLOSE DATASET ld_file.
ENDIF.
*END-OF-SELECTION
END-OF-SELECTION.
*!! Text data is now contained within the internal table IT_RECORD
Display report data for illustration purposes
loop at it_record into wa_record.
write:/ sy-vline,
(10) wa_record-name1, sy-vline,
(10) wa_record-name2, sy-vline,
(10) wa_record-age, sy-vline.
endloop.
reward if help. -
Process Chain - Delete File from Application Server
Hi Gurus,
Im working with Process chain, and i have a load from a flat file, so my question is :
How can i delete that file from the application server after was loaded ?
THANKS IN ADVANCED !!! I REALLY APRECCIATE YOUR HELP.
Marcoshi,
I have gone through the forum you have posted for deleting files from application server through process chain.
I have similar reuirement in my project.
Can you please provide me the solution?
Your inputs will be highly appreciated.
Thanks in advance.
Regards,
Lavanya. -
Read Tilda separated file from Application Server
I have a requirement to read a tilda separated file from application server and write a tilda separeted output to application server. Please suggest how to to get data from tilda separated file to internal table ? and also How to create a tilda separated file from internal table to application server.
Hi again,
This some sample code for outputing data on application server with tilda separator.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT. " MESSAGE msg.
IF sy-subrc <> 0.
message i812(LQ).
LEAVE LIST-PROCESSING.
ENDIF.
LOOP AT gs_input INTO wa_input.
CONCATENATE wa_input-wadat_ist
wa_input-sort2
wa_input-name1
wa_input-street
wa_input-region
wa_input-post_code1
wa_input-zzchep
wa_input-vbeln
wa_input-bstkd
wa_input-zfrom
wa_input-zland
wa_input-zccode
wa_input-zrcvd
wa_input-zfref
wa_input-znorc
wa_input-zsepr
wa_input-zvers
wa_input-zlout
wa_input-zinfo
wa_input-zinco
wa_input-zsqal
wa_input-zscod
wa_input-zrqal
wa_input-zeqal
wa_input-zecod
wa_input-zcust
wa_input-ztran INTO g_path SEPARATED BY '~'.
TRANSFER g_path TO p_file.
CLEAR : g_path, wa_input.
ENDLOOP.
CLOSE DATASET p_file.
Hope this will be helpful for you.
Regards,
Vijay
Maybe you are looking for
-
Hello! I have a pearl 9105. OS 6.0 Bundle 2950 (6.6.0.236). I have a problem with screen rotation. When I go to browser, the screen won´t rotate. In the options I don´t find any options for rotate the screen. Is there any way to rotate the screen fo
-
I have a Nokia 6790 smart phone. I have had the phone since February 2011, since I have had the phone I have received an error message from my phone "SIM Card has failed registration" 5 times since activating it. I have contacted Straighttalk and tol
-
Can t find "corresponding RAW files"
Hi all, I am using aperture 3 with a nikon camera (D40X). I have recently tried the following: shooting in Jpg + NEF (=RAW). I first import the Jpg files then make a first selection and then go back to my memory card to import only the corresponding
-
Hi Gurus, in case of cash jouranl
Hi Gurus, Is it possible issue of check in cash jouranl, that means in case of cash receipt, my clients want a check has to be printed automatically. is it possible? Regards Rajesh
-
DI Integrator XI and Data Service Designer
Hi all I am playing with DI XI (11.7) now, but very soon we would have Data Service Designer (new version of DI which is called Data Service Designer). I'm just wondering what the difference is between DI Integrator 11.7 and Data Service Designer. Th