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: 

Facing problem in call function starting new task taskname

Former Member
0 Kudos

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

Former Member

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

0 Kudos

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

0 Kudos

Is the function remote enabled ?

0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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

Amandeep

0 Kudos

thx...i have done it