Application Development and Automation 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: 
Read only

Transfering dynamic data structures via RFC

Former Member
0 Likes
658

Hi there,

I got a quite basic question.

I want to transfer a text String with differing length to a external tool. Since I don't know how long the String will be, I had to set the number of characters to 30.000. Is there a way to transfer dynamic structures?

Obviously the character typ "String" is not allowed for RFC....

Thanks

Oliver

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
617

Hi Oliver,

What you can do is to have a table with a field of say 100 characters.

Since this is a table, you can add more lines when the length increases .

YOu can make use of Function module RKD_WORD_WRAP to convert a big string into a table of shorter strings.

Sample usage of this FM:

CALL FUNCTION 'RKD_WORD_WRAP'
     EXPORTING
          TEXTLINE            = L_TEXT
          OUTPUTLEN           = 100

*    IMPORTING
*         OUT_LINE1           =
*         OUT_LINE2           =
*         OUT_LINE3           =
    TABLES
         OUT_LINES           = OUT_LINES
    EXCEPTIONS
         OUTPUTLEN_TOO_LARGE = 1
         OTHERS              = 2
          .

Then pass this OUTLINES to the RFC tables parameter.

Regards,

Ravi Kanth Talagana

4 REPLIES 4
Read only

Former Member
0 Likes
618

Hi Oliver,

What you can do is to have a table with a field of say 100 characters.

Since this is a table, you can add more lines when the length increases .

YOu can make use of Function module RKD_WORD_WRAP to convert a big string into a table of shorter strings.

Sample usage of this FM:

CALL FUNCTION 'RKD_WORD_WRAP'
     EXPORTING
          TEXTLINE            = L_TEXT
          OUTPUTLEN           = 100

*    IMPORTING
*         OUT_LINE1           =
*         OUT_LINE2           =
*         OUT_LINE3           =
    TABLES
         OUT_LINES           = OUT_LINES
    EXCEPTIONS
         OUTPUTLEN_TOO_LARGE = 1
         OTHERS              = 2
          .

Then pass this OUTLINES to the RFC tables parameter.

Regards,

Ravi Kanth Talagana

Read only

0 Likes
617

Unfortunatellty the structure I have to transfer is a table :(.. so I have different rows containing strings...

Read only

0 Likes
617

Hi,

How about delimiting the set of lines belonging to one string from another set using a string of

'----


' (100 hyphens)

assume that you have a table of strings say it_strings

loop at it_strings.
CALL FUNCTION 'RKD_WORD_WRAP'
     EXPORTING
          TEXTLINE            = IT_STRINGS-STRING
          OUTPUTLEN           = 100

*    IMPORTING
*         OUT_LINE1           =
*         OUT_LINE2           =
*         OUT_LINE3           =
    TABLES
         OUT_LINES           = OUT_LINES
    EXCEPTIONS
         OUTPUTLEN_TOO_LARGE = 1
         OTHERS              = 2
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
append lines of out_lines to it_final.
it_final-data = '---------------------------------------'.
append it_final.
clear it_final.
endloop.

Regards,

Ravi Kanth Talagana

Read only

0 Likes
617

Will do it that whay.. thx