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: 

Material determination

Former Member
0 Kudos
288

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
130

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.

3 REPLIES 3

Former Member
0 Kudos
131

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.

0 Kudos
130

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.

0 Kudos
130

prakash.ramu@wipro.com