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: 

Files are not getting placed at AL11 Directory

ashish_verma
Explorer
0 Kudos

There is a custom program which uses OPEN DATASET, TRANSFER, CLOSER DATASET commands to create a file, transfer the data and close the file respectively. I am checking SY-SUBRC value after each operations. Even though there are no failure in the above mentioned statements, sometimes the files are generating successfully and sometimes not.

Could somebody tell the reason?

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor
0 Kudos

For these intermittent errors, when you have several application servers, it's frequent that the path where you write the file was not mapped by the administrators in all the servers. You can see that quickly by switching to each server via SM51, and run AL11 to verify if you find the path or not.

Reply by OP:

  • "i checked the applications server using transaction SM51 and found that there are multiple Application Servers. When i switched from an application server to another one i could see the file there."
  • "So the program is creating a file as expected now."
  • "Do we somehow pass the application server anywhere in some parameter so that everytime the file can be dropped to that server?"

My answer:

  • This customizing is to be done by the administrator, to map the paths of all application servers to a common place.
9 REPLIES 9

raymond_giuseppi
Active Contributor
0 Kudos
  • Could you post relevant part of your code?
  • Did you use some addition such as MESSAGE msg or the FILTER addition in your OPEN DATASET statement (without filter, close will always return 0 as soon as no exception is raised.)

0 Kudos

Hi Raymond

Please find the code below:

IF gt_output IS NOT INITIAL.

IF lv_destination IS INITIAL.

CONCATENATE lv_path lv_filename INTO lv_destination SEPARATED BY '/'.

ENDIF.

* Create file at the destination folder

IF gv_opndata_set IS INITIAL.

OPEN DATASET lv_destination FOR OUTPUT IN TEXT MODE ENCODING DEFAULT MESSAGE lv_msg_text.

IF sy-subrc NE 0.

MESSAGE e000(zcf_fallout) WITH lv_msg_text.

ELSE.

gv_opndata_set = abap_true.

PERFORM build_fieldcat_and_layout CHANGING lt_fcat.

PERFORM build_al11_header USING lt_fcat

CHANGING lv_header.

IF lv_header IS NOT INITIAL.

TRANSFER lv_header TO lv_destination.

ENDIF.

ENDIF.

ENDIF.

* Create Instance of Converter Class

CALL METHOD cl_rsda_csv_converter=>create

EXPORTING

i_delimiter = ' '

RECEIVING

r_r_conv = DATA(lo_conv).

DATA(lo_data) = cl_rsda_csv_converter=>get_char_workarea( ls_output ).

ASSIGN lo_data->* TO FIELD-SYMBOL(<lfs_data>).

LOOP AT gt_output ASSIGNING FIELD-SYMBOL(<lfs_output>). "#EC CI_LOOP_INTO_WA

CALL METHOD lo_conv->structure_to_csv

EXPORTING

i_s_data = <lfs_output> " I_S_DATA

IMPORTING

e_data = <lfs_data>. " E_DATA

REPLACE ALL OCCURRENCES OF cl_rsda_csv_converter=>c_default_delimiter IN <lfs_data> WITH space.

* CONDENSE <lfs_data> NO-GAPS.

* Transfer content to destination file

TRANSFER <lfs_data> TO lv_destination.

ENDLOOP.

CLOSE DATASET lv_destination.

IF sy-subrc IS INITIAL.

MESSAGE s001(zcf_fallout) WITH lv_filename p_path.

ENDIF.

Sandra_Rossi
Active Contributor

For these intermittent errors, when you have several application servers, it's frequent that the path where you write the file was not mapped by the administrators in all the servers. You can see that quickly by switching to each server via SM51, and run AL11 to verify if you find the path or not.

RichB
Participant
0 Kudos

When we have experienced this in the past it was always an authorization issue. You could watch it all of the way through the process and it will have good return codes, but the file never gets there

0 Kudos

Hi Rich,

We do not get anything in SU53 so it is not an authorization issue. In case if it would have been an authorization issue, no files should have been placed at all

jmodaal
Active Contributor

Hello,

I guess the comment from sandra.rossi leads into the right direction. My first thought when reading "sometimes the files are generating successfully and sometimes not" was, that your problem raises because of multiple application servers in your system. Sometimes your program / job runs on this server, next time on another one.

If there is a dedicated file server available in your system, you should use this file server for your files. If not, ask your basis for a common directory valid for all application servers. Or, in case there is a successor program / job, expecting the written file as an input file, ensure that it is running on the same application server than the one creating the file.

Kind regards

Jan

ashish_verma
Explorer
0 Kudos

Thanks sandra.rossi. i think you pointed towards the correct direction. i checked the applications server using transaction SM51 and found that there are multiple Application Servers. When i switched from an application server to another one i could see the file there.

So the program is creating a file as expected now.

Do we somehow pass the application server anywhere in some parameter so that everytime the file can be dropped to that server?

Sandra_Rossi
Active Contributor
0 Kudos

ashish_verma

This customizing is to be done by the administrator, to map the paths of all application servers to a common place.

NB: I create an answer.

jmodaal FYI

Sandra_Rossi
Active Contributor
0 Kudos

For these intermittent errors, when you have several application servers, it's frequent that the path where you write the file was not mapped by the administrators in all the servers. You can see that quickly by switching to each server via SM51, and run AL11 to verify if you find the path or not.

Reply by OP:

  • "i checked the applications server using transaction SM51 and found that there are multiple Application Servers. When i switched from an application server to another one i could see the file there."
  • "So the program is creating a file as expected now."
  • "Do we somehow pass the application server anywhere in some parameter so that everytime the file can be dropped to that server?"

My answer:

  • This customizing is to be done by the administrator, to map the paths of all application servers to a common place.