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

Runtime Error while passing parameters in a BAPI

Former Member
0 Likes
860

Hi,

I need to create a loan contract using BAPI_LOAN_CONTRACT_CREATE

But it gives me this runtime error when im passing the values to it.

An exception occurred that is explained in detail below.

The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was

not caught and

therefore caused a runtime error.

The reason for the exception is:

The call to the function module "BAPI_LOAN_CONTRACT_CREATE" is incorrect:

In the function module interface, you can specify only

fields of a specific type and length under "CONDITIONHEADER".

Although the currently specified field

"I_CONDHEADER" is the correct type, its length is incorrect.

Missing Handling of System Exception

Program is:

wa_loan-COMP_CODE = 'COPA'.

WA_LOAN-STATUS = '60'.

WA_LOAN-PROD_TYPE = '24A'.

WA_LOAN-LOAN_TYPE = '302'.

WA_LOAN-CURRENCY = 'USD'.

WA_LOAN-CURRENCY_ISO = 'USD'.

APPEND WA_LOAN TO I_LOAN.

WA_CONDHEADER-CONDITION_VALID_FROM = '20120201'.

*WA_CONDHEADER-VALID_FROM = '20120201'.

WA_CONDHEADER-REPAYMENT_TYPE = '2'.

WA_CONDHEADER-DISC_DET = '1'.

WA_CONDHEADER-P_D_RATE = '100'.

WA_CONDHEADER-COMM_CAP = '10000.0000'.

WA_CONDHEADER-CURRENCY = 'USD'.

*WA_CONDHEADER-CURRENCY_ISO = 'USD'.

WA_CONDHEADER-TERM_START = 20120201.

*WA_CONDHEADER-TERMS_START = '20120201'.

WA_CONDHEADER-FINAL_DUE_DATE = 20120201.

*WA_CONDHEADER-DUE_DATE = '20120201'.

*WA_CONDHEADER-EFFINTFROM = 20120201.

*WA_CONDHEADER-EFF_FROM = '20120201'.

APPEND WA_CONDHEADER TO I_CONDHEADER.

WA_PARTNERS-COMP_CODE = 'COPA'.

WA_PARTNERS-PARTNER = '70027'.

WA_PARTNERS-ROLE_TYPE = 'TR0100'.

APPEND WA_PARTNERS TO I_PARTNERS.

CALL FUNCTION 'BAPI_LOAN_CONTRACT_CREATE'

EXPORTING

LOAN = I_LOAN[]

CONDITIONHEADER = I_CONDHEADER[]

  • CORRESPONDENCE =

  • USERFIELDS =

  • TESTRUN = ' '

  • REFRESH = ' '

  • PROCESSEXTENSION = ' '

  • STEERING =

  • AVOID_INNER_JOIN = ' '

  • CALLN_APPLN = 'INT'

  • IMPORTING

  • LOANNUMBER =

  • ERROR =

TABLES

PARTNER = I_PARTNERS

  • CONDITIONS =

  • FORMULA =

  • OBJECTS =

  • COLLATERALS =

  • ENCUMBRANCES =

  • CLERKS =

  • EXTENSION_IN =

RETURN = I_RETURN

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  • EXPORTING

  • WAIT =

  • IMPORTING

  • RETURN =

.

I am not able to understand where am I going worng.

Kindly Help.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
762

Hi,

under export parameters we have to pass only structures....

Header data will always be passed as structure to the FM

pass only the work area to condition header

CONDITIONHEADER = I_CONDHEADER

5 REPLIES 5
Read only

Former Member
0 Likes
762

You are passing a table:

CONDITIONHEADER = I_CONDHEADER[]

Pass only the structure:

CONDITIONHEADER = I_CONDHEADER

Rob

Read only

0 Likes
762

I think it should be

CONDITIONHEADER = WA_CONDHEADER

Read only

Former Member
0 Likes
763

Hi,

under export parameters we have to pass only structures....

Header data will always be passed as structure to the FM

pass only the work area to condition header

CONDITIONHEADER = I_CONDHEADER

Read only

Former Member
0 Likes
762

>

 APPEND WA_LOAN TO I_LOAN."why append?
> APPEND WA_CONDHEADER TO I_CONDHEADER. "why append?
> CALL FUNCTION 'BAPI_LOAN_CONTRACT_CREATE'
>   EXPORTING
>"LOAN type BAPILOAN_CREATE --> a structure
>"CONDITIONHEADER type BAPICONDHEAD_CREATE --> a structure
>     LOAN                   = I_LOAN[] "==> this is a table not a structure, why [] added? 
>                                     "keep WA_LOAN
>     CONDITIONHEADER        = I_CONDHEADER[] "==> this is a table not a structure, why [] added? 
>                                             "keep WA_CONDHEADER

> Thanks.

Read only

Former Member
0 Likes
762

Thanks Guys,

That was helpful.