You are on page 1of 3

************************************************************************ * LSM Workbench: Data Import Program * Program: /1CADMC/SAP_LSMW_READ_00000017 * Date: 25.09.

2012 * Time: 16:29:10 * User: NEERAJD * Project: MAT_REC2 * Subproject: MAT_REC2 * Object: MAT_REC2 ************************************************************************ report /1CADMC/SAP_LSMW_READ_00000017 message-id /sapdmc/lsmw_obj_070. * Additional data definitions and table declarations include: /sapdmc/sap_lsmw_read_data. * Source structure definitions data: begin of LSMW_STRUCT, MARC-DISGR(004) type C, MARC-DISMM(002) type C, MARC-DISPO(003) type C, MARC-DISLS(002) type C, MARC-BESKZ(001) type C, MARC-FHORI(003) type C, MARC-EISBE(017) type C, end of LSMW_STRUCT. data: begin of TRAN_STRUCT, __record__(30). include structure LSMW_STRUCT. data: end of TRAN_STRUCT. data: begin of str_STRUCT. include structure LSMW_STRUCT. data: recnr_000001 type i. data: end of str_STRUCT. data: STRUCT like sorted table of str_STRUCT with non-unique key recnr_000001 with header line. * Internal Table(s) for field names data: begin of top_STRUCT occurs 0, f000001(30), f000002(30), f000003(30), f000004(30), f000005(30), f000006(30), f000007(30),

end of top_STRUCT. data: begin of upl_0001 occurs 0, record(000087), end of upl_0001. data: begin of upl_bin occurs 0, record(72), end of upl_bin. * Internal Table(s) for split at delimiter data: tab_spl(000017) occurs 0 with header line. * Buffer of maximum length data: g_max_buffer(000136). * Select-option for wildcard value in file names selection-screen begin of block selopts3 with frame title text-003. select-options: so_wldcd for /sapdmc/lsofiw-wildcardvalue no-display. selection-screen end of block selopts3. initialization. g_project = 'MAT_REC2 g_subproj = 'MAT_REC2 g_object = 'MAT_REC2 start-of-selection. * Read object data perform read_object_data. * Reset counters perform reset_counters. * Reset tables perform reset_tables. * Open output file perform open_output_file. * Write header record perform write_header_record. * Read content of files into internal tables perform read_frontend_file using '0001'. loop at STRUCT . add 1 to g_cnt_records_read. add 1 to g_cnt_transactions_read. check so_tcntr. add 1 to g_cnt_transactions_transferred. move-corresponding STRUCT to tran_STRUCT . '. '. '.

tran_STRUCT-__record__ = 'STRUCT'. assign tran_STRUCT to <g_buffer_char> casting type c. g_record_length = strlen( <g_buffer_char> ). g_hex_record_length = g_record_length. transfer g_hex_record_length to g_filename. if g_record_length > 0. assign g_max_buffer(g_record_length) to <g_buffer>. <g_buffer> = <g_buffer_char>. transfer <g_buffer> to g_filename. perform update_statistics_used using 'STRUCT '. endif. add 1 to g_cnt_records_transferred. perform indicate_progress. endloop. * Final message perform final_message. * Close output file close dataset g_filename. * End program exit. * Form routines include: /sapdmc/sap_lsmw_read_forms. *&---------------------------------------------------------------------* *& Form check_user_select_options *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * -->P_FLG_TRANSFER text *----------------------------------------------------------------------* form check_user_select_options changing p_flg_transfer. p_flg_transfer = no. p_flg_transfer = yes. endform. "check_user_select_options