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

Facing problem in call function starting new task taskname

Former Member
0 Likes
1,299

Hi all,

when i call a function module using starting new task, it is failing with sy-subrc 3. can anyone guide me in this.

see the code :

DATA lv_taskname(7) TYPE c VALUE 'PEM_EXE'.

CALL FUNCTION 'PEM_SCHEDULE' STARTING NEW TASK lv_taskname

EXPORTING

iv_packid = gv_packid

iv_pebid = ls_alv_out-peb_id

EXCEPTIONS

invalid_state_request = 1

database_error = 2

OTHERS = 3.

Thanks in advance.

Best Regards,

Prashant

8 REPLIES 8
Read only

Former Member
1,089

Does it work if you don't use NEW TASK ???

Read only

0 Likes
1,089

yes it works, if i dont use 'starting new task taskname'

Read only

0 Likes
1,089

Is the function remote enabled ?

Read only

0 Likes
1,089

no, the function module is not remote enabled. it is executed locally

Read only

0 Likes
1,089

I think the function has to be remote enables. this is what the documentation says.

These additions are used to assign actual parameters to formal parameters of the function module and return values to exceptions that are not class-based. The additions have the same meaning as in the synchronous RFC with the exceptions that values with IMPORTING cannot be imported and that actual parameters specified by CHANGING can be transferred but cannot be imported.

Cheers

Amandeep

Read only

0 Likes
1,089

when i change the function module from normal to remote, it gives me a error that the "generic types are not allowed in RFC", but i have not given any generic type in the parameters.

see the signature of the function module.

*" IMPORTING

*" VALUE(IV_PACKID) TYPE CNVMBTPACK-PACKID

*" VALUE(IV_PEBID) TYPE CNVMBTPEB-PEB_ID

*" EXPORTING

*" VALUE(EV_ERROR_DETECTED) TYPE C

*" VALUE(EV_STOP) TYPE C

*" EXCEPTIONS

*" INVALID_STATE_REQUEST

*" DATABASE_ERROR

*" FORIEGN_LOCK

Can u please check it and find out the problem

Thanks,

Prasanth

Read only

0 Likes
1,089

Instead of Type C use Type CHAR1 etc. Give the variable a length.

Amandeep

Read only

0 Likes
1,089

thx...i have done it