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

Log file

Former Member
0 Likes
959

Hi,

I want to transfer all the logs in one internal table then, then I have to tranfer all the intenal table logs into external file. The external file is from the selection-screen. This selection option should have F4 function also. Any body tell me how can I do it this one.

Thanks & Regards

Venkata

7 REPLIES 7
Read only

Former Member
0 Likes
921

Check these FM BP_JOBLOG_READ

BP_JOBLOG_SHOW

check the table <b>TBTCO</b>

Read only

Former Member
0 Likes
921

Hi ,

The job will not be create in this situation. Actually I wnat to push some information to the external file. How can I do it this.

Thanks & Regards

Venkat

Read only

0 Likes
921

Hi,

check this sample code..

REPORT  ZTEST.

DATA f_name TYPE STRING.
data: itab like mara occurs 0 with header line.
PARAMETERS p_file like rlgrap-filename DEFAULT 'c:test.xls'.

at selection-screen on value-request for p_file.
call function 'F4_FILENAME'
exporting
program_name = syst-repid
dynpro_number = syst-dynnr
field_name = 'p_file'
importing
file_name = p_file.
f_name = p_file.
start-of-selection.
select * from mara into table itab up to 20 rows.
call function 'GUI_DOWNLOAD'
  exporting
    filename                        = f_name
  tables
    data_tab                        = itab[]
 EXCEPTIONS
   FILE_WRITE_ERROR                = 1
   NO_BATCH                        = 2
   GUI_REFUSE_FILETRANSFER         = 3
   INVALID_TYPE                    = 4
   NO_AUTHORITY                    = 5
   UNKNOWN_ERROR                   = 6
   HEADER_NOT_ALLOWED              = 7
   SEPARATOR_NOT_ALLOWED           = 8
   FILESIZE_NOT_ALLOWED            = 9
   HEADER_TOO_LONG                 = 10
   DP_ERROR_CREATE                 = 11
   DP_ERROR_SEND                   = 12
   DP_ERROR_WRITE                  = 13
   UNKNOWN_DP_ERROR                = 14
   ACCESS_DENIED                   = 15
   DP_OUT_OF_MEMORY                = 16
   DISK_FULL                       = 17
   DP_TIMEOUT                      = 18
   FILE_NOT_FOUND                  = 19
   DATAPROVIDER_EXCEPTION          = 20
   CONTROL_FLUSH_ERROR             = 21
   OTHERS                          = 22
          .
if sy-subrc <> 0.
 MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.

Regards

vijay

Read only

0 Likes
921

HI Vijay,

If I am executing the same code its giving short-dump with the message like

'Type conflict when calling a function module'.

what it may be the reason for this.

Thanks & Regards

Venkat

Read only

Former Member
0 Likes
921

Hi, if you want to define an f4 help for external file direction then you have to just have to define a parameter

PARAMETERS : p_f1 LIKE rcgfiletr-ftfront . in your selection Screen.

For the F4 help call FM after the event

This is for presentation server

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_f1.

CONSTANTS: lcl_path TYPE string VALUE 'C:\'.

CALL FUNCTION 'C13Z_FRONTEND_FILENAME_GET'

EXPORTING

i_initial_directory = lcl_path

IMPORTING

e_filename = p_f1

EXCEPTIONS

internal_error = 1

OTHERS = 2.

And if you want to download the file use the following FM

DATA: lcl_filename TYPE string.

lcl_filename = p_f1.

IF filename IS NOT INITIAL.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = lcl_filename

filetype = 'ASC'

write_field_separator = 'X'

TABLES

data_tab = download_itable

EXCEPTIONS

file_open_error = 1

file_read_error = 2

no_batch = 3

gui_refuse_filetransfer = 4

invalid_type = 5

no_authority = 6

unknown_error = 7

bad_data_format = 8

header_not_allowed = 9

separator_not_allowed = 10

header_too_long = 11

unknown_dp_error = 12

access_denied = 13

dp_out_of_memory = 14

disk_full = 15

dp_timeout = 16

OTHERS = 17.

Message was edited by: Dominic Pappaly

Read only

Former Member
0 Likes
921

Hi,

all the variables should be of same type as

defined in FM to aviod error.

Regards

Amole

Read only

Former Member
0 Likes
921

Hi Venkata,

did you declare the Parameters as i specified above.

and the filename type should be of type string that you are going to pass it GUI_DOWNLOAD. just check it.

f_name should be of type string.

<b>f_name</b> = p_file.

call function 'GUI_DOWNLOAD'
  exporting
    filename                        = f_name

Regards

vijay