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

to load customer master using bapi

Former Member
0 Likes
1,098

HI GUYS ,

DOES ANYONE HAVE A SAMPLE CODE TO LOAD THE CUSTOER MASTER DATA USING BAPIS.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
935

Hi Nishanth,

TO LOAD THE CUSTOER MASTER DATA USING BAPIS.

In case you wish to read the customer data you can use the following BAPI, it retrieves the Customer Master (Company Code) Data and the General Data in Customer Master.

CUSTOMER_READ

You need to pass the Customer Number and the Company Code. See the example given below.

REPORT ZEX_CUSTOMERREAD .

Parameters: p_bukrs like KNB1-BUKRS,

p_kunnr like KNA1-KUNNR.

Data: ty_kna1 type kna1,

ty_knb1 type knb1.

Data: int_kna1 like ty_kna1,

int_knb1 like ty_knb1.

CALL FUNCTION 'CUSTOMER_READ'

EXPORTING

I_BUKRS = p_bukrs

I_KUNNR = p_kunnr

IMPORTING

E_KNA1 = int_Kna1

E_KNB1 = int_knb1

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

thanks

karthik

5 REPLIES 5
Read only

Former Member
0 Likes
936

Hi Nishanth,

TO LOAD THE CUSTOER MASTER DATA USING BAPIS.

In case you wish to read the customer data you can use the following BAPI, it retrieves the Customer Master (Company Code) Data and the General Data in Customer Master.

CUSTOMER_READ

You need to pass the Customer Number and the Company Code. See the example given below.

REPORT ZEX_CUSTOMERREAD .

Parameters: p_bukrs like KNB1-BUKRS,

p_kunnr like KNA1-KUNNR.

Data: ty_kna1 type kna1,

ty_knb1 type knb1.

Data: int_kna1 like ty_kna1,

int_knb1 like ty_knb1.

CALL FUNCTION 'CUSTOMER_READ'

EXPORTING

I_BUKRS = p_bukrs

I_KUNNR = p_kunnr

IMPORTING

E_KNA1 = int_Kna1

E_KNB1 = int_knb1

EXCEPTIONS

NOT_FOUND = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

thanks

karthik

Read only

Former Member
0 Likes
935

nishant,

just use either:

BAPI_CUSTOMER_CREATE
BAPI_CUSTOMER_CREATEFROMDATA
BAPI_CUSTOMER_CREATEFROMDATA1

Amit.

Read only

Former Member
0 Likes
935
Read only

Former Member
0 Likes
935

HI GUYS ,

I WANT TO CREATE A CUSTOMER MASTER FROM A FLAT FILE .HOW CAN I DO THIS.

THANKS.

Read only

Former Member
0 Likes
935

http://www.ashpeople.comashthomas

www.sapfans.com/forums/viewtopic.php?f=13&t=314946&p=953638 - 21k - (check this link)

With thanks & regards,

Sravani yendru.