Application Development 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: 

Private methods Importing parameter cannot be changed error

Former Member
0 Kudos

Hi Guys,

I have this scenario where I have a private method inside a class which is having an error "Field SAPMF02K cannot be changed".

here is the code for the private method call.

call method create_bdc_dynpro

importing IM_PROGRAM = 'SAPMF02K'

IM_DYNPRO = '0100'.

code of the method

data: wa_bdcdata type bdcdata.

CLEAR wa_bdcdata.

wa_bdcdata-program = im_program.

wa_bdcdata-dynpro = im_dynpro.

wa_bdcdata-dynbegin = at_true.

APPEND wa_bdcdata to at_bdcdata.

Hope you can help

Thanks!

1 ACCEPTED SOLUTION

alex_cook
Active Participant
0 Kudos

Howdy,

I think you have your importing/exporting the wrong way round.

The method call should be:

call method create_bdc_dynpro

exporting IM_PROGRAM = 'SAPMF02K'

IM_DYNPRO = '0100'.

And of course in the method definition they should be importing parameters.

Cheers

Alex

3 REPLIES 3

alex_cook
Active Participant
0 Kudos

Howdy,

I think you have your importing/exporting the wrong way round.

The method call should be:

call method create_bdc_dynpro

exporting IM_PROGRAM = 'SAPMF02K'

IM_DYNPRO = '0100'.

And of course in the method definition they should be importing parameters.

Cheers

Alex

Former Member
0 Kudos

Thanks Alex. That solved the problem

Is this also the case for Public Methods?

alex_cook
Active Participant
0 Kudos

Howdy,

Yep that applies regardless of the visibility.

Cheers

Alex