cancel
Showing results for 
Search instead for 
Did you mean: 

Pasting of Tables

Former Member
0 Kudos

Hi Guys,

Is there a way to pass a table of type 'crmxif_bustrans_t' into a subroutine and return it to the main program?

I have tried

PERFORM get_info

tables tab

USING top_node

FORM get_info

tables it like crmxif_bustrans_t

USING

value(node) TYPE REF TO if_ixml_node

but there seems to be an error. Thanks.

Regards,

Conrad Chia

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Conrad Chia,

If you are getting type conflict error, then verify your type definition of 'tab' in your 'PERFORM' statement. Both 'tab' in your PERFORM statement and the 'it' in your FORM should be of the same type.

Also, in your FORM statement I see that you defined 'it' <u>like</u> crmxif_bustrans_t. If 'crmxif_bustrans_t' is a table type defined in a type-pool as an internal table, then your FORM statement should be changed like this.


FORM get_info TABLES it TYPE crmxif_bustrans_t
              USING VALUE(node) TYPE REF TO if_ixml_node.

Otherwise, if it is a structure, then your FORM statement should be like this


FORM get_info TABLES it STRUCTURE crmxif_bustrans_t
              USING VALUE(node) TYPE REF TO if_ixml_node.

Please let us know if it works else, let us know the error message you are getting.

Srinivas

Answers (2)

Answers (2)

andreas_mann3
Active Contributor
0 Kudos

Hi Conrad,

you must'nt use form ... tables...

-> only by internal tables with headerline !

-> if it's e.g. a sorted table you can say:

FORM get_info

using it type sorted table

...

regards Andreas

Former Member
0 Kudos

Thanks guys. Got it. I should have use 'type' instead of 'like'.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Yes, you can pass tables in and out of subroutines quite easily. What error message are you getting?

Regards,

Rich Heilman