on 03-18-2011 10:53 AM
Hello All,
I was trying to create a Business Partner(Ship to Party) using function module SD_CUSTOMER_MAINTAIN_ALL. When I am executing this through SE37 transaction, its working fine &
creating a KUNNR value along with new ADRNR number.
But when the same data is passed inside the program, its throwing CAM_ERROR(sy-subrc = 22).
If anyone used this FM, please suggest. Thank you.
Hi Ram,
Refer the below links to solve your issue.
http://www.sapfans.com/forums/viewtopic.php?f=13&t=324781
Regards,
Ragunathan.R
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This FM is reservced for the maintenance of consumer. And this should only be true from the transaction itself.
There exists other cases, one of the oldest one is the BAPI_CUSTOMER_CREATEFROMDATA1. But is is exclusively reserved for SAP Online store.
Despite the fact CMD_EI_API is quite difficult to use, it has the main benefit that is it supported if being triggered directly.
For the maintenance of customers, there is NO BAPI and NO direct function module.
There are some functions modules like the one above where the name is looking nice. But these should not be used.
The only valid solutions are :
Below ECC 2005 (6.00), the only solution was batch input and DEBMAS idocs. See note 384462
Starting with ECC 2005 (6.00) and above: a synchronisation tool has been introduce. See class CMD_EI_API and VMD_EI_API
Hope this helps
BR
Alain
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ragu,
I am passing the data to function module as shown below.
*KNA1 population
ls_kna1-mandt = sy-mandt.
ls_kna1-ktokd = 'ZN02'.
ls_kna1-land1 = ls_adrc-country.
ls_kna1-name1 = ls_adrc-name1.
ls_kna1-name2 = ls_adrc-name2.
ls_kna1-ort01 = ls_adrc-city1."City
ls_kna1-regio = ls_adrc-po_box_reg.
ls_kna1-pstlz = ls_adrc-post_code1.
ls_kna1-sortl = ls_adrc-sort_phn.
ls_kna1-stras = ls_adrc-house_num1.
ls_kna1-spras = ls_adrc-langu.
*BAPIADDR1 population
ls_bapiaddr1-name = ls_adrc-name1.
ls_bapiaddr1-name_2 = ls_adrc-name2.
ls_bapiaddr1-city = ch_adrc_struc-city1.
ls_bapiaddr1-postl_cod1 = ch_adrc_struc-post_code1.
ls_bapiaddr1-street = ch_adrc_struc-street.
ls_bapiaddr1-house_no = ch_adrc_struc-house_num1.
ls_bapiaddr1-str_suppl1 = ch_adrc_struc-str_suppl1.
ls_bapiaddr1-str_suppl2 = ch_adrc_struc-str_suppl2.
ls_bapiaddr1-location = ch_adrc_struc-location.
ls_bapiaddr1-country = ch_adrc_struc-country.
ls_bapiaddr1-langu = ch_adrc_struc-langu.
ls_bapiaddr1-sort1 = ch_adrc_struc-sort1.
ls_bapiaddr1-sort2 = ch_adrc_struc-sort2.
ls_bapiaddr1-langu_cr = ch_adrc_struc-langu_crea.
*KNVV Population
ls_knvv-vkorg = '1000'.
ls_knvv-vtweg = '01'.
ls_knvv-spart = '01'.
CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'
EXPORTING
i_kna1 = ls_kna1
i_knvv = ls_knvv
i_bapiaddr1 = ls_bapiaddr1
i_maintain_address_by_kna1 = 'X'
i_no_bank_master_update = 'X'
i_raise_no_bte = 'X'
pi_postflag = 'X'
i_from_customermaster = 'X'
IMPORTING
e_kunnr = lv_kunnr
o_kna1 = ls_kna1_output
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.
IF sy-subrc = 0.
EXPORT kunnr FROM lv_kunnr TO MEMORY ID 'Z_CUST_NUM'.
EXPORT adrnr FROM lv_adrnr TO MEMORY ID 'Z_ADDR_NUM'.
ENDIF.
When I am executing this through SE37, its working perfectly. However when used in Sales Order Save exit, its throwing an error saying SY-Subrc = 22(CAM_ERROR).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.