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

SD_CUSTOMER_MAINTAIN_ALL

Former Member
0 Likes
6,347

Hi,

i need to modify a customer information with new bank account and other data with the FM SD_CUSTOMER_MAINTAIN_ALL but i dont know how, can anyone explain me how to do it or give me some light over this?

Thanks & Regards,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,560

Hi,

thread for

Avoid direct maintenance of customer master data with any FUNCTION MODULE like

SD_CUSTOMER_MAINTAIN_ALL.

Despite the name, that FM is designed and maintained for very specific customer master data.

It should not be used.

The same is true with any kind of existing BAPI like BAPI_CUSTOMER_CHANGE * or BAPI_CUSTOMER_CREATE*

Look at note 384462. It will provide you enough informations. The only supported maintenance is either batch input, idocs, MASS or eventually eSOA webservices

Alternatively, you may look at class CMD_EI_API introduced with ERP 2005

Alain

Hi,

i need to modify a customer information with new bank account and other data with the FM SD_CUSTOMER_MAINTAIN_ALL but i dont know how, can anyone explain me how to do it or give me some light over this?

Thanks & Regards,

2 REPLIES 2
Read only

Former Member
0 Likes
3,560

If you are going to create a new report for the Customer data updation then

define an internal table as same as the importing parameter of FM. e.g if you want to update data in I_KNA1(importing parameter of FM) then define your internal table which is of refernce type of i_kna1.

once you have all your data in internal table, pass that data to FM's corresponding table.

Go through the below piece of code. Note: do not use select and endselect statement. It's not recommended.

REPORT ZTEST77 .

DATA: SUBRC LIKE SY-SUBRC,

COUNTRY LIKE BAPIKNA101_1-COUNTRY,

LANGUAGE LIKE BAPIKNA101_1-LANGU_P,

POSTFLAG LIKE WDL_FLAG-XFLAG,

CURRENCY LIKE BAPIKNA101_1-CURRENCY,

REF_KUNNR LIKE TKUNDEVTBER-KUNNR,

TITLE LIKE BAPIKNA101_1-TITLE_P,

PERS_COMP_FLAG TYPE XFELD,

CONSUMEREN TYPE XFELD,

CONSUMEREN_INFO TYPE XFELD,

CREDIT_CONTROL_FLAG like BAPIKNA108-X_FLAG,

I_BAPIKNA101_1 LIKE BAPIKNA101_1,

I_BAPIKNA102 LIKE BAPIKNA102,

I_BAPIKNA103 LIKE BAPIKNA103,

I_BAPIKNA105 LIKE BAPIKNA105,

I_BAPIKNA105_2 LIKE BAPIKNA105,

I_BAPIKNA106 LIKE BAPIKNA106,

I_BAPIADDR1_01 LIKE BAPIADDR1,

I_BAPIADDR2_01 LIKE BAPIADDR2,

I_KNA1_01 LIKE KNA1,

I_KNB1_01 LIKE KNB1,

I_KNVV_01 LIKE KNVV,

T_XKNBK_01 LIKE FKNBK OCCURS 0 WITH HEADER LINE,

T_XKNVI_01 LIKE FKNVI OCCURS 0 WITH HEADER LINE,

T_XKNVK_01 LIKE FKNVK OCCURS 0 WITH HEADER LINE,

T_XKNVP_01 LIKE FKNVP OCCURS 0 WITH HEADER LINE,

T_XKNB5_01 LIKE FKNB5 OCCURS 0 WITH HEADER LINE,

T_YKNBK_01 LIKE FKNBK OCCURS 0 WITH HEADER LINE,

T_YKNVI_01 LIKE FKNVI OCCURS 0 WITH HEADER LINE,

T_YKNVK_01 LIKE FKNVK OCCURS 0 WITH HEADER LINE,

T_YKNVP_01 LIKE FKNVP OCCURS 0 WITH HEADER LINE,

T_YKNB5_01 LIKE FKNB5 OCCURS 0 WITH HEADER LINE.

parameters:

pk like kna1-kunnr obligatory,

pb like knb1-bukrs obligatory.

select * from kna1 into corresponding fields of i_kna1_01

where kunnr = pk.

i_kna1_01-kunnr = space.

endselect.

select * from knb1 into corresponding fields of i_knb1_01

where kunnr = pk

and bukrs = pb.

i_knb1_01-kunnr = space.

endselect.

select * from knvv into corresponding fields of i_knvv_01

where kunnr = pk

and vkorg = pb.

i_knvv_01-kunnr = space.

endselect.

select * from knbk into corresponding fields of table T_XKNBK_01

where kunnr = pk.

T_XKNBK_01-kunnr = space.

modify T_XKNBK_01 transporting kunnr where kunnr ne space.

select * from knvi into corresponding fields of table T_XKNVI_01

where kunnr = pk.

T_XKNVI_01-kunnr = space.

modify T_XKNVI_01 transporting kunnr where kunnr ne space.

select * from knvk into corresponding fields of table T_XKNvK_01

where kunnr = pk.

T_XKNvK_01-kunnr = space.

modify T_XKNvK_01 transporting kunnr where kunnr ne space.

select * from knvp into corresponding fields of table T_XKNvp_01

where kunnr = pk.

T_XKNvp_01-kunnr = space.

modify T_XKNvp_01 transporting kunnr where kunnr ne space.

*select * from knbk into corresponding fields of table T_XKNBK_01

  • where kunnr = pk.

*

*select * from knbk into corresponding fields of table T_XKNBK_01

  • where kunnr = pk.

CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'

EXPORTING

I_KNA1 = I_KNA1_01

I_KNB1 = I_KNB1_01

I_KNVV = I_KNVV_01

I_BAPIADDR2 = I_BAPIADDR2_01

I_KNB1_REFERENCE = ' '

PI_POSTFLAG = 'X'

IMPORTING

E_KUNNR = I_BAPIKNA103-CUSTOMER

TABLES

T_XKNBK = T_XKNBK_01

  • t_xknb5 = t_xknb5_01

T_XKNVI = T_XKNVI_01

T_XKNVK = T_XKNVK_01

T_XKNVP = T_XKNVP_01

T_YKNBK = T_YKNBK_01

    • t_yknb5 = t_yknb5_01

  • T_YKNVI = T_YKNVI_01

  • T_YKNVK = T_YKNVK_01

  • T_YKNVP = T_YKNVP_01

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.

write I_BAPIKNA103-CUSTOMER.

Read only

Former Member
0 Likes
3,561

Hi,

thread for

Avoid direct maintenance of customer master data with any FUNCTION MODULE like

SD_CUSTOMER_MAINTAIN_ALL.

Despite the name, that FM is designed and maintained for very specific customer master data.

It should not be used.

The same is true with any kind of existing BAPI like BAPI_CUSTOMER_CHANGE * or BAPI_CUSTOMER_CREATE*

Look at note 384462. It will provide you enough informations. The only supported maintenance is either batch input, idocs, MASS or eventually eSOA webservices

Alternatively, you may look at class CMD_EI_API introduced with ERP 2005

Alain