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

BAPI

Former Member
0 Likes
471

I have developed a custom Function Module which in turn calls the BAPI Function Module 'BAPI_BCONTACT_CREATEFROMDATA'.

The import parameters of the function module are passed to the BAPI function module.

If the BAPI is called successfully then the Customer Contact is created. But if the BAPI is not called successfully then i need to pass back the reason code to the Custom Function Module's export parameter.

I am not able to crack this issue.

Can anyone please help me with this?

Regards,

Rakesh.

3 REPLIES 3
Read only

Former Member
0 Likes
431

'BAPI_BCONTACT_CREATEFROMDATA' will have the return parameter ( RETURN LIKE BAPIRETURN1 STRUCTURE BAPIRETURN1 ). Check what it is returing when the contract is not created. Pass that to the custom function module parameter.

For this in ur custom FM assign a export parameter return like BAPIRETURN1. Pass the value which is coming from BAPI to this return.

Read only

0 Likes
431

> 'BAPI_BCONTACT_CREATEFROMDATA' will have the return

> parameter ( RETURN LIKE BAPIRETURN1 STRUCTURE

> BAPIRETURN1 ). Check what it is returing when the

> e contract is not created. Pass that to the custom

> function module parameter.

>

> For this in ur custom FM assign a export parameter

> return like BAPIRETURN1. Pass the value which is

> coming from BAPI to this return.

>

Ya that is fine i have one export parameter in my custom function module that gets its value from the RETURN export parameter of the BAPI. But what i want really is i need to get the reason codes like 'o1','o2','o3','o4','o5','o6'. So how can i get that.coz i need to get the specific error and not a generalised one.

Read only

Former Member
0 Likes
431

Hi

'BAPI_BCONTACT_CREATEFROMDATA' returns two export parameter 'RETURN' and 'CONTACT'.

If ur Contact will not be created then posiible error msgs will be stroed in RETURN parameter,This u need to pass to ur custom FM.U can check CONTACT field whetehre its initial after firing BAPI.If BAPI succesfully executed then this field will have value otherwise not.

To pass the RETURN value declare one export parameter

RETURN like BAPIRETURN1.

Then collect the msgs.

If helpful

Then reward me points

Regs

Manas Ranjan Panda