‎2006 Oct 12 5:58 PM
Hi,
I have a requirement to do an extract program for material determination from tables KOTD001, KONDD, and KONDPP. I need to download the records to an internal table and write it to a text file. The catch here is to check if the records in this internal table are good by cross checking them against table KOTG927. e.g. If the material number in KOTD001 is listed in KOTG927, then it should not be extracted. Another condition is to check whether if the material has been marked for deletion and not extract it. Can anyone help me with how to achieve this with some skeleton code.
Thanks,
A.P.
‎2006 Oct 12 6:04 PM
While selecting values from KOTD001 make a inner join with KOTG927. For the condition KOTD001-materrial number <> KOTG927-material number and delete indicator <> 'X'.
After all the check use the FM GUI_DOWNLOAD to down the records to text format.
DATA: lws_err_path TYPE string.
lws_err_path = p_error.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lws_err_path
write_field_separator = 'X'
filetype = 'DAT'
confirm_overwrite = c_x
TABLES
data_tab = i_error_log
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 e001(zfin) WITH text-031.
ELSE.
ws_execute = c_x.
ENDIF.
‎2006 Oct 12 6:04 PM
While selecting values from KOTD001 make a inner join with KOTG927. For the condition KOTD001-materrial number <> KOTG927-material number and delete indicator <> 'X'.
After all the check use the FM GUI_DOWNLOAD to down the records to text format.
DATA: lws_err_path TYPE string.
lws_err_path = p_error.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = lws_err_path
write_field_separator = 'X'
filetype = 'DAT'
confirm_overwrite = c_x
TABLES
data_tab = i_error_log
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 e001(zfin) WITH text-031.
ELSE.
ws_execute = c_x.
ENDIF.
‎2006 Oct 12 6:22 PM
Hi Prakash,
I have code similar to what you are suggesting but I'm not sure if it is right. Can you take a look at my code? Please give me your email id if you can.
Thanks,
A.P.
‎2006 Oct 12 6:28 PM