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

Error in Background job

Former Member
0 Likes
1,843

when i run my program in foreground is working fine.

but in background mode it get dump and error message is  " Message type " " is unknown."

this is my code  pls help.

DATA : v_count TYPE i,
       it_infile TYPE  STANDARD TABLE OF  file_info,
       wa_infile TYPE file_info.


CALL METHOD cl_gui_frontend_services=>directory_list_files
   EXPORTING
     directory                   = '\\192.168.1.86\OUT\BINNING'
*    filter                      = '*.*'
     files_only                  = 'X'
*    directories_only            =
   CHANGING
     file_table                  = it_infile
     count                       = v_count
   EXCEPTIONS
     cntl_error                  = 1
     directory_list_files_failed = 2
     wrong_parameter             = 3
     error_no_gui                = 4
     not_supported_by_gui        = 5
     others                      = 6
         .
IF sy-subrc <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

when i run my program in foreground is working fine.

but in background mode it get dump and error message is  " Message type " " is unknown."

this is my code  pls help.

DATA : v_count TYPE i,
       it_infile TYPE  STANDARD TABLE OF  file_info,
       wa_infile TYPE file_info.


CALL METHOD cl_gui_frontend_services=>directory_list_files
   EXPORTING
     directory                   = '\\192.168.1.86\OUT\BINNING'
*    filter                      = '*.*'
     files_only                  = 'X'
*    directories_only            =
   CHANGING
     file_table                  = it_infile
     count                       = v_count
   EXCEPTIONS
     cntl_error                  = 1
     directory_list_files_failed = 2
     wrong_parameter             = 3
     error_no_gui                = 4
     not_supported_by_gui        = 5
     others                      = 6
         .
IF sy-subrc <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

6 REPLIES 6
Read only

former_member189779
Active Contributor
0 Likes
1,503

Its not possible to run front end services in back ground.

For back ground equivalent check http://scn.sap.com/thread/1431755

Read only

0 Likes
1,503

but my requirement is only for presentation server

because i work on two different system one is sap and another is .net base system

my .net system download file on  '\\192.168.1.86\OUT\BINNING'

and i pick up the all file form that path and update data is sap system with no user interaction

Read only

0 Likes
1,503

Hi,

If that's your design then you can use background processing. You can download the file in desktop move it to application server then use the path in the application server to do your background processing.

Cheers,

Arindam

Read only

0 Likes
1,503

In that the only option is that .NET application should write file on application server if you want to run your program in background.

Read only

Former Member
0 Likes
1,503

Hi Mayur

U can run the frontend services even in background.

I have debugged below code in background.

I kept breakpoint keywor before call method statement and go to sm37 select the job and f8.

You can see the job then select the job and in command field use jdbg and press enter which enters into debug mode of background job. Press f8 now the breakpoint keyword in ur program triggers.

I think there is a problem with the directory path.

Its working in my system with my own path(directory).

BREAK-POINT.

CALL METHOD cl_gui_frontend_services=>directory_list_files

    EXPORTING

      directory                   = 'C:\ALL_PROGRAMS'

*    filter                      = '*.*'

      files_only                  = 'X'

*    directories_only            =

    CHANGING

      file_table                  = it_infile

      count                       = v_count

    EXCEPTIONS

      cntl_error                  = 1

      directory_list_files_failed = 2

      wrong_parameter             = 3

      error_no_gui                = 4

      not_supported_by_gui        = 5

      others                      = 6

          .

IF sy-subrc <> 0.

   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Read only

0 Likes
1,503

@ vineesh batchu

i already check it it was working fine as per your suggestion  but when i execute my program in background  it goes to dump

Error msg is  Message type " " is unknown.and sy-subrc = 5 means not_supported_by_gui