‎2008 Sep 01 3:28 PM
Hi there. I've got a problem with passing itab to subprogram.
DATA: internaltable LIKE dbtable OCCURS 0 .
PERFORM fill_itab USING internaltable .
FORM fill_itab USING itab LIKE dbtable .
... here modify itab ...
ENDFORM. "
I receive an error: In PERFORM "FILL_ITAB", the actual parameter "internaltable" and
formal parameter "itab" are incomapatible.
So ... how should I corretly pass such internaltable itab to the subpprogram?
Greetings. P.
‎2008 Sep 01 3:49 PM
Hi,
try:
FORM fill_itab TABLES itab STUCTURE dbtable .
best regards
Walter Habich
‎2008 Sep 01 3:31 PM
In the FORM statement, you are declaring a one line structure, you need to declare a table here. You could do this in two ways, you can use the USING extension or the TABLES extention.
FORM fill_itab USING itab type table of dbtable.
ENDFORM.
FORM fill_itab tables itab type dbtable .
ENDFORM.
Regards,
Rich Heilman
‎2008 Sep 01 3:41 PM
Rich Heilman
FORM fill_itab USING itab type table of dbtab. Returns:
Different number of parameters in FORM and PERFORM (routine:
FILL_ITAB, formal parameters: 3, actual parameters: 1).
FORM fill_itab tables itab type dbtable . Returns:
For typing of TABLES parameters, only table types should be used. -
‎2008 Sep 01 3:44 PM
Hello,
You need first to declare a table type:
TYPES: it_type TYPE TABLE OF dbtable.
FORM fill_itab tables itab TYPE it_type.
FORM fill_itab USING itab TYPE it_type.
FORM fill_itab CHANGING itab TYPE it_type.
Regards.
‎2008 Sep 01 3:46 PM
My apologies. Its a holiday here, so my brain is not up and running yet. Try this.
Create a Table Type using a TYPE statement, and then use this in the FORM statement.
TYPES: ttab TYPE TABLE OF dbtable.
DATA: internaltable LIKE dbtable OCCURS 0 .
PERFORM fill_itab USING internaltable .
FORM fill_itab USING itab TYPE ttab.
ENDFORM. "fill_itabRegards,
Rich Heilman
‎2008 Sep 01 3:49 PM
Hi,
try:
FORM fill_itab TABLES itab STUCTURE dbtable .
best regards
Walter Habich