FIELD-SYMBOLS: <wa_table> TYPE any,
<field> TYPE any.
DATA:lv_counter TYPE I, "countner
ld_fieldtype TYPE CHAR01, "field type
lv_field_num type I. "num of fields
check gt_output[] is not INITIAL.
*Get number of fields for Input table
read TABLE gt_output ASSIGNING <wa_table> INDEX 1.
DATA(lo_descr) = CAST cl_abap_structdescr(
cl_abap_datadescr=>describe_by_data( <wa_table> ) ).
lv_field_num = LINES( lo_descr->components ).
loop at gt_output ASSIGNING <wa_table>.
lv_counter = 1.
DO lv_field_num TIMES.
* loop every fields of internal table
ASSIGN COMPONENT lv_counter
OF STRUCTURE <wa_table> TO <field>.
if sy-subrc eq 0.
DESCRIBE field <field> TYPE ld_fieldtype.
"only replace Character type, could dump like for P type field with replace
IF ld_fieldtype = 'C'.
REPLACE ALL OCCURRENCES OF '"' in <field> with space.
"here only replace the double quotes "
endif.
else.
CONTINUE.
endif.
lv_counter = lv_counter + 1.
ENDDO.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
2 | |
2 | |
2 |