Application Development 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: 

applicationserver file

Former Member
0 Kudos

Hello friends,

I am able to open a directory and write data to it.

However when I go to AL11 and find for it am unable to see the file.

In debug mode I see the SY-subrc = 0.

OPEN DATASET p_apmap1 FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

Where Else should I see the file.

Thanks,

Ster.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello,

A couple of questions.

Is the directory that you are writing defined in AL11?

Did you CLOSE DATASET?

Can you open the file that you wrote?

Regards

Greg Kern

6 REPLIES 6

Former Member
0 Kudos

Hello,

A couple of questions.

Is the directory that you are writing defined in AL11?

Did you CLOSE DATASET?

Can you open the file that you wrote?

Regards

Greg Kern

0 Kudos

Thanks,

I can close the file.

I am trying to read the file using a difrent program and it reads as well.

But when I see in AL11, I am unable to locate the file.

Any Idea if the file stores some where else.

Ster

0 Kudos

Hello,

Is the directory(or even the parent of the directory) that you are writing defined/listed in AL11?

Or do you create the directory with your program?

You may need to configure AL11 to read the directory that you are writing to.( or have Basis configure it for you ).

Regards

Greg Kern

former_member189059
Active Contributor
0 Kudos

Hello,

Try using this FM

Change i_path to whichever directory you are writing to

you should be able to see the file then


data: lv_opath like dxfields-longpath.
  data: ev_server_name like btctgtsrvr-srvname,
        server_name like msxxlist-name.
  call 'C_SAPGPARAM'
  id 'NAME' field 'rdisp/myname'
  id 'VALUE' field ev_server_name.
  if sy-subrc <> 0.
    clear ev_server_name.
  endif.

  move ev_server_name to server_name.

  call function 'F4_DXFILENAME_TOPRECURSION'
   exporting
     i_location_flag       = 'X'
     i_server              = server_name
     i_path                = 'D:\'
*     FILEMASK              = '*.*'
*     FILEOPERATION         = 'R'
   importing
*     O_LOCATION_FLAG       =
*     O_SERVER              =
      o_path                = lv_opath
*     ABEND_FLAG            =
   EXCEPTIONS
     RFC_ERROR             = 1
     ERROR_WITH_GUI        = 2
     OTHERS                = 3
            .
  if sy-subrc <> 0.
   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.

Former Member
0 Kudos

Hi,

Use this FM

If you have multiple application sever best use this FM

CALL FUNCTION 'DX_FILE_WRITE'

EXPORTING

filename = target_filename

server = target_server

pc = space

TABLES

data_tab = lt_data_fix

EXCEPTIONS

OTHERS = 4.

Thanks,

Durai.V

Edited by: Durai V on Oct 7, 2008 6:14 AM

Former Member
0 Kudos

hi use the transaction CG3z to move the file from presentation server to application server, instead of doing code for that , u can use this