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 i_table with changing

Former Member
0 Likes
606

Hello all,

I m trying to pass an internal table with CHANGING

Code


FORM X
 it_zfichpai type table of zfichpai,
wa_zfichpai like line of it_zfichpai.
(...)
perform create_md5key changing wa_zfichpai-MD5KEY
                            it_zfichpai.
ENDFORM.


FORM create_MD5key changing hkey type zfichpai-md5key
                            -> p_zfichpai like zfichpai <-(dont work).

the "like" doesn't work,neither "like table of", "type", "type table of"

A way to do it is to make a global declaration of it_zfichpai and use "like" statement in my form declaration but I want my it_zfichpai declaration stay local.

Need help

1 ACCEPTED SOLUTION
Read only

h_senden2
Active Contributor
0 Likes
585

define a table type like.

types: begin of ty_ltap,

lgnum like ltap-lgnum,

tanum like ltap-tanum,

tapos like ltap-tapos,

end of ty_ltap,

tt_ltap type table of ty_ltap.

data: i_ltap type tt_ltap.

You can use the table type in the definition of the subroutine :

FORM subroutine changing pi_ltap type tt_ltap.

...

ENDFORM.

And call it by :

perform subroutine changing i_ltap.

regards,

Hans

Hello all,

I m trying to pass an internal table with CHANGING

Code


FORM X
 it_zfichpai type table of zfichpai,
wa_zfichpai like line of it_zfichpai.
(...)
perform create_md5key changing wa_zfichpai-MD5KEY
                            it_zfichpai.
ENDFORM.


FORM create_MD5key changing hkey type zfichpai-md5key
                            -> p_zfichpai like zfichpai <-(dont work).

the "like" doesn't work,neither "like table of", "type", "type table of"

A way to do it is to make a global declaration of it_zfichpai and use "like" statement in my form declaration but I want my it_zfichpai declaration stay local.

Need help

3 REPLIES 3
Read only

Former Member
0 Likes
585

Hi,

Generally internal table are passed using "tables" addition and not "changing" addition.

Thanks & Regards,

Navneeth K.

Read only

h_senden2
Active Contributor
0 Likes
586

define a table type like.

types: begin of ty_ltap,

lgnum like ltap-lgnum,

tanum like ltap-tanum,

tapos like ltap-tapos,

end of ty_ltap,

tt_ltap type table of ty_ltap.

data: i_ltap type tt_ltap.

You can use the table type in the definition of the subroutine :

FORM subroutine changing pi_ltap type tt_ltap.

...

ENDFORM.

And call it by :

perform subroutine changing i_ltap.

regards,

Hans

Read only

Former Member
0 Likes
585

Thx for replies,

1reply -> I prefer to not use TABLE cause obsolete 😕

2reply -> The probelm is that I m in an include attached to an sap standard program than i prefer to dont add some declaration of type.

Maybe is it the only way but i wanted to be sure : )