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

BAPI or User Exit to create a partner function in a customer.

Former Member
0 Likes
3,136

Hi gurus,

I have a customer created and I need to create a new partner function automatically.

Someone knows a BAPI or User Exit to create a new partner function in a customer when it exists.

Thanks in advance,

Xavier Gràcia.

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
2,623

Try SD_CUSTOMER_MAINTAIN_ALL

KNVP holds the details

Hi gurus,

I have a customer created and I need to create a new partner function automatically.

Someone knows a BAPI or User Exit to create a new partner function in a customer when it exists.

Thanks in advance,

Xavier Gràcia.

13 REPLIES 13
Read only

former_member632458
Participant
0 Likes
2,623

Hi Xavier Gràcia,

Can please explain ur scenario

Regards,

Rajesh S

Read only

Former Member
0 Likes
2,623

Hi

Check with user exit EXIT_SAPMF02D_001,

BAPI BAPI_CUSTOMER_CHANGEFROMDATA.

Regards

Srilaxmi

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
2,624

Try SD_CUSTOMER_MAINTAIN_ALL

KNVP holds the details

Read only

0 Likes
2,623

Dear ksd,

I'm trying to execute the bapi SD_CUSTOMER_MAINTAIN_ALL but it is returning the error following:

...

Excepción KNA1_INCOMPLETE

ID mensaje: F2 Nº mensaje: 804

...

I'm completing the import parameter I_KNA1 with the values:

MANDT='010'

KUNNr = '4' (Number of the customer)

Also, all the information in the tables KNVP requiered to create the new function partner.

Thanks for your help.

Best Regards,

Xavier Gràcia.

Read only

0 Likes
2,623

Did you pass all the fields to kna1 ?

Read only

0 Likes
2,623

No, In the table KNA1 I passed only the fields that identified the customer.

Thanks.

Read only

0 Likes
2,623

Dear ksd,

I pass the code implemented. In this case I only pass the table T_XKNVP:

DATA: BEGIN OF XKNVP OCCURS 0.

INCLUDE STRUCTURE FKNVP.

DATA: END OF XKNVP.

XKNVP-KUNNR = '0000000004'.

XKNVP-VKORG = 'FDB'.

XKNVP-VTWEG = '01'.

XKNVP-SPART = '01'.

XKNVP-PARZA = '005'.

XKNVP-PARVW = 'WE'.

XKNVP-KUNN2 = '0000000006'.

XKNVP-KZ = 'I'.

APPEND XKNVP.

CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'

TABLES

T_XKNVP = XKNVP

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.

When I execute this code the system does not return any error (sy-subrc = 0), but it is not create the new function partner.

Thanks for your help.

Xavier Gràcia.

Edited by: Oscar Barrabes on Nov 23, 2009 1:01 PM

Read only

0 Likes
2,623

Just do a select single * from kna1 and pass it all.

Try doing the same for KNB1 and KNVV also.

Edited by: ksd on Nov 23, 2009 5:57 PM

Read only

0 Likes
2,623

I try with all KNA1, KNB1 and KNVV also, but the system doesn't work.

Thanks for your help!

Xavier Gràcia.

Read only

0 Likes
2,623

Did you use commit work after the FM call?

Read only

0 Likes
2,623

Dear Sampath,

Thanks for your help. I had not remembered to execute the commit work after the FM call.

Best Regards,

Xavier Gràcia

Read only

0 Likes
2,623

HI,

now am facing the same problem, i am using sd_customer_maintain_all and passing knai,knvp,and knvv.

but wheni check in the table knvp, it is showing kunnr and kunn2 same values,

here is my code:

LT_XKNVP-KUNNR = WA_FINAL-SHIPCUST.

LT_XKNVP-VKORG = L_SORG(4).

LT_XKNVP-VTWEG = L_DCHAN.

LT_XKNVP-SPART = L_DVIS(2).

LT_XKNVP-PARVW = 'SH'.

LT_XKNVP-KUNN2 = WA_FINAL-SOLDCUST.

LT_XKNVP-KZ = 'I'.

CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'

EXPORTING

I_KNA1 = WA_KNA1

I_KNVV = WA_KNVV

I_BAPIADDR1 = WA_BAPIADDR1

PI_POSTFLAG = 'X'

IMPORTING

E_KUNNR = L_KUNNR

O_KNA1 = WA_KNA1

TABLES

T_XKNAS = LT_XKNAS

T_XKNVI = LT_XKNVI

T_XKNVP = LT_XKNVP

T_YKNAS = LT_YKNAS

T_YKNVI = LT_YKNVI

T_YKNVP = LT_YKNVP.

IF SY-SUBRC <> 0.

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

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

ENDIF.

COMMIT WORK AND WAIT.

ENDLOOP.

ENDIF.

plz help me.

thanks in advance.

Read only

Former Member
0 Likes
2,623

Hi ,

Try with USEREXIT_XVBAPF_KEY (in Include RV60AFZA)

Regards

Abhii