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

CALL FUNCTION func STARTING NEW TASK task

Former Member
0 Likes
1,364

hi,

i developed rfc to extract data and send to xi

as my interface is Async

as per soem documents it was mentioned the syntax

CALL FUNCTION func STARTING NEW TASK task

wat is the task ? in the syntax

and how do i use it

jeff

1 ACCEPTED SOLUTION
Read only

suresh_datti
Active Contributor
0 Likes
957

It must be a valid string of at least 2 characters, preferably fewer than 8 characters. You cannot use either ' ' or SPACE as tasknames. the following is valid..

CALL FUNCTION func STARTING NEW TASK 'TEST'.

~Suresh

7 REPLIES 7
Read only

suresh_datti
Active Contributor
0 Likes
958

It must be a valid string of at least 2 characters, preferably fewer than 8 characters. You cannot use either ' ' or SPACE as tasknames. the following is valid..

CALL FUNCTION func STARTING NEW TASK 'TEST'.

~Suresh

Read only

0 Likes
957

Hi Suresh,

It says error while executing async rfc with rfcdestination

this is the way i am using

CALL FUNCTION 'FUNCTION MODULE NAME' STARTING NEW TASK 'TEST'

DESTINATION 'RFCDESTINATION'

Read only

0 Likes
957

What is the error? Did you maintain the Rfc destination via SM59? pl paste your code..

~Suresh

Read only

0 Likes
957

Hi suresh,

this is the code of RFC. if i execute without RFCDESTINATION it executes successfully. when i use RFC DESTINATION it shows error

call to messaging system failed: com.sap.aii.af.ra.ms.api.DeliveryException

i created RFC destination using TCP/IP and registered program. same parameters i am mentioning in XI.

FUNCTION z_bank_reconciliation.

*"----


""Local interface:

*" IMPORTING

*" VALUE(COMP_CODE) TYPE BUKRS

*" VALUE(HOUSE_BANK) TYPE HBKID

*" VALUE(ACCOUNT_ID) TYPE HKTID

*" TABLES

*" CHQDETAILS STRUCTURE ZPAYR

*"----


DATA: itab LIKE payr OCCURS 0 WITH HEADER LINE.

DATA: jtab LIKE payr OCCURS 0 WITH HEADER LINE.

DATA: it_bank LIKE zbankrecon OCCURS 0 WITH HEADER LINE.

DATA: it_bank1 LIKE zpayr OCCURS 0 WITH HEADER LINE.

TYPES : BEGIN OF ty_bseg ,

bukrs LIKE bseg-bukrs,

hbkid LIKE bseg-hbkid,

belnr LIKE bseg-belnr,

zlsch LIKE bseg-zlsch,

kostl LIKE bseg-kostl,

hkont LIKE bseg-hkont,

bzdat LIKE bseg-bzdat,

END OF ty_bseg.

TYPES : BEGIN OF ty_t012 ,

bukrs LIKE t012-bukrs,

bankl LIKE t012-bankl,

bankn LIKE t012k-bankn,

END OF ty_t012.

TABLES : payr, t012, t012k, bseg.

DATA : itpayr LIKE zpayr OCCURS 0 WITH HEADER LINE,

itt012 TYPE STANDARD TABLE OF ty_t012,

itbseg TYPE STANDARD TABLE OF ty_bseg,

wa_itt012 TYPE ty_t012,

wa_itbseg TYPE ty_bseg,

total TYPE n.

SELECT * FROM zbankrecon INTO TABLE it_bank

FOR ALL ENTRIES IN itab

WHERE chequeno EQ itab-chect.

SELECT abukrs abankl b~bankn

INTO CORRESPONDING FIELDS OF TABLE

itt012 FROM t012 AS a

INNER JOIN t012k AS b ON bbukrs = abukrs AND b~hbkid =

house_bank AND b~hktid = account_id

WHERE abukrs = comp_code AND ahbkid = house_bank.

DELETE ADJACENT DUPLICATES FROM itt012.

SELECT zbukr hbkid hktid vblnr gjahr zaldt checf chect znme1 rwbtr

waers zaldt zbnkl FROM payr INTO CORRESPONDING FIELDS OF TABLE itpayr

WHERE ( zbukr = comp_code AND hbkid = house_bank ) AND hktid =

account_id.

SELECT bukrs hbkid belnr zlsch kostl hkont bzdat FROM bseg INTO TABLE

itbseg

WHERE bukrs = comp_code AND hbkid = house_bank.

SORT itt012 BY bankl.

SORT itbseg BY belnr.

READ TABLE itt012 INTO wa_itt012 INDEX 1.

LOOP AT itpayr.

read table itbseg into wa_itbseg with key bukrs = itpayr-zbukr

hbkid = itpayr-hbkid.

if sy-subrc = 0.

itpayr-kostl = wa_itbseg-kostl.

itpayr-hkont = wa_itbseg-hkont.

  • itpayr-bldat = wa_itbseg-bzdat.

itpayr-zlsch = wa_itbseg-zlsch.

endif.

itpayr-zbnkl = wa_itt012-bankl.

itpayr-zbnkn = wa_itt012-bankn.

MODIFY itpayr.

APPEND itpayr TO chqdetails.

ENDLOOP.

LOOP AT chqdetails.

READ TABLE it_bank WITH KEY chequeno = chqdetails-chect.

IF sy-subrc NE 0.

MOVE chqdetails TO it_bank1.

APPEND it_bank1.

CLEAR it_bank1.

ENDIF.

ENDLOOP.

REFRESH chqdetails.

chqdetails[] = it_bank1[].

LOOP AT it_bank1.

MOVE : it_bank1-chect TO zbankrecon-chequeno,

sy-datum TO zbankrecon-check_date,

sy-uzeit TO zbankrecon-check_time.

INSERT zbankrecon.

CLEAR zbankrecon.

ENDLOOP.

ENDFUNCTION.

Read only

0 Likes
957

The function module z_bank_reconciliation should be available in the target system. Do you have the function module defined in the target system?

Read only

0 Likes
957

Target system is XI not R3.

r u sure we need to have this FM in target system?

Read only

0 Likes
957

Sorry I got mixed up, so you are calling the RFC from XI and your function module's attribute is set to 'Remotely Executable'.