Transfer file in application server to another file
Hello guys I have another major hurdle I am encountering for a little task I am doing.
I need to send a downloaded file within the SAP application server to another file automatically using ABAP via Background Processing(most preferable a directory in the <b>newtwork</b>).
What I need to do is, after saving a list from an abap report and saves in the application server (which I have already done), I need it to transport to a the web server. All done in background.
I really appreciate the help you guys have given to me thus far. Thank you guys and take care.
Hi
U have to use unix command for same
i have seen some function module just check it out
SXPG_CALL_SYSTEM you can check the user's authorization for the specified command and run the command. The command runs on the host system on which the function module is executed. The function module is RFC capable. It can therefore be run on the host system at which a user happens to be active or on another designated host system at which an R/3 server is active.
<b>SXPG_COMMAND_CHECK</b> Check whether the user is authorized to execute the specified command on the target host system with the specified arguments.
<b>SXPG_COMMAND_DEFINITION_GET</b> Read the definition of a single external OS command from the R/3 System's database.
<b>
SXPG_COMMAND_EXECUTE</b> Check a user's authorization to use a command, as in SXPG_COMMAND_CHECK. If the authorization check is successful, then execute the command on the target host system.
<b>SXPG_COMMAND_LIST_GET</b> Select a list of external OS command definitions.
<b>RZL_READ_DIR_LOCAL</b> Read a directory on the Application Server
<b>SUBST_GET_FILE_LIST</b> Return table with file list for the given directory (pattern allowed)
regards
vinod
Similar Messages
-
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 -
Transfer data to Application Server
Hi All,
I need to send data to Application Server. Each record should be length 504. But i am not able to send data more than 255 characters in length in a single line.
Is there any way to send more than 255 characters in a single record(single line) to the Application server.
Thanks
ArunApplication Server File will be stored upto the maximum length,
but we can not view the length more than 255 charecters
OPEN DATASET outfile_fcsr FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT t_zdlqran3.
TRANSFER t_zdlqran3 TO outfile_fcsr LENGTH 700.
ENDLOOP.
CLOSE DATASET outfile_fcsr. -
Moving bpel instances from one application server to another
Is it possible to move bpel instances from one server to another?
We use SOA Suite 10.1.3. The idea is:
1. shutdown the appserver
2. make a dump of the dehydration store (bpel schema, ...)
3. import the dump in the new environment
4. startup the the "new" SOA Suite
The question is: Are there any hard coded references (e.g. OAS url) within the
SOA database schema?
Thanks,
MarcusApologies for the formatting, IE6 and company policy means none of the formatting seems to work. :o(
-
File transfer from a FTP server to another External FTP server
Hi,
I have one FTP server , I need to transfer a file from this FTP server to aother external FTP server. Could any one please help me how to write a batch file on FTP server so that my file is transfered to another FTP server by executing the Batch file. I don't want to use SAP server for this.
best regards
bobbyCREATE CONTROLFILE
Caution:
Oracle recommends that you perform a full backup of all files in the database before using this statement. For more information, see Oracle9i User-Managed Backup and Recovery Guide.
Purpose
Use the CREATE CONTROLFILE statement to re-create a control file in one of the following cases:
All copies of your existing control files have been lost through media failure.
You want to change the name of the database.
You want to change the maximum number of redo log file groups, redo log file members, archived redo log files, datafiles, or instances that can concurrently have the database mounted and open.
Note:
If it is necessary to use the CREATE CONTROLFILE statement, do not include in the DATAFILE clause any datafiles in temporary or read-only tablespaces. You can add these types of files to the database later.
An alternative to the CREATE CONTROLFILE statement is ALTER DATABASE BACKUP CONTROLFILE TO TRACE, which generates a SQL script in the trace file to re-create the controlfile. If your database contains any read-only or temporary tablespaces, that SQL script will also contain all the necessary SQL statements to add those files back into the database.
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_54a.htm#SQLRF01203 -
Read file in application server of another server into another server
I have a requirement as below:
A bank transfers a file into our XI server (10.x.y.z). This file needs to be used as input to a program to be run on the HR sever(10.a.b.c)
My question is how do i modify the program to read and use a file present on a different server?
A program would help to understand/Hii...
Please refer to the below blog for the programming details.. which has help me in my scenario..
/people/thomas.jung3/blog/2005/06/27/abap-server-side-file-access
Hope this helps u out!!
Regards
Anu. -
Data transfer from one sql server to another sql server in 2005
Hi,
Im trying to transfer only one table data from one server database to another server database table.both are in 2005 .Can anyone help?Hi,
Im trying to transfer only one table data from one server database to another server database table.both are in 2005 .Can anyone help?
If you are not using express you can use Import export wizard to mode data its very easy below link will help.In link destination is excel but you can select destination as your SQL Server
http://www.mssqltips.com/sqlservertutorial/202/simple-way-to-export-data-from-sql-server/
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers -
Transfer data from one server to another server using idocs
hi,crm
i have a data in crm system, i want to download this data and upload into another crm system by using idocs.
please any one explain.Hi Ravi,
my senario is i have to transfer data from crm 5.0 to 7.0.
i have marketing attributes
t-code: bp----> marketing attributes
i want to transfer marketing attributes from A to B.
i created one structure for marketing attributes around 160. and i added this structure fields into custom segments.
i created custom idoc type and i added segments into idoc.
i created one function module for getting data from structure and passing to segments and idoctype.
check the code below.
FUNCTION ZCRMXIF_MKT_DATA.
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(EV_MKT_ATTR) TYPE ZCRMXIF_MKT_STR
Data : c_segment type ZE101CRMXIF_MKT_ATTR_DATA,
c_segment1 type ZE101CRMXIF_MKT_ATTR_DATA1,
c_segment2 type ZE101CRMXIF_MKT_ATTR_DATA2,
c_segment3 type ZE101CRMXIF_MKT_ATTR_DATA3,
c_segment4 type ZE101CRMXIF_MKT_ATTR_DATA4.
data: c_messagetype type c value'zcrmxif_partner_save',
c_idoc_type type c value'zcrmxif_partner_save_mkt',
idoc_control like edidc,
t_comm_control like edidc occurs 0 with header line,
idoc_data like edidd occurs 0 with header line.
data: lt_mkt_attr type Zcrmxif_mkt_str occurs 0 with header line,
ls_mkt_attr like zcrmxif_mkt_str.
loop at lt_mkt_attr.
c_segment-PARTNER = lt_mkt_attr-partner.
c_segment-PARTNER_GUID = lt_mkt_attr-partner_guid.
idoc_data-segnam = 'ZE101CRMXIF_MKT_ATTR_DATA' .
idoc_data-sdata = c_segment.
append idoc_data.
c_segment1-ADHAR_NUM = lt_mkt_attr-ADHAR_NUM.
c_segment1-ADULTS = lt_mkt_attr-ADULTS.
c_segment1-AGEGROUP = lt_mkt_attr-AGEGROUP.
c_segment1-AG_CODE = lt_mkt_attr-AG_CODE.
c_segment1-AMERICANEXPRESS = lt_mkt_attr-AMERICANEXPRESS.
c_segment1-ANNUALINCOME = lt_mkt_attr-ANNUALINCOME.
c_segment1-AUTO_TYPE_1 = lt_mkt_attr-AUTO_TYPE_1.
c_segment1-AUTO_TYPE_2 = lt_mkt_attr-AUTO_TYPE_2.
c_segment1-AUTO_TYPE_3 = lt_mkt_attr-AUTO_TYPE_3.
c_segment1-A_HOMEDEL = lt_mkt_attr-A_HOMEDEL.
c_segment1-BANKNAME = lt_mkt_attr-BANKNAME.
c_segment1-BLOODPRESSURE = lt_mkt_attr-BLOODPRESSURE.
c_segment1-BPRELATION = lt_mkt_attr-BPRELATION.
c_segment1-BRAND = lt_mkt_attr-BRAND.
c_segment1-CC1001 = lt_mkt_attr-CC1001.
c_segment1-CC1002 = lt_mkt_attr-CC1002.
c_segment1-CCCLASSIC = lt_mkt_attr-CCCLASSIC.
c_segment1-CCGOLD = lt_mkt_attr-CCGOLD.
c_segment1-CCOTHERS = lt_mkt_attr-CCOTHERS.
c_segment1-CCPLAT = lt_mkt_attr-CCPLAT.
c_segment1-CCREDIT = lt_mkt_attr-CCREDIT.
c_segment1-ccsilver = lt_mkt_attr-ccsilver.
c_segment1-CCTITA = lt_mkt_attr-CCTITA.
c_segment1-CDEBIT = lt_mkt_attr-CDEBIT.
c_segment1-CHILDREN = lt_mkt_attr-CHILDREN.
c_segment1-CITIBANK = lt_mkt_attr-CITIBANK.
c_segment1-CNAPP = lt_mkt_attr-CNAPP.
c_segment1-CNC_PRINT = lt_mkt_attr-CNC_PRINT.
c_segment1-CNC_SIZE = lt_mkt_attr-CNC_SIZE.
c_segment1-CNC_SIZE_NEW = lt_mkt_attr-CNC_SIZE_NEW.
c_segment1-CNC_STATUS = lt_mkt_attr-CNC_STATUS.
c_segment1-CNC_TIME_ZONE = lt_mkt_attr-CNC_TIME_ZONE.
c_segment1-CNC_TIME_ZONE_NEW = lt_mkt_attr-CNC_TIME_ZONE_NEW.
c_segment1-CONDFIRSTZ = lt_mkt_attr-CONDFIRSTZ.
c_segment1-COMPANY = lt_mkt_attr-COMPANY.
c_segment1-CONDSECOND = lt_mkt_attr-CONDSECOND.
c_segment1-CONDTHIRD = lt_mkt_attr-CONDTHIRD.
c_segment1-CUSTOMERTYPE = lt_mkt_attr-CUSTOMERTYPE.
c_segment1-CUST_BUSINESS_NAME = lt_mkt_attr-CUST_BUSINESS_NAME.
c_segment1-DECL_DATE = lt_mkt_attr-DECL_DATE.
c_segment1-DED = lt_mkt_attr-DED.
c_segment1-DIST = lt_mkt_attr-DIST.
c_segment1-DNC = lt_mkt_attr-DNC.
c_segment1-DNCEMAIL = lt_mkt_attr-DNCEMAIL.
c_segment1-DNCPHONE = lt_mkt_attr-DNCPHONE.
c_segment1-DNCPOST = lt_mkt_attr-DNCPOST.
c_segment1-DOB_FAM_2 = lt_mkt_attr-DOB_FAM_2.
c_segment1-DOB_FAM_3 = lt_mkt_attr-DOB_FAM_3.
c_segment1-DOB_FAM_4 = lt_mkt_attr-DOB_FAM_4.
c_segment1-PLANG = lt_mkt_attr-PLANG.
* c_segment1-APPL_SNAME = lt_mkt_attr-APPL_SNAME.
idoc_data-segnam = 'ZE101CRMXIF_MKT_ATTR_DATA1'.
idoc_data-sdata = c_segment4.
append idoc_data.
c_segment2-DTPCARDGIVCOU = lt_mkt_attr-DTPCARDGIVCOU.
c_segment2-DTPCARDOFF = lt_mkt_attr-DTPCARDOFF.
c_segment2-DTPCARDOTHSTORE = lt_mkt_attr-DTPCARDOTHSTORE.
c_segment2-DTPCARDRETCOU = lt_mkt_attr-DTPCARDRETCOU.
c_segment2-DTPCARDSHREDDED = lt_mkt_attr-DTPCARDSHREDDED.
c_segment2-DTWELCOMCALL = lt_mkt_attr-DTWELCOMCALL.
c_segment2-DUDZ = lt_mkt_attr-DUDZ.
c_segment2-EDUDR = lt_mkt_attr-EDUDR.
c_segment2-DTPCARDSTORE = lt_mkt_attr-DTPCARDSTORE.
c_segment2-EDUER = lt_mkt_attr-EDUER.
c_segment2-EDUG = lt_mkt_attr-EDUG.
c_segment2-EDUHS = lt_mkt_attr-EDUHS.
c_segment2-EDULAW = lt_mkt_attr-EDULAW.
c_segment2-FOURWHEELER = lt_mkt_attr-FOURWHEELER.
c_segment2-FULL_NAME = lt_mkt_attr-FULL_NAME.
c_segment2-FWLT15KCC = lt_mkt_attr-FWLT15KCC.
c_segment2-FAMILY_MEMBER_NAME = lt_mkt_attr-FAMILY_MEMBER_NAME.
c_segment2-FAMILYMEMBERS = lt_mkt_attr-FAMILYMEMBERS.
c_segment2-FAMILY_MEMBER_NAME_2 = lt_mkt_attr-FAMILY_MEMBER_NAME_2.
c_segment2-FAMILY_MEMBER_NAME_3 = lt_mkt_attr-FAMILY_MEMBER_NAME_3.
c_segment2-FAMILY_MEMBER_NAME_4 = lt_mkt_attr-FAMILY_MEMBER_NAME_4.
c_segment2-FAMILY_MEMBER_NAME_5 = lt_mkt_attr-FAMILY_MEMBER_NAME_5.
c_segment2-FWLT1KCC = lt_mkt_attr-FWLT1KCC.
c_segment2-FWLT2KCC = lt_mkt_attr-FWLT2KCC.
c_segment2-GEO_WING_LAT = lt_mkt_attr-GEO_WING_LAT.
c_segment2-GEO_WING_LONG = lt_mkt_attr-GEO_WING_LONG.
c_segment2-HDFCBANK = lt_mkt_attr-HDFCBANK.
c_segment2-HSBC = lt_mkt_attr-HSBC.
c_segment2-ICICIBANK = lt_mkt_attr-ICICIBANK.
c_segment2-INCMTO = lt_mkt_attr-INCMTO.
c_segment2-INCT2F = lt_mkt_attr-INCT2F.
c_segment2-INCT2T = lt_mkt_attr-INCT2T.
c_segment2-IND_SECTOR = lt_mkt_attr-IND_SECTOR.
c_segment2-INTERNETCHATTING = lt_mkt_attr-INTERNETCHATTING.
c_segment2-LICENSE_INFO = lt_mkt_attr-LICENSE_INFO.
c_segment2-INTERNET_CONNECT = lt_mkt_attr-INTERNET_CONNECT.
c_segment2-MFAM_INCOME = lt_mkt_attr-MFAM_INCOME.
c_segment2-MODEL_1 = lt_mkt_attr-MODEL_1.
c_segment2-MODEL_2 = lt_mkt_attr-MODEL_2.
c_segment2-MODEL_3 = lt_mkt_attr-MODEL_3.
c_segment2-MOTHERS_NAME = lt_mkt_attr-MOTHERS_NAME.
c_segment2-MO_OF_P = lt_mkt_attr-MO_OF_P.
c_segment2-MO_OF_P2 = lt_mkt_attr-MO_OF_P2.
c_segment2-MO_OF_P3 = lt_mkt_attr-MO_OF_P3.
c_segment2-MY_OF_P3 = lt_mkt_attr-MY_OF_P3.
c_segment2-NOMINEES_NAME = lt_mkt_attr-NOMINEES_NAME.
c_segment2-NONE = lt_mkt_attr-NONE.
c_segment2-OCCU_OD_OTHR = lt_mkt_attr-OCCU_OD_OTHR.
c_segment2-OCC_FAM_1 = lt_mkt_attr-OCC_FAM_1.
c_segment2-OCC_FAM_2 = lt_mkt_attr-OCC_FAM_2.
c_segment2-OCC_FAM_3 = lt_mkt_attr-OCC_FAM_3.
c_segment2-OCC_FAM_4 = lt_mkt_attr-OCC_FAM_4.
c_segment2-OCC_FAM_5 = lt_mkt_attr-OCC_FAM_5.
c_segment2-OCC_NOM = lt_mkt_attr-OCC_NOM.
idoc_data-segnam = 'ZE101CRMXIF_MKT_ATTR_DATA2'.
idoc_data-sdata = c_segment4.
append idoc_data.
C_segment3-PLANG_OTHR = lt_mkt_attr-PLANG_OTHR.
C_segment3-REF_MAILADD = lt_mkt_attr-REF_MAILADD.
C_segment3-RELATION_FAM_1 = lt_mkt_attr-RELATION_FAM_1.
C_segment3-RELATION_FAM_2 = lt_mkt_attr-RELATION_FAM_2.
C_segment3-RELATION_FAM_3 = lt_mkt_attr-RELATION_FAM_3.
C_segment3-RELATION_FAM_4 = lt_mkt_attr-RELATION_FAM_4.
C_segment3-RELATION_FAM_5 = lt_mkt_attr-RELATION_FAM_5.
C_segment3-REL_ACTIVE_STAT = lt_mkt_attr-REL_ACTIVE_STAT.
C_segment3-REL_KISAN_MITRA_STAT = lt_mkt_attr-REL_KISAN_MITRA_STAT.
C_segment3-REL_NOM = lt_mkt_attr-REL_NOM.
C_segment3-REL_PLASTIC_CARD_STAT = lt_mkt_attr-REL_PLASTIC_CARD_STAT.
C_segment3-REL_STAFF_STAT = lt_mkt_attr-REL_STAFF_STAT.
C_segment3-REMARKS = lt_mkt_attr-REMARKS.
C_segment3-ROCN = lt_mkt_attr-ROCN.
C_segment3-ROCN_FAM_1 = lt_mkt_attr-ROCN_FAM_1.
C_segment3-ROCN_FAM_2 = lt_mkt_attr-ROCN_FAM_2.
C_segment3-ROCN_FAM_3 = lt_mkt_attr-ROCN_FAM_3.
C_segment3-ROCN_FAM_4 = lt_mkt_attr-ROCN_FAM_4.
C_segment3-ROOMS_PER_FLAT = lt_mkt_attr-ROOMS_PER_FLAT.
C_segment3-SCH_NUM = lt_mkt_attr-SCH_NUM .
C_segment3-SECONDARYEMAIL = lt_mkt_attr-SECONDARYEMAIL.
C_segment3-SERIAL_NUM = lt_mkt_attr-SERIAL_NUM.
C_segment3-SOCIETY_MEMBER = lt_mkt_attr-SOCIETY_MEMBER.
C_segment3-SOC_CONTNO_LL = lt_mkt_attr-SOC_CONTNO_LL.
C_segment3-SOC_CONTNO_MOB = lt_mkt_attr-SOC_CONTNO_MOB.
C_segment3-SOC_CONT_DESIG = lt_mkt_attr-SOC_CONT_DESIG.
C_segment3-SOC_CONT_PER_NAM = lt_mkt_attr-SOC_CONT_PER_NAM.
C_segment3-STANCHART = lt_mkt_attr-STANCHART.
C_segment3-ST_CODE = lt_mkt_attr-ST_CODE.
C_segment3-ST_CODE_OLD = lt_mkt_attr-ST_CODE_OLD.
C_segment3-ST_EMP_CODE = lt_mkt_attr-ST_EMP_CODE.
C_segment3-TEENAGERS = lt_mkt_attr-TEENAGERS.
C_segment3-SBI = lt_mkt_attr-SBI.
C_segment3-ZLAT1 = lt_mkt_attr-ZLAT1.
C_segment3-ZLONG1 = lt_mkt_attr-ZLONG1.
C_segment3-ZWING_GEOCODE = lt_mkt_attr-ZWING_GEOCODE.
C_segment3-ZNAMEPLATE_PHOTO = lt_mkt_attr-ZNAMEPLATE_PHOTO.
C_segment3-ZLATITUDE = lt_mkt_attr-ZLATITUDE.
C_segment3-ZLONGITUDE = lt_mkt_attr-ZLONGITUDE.
C_segment3-ZLATITUDE_N_LONGITUDE = lt_mkt_attr-ZLATITUDE_N_LONGITUDE.
C_segment3-ZWING_PHOTO = lt_mkt_attr-ZWING_PHOTO.
C_segment3-ZCATEGORY_SHOPS = lt_mkt_attr-ZCATEGORY_SHOPS.
C_segment3-ZNUM_OF_SHOPS = lt_mkt_attr-ZNUM_OF_SHOPS.
C_segment3-ZELECT_SURVILL = lt_mkt_attr-ZELECT_SURVILL.
C_segment3-ZBUILDING_TYPE = lt_mkt_attr-ZBUILDING_TYPE.
C_segment3-ZFLATS_PER_FLOOR = lt_mkt_attr-ZFLATS_PER_FLOOR.
C_segment3-ZBULDNG_FLOOR = lt_mkt_attr-ZBULDNG_FLOOR.
C_segment3-ZSWIMMING_POOL = lt_mkt_attr-ZSWIMMING_POOL.
C_segment3-ZGYM = lt_mkt_attr-ZGYM.
idoc_data-segnam = 'ZE101CRMXIF_MKT_ATTR_DATA3'.
idoc_data-sdata = c_segment4.
append idoc_data.
c_segment4-others = lt_mkt_attr-others.
c_segment4-OCCU_OD = lt_mkt_attr-OCCU_OD.
c_segment4-ZFLAT_TYPE = lt_mkt_attr-ZFLAT_TYPE.
idoc_data-segnam = 'ZE101CRMXIF_MKT_ATTR_DATA4'.
idoc_data-sdata = c_segment4.
append idoc_data.
ENDLOOP.
IDOC_CONTROL-MESTYP = c_messagetype.
IDOC_CONTROL-DOCTYP = c_idoc_type.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
MASTER_IDOC_CONTROL = IDOC_CONTROL
* OBJ_TYPE = ''
* CHNUM = ''
TABLES
COMMUNICATION_IDOC_CONTROL = t_comm_control
MASTER_IDOC_DATA = IDOC_DATA
* EXCEPTIONS
* ERROR_IN_IDOC_CONTROL = 1
* ERROR_WRITING_IDOC_STATUS = 2
* ERROR_IN_IDOC_DATA = 3
* SENDING_LOGICAL_SYSTEM_UNKNOWN = 4
* OTHERS = 5
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFUNCTION.
i implement a badi "CRMXIF_PARTNER_MAP"
data ls_mkt_attr type zcrmxif_mkt_str.
LOOP AT cs_data_mapped INTO ls_data_mapped .
lv_tabix = sy-tabix.
loop at ls_data_mapped-ZZPARTNER-ZZMKT_ATTR into ls_mkt_attr.
read table ls_data_mapped-zzpartner-ZZMKT_ATTR into ls_mkt_attr index 1.
if ls_mkt_attr is not initial.
CALL FUNCTION 'ZCRMXIF_MKT_DATA'
EXPORTING
EV_MKT_ATTR = ls_mkt_attr
endif.
endloop.
read table ls_data_mapped-zzpartner-ZZMKT_ATTR into ls_mkt_attr index 1.
MODIFY cs_data_mapped FROM ls_data_mapped INDEX lv_tabix.
endloop.
i ddn't get data into sructure.
please explain how to doit. -
File archiving in application server ?
Hi Experts,
How to a archive file in application server to another folder? Is there any function module used for that?.
ThanksHi Dan
For archiving, we can use FM: <b>EPS_DELETE_FILE</b> for archiving a file.
Below code can help you understand for moving a file:
[code]FUNCTION y_copy_file_within_appli_serv.
""Local interface:
*" IMPORTING
*" VALUE(RFC_DESTINATION) LIKE RFCDES-RFCDEST
*" VALUE(LOCAL_FILE) LIKE EPSF-EPSFILNAM
*" VALUE(LOCAL_DIRECTORY) LIKE EPSF-EPSDIRNAM DEFAULT SPACE
*" VALUE(REMOTE_FILE) LIKE EPSF-EPSFILNAM DEFAULT SPACE
*" VALUE(REMOTE_DIRECTORY) LIKE EPSF-EPSDIRNAM DEFAULT SPACE
*" VALUE(OVERWRITE_MODE) LIKE EPSF-EPSOVRWRI DEFAULT SPACE
*" VALUE(TEXT_MODE) LIKE EPSF-EPSTXTMOD DEFAULT SPACE
*" VALUE(TRANSMISSION_MONITOR) LIKE EPSF-EPSTRAMON DEFAULT 'X'
*" VALUE(RECORDS_PER_TRANSFER) LIKE EPSF-EPSRECTRA DEFAULT 10
*" VALUE(REQUESTED_FILE_SIZE) LIKE EPSF-EPSFILSIZ DEFAULT 0
*" VALUE(MONITOR_TITLE) LIKE EPSF-EPSTEXT OPTIONAL
*" VALUE(MONITOR_TEXT1) LIKE EPSF-EPSTEXT OPTIONAL
*" VALUE(MONITOR_TEXT2) LIKE EPSF-EPSTEXT OPTIONAL
*" VALUE(PROGRESS_TEXT) LIKE EPSF-EPSTEXT OPTIONAL
*" VALUE(OBJECT_NAME) LIKE EPSF-EPSFILNAM OPTIONAL
*" EXPORTING
*" VALUE(LOCAL_DIRECTORY) LIKE EPSF-EPSDIRNAM
*" VALUE(LOCAL_PATH) LIKE EPSF-EPSPATH
*" VALUE(REMOTE_FILE) LIKE EPSF-EPSFILNAM
*" VALUE(REMOTE_DIRECTORY) LIKE EPSF-EPSDIRNAM
*" VALUE(REMOTE_PATH) LIKE EPSF-EPSPATH
*" VALUE(FILE_SIZE) LIKE EPSF-EPSFILSIZ
*" VALUE(LOCAL_SYSTEM_INFO) LIKE EPSFTPSI STRUCTURE EPSFTPSI
*" VALUE(REMOTE_SYSTEM_INFO) LIKE EPSFTPSI STRUCTURE EPSFTPSI
*" EXCEPTIONS
*" OPEN_INPUT_FILE_FAILED
*" OPEN_OUTPUT_FILE_FAILED
*" READ_BLOCK_FAILED
*" WRITE_BLOCK_FAILED
*" CLOSE_OUTPUT_FILE_FAILED
*" INVALID_FILE_SIZE
*" STOPPED_BY_USER
*" INVALID_INPUT_FILE_SIZE
*" RESTART_FAILED
*" CONNECTION_FAILED
*" INVALID_VERSION
DATA: BEGIN OF eps_buffer OCCURS 10.
INCLUDE STRUCTURE tbl8000.
DATA: END OF eps_buffer.
DATA: BEGIN OF eps_txtbuf OCCURS 0.
INCLUDE STRUCTURE epsteco.
DATA: END OF eps_txtbuf.
DATA: ls_save_moni LIKE g$moni.
DATA: lv_local_file_size LIKE epsf-epsfilsiz,
lv_remote_file_size LIKE epsf-epsfilsiz,
lv_block_size LIKE epsf-epsfilsiz,
lv_number_of_records LIKE epsf-epsrectra,
lv_last_record_length LIKE epsf-epsreclen,
lv_max_record_length LIKE epsf-epsreclen,
lv_end_of_file LIKE epsf-epsflag,
lv_low_rc LIKE sy-subrc,
lv_rfc_message LIKE sy-msgv1,
lv_restart_flag LIKE epsf-epsflag,
lv_pattern LIKE tbl8000-line,
lv_records_to_skip LIKE epsf-epsrectra,
lv_skiped_size LIKE epsf-epsfilsiz.
check parameters (only if not started from EPS_ftp_mput)
IF transmission_monitor <> gc_mon_flag_m.
PERFORM get_ftp_system_info " get ftp system info
USING
rfc_destination
CHANGING
local_system_info
remote_system_info.
PERFORM check_ftp_version " check ftp version
USING
text_mode
remote_system_info.
PERFORM check_overwrite_mode " check OVERWRITE_MODE
USING
text_mode
CHANGING
overwrite_mode.
PERFORM check_records_per_transfer " check RECORDS_PER_TRANSFER
USING
text_mode
CHANGING
records_per_transfer.
ENDIF.
determine block_size [byte] (binary mode only)
IF text_mode <> 'X'.
*>>> Begin of modification for change log reference UnicodeC <<<
DESCRIBE FIELD eps_buffer-line LENGTH lv_max_record_length.
DESCRIBE FIELD eps_buffer-line LENGTH lv_max_record_length IN
BYTE MODE.
*<<< End of modification for change log reference UnicodeC >>>
lv_block_size = lv_max_record_length * records_per_transfer.
ENDIF.
open local file for input
CALL FUNCTION 'EPS_OPEN_INPUT_FILE'
EXPORTING
file_name = local_file
dir_name = local_directory
text_mode = text_mode
IMPORTING
dir_name = local_directory
file_path = local_path
file_size = lv_local_file_size
EXCEPTIONS
invalid_eps_subdir = 11
sapgparam_failed = 12
build_directory_failed = 13
no_authorization = 14
build_path_failed = 15
open_failed = 16
read_directory_failed = 17
read_attributes_failed = 18.
lv_low_rc = sy-subrc.
IF sy-subrc <> 0.
CALL FUNCTION 'EPS_CLOSE_FILE'
EXPORTING
file_name = local_file
dir_name = local_directory
EXCEPTIONS
OTHERS = 99.
MESSAGE e001 WITH lv_low_rc local_file local_directory
space " rfc message
RAISING open_input_file_failed.
ENDIF.
check file size
IF requested_file_size <> 0 AND
requested_file_size <> lv_local_file_size.
CALL FUNCTION 'EPS_CLOSE_FILE'
EXPORTING
file_name = local_file
dir_name = local_directory
EXCEPTIONS
OTHERS = 99.
lv_low_rc = 0.
MESSAGE e008 WITH lv_low_rc local_file
requested_file_size lv_local_file_size
RAISING invalid_input_file_size.
ENDIF.
open remote file for output
IF remote_file = space. " no remote file specified
remote_file = local_file. " -> remote file = local file
ENDIF.
IF text_mode = 'X' AND " no restart in textmode
overwrite_mode = 'R'.
overwrite_mode = 'S'.
ENDIF.
CALL FUNCTION 'EPS_OPEN_OUTPUT_FILE'
DESTINATION rfc_destination
EXPORTING
file_name = remote_file
dir_name = remote_directory
file_size_request = lv_local_file_size
overwrite_mode = overwrite_mode
text_mode = text_mode
IMPORTING
dir_name = remote_directory
file_path = remote_path
restart_flag = lv_restart_flag
EXCEPTIONS
system_failure = 03 MESSAGE lv_rfc_message
communication_failure = 04 MESSAGE lv_rfc_message
invalid_eps_subdir = 11
sapgparam_failed = 12
build_directory_failed = 13
no_authorization = 14
build_path_failed = 15
open_failed = 16
file_already_exists = 19.
lv_low_rc = sy-subrc.
IF sy-subrc <> 0.
CALL FUNCTION 'EPS_CLOSE_FILE'
DESTINATION rfc_destination
EXPORTING
file_name = remote_file
dir_name = remote_directory
EXCEPTIONS
OTHERS = 99.
CALL FUNCTION 'EPS_CLOSE_FILE'
EXPORTING
file_name = local_file
dir_name = local_directory
EXCEPTIONS
OTHERS = 99.
MESSAGE e002 WITH lv_low_rc remote_file remote_directory
lv_rfc_message
RAISING open_output_file_failed.
ENDIF.
restart file transfer
IF lv_restart_flag = 'X'.
ls_save_moni = g$moni. " save monitor data
CALL FUNCTION 'EPS_SEEK_OUTPUT_FILE'
DESTINATION rfc_destination
EXPORTING
file_name = remote_file
dir_name = remote_directory
records_per_transfer = records_per_transfer
object_name = object_name
IMPORTING
pattern = lv_pattern
records_to_skip = lv_records_to_skip
EXCEPTIONS
system_failure = 03 MESSAGE lv_rfc_message
communication_failure = 04 MESSAGE lv_rfc_message
invalid_eps_subdir = 11
sapgparam_failed = 12
build_directory_failed = 13
no_authorization = 14
build_path_failed = 15
open_failed = 16
read_directory_failed = 17
read_attributes_failed = 18
read_failure = 20
write_failure = 21
OTHERS = 99.
lv_low_rc = sy-subrc.
IF sy-subrc <> 0.
CALL FUNCTION 'EPS_CLOSE_FILE'
EXPORTING
file_name = local_file
dir_name = local_directory
EXCEPTIONS
OTHERS = 99.
g$moni = ls_save_moni. " restore monitor data
MESSAGE e009 WITH lv_low_rc remote_file remote_directory
lv_rfc_message
RAISING restart_failed.
ENDIF.
CALL FUNCTION 'EPS_SEEK_INPUT_FILE'
EXPORTING
pattern = lv_pattern
records_to_skip = lv_records_to_skip
file_path = local_path
records_per_transfer = records_per_transfer
EXCEPTIONS
read_failure = 20
write_failure = 21
end_of_file = 22
pattern_not_found = 23
OTHERS = 99.
lv_low_rc = sy-subrc.
IF sy-subrc <> 0.
CALL FUNCTION 'EPS_CLOSE_FILE'
DESTINATION rfc_destination
EXPORTING
file_name = remote_file
dir_name = remote_directory
EXCEPTIONS
OTHERS = 99.
CALL FUNCTION 'EPS_CLOSE_FILE'
EXPORTING
file_name = local_file
dir_name = local_directory
EXCEPTIONS
OTHERS = 99.
CALL FUNCTION 'EPS_DELETE_FILE'
DESTINATION rfc_destination
EXPORTING
file_name = remote_file
dir_name = remote_directory
EXCEPTIONS
OTHERS = 99.
g$moni = ls_save_moni. " restore monitor data
MESSAGE e009 WITH lv_low_rc remote_file remote_directory
space " rfc message
RAISING restart_failed.
ENDIF.
lv_skiped_size = lv_records_to_skip * lv_max_record_length.
g$moni = ls_save_moni. " restore monitor data
ENDIF.
start transmission monitor
IF transmission_monitor <> 'M'.
PERFORM monitor_open
USING transmission_monitor
monitor_title.
PERFORM monitor_set_values
USING gc_ftp_put
progress_text
monitor_text1
monitor_text2
rfc_destination
local_file
0 " total files
0 " current file
0 " maxval gauge 1
lv_local_file_size " maxval gauge 2
0 " skiped size gauge 1
lv_skiped_size. " skiped size gauge 2
ELSE.
PERFORM monitor_update_values
USING 0 " increment
0 " skiped size gauge 1
lv_skiped_size. " skiped size gauge 2
ENDIF.
file transfer ------------------------------------------ begin -------
CLEAR lv_end_of_file.
WHILE lv_end_of_file <> 'X'.
read block from input file
IF text_mode = 'X'.
REFRESH eps_txtbuf.
CALL FUNCTION 'EPS_READ_TEXT_BLOCK'
EXPORTING
file_path = local_path
records_per_transfer = records_per_transfer
IMPORTING
end_of_file = lv_end_of_file
TABLES
eps_buffer = eps_txtbuf
EXCEPTIONS
read_failure = 20.
ELSE.
REFRESH eps_buffer.
CALL FUNCTION 'EPS_READ_BLOCK'
EXPORTING
file_path = local_path
records_per_transfer = records_per_transfer
IMPORTING
number_of_records = lv_number_of_records
last_record_length = lv_last_record_length
end_of_file = lv_end_of_file
TABLES
eps_buffer = eps_buffer
EXCEPTIONS
read_failure = 20.
ENDIF.
lv_low_rc = sy-subrc.
IF sy-subrc <> 0.
IF transmission_monitor = 'X'. " stop monitor
PERFORM monitor_stop.
ENDIF.
MESSAGE e003 WITH lv_low_rc local_path space
RAISING read_block_failed.
ENDIF.
write block into output file
IF text_mode = 'X'.
CALL FUNCTION 'EPS_WRITE_TEXT_BLOCK'
DESTINATION rfc_destination
EXPORTING
file_path = remote_path
IMPORTING
transfered_bytes = lv_block_size
TABLES
eps_buffer = eps_txtbuf
EXCEPTIONS
system_failure = 03 MESSAGE lv_rfc_message
communication_failure = 04 MESSAGE lv_rfc_message
write_failure = 21.
ELSE.
CALL FUNCTION 'EPS_WRITE_BLOCK'
DESTINATION rfc_destination
EXPORTING
file_path = remote_path
number_of_records = lv_number_of_records
last_record_length = lv_last_record_length
TABLES
eps_buffer = eps_buffer
EXCEPTIONS
system_failure = 03 MESSAGE lv_rfc_message
communication_failure = 04 MESSAGE lv_rfc_message
write_failure = 21.
ENDIF.
lv_low_rc = sy-subrc.
IF sy-subrc <> 0.
IF transmission_monitor = 'X'. " stop monitor
PERFORM monitor_stop.
ENDIF.
MESSAGE e004 WITH lv_low_rc remote_path lv_rfc_message
RAISING write_block_failed.
ENDIF.
update transmission monitor
PERFORM monitor_update_values
USING lv_block_size " increment
0 " skiped size gauge 1
0. " skiped size gauge 2
IF g$moni-cancel = 'X'. " stop transmission
MESSAGE e007 RAISING stopped_by_user.
ENDIF.
ENDWHILE.
file transfer ------------------------------------------ end ---------
stop transmission monitor
IF transmission_monitor = 'X'.
PERFORM monitor_stop.
ENDIF.
close output file and get size
CALL FUNCTION 'EPS_CLOSE_FILE'
DESTINATION rfc_destination
EXPORTING
file_name = remote_file
dir_name = remote_directory
IMPORTING
file_size = lv_remote_file_size
EXCEPTIONS
system_failure = 03 MESSAGE lv_rfc_message
communication_failure = 04 MESSAGE lv_rfc_message
build_path_failed = 15
read_directory_failed = 17
read_attributes_failed = 18.
lv_low_rc = sy-subrc.
IF sy-subrc <> 0.
MESSAGE e005 WITH lv_low_rc remote_file remote_directory
lv_rfc_message
RAISING close_output_file_failed.
ENDIF.
compare size of local and remote file (binary mode only)
IF text_mode <> 'X'.
IF lv_local_file_size <> lv_remote_file_size.
lv_low_rc = 0.
MESSAGE e006 WITH lv_low_rc local_file lv_local_file_size
RAISING invalid_file_size.
ENDIF.
ENDIF.
file_size = lv_local_file_size.
ENDFUNCTION.[/code]
Regards
Eswar -
How to copy file from application server
Hello experts,
How to copy file from one folder of application server and paste it to other folder of application server(application server is same)?
Is there any function module exists???
thanks in advance
SaurabhHi you can use this function module to move a file from application server to another folder on application server.
call function 'WS_FILE_COPY'
exporting
destination = m_destination
source = m_source
importing
return = return.
Plus u can use this function module to delete the file from that folder from which u want to replace it.
call function 'WS_FILE_DELETE'
exporting
file = m_source
importing
return = return.
The above FM can help u copy a file from one folder to another and delete the file from that folder. -
Regarding moving files b/w folders in the Application server
Hi,
I need to move the file from one folder(main folder) of the application server to another (eg, archive, error) with certain conditions. When I try to move file from main folder to archive folder, it is working fine (.txt). The file along with the contents are moving, but when I try to move the file from main folder to error folder (.err), though the file has moved, the contents are not showing (though the file is erased from the main folder). I have used the function module
SXPG_COMMAND_EXECUTE for performing these actions. Can any one suggest as to why the contents are not showing.
LEAR: lv_mv_command_exitcode,
lv_mv_command_arguments,
lv_dummy_string.
CONCATENATE is_dir_list-fullname iv_error_file INTO lv_mv_command_arguments
SEPARATED BY space.
REFRESH lt_mv_command_stdout.
CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
EXPORTING
commandname = 'ZMV'
additional_parameters = lv_mv_command_arguments
IMPORTING
exitcode = lv_mv_command_exitcode
TABLES
exec_protocol = lt_mv_command_stdout
EXCEPTIONS
no_permission = 1
command_not_found = 2
parameters_too_long = 3
security_risk = 4
wrong_check_call_interface = 5
program_start_error = 6
program_termination_error = 7
x_error = 8
parameter_expected = 9
too_many_parameters = 10
illegal_command = 11
wrong_asynchronous_parameters = 12
cant_enq_tbtco_entry = 13
jobcount_generation_error = 14
OTHERS = 15.
IF sy-subrc <> 0 OR lv_mv_command_exitcode <> 0.
CONCATENATE 'Error in File'
iv_basefile
'but,not moved to Error folder.'
INTO lv_dummy_string SEPARATED BY space.
WRITE: / lv_dummy_string.
IF sy-batch = c_flag_on.
MESSAGE e054 WITH iv_basefile.
ENDIF.
ELSE.
CONCATENATE 'Error in File,'
iv_basefile
'moved to Error folder.'
INTO lv_dummy_string SEPARATED BY space.
WRITE: / lv_dummy_string.
IF sy-batch = c_flag_on.
MESSAGE s055 WITH iv_basefile.
ENDIF.
Regards,
JohnHi,
Here what I found was, if the file is empty, then the system is not moving the empty file to the destination , but if the file is not empty it is copying the contents and the corresponding folder to the destination folder. My intent is to copy the folder even if the contents of the folder is empty to the destination folder and delete the old file.
regards,
John -
How to bring the data from application server to presentation server
hi,
i have one problem,i have written the program which will open the files in the application server when we run the program in the background(sm37),the same data from application server i want to bring into presentation server in the format of (.csv),how to bring the data from application to presentation server can any body help me on this topic.folowing is the code .
*& Report ZPFA_HIER_LOAD
REPORT ZFPA_HIER_LOAD.
*---- Declaration of Oracle connectioN
DATA con_name LIKE dbcon-con_name VALUE 'COMSHARE'.
DATA: MFL1(9),MFL2(5),MFL3(9),MFL4(2),MFL5(8) TYPE c.
DATA : mfilename type string.
data: begin of matab1 occurs 0,
MFL1(9) TYPE C,
MFL2(5) TYPE C,
MFL3(9) TYPE C,
MFL4(2) TYPE C,
MFL5(8) TYPE C ,
end of matab1 .
data: setid(8) type c.
data: begin of source occurs 0,
setid(8) type c,
end of source.
*PARAMETERS : p_pfile LIKE filename-FILEEXTERN.
*PARAMETERS : m_bsenty(8). " type c obligatory.
*mfilename = P_PFILE.
EXEC SQL.
SET CONNECTION :con_name
ENDEXEC.
EXEC SQL.
CONNECT TO :con_name
ENDEXEC.
EXEC SQL PERFORMING get_source.
SELECT set_id FROM UNIT_SET INTO
:setid
ORDER BY SET_ID
ENDEXEC.
start-of-selection.
LOOP AT SOURCE.
REFRESH matab1. CLEAR matab1.
EXEC SQL PERFORMING evaluate.
SELECT TO_CHAR(MEM_ID),TRIM(TO_CHAR(MEM_PID)) FROM UNIT_TREE INTO :MFL1,
:MFL5
where set_id = :SOURCE-SETID ORDER BY MEM_ID
ENDEXEC.
if SOURCE-SETID = '80000000'.
mfilename = '/tmp/aesorg'.
elseif SOURCE-SETID = '80000006'.
mfilename = '/tmp/Consolidation_Manager'.
elseif SOURCE-SETID = '80000010'.
mfilename = '/tmp/10org'.
elseif SOURCE-SETID = '80000012'.
mfilename = '/tmp/20org'.
elseif SOURCE-SETID = '80000018'.
mfilename = '/tmp/30org'.
elseif SOURCE-SETID = '80000025'.
mfilename = '/tmp/40org'.
Endif.
mfilename = '/usr/test.dat'.
************************This was i tried***********************
open dataset mfilename for output in text mode encoding default." IN
*TEXT MODE ENCODING DEFAULT.
if sy-subrc <> 0.
exit.
endif.
close dataset mfilename.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = MFILENAME
FILETYPE = 'ASC'
TABLES
data_tab = matab1
EXCEPTIONS
file_write_error = 1
invalid_type = 2
no_authority = 3
unknown_error = 4
OTHERS = 10.
loop at matab1 .
transfer matab1 to mfilename.
endloop.
clear matab1.
ENDLOOP.
loop at matab1 .
transfer matab1 to mfilename.
endloop.
close dataset mfilename.
MFL5 = '0'.
CLEAR MFL5.
FORM evaluate.
if MFL5 = -1.
MFL5 = ''.
ENDIF.
concatenate MFL1 ',' into MFL1.
concatenate MFL1 ',' into MFL3.
matab1-MFL1 = MFL1.
matab1-MFL2 = 'ZBUE,'.
matab1-MFL3 = MFL3.
matab1-MFL4 = ' ,'.
matab1-MFL5 = MFL5.
append matab1 .
CLEAR MFL1.
CLEAR MFL2.
CLEAR MFL3.
CLEAR MFL4.
CLEAR MFL5.
ENDFORM.
"evaluate
*& Form GET_SOURCE
text
FORM GET_SOURCE.
source-setid = setid.
append source.
clear source.
ENDFORM. "GET_SOURCEHi Rammohan,
You cannot use OPEN DATASET to transfer data from application server to presentation server.
You can do the following :
<b>Do 1st point in BACKGROUND</b>
1. Read the data file from application server into an internal table using OPEN DATASET
<b>Do 2nd point in Foreground</b>
2. Once you get the data into an internal table, then use FM GUI_DOWNLOAD to download it on presentation server
You cannot use the above 2 point together in Background because its not possible. Hence you need program it partially in background and partially in foreground.
Best regards,
Prashant -
I want to send data from One server to another
Hi all,
My requirement to send data from one server's application server path(data in one directory in Al11 of the source server) to another server's application server(TO another directory in Al11 transaction of the destination server).
What are all the ways to achieve this task.
Thanks in Advance.
RajaWhile the FTP option mentioned above is workable, both servers should have some form of FTP service running with reference to this solution.
I suggest two more options, just to give you an idea. I am not getting into details as it is important to get the big picture first before working on details.
1: Through RFC destinations:
You can define two RFc destinations, each pointing to the specific application server. Assuming the server names are SOURCE and TARGET, you can have two RFC destinations where you differentiate the servers by specifying the host name or IP address.
Once the destinations are defined, you need to develop two RFC enabled function module, one will be used to read the file and return it in form of internal table. The other will be get the internal table as input and should save it on server (using abap commands open dataset etc.)
Now you can have an ABAP program where you first call the function which is reading the file. In call function you mention the RFC destination of source server.
Once the file is read, you than call the second function module with destination to target server and save the internal table to a file.
2: Through Background job programming
While scheduling a background job, you can specify target system which forces the background job to run on that target application server. The basic idea here is to have two abap programs, one would be used to read file and export it to database table like INDX (we can call it ZPRG1), the other will import from the table INDX and write it as a file (we can call it ZPRG2).
Now you can define a job through SM36, using ZPRG1 as program, and target system as the first application server. This job you can schedule to run periodically.
Also define a second job through SM36, using ZPRG2 as program and target system as the second application server. For this job, the starting condition you can put as After completion of job1.
Another method one can be by using FMs used in tcode SM49 but for that I think your sysadmin might have to create a batch file/script first. Which you can later call from ABAP.
Cheers. -
Connection of oracle database in database server from application server
Hi,
I have two servers, one is application server and another one is database server…..
I want to connect oracle 10g database in database server to application server. In application server oracle 10g client is installed……In database server, I have set tnsnames.ora, Listener.ora …while checking in lsnrctl…the particular sid is running fine…
In application server, while I give as sqlplus
After giving username and password its showing error as
ORA-12545: Connect failed because target host or object does not exist
While surfing in net it shows check tnsnames.ora and listener.ora….. I have set the environmental variables here in application server…..
It’s connecting when I give
Sqlplus
Sql>username/password @ hostname: 1521/sid_name
Is it possible to connect with the username and password
I have set the host names in /etc/hosts….
If we are giving the hostname, port number and Sid name this connects without using tnsnames.ora…..
While pinging between two servers the connectivity is there between two servers…..
Could u pls help me out?
Thanks in advancehi,
as u said i have done that ..s.till the same problem persists...
lsnrctl>services
$ lsnrctl
LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 08-FEB-2007 03:56:23
Copyright (c) 1991, 2005, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> services
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
Services Summary...
Service "RBTT" has 1 instance(s).
Instance "RBTT", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
Service "RBTTXDB" has 1 instance(s).
Instance "RBTT", status READY, has 1 handler(s) for this service...
Handler(s):
"D000" established:0 refused:0 current:0 max:1022 state:ready
DISPATCHER <machine: emea, pid: 197076>
(ADDRESS=(PROTOCOL=tcp)(HOST=emea)(PORT=37484))
Service "RBTT_XPT" has 1 instance(s).
Instance "RBTT", status READY, has 1 handler(s) for this service...
Handler(s):
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER -
Transport from one server to another
Can someone please explain me on how to transfer data from one server to another? like form dev to prod?
ashishHi,
Do u mean transport Objects or Data ??
If Objects i.e SLD, Repository Objects, Directory Objects etc go thru this 3 series blog :
/people/sap.india5/blog/2005/11/28/xi-software-logistics-solution-iii-cms
if data means, you need to go with Conversions or Table Copy or Client copy ...
Rgds,
Moorthy
Maybe you are looking for
-
E-Recruiting - Hiring Manager field data is changing to 00000000 in job requisition
Hi Nicole, I am facing an issue with hiring manager search. Am on a EREC standalone system. EHP5, SP0007. HCM_ERC_CI_2 & 3 business functions are activated. NB data is available in 5131 for US of hiring managers, 5152 support group also has hiring ma
-
How to get the pull path name from a file upload window
Hello everyone! I have encountered the following problem with the following JSP code: <form method="post" action="filename.jsp"> Upload JAVA program: <input type=file size=20 name="fname" accept="java"> <input type=submit value="go"> </form> <% Strin
-
BI report - +Sum for Characteristics
I am trying to build a query in Bex Analyzer and I created a calculated key figure from a characteristic. I created a forumula variable using replacement path and referencing the characteristic that I need to sum. When I run the query, the total is i
-
SXMB_MONI - Error accessing persistence layer
Hi, In SXMB_MONI there are messages with status "system error manual restart possible" and "scheduled". when i try opening those messages it says "XML message not found". I no longer need those messages and want to delete them. But when i try to canc
-
Standard extractors for pricing conditons in CRM
HI Guys, I would like to extract pricing conditions from CRM and wondering if there is a standard extractor for that. thanks