2014 Jan 25 3:11 AM
Dear ALL,
check the code:
DATA: it_konvkomx LIKE TABLE OF konvkomx WITH HEADER LINE.
DATA: it_konvkom LIKE TABLE OF konvkom WITH HEADER LINE.
IT_KONVKOM-KNUMV = '0000003174'.
IT_KONVKOM-KPOSN = '000010'.
IT_KONVKOM-ZAEHK = '1'.
IT_KONVKOM-STUNR = '050'.
IT_KONVKOM-KSCHL = 'ZDC3'.
IT_KONVKOM-KBETR = '10'.
IT_KONVKOM-WAERS = 'HKD'.
IT_KONVKOM-KMEIN = 'PAA'.
IT_KONVKOM-KPEIN = '1'.
IT_KONVKOM-J_3AETENR = '0002'.
IT_KONVKOM-koupd = 'X'.
IT_KONVKOM-KINAK = 'X'.
APPEND IT_KONVKOM.
IT_KONVKOMX-KPOSN = '000010'.
IT_KONVKOMX-STUNR = '010'.
IT_KONVKOMX-KSCHL = 'ZDC3'.
IT_KONVKOMX-ZAEHK = '01'.
IT_KONVKOMX-UPDKZ = 'I'.
IT_KONVKOMX-KBETR = 'X'.
IT_KONVKOMX-WAERS = 'X'.
IT_KONVKOMX-KMEIN = 'X'.
IT_KONVKOMX-KPEIN = 'X'.
IT_KONVKOMX-J_3AETENR = '0002'.
APPEND IT_KONVKOMX.
CALL FUNCTION 'SD_SALES_ITEM_COND_MAINTAIN'
EXPORTING
FIV_BWE = ''
TABLES
fit_konvkom = it_konvkom
fit_konvkomx = it_konvkomx
fet_return = it_so_return
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
the table it_so_return return the error:Country key has no ISO code.
Why?
Thanks
Freddy
2014 Jan 26 1:17 PM
- first, you must read the document, when you're not in the SAPMV45A context
- after SD_SALES_ITEM_MAINTAIN, you need the SD_SALES_DOCUMENT_SAVE to save the changes
- at last, you need a commit work
I've trying the following coding in one of my systems and it works... (other curreny, condition key).
DATA: it_konvkomx LIKE TABLE OF konvkomx WITH HEADER LINE.
DATA: it_konvkom LIKE TABLE OF konvkom WITH HEADER LINE.
CALL FUNCTION 'SD_SALES_DOCUMENT_READ'
EXPORTING
document_number = '2000001417'.
it_konvkom-knumv = '0000002793'.
it_konvkom-kposn = '000010'.
*it_konvkom-zaehk = '1'.
it_konvkom-stunr = '245'.
it_konvkom-kschl = 'YFR4'.
it_konvkom-kbetr = '10'.
it_konvkom-waers = 'EUR'.
it_konvkom-kmein = 'M2'.
it_konvkom-kpein = '1'.
*it_konvkom-j_3aetenr = '0002'.
it_konvkom-koupd = 'X'.
it_konvkom-kinak = 'X'.
APPEND it_konvkom.
it_konvkomx-kposn = '000010'.
it_konvkomx-stunr = '245'.
it_konvkomx-kschl = 'YFR4'.
*it_konvkomx-zaehk = '01'.
it_konvkomx-updkz = 'I'.
it_konvkomx-kbetr = 'X'.
it_konvkomx-waers = 'X'.
it_konvkomx-kmein = 'X'.
it_konvkomx-kpein = 'X'.
*it_konvkomx-j_3aetenr = '0002'.
APPEND it_konvkomx.
DATA: it_so_return TYPE TABLE OF bapiret2.
CALL FUNCTION 'SD_SALES_ITEM_COND_MAINTAIN'
* EXPORTING
* fiv_bwe = ''
TABLES
fit_konvkom = it_konvkom
fit_konvkomx = it_konvkomx
fet_return = it_so_return.
CALL FUNCTION 'SD_SALES_DOCUMENT_SAVE'.
COMMIT WORK.
2014 Feb 13 2:14 AM
Thomas,
Thank you. It works.
But I want to use the field it_konvkom-j_3aetenr and it_konvkomx-j_3aetenr. It does not work.
How can solve it?
Thanks
Freddy