2007 Dec 08 11:08 AM
hi i want to pass one internal table to other subroutine like this
form abc
data: begin of itab occurs 0.
-
-
end of itab
perform xyz tables itab.
endform.
form xyz tables itab like itab[].
end form
it is giving and error that itab is not defiend by data statement
and also tell how to pass two internal tables to the subroutine
thanx in advance
its very urgent
points wil be rewarded
plz help its very urgent
2007 Dec 08 11:40 AM
Hi,
when u r declaring the internal table in the form it have been declared as local variable, if u want to over come the problem then u need declare outside the form
before the start-of-selection.
hope this will help u.
plzz reward points if it helps.
2007 Dec 08 11:14 AM
Hi,
perform xyz tables itab.
form xyz tables itab like itab.
in the above type table will pass the values with header line.
perform xyz using itab.
form xyz using itab like itab[].
in this case the header line will not pass u have explicitly declare the work area.
plzz reward points if it helps.
2007 Dec 08 11:16 AM
internal table is defiend in first soubroutine
and when i use
form for second subroutine then it gives and error
itab is not defiend by data statement
how to overcome this porb
2007 Dec 08 11:26 AM
Hi,
Check this Example
PROGRAM FORM_TEST.
TYPES: BEGIN OF LINE,
COL1 TYPE I,
COL2 TYPE I,
END OF LINE.
DATA: ITAB TYPE STANDARD TABLE OF LINE WITH HEADER LINE,
JTAB TYPE STANDARD TABLE OF LINE.
PERFORM FILL TABLES ITAB.
MOVE ITAB[] TO JTAB.
PERFORM OUT TABLES JTAB.
FORM FILL TABLES F_ITAB LIKE ITAB[].
DO 3 TIMES.
F_ITAB-COL1 = SY-INDEX.
F_ITAB-COL2 = SY-INDEX ** 2.
APPEND F_ITAB.
ENDDO.
ENDFORM.
FORM OUT TABLES F_ITAB LIKE JTAB.
LOOP AT F_ITAB.
WRITE: / F_ITAB-COL1, F_ITAB-COL2.
ENDLOOP.
ENDFORM.
Regards,
Satish
2007 Dec 08 11:30 AM
nooo
look
i m creating an internal table in first subroutine
and then passing it to other subroutine
and then it is givinng error
that internal table is not defiend
2007 Dec 08 11:32 AM
2007 Dec 08 11:14 AM
Hi,
Try this
Types: begin of ty_tab,
end of ty_tab.
data: itab type table of ty_tab.
form abc.
perform xyz tables itab.
endform.
form xyz tables itab type ty_tab.
end form.
Regards,
Satish
2007 Dec 08 11:24 AM
Hi,
In the first form call the 2nd form.
for example.
perform xyz.
form xyz .
itab declaration.
perform abc using itab.
endform.
form abc using p_itab like itab[].
endform.
plzz reward points if it is useful.
2007 Dec 08 11:40 AM
Hi,
when u r declaring the internal table in the form it have been declared as local variable, if u want to over come the problem then u need declare outside the form
before the start-of-selection.
hope this will help u.
plzz reward points if it helps.
2007 Dec 08 1:04 PM
i think local internal tables can not b passed to other subroutines
2007 Dec 08 1:40 PM
If I remember it right, passing internal tables with <b>TABLES</b> addition has become obsolete. SAP recommends to use the <b>USING</b> addition even with internal tables.
Can anyone confirm this? I donot have access to SAP right now.