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: 

SD_CUSTOMER_MAINTAIN_ALL

Former Member
0 Kudos

I am using this FM to insert partner functions after the creation of a customer. What are the required parameters for this.

below is the code i am using where KZ in the x_knvp is 'I'. It tries to update sometimes. But some times if there is an error it send to the user inbox even though sy-subrc = 0. Is there any way i can check if its a valid kunn2 for the customer.

thanks in advance.

EDA

CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'

EXPORTING

PI_POSTFLAG = 'X'

IMPORTING

E_SD_CUST_1321_DONE = y_txt

TABLES

T_XKNVP = xknvp_tab

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.

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

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

ENDIF.

5 REPLIES 5

Former Member
0 Kudos

any idea anyone why this does not work?

Former Member
0 Kudos

hi ,

I am also having the similar requirement. I have change a partner function from y2 to y1.

I tried with kz as 'D' first then with 'I' with the same kunn2. I am also getting error to my inbox.

If you have found any solution , please forward it to me.

Thanks,

vijay

Message was edited by: vijay kanth

uwe_schieferstein
Active Contributor
0 Kudos

Hello

In order to check customer number you should use <b>BAPI_CUSTOMER_EXISTENCECHECK</b>.

I had a look at the coding of the function module SD_CUSTOMER_MAINTAIN_ALL and it looks like that it compares old vs. new data and then sets the appropriate change indicator itself. Thus, you could try to fill T_YKNVP (old) with all current partner data and T_XKNVP (new) with the current partner data + new partner data.

In addition, in some cases I have seen that even if PI_POSTFLAG = 'X' it did not commit work. In this cases I set PI_POSTFLAG = ' ' and execute

COMMIT WORK AND WAIT

afterwards.

Regards

Uwe

Former Member
0 Kudos

Hello vijay! I was not able to figure it out as there are more checks to be made other than the customer existance for a partner function. so i used LSMW to upload. I guess it would be easier to use BDC if its an option.

Please let me know if you were able to figure out the FM.

Thanks

eda

0 Kudos

Hi KE,

I used BDC to upload updated partner functions. I will send you code if i can find any solution.

Thanks for the reply.

Vijay