sap - Looking for Non-Printable characters inside internal table ABAP -
i have internal table written file , pulled bw datasource. non printable character makes file output , breaks import process bw. below sample of code. since itab not type c or string unable use find/replace regex on it. has else had solve type of problem before?
form eliminate_non_print_char tables p_shiptab structure shiptab. loop @ p_shiptab wa_shiptab. find regex '[^[:print:]]+(?!$)' in wa_shiptab ignoring case. "results result. if sy-subrc = 0. replace regex '[^[:print:]]+(?!$)' in wa_shiptab '' ignoring case. endif. endloop. data: begin of shiptab occurs 2000. include structure ship1. include structure ship2. data: landtx vbrk-landtx, bl_konwa vbak-waerk. include structure ship3. include structure ship4. data: frght_amnt_usd konv-kwert, revenue_amnt_usd vbap-netwr, unit_price_usd vbap-netpr, pgi_posting_date mkpf-budat, ord_line_item_qty lips-lfimg, asm_no kna1-kunnr, asm_username adrc-sort1, va_augru_t tvaut-bezei, ship_to_name adrc-name1, bill_to_name adrc-name1, forward_to_name adrc-name1, fmv_amnt konv-kbetr, va_butxt t001-butxt, sold_to_search_term adrc-sort1, bill_to_search_term adrc-sort1, va_prctr vbap-prctr, va_bezei tvrot-bezei. include structure zorder_attr. data: extended_bits_count(20), va_bstkd_hdr char32. data: gsm_bp_katr6 kna1-katr6, gsm_bp_vtext6 tvk6t-vtext, asm_ze_katr7 kna1-katr7, asm_ze_vtext7 tvk7t-vtext, gsm_ze_katr6 kna1-katr6, gsm_ze_vtext6 tvk7t-vtext. data: end of shiptab
.
the error is: "wa_shiptab" must character-type data object (data type c, n, d,t, or string). have non character types in itab shiptab. know can lookup on each field individually, itab has 235 fields , not seem efficient.
the program has copy of main itab char based fields, looped through , placed following code:
replace occurrences of regex '[^[:print:]]+$' in transtab '' ignoring case.
links answer:
Comments
Post a Comment