2007 Jul 10 2:31 AM
hi all,
i am using SD_SALESDOCUMENT_CREATE to create Credit Memo request with reference to Billing no, i encountered error:
Enter a document number between 0065000000 and 0069999999
Sales document 60000635 was not changed
the number range error : 0065000000 to 0069999999 is external number range setting, in our spro, we use internal range starts from 0060000000 to 0064999999,
why system cannot read the internal no 60000635 that i have passed in the coding, pls help
Header data
CLEAR: vbrk, vbpa, tvak, nriv.
REFRESH: ivbrp.
SELECT SINGLE * FROM vbrk
WHERE vbeln = '0090009938'.
SELECT SINGLE * FROM vbpa
WHERE vbeln = '0090009938'
AND parvw = 'WE'.
SELECT * FROM vbrp
INTO TABLE ivbrp
WHERE vbeln = '0090009938'.
SELECT SINGLE * FROM tvak
WHERE auart = 'G2'.
IF sy-subrc = 0.
SELECT SINGLE * FROM nriv
WHERE nrrangenr = tvak-numki
AND object = 'RV_BELEG'.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = nriv-nrlevel
IMPORTING
OUTPUT = wvbeln_in
.
*wvbeln_in = nriv-nrlevel.
Sales document type
header-doc_type = wauart.
headerx-doc_type = 'X'.
Sales organization
header-sales_org = vbrk-vkorg.
headerx-sales_org = 'X'.
Distribution channel
header-distr_chan = vbrk-vtweg.
headerx-distr_chan = 'X'.
Division
header-division = vbrk-spart.
headerx-division = 'X'.
header-ref_doc = vbrk-vbeln.
headerx-ref_doc = 'X'.
*header-REFDOCTYPE = 'F2'.
*headerx-REFDOCTYPE = 'X'.
headerx-updateflag = 'I'.
append header. append headerx.
Partner data
Sold to
partner-partn_role = 'AG'.
partner-partn_numb = vbpa-kunnr.
APPEND partner.
LOOP AT ivbrp.
CLEAR: item, itemx.
ITEM DATA
itemx-updateflag = 'I'.
Line item number.
item-itm_number = ivbrp-posnr.
itemx-itm_number = 'X'.
Material
item-material = ivbrp-matnr.
itemx-material = 'X'.
Plant
item-plant = ivbrp-werks.
itemx-plant = 'X'.
Quantity
item-target_qty = ivbrp-fkimg.
itemx-target_qty = 'X'.
APPEND item.
APPEND itemx.
ENDLOOP.
CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
EXPORTING
salesdocument = wvbeln_in
sales_header_in = header
sales_header_inx = headerx
SENDER =
BINARY_RELATIONSHIPTYPE = ' '
INT_NUMBER_ASSIGNMENT = ' '
BEHAVE_WHEN_ERROR = ' '
LOGIC_SWITCH = ' '
business_object = 'BUS2094'
TESTRUN =
CONVERT_PARVW_AUART = ' '
STATUS_BUFFER_REFRESH = 'X'
IMPORTING
SALESDOCUMENT_EX =
SALES_HEADER_OUT =
SALES_HEADER_STATUS =
TABLES
return = return
sales_items_in = item
sales_items_inx = itemx
sales_partners = partner
SALES_SCHEDULES_IN =
SALES_SCHEDULES_INX =
SALES_CONDITIONS_IN =
SALES_CONDITIONS_INX =
SALES_CFGS_REF =
SALES_CFGS_INST =
SALES_CFGS_PART_OF =
SALES_CFGS_VALUE =
SALES_CFGS_BLOB =
SALES_CFGS_VK =
SALES_CFGS_REFINST =
SALES_CCARD =
SALES_TEXT =
SALES_KEYS =
SALES_CONTRACT_IN =
SALES_CONTRACT_INX =
EXTENSIONIN =
PARTNERADDRESSES =
SALES_SCHED_CONF_IN =
ITEMS_EX =
SCHEDULE_EX =
BUSINESS_EX =
INCOMPLETE_LOG =
EXTENSIONEX =
CONDITIONS_EX =
PARTNERS_EX =
TEXTHEADERS_EX =
TEXTLINES_EX =
BATCH_CHARC =
.
2007 Jul 10 2:47 AM
Hi Ester,
You need to convert 60000635 to 0060000635.
For this Use FM CONVERSION_EXIT_ALPHA_INPUT.
Pass the same document no. as INPUT and OUTPUT parameter and then use it in the SD_SALESDOCUMENT_CREATE .
Reward points if useful.
Regards,
Atish
2007 Jul 10 2:52 AM
2007 Jul 10 2:56 AM
Hi Ester,
Try without passing any document number.
Regards,
Atish
2007 Jul 10 2:58 AM
still the same error occurs
Enter a document number between 0065000000 and 0069999999
Sales document 0060000638 was not changed
2007 Jul 10 2:58 AM
2007 Jul 10 3:00 AM
2007 Jul 10 3:09 AM
Well ,Hope you will get it
Look at FM : /SAPNEA/SMAPI_ORDER_CREATE -> this FM use SD_SALESDOCUMENT_CREATE..
Use like above FM
Thanks
Seshu
2007 Jul 10 3:15 AM
were you suggesting me to code the program using /SAPNEA/SMAPI_ORDER_CREATE ?
2007 Jul 10 3:30 AM
No Ester,i am just saying that check with that FM,how they are using parameters,based on that you can do the coding.
Thanks
Seshu
2007 Jul 10 3:34 AM
hi Seshu,
I have put debugger at FM /SAPNEA/SMAPI_ORDER_CREATE and create SO via VA01 but it didn't trigger this FM
2007 Jul 10 4:15 AM
2007 Jul 10 5:37 PM
Hi Ester,
I am also in process of creationg Credit Memo, can you please help me with the process you did to create the order.
Neelu_s@yahoo.com
Thanks,
Neelu.