2006 Aug 23 1:30 PM
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.
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.
2006 Aug 23 5:47 PM
2006 Sep 20 8:58 AM
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
2006 Sep 21 9:51 AM
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 WAITafterwards.
Regards
Uwe
2006 Sep 22 2:00 PM
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
2006 Sep 25 7:14 AM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |