cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI Exception !

Former Member
0 Kudos

Hello Friends,

I am trying to call a bapi 'BAPI_DEBTOR_EXISTENCECHECK'.

When I try to execute the program, it gives me following parameter missing exception,

CALL_FUNCTION_PRAM_MISSING

though I am sending the appropriate parameters, but still I am getting this exception. Here is the ABAP code,

DATA : Company_ID LIKE BAPI1007-COMP_CODE.

DATA : MY_RETURN TYPE BAPIRETURN.

DATA : debtor_ID like BAPI1007-CUSTOMER.

MOVE '0001' TO Company_ID.

MOVE '1' TO debtor_ID.

CALL FUNCTION 'BAPI_DEBTOR_EXISTENCECHECK'

EXPORTING

RETURN = MY_RETURN

IMPORTING

Company_ID = Company_ID

DEBTORID = debtor_ID

.

Thanks in advance,

Haider Syed.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Syed,

If the coding sample that you wrote is what you have in your program, then I can say that you call BAPI incorrectly. Try this one:

CALL FUNCTION 'BAPI_DEBTOR_EXISTENCECHECK'

EXPORTING

debtorid = debitor_id

COMPANYCODE = company_id

IMPORTING

RETURN = my_return.

Just for information. This EXPRORT and IMPORT parameters are a bit misleading. For example the DEBITORID is an

IMPORT parameter for your function modules. But when you call this function module from your program you should write

EXPORTING for this IMPORT parameters.

Also I can recommend you one feature. When you write ABAP coding and want to call a Function Module you can use

button "Pattern" on SAP toolbar. Just press this button then choose first radio button CALL FUNCTION, enter the name of FM you want to call and press Enter.

The correct function module call appears on the place where the cursor is set in your coding. For example in your case:

CALL FUNCTION 'BAPI_DEBTOR_EXISTENCECHECK'

EXPORTING

debtorid =

  • COMPANYCODE =

  • IMPORTING

  • RETURN =

.

All you need to do - just uncomment optional parameters if you need them and supply your variables after '=' sigh for corresponded parameters.

Good luck,

Mikhail

Former Member
0 Kudos

Hello Mikhail,

Thanks for your kind help, it works now, so nice of you.

But now I am facing another problem, when i execute the program it shows me "customer 1 does not exists", though it exists with in the system. if I go directly in FI and then, AccountRecieable, and then master record, click on display, enter the customer "1" and company code "0001", I get the requried customer data.

Any suggestions, what can be possibly wronge.

Many thanks indeed

Haider Syed.

Former Member
0 Kudos

Hi again,

As I see from looking through the coding of

BAPI_DEBTOR_EXISTENCECHECK. Inside this FM there's a SELECT statement from DB table KNA1 in order to check the

existence of the debitor, which you supply as import parameter.

The problem is that you supply the parameter with value '1', but in DB there is an entrie - '0000000001'.

So try the value with leading zeros, like you do with company code.

Regards,

Mikhial

Former Member
0 Kudos

Hi,

Thanks once again, now I have used '0000000001' insted of 1, and now there is no error,...

I have also checked the source code, but can u please let me know, how u checked that in db it is stored with '0000000001'.

So nice of you,

Haider Syed.

Former Member
0 Kudos

I just have seen that there is a DB SELECT statement in

BAPI_DEBTOR_EXISTENCECHECK :

  • ------ Selektion -----------------------------------

SELECT SINGLE * FROM KNA1

WHERE KUNNR = DEBTORID.

The DEBITORID is the import parameter you supply to the FM.

To see the content of the DB tables you can use transaction SE16. I just display the content of the DB table KNA1 and have seen that leading zeros are used in KUNNR field.

Former Member
0 Kudos

Hi,

Thanks, I got it... so nice of you....

bye.