Application Development 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: 

Bapi Bdc Combination to create customer

madhu_vadlamani
Active Contributor
0 Kudos
264

Dear all,

I want to create a customer master from external system. What are the standard bapis are there they re not suitable for my requirement. I approach it in the following way. I did a bdc for xd01 and trying to call it from a rfc fm which i prepared. But the data that i passes from this fm is not reaching my bdc program. If any body have a good idea on this please share your idea with me .

1) I created an import parameter in this i created a structure.

2) the same structure i declare with the same name in bdc report(se38).

The code in the fm is in this way

DATA:

t_cust TYPE zcust_table .(this is the structure name in my fm import tab)

EXPORT t_cust TO MEMORY ID 'TABLE'.

SUBMIT ZBDC_CUSTOMER AND RETURN.

3)

DATA :BEGIN OF zcust OCCURS 100 .

INCLUDE STRUCTURE zcust_table.

DATA:END OF ZCUST.

START-OF-SELECTION.

IMPORT t_cust FROM MEMORY ID 'TABLE'.(Thi is my decalration in se38 bdc program.)

when i executed my fm the value that given in fm is not reaching my table which i declared in bdc program.

Regards,

Madhu.

10 REPLIES 10

Former Member
0 Kudos
147

Hi,

We have the same scenario .

We have created customers from external system through RFC connection.

We have created RFC function module by using SD_CUSTOMER_MAINTAIN_ALL Function module.

In this we have all the options.

Regards

Madhu

0 Kudos
147

Hi Madhu,

Thanks for your reply. I tried to use this fm sd_customer_maintain_all. This will update only tables. Can you tell how you created customer with this fm. I think it contains only few fields. Please share your idea if you have any idea on this.

Regards,

Madhu.

0 Kudos
147

Hi,

Already we have created RFC function module to create customer.

We have to fill all the structures and we have to call sd_customer_maintain_all function module internally.

Already we have done it.

It will create the customers.

Regards

Madhu

0 Kudos
147

Hi madhu,

Dont mind when i am telling like this. I filled some of the tables and try to create a customer. It is not created any customer. Can you share your ideas with me. If possible can u tell me how you did . I will do in the same way. I am vey thankful to you if i can what you said.

Regards,

Madhu.

0 Kudos
147

Hi,

Populate all the customer details address details and personal details in KNA1 structure.

Populate Company code details in KNB1 structure.

Populate Sales area details in KNVV structure.

Populate dunning data in KNB5 table.

Populate Tax data in KNVI table

In all the structures other than customer number we have to fill all the primary key fields.

Call the SD_CUSTOMER_MAINTAIN_ALL function module to create customer as below.

  • Create Customer in SAP

CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'

EXPORTING

i_kna1 = fs_kna1

i_knb1 = fs_knb1

i_knvv = fs_knvv

i_bapiaddr1 = fs_add1

i_bapiaddr2 = fs_add2

pi_postflag = c_true

IMPORTING

e_kunnr = w_kunnr

TABLES

t_xknb5 = t_knb5

t_xknvi = t_knvi

EXCEPTIONS

client_error = 1

kna1_incomplete = 2

knb1_incomplete = 3

knb5_incomplete = 4

knvv_incomplete = 5

kunnr_not_unique = 6

sales_area_not_unique = 7

sales_area_not_valid = 8

insert_update_conflict = 9

number_assignment_error = 10

number_not_in_range = 11

number_range_not_extern = 12

number_range_not_intern = 13

account_group_not_valid = 14

parnr_invalid = 15

bank_address_invalid = 16

tax_data_not_valid = 17

no_authority = 18

company_code_not_unique = 19

dunning_data_not_valid = 20

knb1_reference_invalid = 21

cam_error = 22

OTHERS = 23.

Check sysubrc to know the error .

Please let me know if you need any further details.

Regards

Madhu

0 Kudos
147

Hi madhu,

Once again thanks for your immediate reply. Here there is no table for excise duties to fill. This table i have to fill at the time of customer creation. Is it possible in this. When i studied these table there is no table for excise duties.If there is any options please tell me .

Regards,

Madhu.

0 Kudos
147

HI ,

Can you please tell me in which table these excise duties will save while creating customer.

You are saying about CIN details.

Could you please explain me exactly ,

Regards

Madhu

0 Kudos
147

Hi madhu

i gone through your answer,

but i have some query

i want to create customer through bapi which facilitates to enter customer code (our own defined, not sequentially next no)

do you have any idea how to do this.

thanks

kesavadas_thekkillath
Active Contributor
0 Kudos
147

Wrap SD_CUSTOMER_MAINTAIN_ALL in your rfc.

madhu_vadlamani
Active Contributor
0 Kudos
147

This message was moderated.