Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

application server

Former Member
0 Likes
576

Hi,

I want to move file from one directory to another directory in applicatioin server with out using OPENDATASET. Is it possible?

Pls let me know.

thanks

Jana.

4 REPLIES 4
Read only

Former Member
0 Likes
531

hi,

I feel you have to use open dataset for file manuplations on the application server.....

File manuplations...............................

At the application server level:

->OPEN DATASET : open a file in the application server for reading or writing.

->READ DATASET : used to read from a file on the application server that has been opened for reading

-> TRANSFER DATASET : writing data to a file.

-> CLOSE DATASET : closes the file

-> DELETE DATASET : delete file

<b>reward points if useful....</b>

regards,

Vinod Samuel.

Read only

Former Member
0 Likes
531

Hi

Get all the files from application server directory using function module EPS_GET_DIRECTORY_LISTING and process one by one.

For Each File:

1)Open, Read and Close current file using OPEN DATASET , READ DATASET, CLOSE DATASET

Further, parse strings and move to internal table.

2) Populate the customer table for inspection data with the file data fetched in last step. This table contains characteristics like Corbon%, Sulphur%, Mn% etc. against External Batch Number, Date & Time. Perfomr a check for duplicate record on this table at this point of time and data is inserted at the end of the processing.

3) Determine the grade of the sample pig iron by comparing the charactersics with the grade master table ( a customer table with grade determination rules ). This table contains Material with its minimum and maximum values of relevant characteristics.

4)Create Batch and populate characteristic values against that material and batch combination in SAP system.

Standard SAP has provided APIs for this purpose. Function Modules are 'CALO_INIT_API', 'CACL_OBJECT_ALLOCATION_MAINT', CACL_OBJECT_VALIDATION_MAINT', 'CACL_CLASSIFICATION_SAVE','VB_CREATE_BATCH' , 'CARD_CLASS_READ_CHARACTS'

Further, a customer function module 'Z_CREATE_BATCH_WITH_CHARCT' is developed using these FMs.

  • After finishing the processing for the current file move the file to archive directory. This is achieved by using FMs for copy 'PFL_COPY_OS_FILE' and delete 'EPS_DELETE_FILE'.

  • Insert records in inspection data table.

Regards

Pavan

Read only

Former Member
0 Likes
531

First, To download file from application server to desktop by T-Code: CG3Y

Then, upload file from desktop to application server by T-Code: CG3Z

Read only

Former Member
0 Likes
531

Hi,

You can make use of the function module 'EPS_FTP_PUT' for this, only restriction is you have specify the RFC destination for the same. We have used this for transfering the file from one application to another application server. I hope you can make use of this even for the same system by giving the rfc destination of your application server.

CALL FUNCTION 'EPS_FTP_PUT'

EXPORTING

rfc_destination = rfc_dest

local_file = loc_file

local_directory = loc_dir

remote_file = rem_file

remote_directory = rem_dir

overwrite_mode = 'F'

text_mode = 'X'

transmission_monitor = space

object_name = loc_file

EXCEPTIONS

open_input_file_failed = 1

open_output_file_failed = 2

read_block_failed = 3

write_block_failed = 4

close_output_file_failed = 5

invalid_file_size = 6

stopped_by_user = 7

invalid_input_file_size = 8

restart_failed = 9

connection_failed = 10

invalid_version = 11

OTHERS = 12.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Please let me know if this is useful to you or not..