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 in parameters

Former Member
0 Likes
834

Hello, I have the following line in one of my forms:


 FORM PRINT_THINGS TABLES P_COL_WIDTH
                     USING P_DATA_DETAIL(1000) TYPE C.

where p_col_width is the width of each column of a table (i.e., p_col_width is an internal table) and p_data_detail is a string containing all the actual data. When I tried to run it, however, this is what I got:

Parameters must be specified either with "p" (pass by reference) or with "VALUE(p)" (pass by value).

May I know what is wrong with this code? Thanks a lot!

Regards,

Anyi

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
680

Please define like this.




<b>types: t_data_detail(1000) type c.</b>


*---------------------------------------------------------------------*
*       FORM PRINT_THINGS                                             *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
*  -->  P_COL_WIDTH                                                   *
*  -->  P_DATA_DETAIL(1000)                                           *
*---------------------------------------------------------------------*
form print_things tables p_col_width
                  <b> using p_data_detail type t_data_detail.</b>


endform.


Regards,

Rich Heilman

PS.

Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.

Spread the wor(l)d!

Please define like this.




<b>types: t_data_detail(1000) type c.</b>


*---------------------------------------------------------------------*
*       FORM PRINT_THINGS                                             *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
*  -->  P_COL_WIDTH                                                   *
*  -->  P_DATA_DETAIL(1000)                                           *
*---------------------------------------------------------------------*
form print_things tables p_col_width
                  <b> using p_data_detail type t_data_detail.</b>


endform.


Regards,

Rich Heilman

PS.

Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.

Spread the wor(l)d!

5 REPLIES 5
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
681

Please define like this.




<b>types: t_data_detail(1000) type c.</b>


*---------------------------------------------------------------------*
*       FORM PRINT_THINGS                                             *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
*  -->  P_COL_WIDTH                                                   *
*  -->  P_DATA_DETAIL(1000)                                           *
*---------------------------------------------------------------------*
form print_things tables p_col_width
                  <b> using p_data_detail type t_data_detail.</b>


endform.


Regards,

Rich Heilman

PS.

Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.

Spread the wor(l)d!

Read only

Former Member
0 Likes
680

FORM PRINT_THINGS TABLES P_COL_WIDTH

<b> USING P_DATA_DETAIL TYPE Char1000.</b>

make the highlighted change

Read only

Former Member
0 Likes
680

FORM PRINT_THINGS TABLES P_COL_WIDTH
                     USING P_DATA_DETAIL type char1000.

or 

FORM PRINT_THINGS TABLES P_COL_WIDTH
                     USING P_DATA_DETAIL .

Read only

Former Member
0 Likes
680

hi Declare like this

FORM PRINT_THINGS TABLES P_COL_WIDTH <b>type yourtable type</b>

USING P_DATA_DETAIL(1000) TYPE C.

Message was edited by: Ashok Parupalli

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
680

You can directly define the length and type in the FORM statement, you must use a TYPE, or LIKE.

Regards,

Rich Heilman