2013 May 24 5:44 AM
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.
2013 May 24 7:03 AM
Its not possible to run front end services in back ground.
For back ground equivalent check http://scn.sap.com/thread/1431755
2013 May 24 7:34 AM
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
2013 May 24 8:53 AM
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
2013 May 24 9:27 AM
In that the only option is that .NET application should write file on application server if you want to run your program in background.
2013 May 24 11:20 AM
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.
2013 May 25 4:59 AM
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