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 parameters which is gotten from method

Former Member
0 Likes
559

Hi all,

I would like to pass data gotten by the method

as the parameter to another method .

For example ...

read_table(

EXPORTING

i_value = zclass001=>get_value( `CON-TEXT01` )

IMPORTING

e_out = l_wrk ).

But when I activate this method , error message is issued .

The massage is...

") IMPORTING e_Data "is not expected

I do not understand why the error is issued .

I apporogize for poor English , and asking rudimentary question .

SAP ECC 6.0

SAP_BASIS SAPKB70011

SAP_ABA SAPKA70011

Many thanks for your help.

Regards,

Masao

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
528

Hi Masao San,

Use the following.

lv_temp = zclass001=>get_value( `CON-TEXT01` ).

obj->read_table( EXPORTING i_value = lv_temp

IMPORTING e_out = l_wrk ).

But for this to work define get_value method as a functional method i.e. with RETURNING parameter.

CLASS-METHODS: get_value

IMPORTING im_text TYPE string

RETURNING value(re_value) TYPE i.

Award points if found useful.

Regards

Indrajit.

3 REPLIES 3
Read only

Former Member
0 Likes
529

Hi Masao San,

Use the following.

lv_temp = zclass001=>get_value( `CON-TEXT01` ).

obj->read_table( EXPORTING i_value = lv_temp

IMPORTING e_out = l_wrk ).

But for this to work define get_value method as a functional method i.e. with RETURNING parameter.

CLASS-METHODS: get_value

IMPORTING im_text TYPE string

RETURNING value(re_value) TYPE i.

Award points if found useful.

Regards

Indrajit.

Read only

0 Likes
528

Thank you for answering .

I'm sorry for my bad explanation .

But I do not want to restore zclass001=>get_value( `CON-TEXT01` )

to the local work .

I would like to pass "zclass001=>get_value( `CON-TEXT01` )"

to read_table directory .

Because I have to write a lot of parameters for the method "get_value" ,

and call method "read_table" many times .

And about the method "get_value" ...

Import parameter : I_ID type string

Export parameter : R_TEXT type string

METHOD get_value.

INCLUDE: zghri00002.

FIELD-SYMBOLS: <fs> TYPE ANY.

ASSIGN (i_id) TO <fs>.

r_text = <fs>.

ENDMETHOD.

This method is for calling text-synbols of zclass001

and for calling constants of another ABAP include zghri00002 .

So , I would like to call method like "get_value" ,

and pass value of the method "get_value" to another method .

Read only

Former Member
0 Likes
528

hi,

for parameters (for the report) you can have simple import parameters but for select options you can use a table type like range (for example RSELOPTION) as importing parameter

REgards