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: 

Need to tranfer File from AL11 to Archive Server

mariano_sabiche
Active Participant
0 Kudos

Hello Gurus;

I have an issue when I want transfer a File from AL11 to Archive Server. The file are broke in the middle of the process.

I'm ussing the function modules:

MOVE gv_extension TO lv_extension.

   TRANSLATE lv_extension TO UPPER CASE.

   CLEAR gs_clases.

   READ TABLE gt_clases INTO gs_clases

           WITH KEY docuclass = lv_extension.

   IF sy-subrc EQ 0.

     lv_doc_type = gs_clases-ar_object.

*prueba de leer el dataset antes de crear el archivo en el Archive

     CALL FUNCTION 'ARCHIVOBJECT_CREATE_FILE'

       EXPORTING

         archiv_id                = c_d1

         document_type            = lv_doc_type

         path                     = gv_path

       IMPORTING

         archiv_doc_id            = lv_arc_docid

       EXCEPTIONS

         error_archiv             = 1

         error_communicationtable = 2

         error_upload             = 3

         error_kernel             = 4

         blocked_by_policy        = 6

         OTHERS                   = 7.

     IF sy-subrc <> 0.

* Implement suitable error handling here

       MOVE text-004 TO gv_texto_obs.

       PERFORM f_guardar_log

                   USING

                      '1'

                      gv_texto_obs.

     ELSE.

       MOVE lv_arc_docid TO gv_id_arc.

       READ TABLE gt_archiving INTO gs_archiving

             WITH KEY vbeln = wa_salida-clmno

                       dms_id = gv_id_dms.

       IF sy-subrc NE 0.

         MOVE wa_salida-clmno TO lv_object_id.

         MOVE lv_doc_type TO lv_ar_obj.

         CALL FUNCTION 'ARCHIV_CONNECTION_INSERT'

           EXPORTING

             archiv_id             = c_d1

             arc_doc_id            = lv_arc_docid

             ar_object             = lv_ar_obj

             object_id             = lv_object_id

             sap_object            = 'BUS2400'

             doc_type              = gv_extension

           EXCEPTIONS

             error_connectiontable = 1

             OTHERS                = 2.

Please, help.

Regards,

Mariano

1 ACCEPTED SOLUTION

Jelena
Active Contributor
0 Kudos

Kindly search in Google before posting on SCN. Simple search by the first FM name finds numerous existing posts. One solution is given at the end of this one, for example.

The code fragment posted does not really provide much information anyway as it does not show what actually happens with the content. The FM call itself is not likely a problem.

3 REPLIES 3

Former Member
0 Kudos

Hi Mariano,

In the below link  step by step explanation for how to move file another file.

http://scn.sap.com/community/unix/blog/2013/01/24/deleteremove-file-in-unix-folder-using-sm69-in-sap...#

hope this will help you.

Regards,

Marcelo Macedo

Jelena
Active Contributor
0 Kudos

Kindly search in Google before posting on SCN. Simple search by the first FM name finds numerous existing posts. One solution is given at the end of this one, for example.

The code fragment posted does not really provide much information anyway as it does not show what actually happens with the content. The FM call itself is not likely a problem.

0 Kudos

Thank you Jelena and Marcelo;

I found the solution in the thread -->

Regards,

Mariano