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

Can not loop an input parameter in the Form

JayChan
Active Participant
0 Likes
1,921

hi all,

I have following subroutine.

since I have a input parameter P_Itab as a internal table

How come I can not loop this internal table in the FORM.

FORM get_dydata using P_Itab

   LOOP AT P_Itab.
        some code.....
   END LOOP.

ENDFORM.                    "get_data

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,678

loop ....

endloop.

hi all,

I have following subroutine.

since I have a input parameter P_Itab as a internal table

How come I can not loop this internal table in the FORM.

FORM get_dydata using P_Itab

   LOOP AT P_Itab.
        some code.....
   END LOOP.

ENDFORM.                    "get_data

11 REPLIES 11
Read only

Former Member
0 Likes
1,679

loop ....

endloop.

Read only

0 Likes
1,678

it still doesn't work.

Read only

Former Member
0 Likes
1,678

Hi,

use this

FORM get_dydata tables P_Itab

endform.

regards,

Santosh Thorat

Read only

0 Likes
1,678

hi,

try this one...


FORM get_dydata using tables P_Itab
 
   LOOP AT P_Itab.

        some code.....

   ENDLOOP.
 
ENDFORM.                    "get_data

regards

vijay

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 3:52 PM

Read only

0 Likes
1,678

This might be work.

But I thought SAP didn't recommend us to do so.

Read only

Former Member
0 Likes
1,678

HI,

You need to make it as


data: itab like tstc occurs 0 with header line.
select * from tstc into table itab up to 10 rows.
perform abc using itab.
*&---------------------------------------------------------------------*
*&      Form  abc
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_ITAB  text
*----------------------------------------------------------------------*
form abc using   p_itab structure tstc.
  loop at itab.
   write:/ 'HALO'.
  endloop.
endform.  

regards,

venkatesh

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 3:52 PM

Read only

0 Likes
1,678

What if I can not specify the structure in advance??

Read only

Former Member
0 Likes
1,678

HI,


data: itab like tstc occurs 0 with header line.
select * from tstc into table itab up to 10 rows.
perform abc tables itab.
*&---------------------------------------------------------------------*
*&      Form  abc
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->P_ITAB  text
*----------------------------------------------------------------------*
form abc tables   p_itab structure tstc.
  loop at p_itab.
   write:/ 'HALO'.
  endloop.
endform. 

Regards,

venkatesh

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 3:52 PM

Read only

Former Member
0 Likes
1,678

Hi,

Can you tell me how an Input Parameter can be an "Internal Table"??

Select-option is an Internal table and you can loop over it....

S_itab


loop at s_itab into wa_itab.
     wa_itab-low .....   "this holds the value
endloop.

please do let me know...

Regards,

neha

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 3:53 PM

Read only

0 Likes
1,678

I don't know internal table can not be used in this specific way.

Just want to express that I want to input a structure as a parameter but the structure of it is unknown yet.

Read only

0 Likes
1,678

Hi,

No,you cannot input structure as a parameter!!!!

Can you tell me what exactly is your requirement?

Regards,

Neha