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

Syntax Error in Perform Sub syntax

Former Member
0 Likes
687

Hi All

I am using the following set of code in a function module

The Function module has the following:

Import Parameters :p_orgunit

p_begda

p_endda

p_level

p_lmid

p_lvl_max

And

export paramter as: p_struc.

p_struc has a associated type of that of a table type !!!

MY Requirement get the O/P of the Function Module into a Table ( Internal TAble)

So I have used the Export paramter of the type " TABLE TYPE"

And withing that FM i am calling a subtoutine as mentioned below:

perform read_empl_by_ou using p_orgunit

p_begda

p_endda

p_level

p_lmid

p_lvl_max

changing p_struc.

My Requirment is to update table p_struc in the Form logic and the apply a other set of logic on the table p_struc

It's Form and Endform code is enclosed in a include:

form read_empl_by_ou using orgunit

begda

endda

level

lmid

lvl_max

changing op_struc. "change

Endform.

Now when i go for the syntax check , it gives an error stating that :

Different no. of parameters in Form and Perform ( routine read_empl_by_ou, number of formal parameters 12, number of actual parameters 7)

HOwever there are only 7 parameter's used in FORM and PERFORM.

One more thing the error goes away if i comment/delete the following statement from Perform and Form

changing p_struc.

6 REPLIES 6
Read only

Former Member
0 Likes
643

hi ,

use the tables not exporting then it is possible.

reward points if useful,

venkat

Read only

0 Likes
643

Hi

If i shift my table declaration form Export section into the TAble cloumn then

I get an Information as:

Only tables with flat line Structure can be used in RFC

MY FUnction MOdule usesa RFC...

Edited by: Gaurav Verma on Mar 7, 2008 11:05 AM

Read only

0 Likes
643

or check this for example:

import:

IPA_PERNR LIKE PA0001-PERNR Personnel number

IPA_DATUM LIKE SY-DATUM SY-DATUM Date and Time, Current (Application Server) Date

export:

EPA_PERNR LIKE PA0001-PERNR Personnel number

EPA_ENAME LIKE PA0001-ENAME Formatted Name of Employee or Applicant

exceptions:

DEFAULT_POSITION_HOLDER DEFAULT_POSITION_HOLDER

INVALID_PERNR INVALID_PERNR

source code:

FUNCTION Z_GET_SUPERVISOR.

*"----


""Local interface:

*" IMPORTING

*" REFERENCE(IPA_PERNR) LIKE PA0001-PERNR

*" REFERENCE(IPA_DATUM) LIKE SY-DATUM DEFAULT SY-DATUM

*" EXPORTING

*" REFERENCE(EPA_PERNR) LIKE PA0001-PERNR

*" REFERENCE(EPA_ENAME) LIKE PA0001-ENAME

*" EXCEPTIONS

*" DEFAULT_POSITION_HOLDER

*" INVALID_PERNR

*"----


CLEAR: I0001, I0001[], W_MSTBR.

SELECT SINGLE * FROM PA0003 CLIENT SPECIFIED

WHERE MANDT = SY-MANDT

AND PERNR = IPA_PERNR.

*

IF SY-SUBRC <> 0.

RAISE INVALID_PERNR.

ENDIF.

CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING

PERNR = IPA_PERNR

INFTY = '0001'

BEGDA = IPA_DATUM

ENDDA = IPA_DATUM

IMPORTING

SUBRC = G_RETCD

TABLES

INFTY_TAB = I0001

EXCEPTIONS

INFTY_NOT_FOUND = 01

OTHERS = 02.

*

IF SY-SUBRC EQ 0. "Get Managed By #(S)

IF I0001-PLANS = '99999999'.

RAISE DEFAULT_POSITION_HOLDER.

ENDIF.

CALL funCTION 'Z_GET_SUPV_NAME_FOR_USER_EXITS'

EXPORTING

IPA_ORGEH = I0001-ORGEH

IPA_PLANS = I0001-PLANS

IPA_BEGDA = IPA_DATUM

IPA_ENDDA = IPA_DATUM

IMPORTING

EPA_PERNR = W_MSTBR

EPA_ENAME = EPA_ENAME.

EPA_PERNR = W_MSTBR.

ENDIF.

ENDFUNCTION.

reward points if useful,

venkat

Read only

0 Likes
643

This example does not help in solving my query !!

Read only

0 Likes
643

The problem stands resolved now !!

Read only

Former Member
0 Likes
643

Hi ,

Please make sure that you are activating both the calling part and the called part of the code on a single go.Kindly excuse me if this is not the case.

Regards,

Kiran