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

problem with SD_CUSTOMER_MAINTAIN_ALL

Former Member
0 Likes
2,019

Hi Experts,

i am using the following code but i am not able to see my created customers in kna1,

LOOP AT LT_FINAL INTO WA_FINAL.

CALL FUNCTION 'SD_CUSTOMER_MAINTAIN_ALL'

EXPORTING

I_KNA1 = I_KNA1

I_BAPIADDR1 = I_BAPIADDR1

I_MAINTAIN_ADDRESS_BY_KNA1 = 'X'

PI_POSTFLAG = 'X'

IMPORTING

E_KUNNR = KNA1-KUNNR

O_KNA1 = KNA1

TABLES

T_XKNAS = I_XKNAS

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.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = RETURN.

ENDLOOP.

APPEND WA_FINAL TO LT_FINAL.

thanks in advance.

5 REPLIES 5
Read only

Former Member
0 Likes
985

Hi Anusha,

Are you sure no exception is triggered (subrc)? Do you receive a new customer number in E_KUNNR exporting parameter?

Note that your commit statement should be executed if subrc is initial...

Kr,

Manu.

Read only

Former Member
0 Likes
985

Hi,

I am Not getting any of the value, i have passed the values what should i have to,

plz help me am not able to find out where the problem is??

thanks in advance.

Read only

0 Likes
985

Anusha,

Go to debug and check the value of SY-SUBRC after calling the function...

Read only

Former Member
0 Likes
985

hi

it is showing 0 only. and its not taking any value.

thnaku

Read only

985

What is the use of your LT_FINAL table ? how is it filled ?

Also, how are your importing structures filled in (I_KNA1, I_BAPIADDR1, I_BAPIADDR2) ?

m.