‎2011 Sep 21 2:45 PM
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.
‎2011 Sep 21 3:03 PM
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.
‎2011 Sep 21 3:10 PM
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.
‎2011 Sep 21 3:16 PM
Anusha,
Go to debug and check the value of SY-SUBRC after calling the function...
‎2011 Sep 21 3:20 PM
‎2011 Sep 21 3:33 PM
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.