Separated by pipe in datasets
Hi al,
I am using 'PIPE' addition in datasets. But the problem is if there is nodata end of file , pipe sysmbol was not coming. if it is happend in middile of data, pipe was coming .
but end of file it was coming ..please help.
Example.
123|sgjg|X|| | jdgsdjj|35|
still i have 3 fileds end of file ...that is blank data, then it will give pipe sysmbol with that lengh.
correct : 123|sgjg|X|| | jdgsdjj|35| | | |
regasds,
Aj
pl
Hi ajay,
try something like this
Field-symbols : <fs_field> TYPE ANY.
DATA : l_field(255).
DATA : transfer_stru(1000).
LOOP AT i_final.
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE i_final TO <fs_field>.
IF sy-subrc EQ 0.
MOVE <fs_field> TO l_field.
CONDENSE l_field.
CONCATENATE transfer_stru '|' l_field INTO transfer_stru.
CLEAR l_field.
ELSE.
EXIT.
ENDIF.
ENDDO.
SHIFT transfer_stru LEFT.
TRANSFER transfer_stru TO v_file.
CLEAR transfer_stru.
ENDLOOP.
Similar Messages
-
Text file contains data separated by pipe symbol read the data and saved in
Hi ,
This is Sreedhar, i am new to java. my query is Report its in text file format it contains data like GLNO,name ,amount. All fields are separated by pipe(|) symbol. I would like to read that
data and saved into the database. Please anyone can help me.thx Ottobonn.
Scanner is very usefull with string operation like in my problem..but i want try to find java.util.Scanner in j2me, i can't found this class...:(
so, may be i can't use this class in j2me...
i new in java, so i try myself to code the simple method for my problem,
may be anyone can make this class more simple than my coding....:)
public StringPipe(String _msg){
String message = _msg;
int pipe = 0;
int lengthmessage = message.length();
int lengthMsgresult = 0;
while(lengthMsgresult<=lengthmessage){
String msg = null;
int pipeX = message.indexOf("|");
if(pipeX==-1){
msg = message;
else{
msg = message.substring(pipe, pipeX);
message = message.substring(pipeX+1, message.length());
lengthMsgresult += msg.length();
// the string seperated by pipe
System.out.println("msg = " + msg);
if(pipeX==-1){
break;
}thx... -
Parsing notepad content separated by pipes...urgent!!
Hi there,
I really need your help guys, I need to read the content of a notepad file and then parse it, specifically it's a string just like this one,
AAA_AAAA.01 | BBB_BBBB.01 BBB_BBBB.02 | BBB_BBBB.03 | CCC_CCCC.01 | DDD_DDDD.01 | DDD_DDDD.02 | DDD_DDDD.03 | DDD_DDDD.04....and so on,
and so far I've got only this code
package tokenizer;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
* @author Henz
public class ThreadParser {
public ThreadParser() {
// Auto-generated constructor stub
* @param args
public static void main(String[] args) {
// Auto-generated method stub
String line;
try {
System.out.print("Enter the path: ");
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
String file = stdin.readLine();
BufferedReader sfile = new BufferedReader(new FileReader(file));
File myFile = new File(file);
if (myFile.exists()) {
System.out.println("File founded, preparing parsing...");
} else {
System.out.println("File not founded, verify path...");
while ((( line = sfile.readLine())!= null))
System.out.println(line);
StringTokenizer st = new StringTokenizer(line)//Exactly here I need the string so I can parse it but it returns me a NullPointerEx
while(st.hasMoreTokens())
System.out.println(st.nextToken());
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
But I've got only this output
Enter the path: C:\Test.txt
File founded, preparing parsing...
Exception in thread "main" java.lang.NullPointerException
at java.util.StringTokenizer.<init>(StringTokenizer.java.182)
at java.util.StringTokenizer.<init>(StringTokenizer.java.219)
at tokenizer.ThreadParser.main(ThreadParser.java:54)
The question is, what else do I need so I can get this output ,
AAA_AAAA.01
BBB_BBBB.01 BBB_BBBB.02 BBB_BBBB.03
CCC_CCCC.01
DDD_DDDD.01 DDD_DDDD.02 DDD_DDDD.03 DDD_DDDD.04
The main objective is to parse the string above eliminating its pipes and in each line having just the same type prefix words
Regards!I will post the bad part of your code, indented correctly:while ((( line = sfile.readLine())!= null))
System.out.println(line);
StringTokenizer st = new StringTokenizer(line);The first two lines read through the file and copy it to standard output. After they are finished, the "line" variable is null (that's what the "while" does) and then you proceed to try and use it in the third line of code.
In other words, you should surround the code that you want controlled by that "while" by braces. Like this:while ((( line = sfile.readLine())!= null)) {
System.out.println(line);
StringTokenizer st = new StringTokenizer(line);
... and so on
}If you don't do that then only the single line of code after the "while" statement is in the while-loop. -
Pipe separated flat file upload
Hi ALl,
Can any one tell me how to upload a flat file (field separator is pipe |) using the FM GUI_UPLOAD.
And than how to split the fields into there corresponding table-fields.
Thanks in advance.
regards
satish.Upload the flat file into a flat itab using the GUI_UPLOAD.
Types: Begin of ttab,
rec(1000) type c,
end of ttab.
data: itab type table of ttab with header line.
After you have the data in the flat itab. Loop thru it and split at the pipe(|). Update another itab with your data.
data: Begin of itab2 occurs 0,
field1(10) type c,
field2(10) type c,
field3(10) type c,
endo of itab2.
Loop at itab.
split itab-rec at '|' into itab2-field1
itab2-field2
itab2-field3.
append itab2.
endloop.
Regards,
Rich Heilman -
Multiple flat files with Comma delimiter and Pipe Delimiter in the sub folders.
Hi,
I have a directory C:\doc\Outcomes\Health --(This is the main path).
In the path above i have multiple subfolders like
A
B
C
D
Folder A & B have 20 flat files each which are comma separated and pipe delimiter files.
Folder C&D have 20 excel files each.
1) So, In SSIS while looping through the subfolders how do i limit to loop only excel files one time and flat files one time.
2) In folder A&B, how do i loop only Pipe delimiter files (neglecting comma saperated files). I want to loop only pipe delimiter files while using for each loop container.
ThanksBoth are txt files, but the data inside the files is saperated by ',' and '|'. ( comma and pipe)
Thats ok
If delimiters are not consistent you can use this method
http://visakhm.blogspot.in/2014/07/ssis-tips-handling-inconsistent-text.html
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
When I go to Mozilla Firefox, I always see YOUR page first instead of my chosen home page. This page says "Committed to You, your privacy and an open web under your logo, and in top right corner, it says "See what's New" and it makes me either check "No Thanks" or "Let's go". This is annoying because I really just want my home page when I click on Firefox.
How do I get rid of YOUR page that comes up first? If I can't get rid of this, I plan to no longer use Mozilla Firefox. Please advise. (I would have given you a screen shot, but your system doesn't accept it here)
Thanks!
Kathy BurdenYou can check the target line in the Firefox desktop shortcut (right-click: Properties) to make sure that nothing is appended after the path to the Firefox program.
Do you still have your home page set correctly?
*Tools > Options > General > Startup: Home page
Firefox supports multiple home pages separated by '|' (pipe) symbols.
*https://support.mozilla.org/kb/How+to+set+the+home+page
You can check for problems with preferences.
Delete a possible user.js file and numbered prefs-##.js files and rename (or delete) the prefs.js file to reset all prefs to the default value including prefs set via user.js and prefs that are no longer supported in the current Firefox release.
*http://kb.mozillazine.org/Preferences_not_saved
*http://kb.mozillazine.org/Resetting_preferences -
Why is there a blank tab when I open firefox when there wasn't one before?
When I open firefox, I have it set to only open ONE home page but for some reason, it opens that page and then a blank one. How do I get rid of the annoying blank tab that pops up with my home page now? It is extremely annoying. Thanks!
You can check the home page setting:
*Tools > Options > General > Startup: Home page
Firefox supports multiple home pages separated by '|' (pipe) symbols.
*https://support.mozilla.org/kb/How+to+set+the+home+page
You can check the target line in the Firefox desktop shortcut (right-click: Properties) to make sure that nothing is appended after the path to the Firefox program.
Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem.
*Switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance
*Do NOT click the Reset button on the Safe Mode start window
*https://support.mozilla.org/kb/Safe+Mode
*https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes -
In the below example, the book titled 'Collapse of the Dollar' has multiple authors.
create table books
(surrId number(5),
book_id number(7),
isbn number (10),
title varchar2(100) ,
Author varchar2(100)
insert into books values (1, 457, 8478, 'Perilous Power' , 'Noam Chomsky');
insert into books values (2, 458, 2345, 'Macbeth' , 'Shakespeare');
insert into books values (3, 459, 6789, 'Collapse of the Dollar' , 'James Turk');
insert into books values (4, 459, 6789, 'Collapse of the Dollar' , 'John Rubino');
col title format a35
col author format a15
col title format a15
set lines 200
SQL> select * from books;
SURRID BOOK_ID ISBN TITLE AUTHOR
1 457 8478 Perilous Power Noam Chomsky
2 458 2345 Macbeth Shakespeare
3 459 6789 Collapse of the Dollar James Turk
4 459 6789 Collapse of the Dollar John RubinoI need to write a query whiich returns book details but it should identify records (ie. Titles) with multiple authors and return the record with Authors separated with pipe ('|') like (no need of SURRID column )
expected output
-- no need to retrieve surrogate ID
BOOK_ID ISBN TITLE AUTHOR
457 8478 Perilous Power Noam Chomsky
458 2345 Macbeth Shakespeare
459 6789 Collapse of the Dollar James Turk|John Rubino
Related question on the above Table design (Create table DDL shown above):
A table storing book details can only be designed like above. Right ? I mean, the duplication of records for one book because of multiple authors cannot be avoided. Right ?
One wonders how Amazon has desined its books table :)Hi,
Pete_Sg1 wrote:
I need to write a query whiich returns book details but it should identify records (ie. Titles) with multiple authors and return the record with Authors separated with pipe ('|') like (no need of SURRID column )Get there : {message:id=9360005}
and scroll down to "string aggregation"
Pete_Sg1 wrote:
A table storing book details can only be designed like above. Right ? I mean, the duplication of records for one book because of multiple authors cannot be avoided. Right ? I would have had a table for books, and a separate one for authors, and a 3rd one for their relations :
create table books
book_id integer,
title varchar2(100),
etc...
create table authors
author_id integer,
name varchar2(100),
etc...
create table book_authors
book_id integer,
author_id integer
);You could also have only 2 tables book and authors (with authors table having a fk column to book_id).
It would depends if the author is supposed to remain unique throught different books.
- The 3 tables model would allow a single update on author information to be automatically "propagated" to all book he participed in.
- The 2 tables model would allow to have different information for each participation of the author to different books (but would certainly "duplicate" part of the data about the author)
One can also have even more tables to totally avoid data "duplication". -
Why does a new tab page open along with my home page?
When I go online, I expect to have only my home page open, instead, I have two tabs, my home page tab and New Tab and the New Tab page is the page that actually opens. This just started yesterday, why??
Did you check the home page setting to make sure that it is still correct?
*Tools > Options > General > Startup: Home page
*https://support.mozilla.org/kb/How+to+set+the+home+page
Firefox supports multiple home pages separated by '|' (pipe) symbols.
You can check the target line in the Firefox desktop shortcut (right-click: Properties) to make sure that nothing is appended after the path to the Firefox program.
You can check for problems with preferences.
*http://kb.mozillazine.org/Preferences_not_saved
*http://kb.mozillazine.org/Resetting_preferences -
Issue in concurrent update of the same attribute
Hi All,
We have a requirement to populate an attribute on user profile from target resource process form during reconciliation. This attribute can hold the multiple values separated by '|' (pipe). A user can have multiple account on this target resource. Now we are facing the issue where if the user's multiple account is updated and during reconciliation when they are trying to update the user form (concurrently...almost at the same time..) via different recon events (and hence process task on recon update received), only last update came into effect. Lets say if two recon event R1 and R2 created for a user and trying to copy the value ATTRVAL1 and ATTRVAL2 on user profile attribute attr1. In ideal scenerio the value of attr1 should be ATTRVAL1|ATTRVAL2, but in our case the value we received is either ATTRVAL1 or ATTRVAL2 (depending on the last update). The process task to update the value on user profile is successfully completed. It seems till the time last one capture the value, it stale the first update usr_rowver field that used in profile update.
Please let me know if you ever face this issue and how to deal with this. There is no caching enabled in OIM (under config file)Hi,
Can you just tell me which type of Recon you are using is it GTC or any other recon?
What is target resource from which recon is happening?
Just check the metadata.xml whehter it gives you option to make attribute as multivalued or not. IF it is there then you just define your attribute as multivalued and proceed..
Regards
Alabhya Goel -
GUI_UPLOAD+HAS_FIELD_SEPARATOR
Hi everybody .
In my program, I use the fm GUI_UPLOAD to upload the flat file which separator is the pipe(|).
Exemple of line : AAA|BBB|CCC|DDD
HAS_FIELD_SEPARATOR='|' not working, so how can i use this fm and define SEPARATOR as pipe .
thank in advanceHi ,
I believe the field separator parameter will work for Excel files..You have to get the internal table in a string format..and then use split statement..
Use the below code it work for me..
DATA: BEGIN OF it_tab OCCURS 0,
object_id TYPE string,
version_series_id TYPE string,
version_number TYPE string,
revision TYPE string,
doc_number TYPE string,
doctitle TYPE string,
filesize TYPE string,
mime_type TYPE string,
plantunit TYPE string,
END OF it_tab.
DATA: t_tab TYPE TABLE OF string,
v_string TYPE string.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\TEST.TXT'
has_field_separator = '|' "Actually not required.*
TABLES
data_tab = t_tab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc 0.
ENDIF.
LOOP AT t_tab INTO v_string.
SPLIT v_string AT '|'
INTO
it_tab-object_id
it_tab-version_series_id
it_tab-version_number
it_tab-revision
it_tab-doc_number
it_tab-doctitle
it_tab-filesize
it_tab-mime_type
it_tab-plantunit.
APPEND it_tab.
CLEAR: it_tab.
ENDLOOP.
Regards,
DHina..
Edited by: Dhina DMD on May 13, 2011 1:41 PM
Edited by: Dhina DMD on May 13, 2011 1:47 PM -
Problem to send text file to mail from ALV report
Hi Friends,
I have a problem in my ALV report with text file. As per the requirment, when we execute the program then text attachment should go to the particual email.
When i am using file type as XLS i am getting attachment with all 4 recoreds( input for 4 records) in mail. But all 4 records are coming in SAME ROW. It should come 4 records in 4 rows. when I use file type as TXT and separated by pipe symble in code, it is showing only one recored for same above input.
When i use file type as XLS and click the attachment in email, it will triggire one popul with three options like SAVE, OPEN, CANCEL.
But when i click on text file attachment, it is directly showing ony one recored.
Please correct me on this.
my code is
PERFORM send_file_as_email_attachment
tables i_message
i_attach
using v_email
'User last log on details'
'XLS'
'User log on list'
changing v_error
v_reciever.
FORM send_file_as_email_attachment tables pi_message
pi_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: l_error TYPE sy-subrc,
l_reciever TYPE sy-subrc,
l_mtitle LIKE sodocchgi1-obj_descr,
l_email LIKE somlreci1-receiver,
l_format TYPE so_obj_tp ,
l_attdescription TYPE so_obj_nam ,
l_attfilename TYPE so_obj_des ,
l_sender_address LIKE soextreci1-receiver,
l_sender_address_type LIKE soextreci1-adr_typ,
l_receiver LIKE sy-subrc.
l_email = p_email.
l_mtitle = p_mtitle.
l_format = p_format.
l_attdescription = p_attdescription.
l_attfilename = p_filename.
l_sender_address = p_sender_address.
l_sender_address_type = p_sender_addres_type.
Fill the document data.
v_doc_data-doc_size = 1.
Populate the subject/generic message attributes
v_doc_data-obj_langu = sy-langu.
v_doc_data-obj_name = 'SAPRPT'.
v_doc_data-obj_descr = l_mtitle .
v_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR v_doc_data.
READ TABLE i_attach INDEX v_cnt.
v_doc_data-doc_size =
( v_cnt - 1 ) * 255 + STRLEN( i_attach ).
v_doc_data-obj_langu = sy-langu.
v_doc_data-obj_name = 'SAPRPT'.
v_doc_data-obj_descr = l_mtitle.
v_doc_data-sensitivty = 'F'.
CLEAR i_attachment.
REFRESH i_attachment.
i_attachment[] = pi_attach[].
Describe the body of the message
CLEAR i_packing_list.
REFRESH i_packing_list.
i_packing_list-transf_bin = space.
i_packing_list-head_start = 1.
i_packing_list-head_num = 0.
i_packing_list-body_start = 1.
DESCRIBE TABLE i_message LINES i_packing_list-body_num.
i_packing_list-doc_type = 'RAW'.
APPEND i_packing_list.
Create attachment notification
i_packing_list-transf_bin = 'X'.
i_packing_list-head_start = 1.
i_packing_list-head_num = 1.
i_packing_list-body_start = 1.
DESCRIBE TABLE i_attachment LINES i_packing_list-body_num.
i_packing_list-doc_type = l_format.
i_packing_list-obj_descr = l_attdescription.
i_packing_list-obj_name = l_attfilename.
i_packing_list-doc_size = i_packing_list-body_num * 255.
APPEND i_packing_list.
Add the recipients email address
CLEAR i_receivers.
REFRESH i_receivers.
i_receivers-receiver = l_email.
i_receivers-rec_type = 'U'.
i_receivers-com_type = 'INT'.
i_receivers-notif_del = 'X'.
i_receivers-notif_ndel = 'X'.
APPEND i_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = v_doc_data
put_in_outbox = 'X'
sender_address = l_sender_address
sender_address_type = l_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = v_sent_all
TABLES
packing_list = i_packing_list
contents_bin = i_attachment[]
contents_txt = i_message
receivers = i_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Populate zerror return code
l_error = sy-subrc.Hi,
declare the following constant in u r program and concatenate at the end of each and every record in your internal table.
CONSTANTS : LV_CRLF TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
for eg.
if u internal table has values like
row1
row2
row3
concatenate the 1st record lv_crlf into first record.
conactenate second record lv_crlf into second record.
concatenate third record lv_crlf into third record.
now attach the internal table to the FM which u use for sending email. Each and every row will come in new line. The LV_CRLF will hold nothing but a line feed character (#).
Hope it will solve u r problem
Regards,
Rose. -
File Content Conversion (FCC ) to IDoc Scenario
Hi All,
I have a Flat File to Idoc Scenario. Sample flat file looks as shown below.
A|20101001150207|SAPQMP|31|
B|5998|400858|2|N|20012010|MRGB0309S0030|
C|T0025|M0331||0.884||Inspection|1|No|Y||
C|T0001|M1556||Clear & bright ||QC|1|No|Y|Text|
C|T0050|M0341|6.0|6.5|7.0|QC|1|No|Y|Number|
C|T0010|M0360|0.279|0.341|QC|1|No|Y|Number|
C|T0062|M0360|0.112|0.137|QC|1|No|Y|Number|
C|T0056|M0373|7000|QC|1|No|Y|Number|
C|T0042|M0422|||-25|First Prod|1|No|N||
B|5998|400859|4|N|20012010|MRGB0309S0065|
C|T0025|M0331||0.896||Inspection|1|No|Y||
C|T0001|M1556||Clear & bright ||QC|1|No|Y|Text|
C|T0050|M0341|10.6|11.0|12.0|QC|1|No|Y|Number|
C|T0042|M0422|||-25|QC|1|No|Y||
C|T0010|M0360|0.279|0.341|QC|1|No|Y|Number|
B|5998|400859|4|N|20012010|MRGB0309S0065|
C|T0025|M0331||0.896||Inspection|1|No|Y||
C|T0001|M1556||Clear & bright ||QC|1|No|Y|Text|
C|T0050|M0341|10.6|11.0|12.0|QC|1|No|Y|Number|
Z|20101001150242|SAPQMP|31|
where Records A indicate File Header, Z indicates File Trailer
Recodrs B indicateds Material header and Would be repeating multiple times
No. of B Records = No. of Idocs generated with corresponding C records data which indicates Component Rows (multiple)
i.e as many B records file contains, that many Idoc will be created
For Mapping I require B and C Records. Field Separator is Pipe | symbol
I need to Ignore A B C Z
How to define the source structure and the respective FCC Parameters.
Regads,
VarunHi,
For Mapping I require B and C Records. Field Separator is Pipe | symbol
I need to Ignore A B C Z
two statements are ambiguous.
I assume u want only B and C records.
Since the structure is little complex, u can gat the whole record as a single element into Mapping and then u can take only those u want to access and map.
MT_Name
Records
Data(0..unbounded)
Now in Data u have all the records.
If you dont want at all these A and Z records to come to mapping(IE) then u need to go for a small adapter module.
Deploy it and use in the modules sequence...
Babu -
2 tabs load whenever I open firefox. The first tab is firefox page and the second is my homepage google.
I want to keep the google but stop the firefox tab. Tried the suggested fixes. %7c will not save it just reverts back. Anything changed in about:config doesn't help either.What is the current value of the browser.startup.homepage pref on the <b>about:config</b> page?
You can check the home page setting:
*Tools > Options > General > Startup: Home page
Firefox supports multiple home pages separated by '|' (pipe) symbols.
*https://support.mozilla.org/kb/How+to+set+the+home+page
You can check for problems with preferences.
Delete possible user.js and numbered prefs-##.js files and rename (or delete) the prefs.js file to reset all prefs to the default value including prefs set via user.js and prefs that are no longer supported in the current Firefox release.
*http://kb.mozillazine.org/Preferences_not_saved
*http://kb.mozillazine.org/Resetting_preferences
You can use this button to go to the currently used Firefox profile folder:
*Help > Troubleshooting Information > Profile Directory: Show Folder (Linux: Open Directory; Mac: Show in Finder) -
ABAP to FTP connect to non SAP UNIX system
Greetings~
I'm looking for a way (via function modules and/or BAPI) to transfer data in flat files from an SAP UNIX system to a non-SAP UNIX system using an ABAP program. I see FM's FTP_CONNECT and FTP_COMMAND however these seem to only work with UNIX systems running SAP as they require RFC_DESTINATION information. Anybody know which (if any) FM's can be used without the necessity of the target system running SAP/RFC?
Thanks!Hi Joseph,
Please refer the below program.
REPORT ZHR_T777A_FEED.
tables: t777a. "Building Addresses
Internal Table for Building table.
data: begin of it_t777a occurs 0,
build like t777a-build, "Building
stext like t777a-stext, "Object Name
cname like t777a-cname, "Address Supplement (c/o)
ort01 like t777a-ort01, "City
pstlz like t777a-pstlz, "Postal Code
regio like t777a-regio, "Region (State, Province, County)
end of it_t777a.
Internal Table for taking all fields of the above table in one line
separated by |(pipe).
data: begin of it_text occurs 0,
text(131),
end of it_text.
Constants: c_key type i value 26101957,
c_dest type rfcdes-rfcdest value 'SAPFTPA'.
data: g_dhdl type i, "Handle
g_dlen type i, "pass word length
g_dpwd(30). "For storing password
Selection Screen Starts
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE TEXT-001.
parameters: p_user(30) default 'XXXXXXX' obligatory,
p_pwd(30) default 'XXXXXXX' obligatory,
p_host(64) default 'XXX.XXX.XX.XXX' obligatory.
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE TEXT-002.
parameters: p_file like rlgrap-filename default 't777a_feed.txt'.
SELECTION-SCREEN END OF BLOCK blk2.
Password not visible.
at Selection-screen output.
loop at screen.
if screen-name = 'P_PWD'.
screen-invisible = '1'.
modify screen.
endif.
endloop.
g_dpwd = p_pwd.
Start of selection
start-of-selection.
To fetch the data records from the table T777A.
select build stext cname ort01 pstlz regio
from t777a
into table it_t777a.
Sort the internal table by build.
if not it_t777a[] is initial.
sort it_t777a by build.
endif.
Concatenate all the fields of above internal table records in one line
separated by |(pipe).
loop at it_t777a.
concatenate it_t777a-build it_t777a-stext it_t777a-cname
it_t777a-ort01 it_t777a-pstlz it_t777a-regio
into it_text-text separated by '|'.
append it_text.
clear it_text.
endloop.
To get the length of the password.
g_dlen = strlen( g_dpwd ).
Below Function module is used to Encrypt the Password.
CALL FUNCTION 'HTTP_SCRAMBLE'
EXPORTING
SOURCE = g_dpwd "Actual password
SOURCELEN = g_dlen
KEY = c_key
IMPORTING
DESTINATION = g_dpwd. "Encyrpted Password
*Connects to the FTP Server as specified by user.
Call function 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
text = 'Connecting to FTP Server'.
Below function module is used to connect the FTP Server.
It Accepts only Encrypted Passwords.
This Function module will provide a handle to perform different
operations on the FTP Server via FTP Commands.
call function 'FTP_CONNECT'
EXPORTING
user = p_user
password = g_dpwd
host = p_host
rfc_destination = c_dest
IMPORTING
handle = g_dhdl
EXCEPTIONS
NOT_CONNECTED.
if sy-subrc ne 0.
format color col_negative.
write:/ 'Error in Connection'.
else.
write:/ 'FTP Connection is opened '.
endif.
**Transferring the data from internal table to FTP Server.
CALL FUNCTION 'FTP_R3_TO_SERVER'
EXPORTING
HANDLE = g_dhdl
FNAME = p_file
CHARACTER_MODE = 'X'
TABLES
TEXT = it_text
EXCEPTIONS
TCPIP_ERROR = 1
COMMAND_ERROR = 2
DATA_ERROR = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
write:/ 'File has created on FTP Server'.
ENDIF.
Call function 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
text = 'File has created on FTP Server'.
To Disconnect the FTP Server.
CALL FUNCTION 'FTP_DISCONNECT'
EXPORTING
HANDLE = g_dhdl.
To Disconnect the Destination.
CALL FUNCTION 'RFC_CONNECTION_CLOSE'
EXPORTING
destination = c_dest
EXCEPTIONS
others = 1.
Regards,
Kumar Bandanadham.
Maybe you are looking for
-
Entries removed from cache when calling get()
Hi. Have a problem where entries seems to be removed from the cache when calling get(). The problem occurs after the cluster has been idle (no calls to get or put) for a while. When I then call get for an entry that I know should be in the cache i ca
-
Hi I am using Photoshop Elements 6.0 on Windows Vista and I have added Elements+ (http://simplephotoshop.com/elementsplus/index.htm). Now suddenly I cannot launch the Elements+ functionality. I get the error message "Javascript code was missing". Doe
-
Can't see shared files, so can't share 'em!
I know this is probably just a matter of a setting in the admin or something...but here's my situation. Office computer, running XP, cable modem connected to WRT54GS. Studio computer in another room, running Vista Home Premium, connected to the WRT54
-
Hi, I've been having problems since the last Premiere Pro CC update. 1) After rendering with Adobe Media Encoder Premiere crashes. If I try to render more then one format also Encoder crashes (it actually crashed my whole system and I had to reboot w
-
I thought I would restore my iphone so I backed it up and everything it backed up fine. It will put the firmware on the phone fine it also syncs but it come up and says warring it didn't sync the number of apps. Then I press ok then I get this. iTu