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: 

Converting 2 internal tables

Peter_Lintner
Participant
0 Kudos
88

Hi!

I've get binary data from a sap function module in an internal table in structure DOCS (line length 1024). The next FM needs this data in an internal table in structure SOLISTI1 (line length 255). How do I have to convert these tables?

Thanks for any hints!

Peter

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos
47

Hi Peter,

You can use the function module

RKD_WORD_WRAP

loop at it_docs.

refresh t_out.

CALL FUNCTION 'RKD_WORD_WRAP'

EXPORTING

textline = it_DOCS-data

  • DELIMITER = ' '

OUTPUTLEN = 255

TABLES

OUT_LINES = t_out

EXCEPTIONS

OUTPUTLEN_TOO_LARGE = 1

OTHERS = 2

.

append lines of t_out to t_final. "For each loop pass

endloop.

Regards,

Ravi

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos
48

Hi Peter,

You can use the function module

RKD_WORD_WRAP

loop at it_docs.

refresh t_out.

CALL FUNCTION 'RKD_WORD_WRAP'

EXPORTING

textline = it_DOCS-data

  • DELIMITER = ' '

OUTPUTLEN = 255

TABLES

OUT_LINES = t_out

EXCEPTIONS

OUTPUTLEN_TOO_LARGE = 1

OTHERS = 2

.

append lines of t_out to t_final. "For each loop pass

endloop.

Regards,

Ravi

Peter_Lintner
Participant
0 Kudos
47

Sorry, this does not solve my problem, because the FM delivers 5 rows for each original row. The 5th ist just 4 bytes long and not 255.

Thanks!

Peter

Peter_Lintner
Participant
0 Kudos
47

Hi!

I've solved the problem myself by writing a temporary file and reading it with the the new length.

Peter_Lintner
Participant
0 Kudos
47

Hi!

I've solved the problem myself by writing a temporary file and reading it with the the new length.