2007 Jul 13 8:46 AM
Hello All,
I am calling a subrotuine multiple times and every time passign a table of different
structure to it.
Data: itab1 type table of kna1,
itab2 type table of knvp.
PERFORM sub TABLES itab1.
PERFORM sub TABLES itab2.
FORM sub TABLES p_itab.
SORT p_itab BY kunnr.
ENDFORM.
This is giving me a syntax error that
"The specified type has no structure and no component called 'kuunr'".
Is it possible that inside the subroutine 'sub', I assign some structure to the table
'p_itab' based on some conditions?
Please suggest.
Regards
Indrajit
2007 Jul 13 10:11 AM
Hi Indrajit,
Use a macro instead.
define sub.
SORT &1 BY kunnr.
enddefine.
main program:
sub itab1.
sub itab2.
REgards,
Ravi
2007 Jul 13 10:16 AM
Use this code..
Data: itab1 type table of kna1,
itab2 type table of knvp.
PERFORM sub TABLES itab1.
PERFORM sub TABLES itab2.
FORM sub TABLES p_itab.
data kunnr type char5.
kunnr = 'KUNNR'.
SORT p_itab BY (KUNNR).
ENDFORM.
Reward points if useful