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 to Internal Table

Former Member
0 Likes
643

Can anyone pls let me know is there any function module to get all the files from a directory in the application server to an internal table ??? If not a function module is there anyway which i can get the files to FTP them to Non sap system......Pls help me out

6 REPLIES 6
Read only

Former Member
0 Likes
615

Hi,

Use FM EPS_GET_DIRECTORY_LISTING, pass the file path & get the list in an internal table.

Best regards,

Prashant

Read only

Former Member
0 Likes
615

OPEN DATASET FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc NE 0.

  • MESSAGE s107(yaero_ps) DISPLAY LIKE c_e.

message e008.

ELSE.

DO.

CLEAR: l_string.

READ DATASET FNAME INTO l_string LENGTH l_wllength.

IF sy-subrc NE 0.

EXIT.

ELSE.

SPLIT l_string AT con_tab INTO wa_data_file-ebeln

wa_data_file-ebelp.

APPEND wa_data_file TO fp_flatfile.

ENDIF.

ENDDO.

CLOSE DATASET FNAME.

and to get the file name use FM

CALL FUNCTION 'FILE_GET_NAME'

EXPORTING

LOGICAL_FILENAME = FP_FILE

OPERATING_SYSTEM = SY-OPSYS

IMPORTING

FILE_NAME = FNAME

EXCEPTIONS

FILE_NOT_FOUND = 1

OTHERS = 2.

Regards,

Bikash

Read only

Former Member
0 Likes
615

HI

here is the code for app server to internal table

parameters: v_data(132) lower case.------ file path

data: begin of record OCCURS 0,

-


structure-----

end of record.

start-of-selection.

open dataset v_data for input in text mode encoding default .

perform open_group.

do.

read dataset v_data into record.

if sy-subrc <> 0. exit. endif.

enddo.

perform close_group.

close dataset v_data.

regards

kishore

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
615

Hi,

Check the FM 'SKTX_DIRECTORY_FILE_LIST_GET'.

Read only

Former Member
0 Likes
615

HI mivrickk

what's your problem is using the functional module?

regards

kishore

Read only

hymavathi_oruganti
Active Contributor
0 Likes
615

open data set,----


opens file in app server

transfer,----


writes contents of file to int table

read data set-------reads contents from int table to file

close data set----


closes file