0
votes

I have an internal table of type string.

it_fields TYPE STANDARD TABLE OF string

Inside this there are some values which I need to parse and then store it in it_final.

it_final TYPE STANDARD TABLE OF dd03l-fieldname

dd03l has a column name field name with datatype char 30.

Is parsing possible in ABAP?

3
What is the exact question? What is possible? You mean pairing? What kind of pairing? You have problem with placing string value in the fixed length char value? If that, you can use for example MOVE statement to move string value to fixed char value. Or you have problems with the internal tables? If that, you should check the documantation regarding internal tables and how to handle them. - szako
Once there is parsing written and once parising. I doubt, that pairing is the intention .... more likely is parsing, in this case I would say, simply move from a to b. - icbytes
Can you show us a sample of what a line of it_fields looks like? It's impossible for us to give an answer without knowing what the data looks like. - gkubed

3 Answers

2
votes
LOOP at it_fields into data(source).
   if strlen( source ) <= 30.
      Append initial line to it_final ASSIGNING FIELD-SYMBOL(<target>).
      <target> = source.
   endif.
ENDLOOP.

Is that what You need ? I did not test it, I just thought, this might be Your requirement...

0
votes
DATA: ls_final like line of it_final.
LOOP at it_fields into data(lv_field).
   ls_final = lv_field.
   APPEND ls_final TO it_final.
   CLEAR:ls_final .
ENDLOOP.

This one works too, i guess.

0
votes

In Abap the strings are very difficult to use. Somethimes there are 255 characters, somethimes more.

For me, the best way is:

Loop at it_fields into/assigning wa/.

condense wa/.

wa_final = wa/.

append wa_final into it_final.

clear: wa_final.

endloop.