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

pass a table to the changing parameter

Former Member
0 Likes
1,418

This below shown code doesn't work because I get the message "p_ttest is not an internal table"

How can I get it working ?

TYPES: BEGIN OF tty_test,
       name(10) type c,
       zahl      type i,
       END OF tty_test.

data  ttest type table of tty_test.

perform training changing ttest .

write: ''.


FORM training changing p_ttest.
data xyz type tty_test.
xyz-name = 'John'.
xyz-zahl = '23'.
append xyz TO p_ttest.
ENDFORM.                    " 

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,389

U need to declare some syntax for p_ttest.

See code below...

TYPES: BEGIN OF tty_test,

name(10) type c,

zahl type i,

END OF tty_test.

data ttest type table of tty_test.

perform training changing ttest .

write: ''.

FORM training changing p_ttest like ttest.

data xyz type tty_test.

xyz-name = 'John'.

xyz-zahl = '23'.

append xyz TO p_ttest.

ENDFORM.

This below shown code doesn't work because I get the message "p_ttest is not an internal table"

How can I get it working ?

TYPES: BEGIN OF tty_test,
       name(10) type c,
       zahl      type i,
       END OF tty_test.

data  ttest type table of tty_test.

perform training changing ttest .

write: ''.


FORM training changing p_ttest.
data xyz type tty_test.
xyz-name = 'John'.
xyz-zahl = '23'.
append xyz TO p_ttest.
ENDFORM.                    " 

13 REPLIES 13
Read only

Former Member
0 Likes
1,389

Hi,

change p_ttest to ttest.its working fine.

regards

Read only

Former Member
0 Likes
1,389

TYPES: BEGIN OF tty_test,

name(10) type c,

zahl type i,

END OF tty_test.

data ttest type standard table of tty_test.

perform training changing ttest .

write: ''.

FORM training changing p_ttest type standard table of tty_test.

data xyz type tty_test.

xyz-name = 'John'.

xyz-zahl = '23'.

append xyz TO p_ttest.

ENDFORM. "

Edited by: kartik tarla on Dec 4, 2008 3:17 PM

Read only

Former Member
0 Likes
1,389

Hi,

If u want to pass an internal table, then instead of the changing clause, use tables claues.

Regards,

Ajay

Read only

Former Member
0 Likes
1,389

hi,

use FORM training changing p_ttest type tty_test.

data xyz type tty_test.

xyz-name = 'John'.

xyz-zahl = '23'.

append xyz TO p_ttest.

ENDFORM.

regards,

Srilatha

Read only

Former Member
0 Likes
1,389

Hi,

Just a small change in your code.try this:

TYPES: BEGIN OF tty_test,

name(10) type c,

zahl type i,

END OF tty_test.

data:p_ ttest type table of tty_test.

perform training changing p_ttest .

write: ''.

FORM training changing p_ttest.

data xyz type tty_test.

xyz-name = 'John'.

xyz-zahl = '23'.

append xyz TO p_ttest.

ENDFORM. "

The error came because you have not made the internal table p_ttest.

after making the internal table only you can append the work area to intrnal table.

Hope it helps.

Rahul

Edited by: Rahul Kumar Sinha on Dec 4, 2008 10:50 AM

Read only

Former Member
0 Likes
1,390

U need to declare some syntax for p_ttest.

See code below...

TYPES: BEGIN OF tty_test,

name(10) type c,

zahl type i,

END OF tty_test.

data ttest type table of tty_test.

perform training changing ttest .

write: ''.

FORM training changing p_ttest like ttest.

data xyz type tty_test.

xyz-name = 'John'.

xyz-zahl = '23'.

append xyz TO p_ttest.

ENDFORM.

Read only

Former Member
0 Likes
1,389

PARAMETERS: p_carr TYPE sflight-carrid,

p_conn TYPE sflight-connid.

DATA sflight_tab TYPE STANDARD TABLE OF sflight.

PERFORM select_sflight TABLES sflight_tab

USING p_carr p_conn.

FORM select_sflight TABLES flight_tab LIKE sflight_tab

USING f_carr TYPE sflight-carrid

f_conn TYPE sflight-connid.

SELECT *

FROM sflight

INTO TABLE flight_tab

WHERE carrid = f_carr AND

connid = f_conn.

ENDFORM.

Read only

Former Member
0 Likes
1,389
TYPES: BEGIN OF tty_test,
       name(10) type c,
       zahl      type i,
       END OF tty_test.
 
data  ttest type table of tty_test.
 
perform training changing ttest[] .
 
write: ''.
 
 
FORM training changing p_ttest.
data : temp type table of tty_test.
data xyz type tty_test.
temp[] = p_ttest.
xyz-name = 'John'.
xyz-zahl = '23'.
append xyz TO temp.
p_ttest = temp[].
ENDFORM.                    "
Read only

tarangini_katta
Active Contributor
0 Likes
1,389

hello erdem,

write lik ethis

TYPES: BEGIN OF tty_test,

name(10) type c,

zahl type i,

END OF tty_test.

data ttest type table of tty_test.

perform training changing ttest .

write: ''.

FORM training changing p_ttest type table .

data xyz type tty_test.

xyz-name = 'John'.

xyz-zahl = '23'.

append xyz TO p_ttest.

ENDFORM.

Read only

Former Member
0 Likes
1,389

Hi



TYPES: BEGIN OF tty_test,
       name(10) type c,
       zahl      type i,
       END OF tty_test.

data  ttest type table of tty_test.

perform training tables ttest .

write: ''.


FORM training tables p_ttest.
data xyz type tty_test.
xyz-name = 'John'.
xyz-zahl = '23'.
append xyz TO p_ttest.
ENDFORM.

Thanks.

Chitrali

Read only

i048168
Product and Topic Expert
Product and Topic Expert
0 Likes
1,389

Hi,

Try this,

FORM training changing p_ttest like ttest.

Regards,

Vadivelan B

Read only

Former Member
0 Likes
1,389

Hi erdem,

u haven't defin p_ttest anywhere in your code declare it like ttest in changing. because u already defined that ttest type table of tty_test.

it will work fine.

regards

Saurabh

Read only

Former Member
0 Likes
1,389

@kartik tarla your sample doesnt work

@Jansi Dorai your sample doesnt work

@Ajay Abhyankar this is obselete

@Rahul thank you but it is very circuitous

@ Ramesh has solved this problem finally