BAPI to create a credit memo request
Is there a standard BAPI that can create a credit memo request?
If not, then can we copy a standard BAPI to a Z-version and amend that?
Sample code appreciated.
Thanks,
John
The suggestion to use SD_SALESDOCUMENT_CREATE proved fruitful.
For creating with reference to an invoice:
Setting ref_doc and ref_doc_ca for each line-item in sales_item_in seems necessary for the creation of the document flow. Maybe it also brought through other data from the invoice?
Setting ref_doc and refdoc_cat for sales_header_in caused header text (and maybe other stuff?) to be brought through from the invoice.
It looks like it will do bills of materials - there's hg_lv_item in sales_items_in - but I've yet to try that.
Here's the code of a demo program for a one-line CMR.
REPORT YJNM_CREATE_CMR5 .
Uses SD_SALESDOCUMENT_CREATE
parameters:
p_vgbel like vbrk-vbeln default '90175587', "reference invoice
p_fkdat like vbkd-fkdat default sy-datum, "billing date
p_auart like tvak-auart default 'Z002', "sales document type
p_vkorg like tvko-vkorg default '3', "sales org.
p_vtweg like tvtw-vtweg default '01', "distr. chan.
p_spart like tspa-spart default '06', "division
p_vkbur like tvbur-vkbur default '034', "sales office
p_kunnr like kna1-kunnr default '16797', "sold-to
p_bstnk like vbak-bstnk default 'pono00000017',
"PO number
p_bname like vbak-bname default 'Bartholomew Snodgrass',
"name of orderer
p_augru like tvau-augru default '002'. "order reason
selection-screen skip.
selection-screen begin of block i1 with frame title text-001.
parameters:
p_matnr like mara-matnr default '27585', "material number
p_zmeng type dzmengc default '65', "target quantity
p_netwr like vbap-netwr default '1.20', "net amount
p_arktx like vbap-arktx default 'Afternoon tea',
"short text
p_fbuda like vbkd-fbuda default '20060109'."service-rendered date
selection-screen end of block i1.
data:
return like bapiret2,
returns like table of return,
salesdocument_ex like bapivbeln-vbeln,
sales_header_in like bapisdhd1,
sales_item_in like bapisditm,
sales_items_in like table of sales_item_in,
sales_condition_in like bapicond,
sales_conditions_in like table of sales_condition_in,
sales_partner like bapiparnr,
sales_partners like table of sales_partner,
incomplete_log like bapiincomp,
incomplete_logs like table of incomplete_log.
perform:
fill_sales_header_in,
fill_sales_items_in,
fill_sales_partners,
fill_sales_conditions_in,
call_bapi.
FORM call_bapi .
CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
EXPORTING
SALESDOCUMENT =
SALES_HEADER_IN = sales_header_in
SALES_HEADER_INX =
SENDER =
BINARY_RELATIONSHIPTYPE = ' '
INT_NUMBER_ASSIGNMENT = ' '
BEHAVE_WHEN_ERROR = ' '
LOGIC_SWITCH = ' '
BUSINESS_OBJECT = 'BUS2094' "cred. mem. req.
TESTRUN =
CONVERT_PARVW_AUART = ' '
STATUS_BUFFER_REFRESH = 'X'
IMPORTING
SALESDOCUMENT_EX = salesdocument_ex
SALES_HEADER_OUT =
SALES_HEADER_STATUS =
TABLES
RETURN = returns
SALES_ITEMS_IN = sales_items_in
SALES_ITEMS_INX =
SALES_PARTNERS = sales_partners
SALES_SCHEDULES_IN =
SALES_SCHEDULES_INX =
SALES_CONDITIONS_IN = 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 = incomplete_logs
EXTENSIONEX =
CONDITIONS_EX =
PARTNERS_EX =
TEXTHEADERS_EX =
TEXTLINES_EX =
BATCH_CHARC =
perform imcompletion_log.
loop at returns into return where type ne 'S'.
message id return-id type 'I' number return-number
with
return-message_v1
return-message_v2
return-message_v3
return-message_v4.
endloop.
if salesdocument_ex is initial.
write: / 'Document not created'.
else.
commit work.
write: / 'Sales document number:', salesdocument_ex.
endif.
ENDFORM. " call_bapi
FORM fill_sales_header_in .
clear sales_header_in.
move:
p_fkdat to sales_header_in-bill_date,
p_vgbel to sales_header_in-ref_doc, "invoice number
'M' to sales_header_in-refdoc_cat, "invoice
p_auart to sales_header_in-doc_type,
p_vkorg to sales_header_in-sales_org,
p_vtweg to sales_header_in-distr_chan,
p_spart to sales_header_in-division,
p_vkbur to sales_header_in-sales_off,
p_bstnk to sales_header_in-purch_no_c,
p_bname to sales_header_in-name,
p_augru to sales_header_in-ord_reason.
ENDFORM. " fill_sales_header_in
FORM fill_sales_partners .
clear sales_partner.
sales_partner-partn_role = 'AG'.
sales_partner-partn_numb = p_kunnr.
append sales_partner to sales_partners.
ENDFORM. " fill_sales_partners
FORM fill_sales_items_in .
perform one_item_in using:
10
p_matnr
p_zmeng
p_netwr
'GBP'
p_arktx
p_fbuda.
ENDFORM. " fill_sales_items_in
FORM one_item_in using value(p_itm_number)
value(p_p_matnr)
value(p_p_zmeng)
value(p_p_netwr)
value(p_p_waerk)
value(p_p_arktx)
value(p_p_fbuda).
clear sales_item_in.
move:
p_itm_number to sales_item_in-itm_number,
p_fkdat to sales_item_in-bill_date,
p_vgbel to sales_item_in-ref_doc, "invoice number
'M' to sales_item_in-ref_doc_ca, "invoice
p_p_matnr to sales_item_in-material,
p_p_zmeng to sales_item_in-target_qty,
p_p_netwr to sales_item_in-target_val,
p_p_waerk to sales_item_in-currency,
p_p_arktx to sales_item_in-short_text,
p_p_fbuda to sales_item_in-serv_date.
append sales_item_in to sales_items_in.
ENDFORM. " one_item_in
FORM fill_sales_conditions_in .
refresh sales_conditions_in.
perform one_sales_condition_in using:
10
p_netwr
'GBP'.
ENDFORM. " fill_sales_conditions_in
FORM one_sales_condition_in using value(p_itm_number)
value(p_p_netwr)
value(p_p_waerk).
clear sales_condition_in.
move:
p_itm_number to sales_condition_in-itm_number,
'PR00' to sales_condition_in-cond_type,
p_p_netwr to sales_condition_in-cond_value,
p_p_waerk to sales_condition_in-currency.
append sales_condition_in to sales_conditions_in.
ENDFORM. " one_sales_condition_in
FORM imcompletion_log .
loop at incomplete_logs into incomplete_log.
write: / incomplete_log-itm_number,
incomplete_log-field_text,
incomplete_log-table_name,
incomplete_log-field_name.
endloop.
ENDFORM. " imcompletion_log
Similar Messages
-
FM/BAPI for creating the credit memo request for Vendor
Hi Experts,
I need an RFC/BAPI, for creating the credit memo request for Vendor.
Thanks in Advance,
Kiruba.RHi,
Use this BAPI 'BAPI_DRMCREDITMEMOREQ_CREATE' - Credit Memo Request Creation
Regards,
Jyothi CH. -
FM to create a Credit Memo Request
hi,
i have to create a credit memo request that will be created on creation of debit memo. actually output determination of debit memo will trigger the creation credit memo request.
please provide me a FM to create a Credit Memo Request.
regardsHi,
Try to use the BAPI BAPI_SALESDOCU_CREATEFROMDATA1
Please check this thread for sample codes.
https://forums.sdn.sap.com/click.jspa?searchID=46332&messageID=2304043
rEGARDS -
BAPI to create SD credit MEMO from Flat file
Hello All:
New with BAPi wondering if anyone have sample code to access structured flatfiles and create transactions with the data from flatfiles. The one I am most interested is Credit Memo, however if any other transactional documents will also help as well!
Sincerely YoursThanks. Problem solved.
Regards,
Yayati Ekbote -
BAPI_SALESDOCU_CREATEFROMDATA, create credit memo request
hi all,
in which field of BAPI_SALESDOCU_CREATEFROMDATA needs to fill in, i need to create SO Credit memo request (CR doc type ) with reference to billing no , which field shall i put the billing no ?REPORT ZTEST_SO_CREATE .
Order Header
DATA: HEADER LIKE BAPISDHD1.
Internal Item Number Assignment
DATA: L_INA LIKE BAPIFLAG-BAPIFLAG.
Item Data
DATA: IT_ITEM LIKE BAPISDITM OCCURS 0 WITH HEADER LINE.
Document Partner
DATA: IT_PARTN LIKE BAPIPARNR OCCURS 0 WITH HEADER LINE.
Schedule Line Data
DATA: IT_SIN LIKE BAPISCHDL OCCURS 0 WITH HEADER LINE.
Conditions
DATA: IT_COND LIKE BAPICOND OCCURS 0 WITH HEADER LINE.
Configuration: Reference Data
DATA: IT_CUCFG LIKE BAPICUCFG OCCURS 0 WITH HEADER LINE.
Configuration: Instances
DATA: IT_CUINS LIKE BAPICUINS OCCURS 0 WITH HEADER LINE.
Part_of Entries of Several Configurations
DATA: IT_CUPRT LIKE BAPICUPRT OCCURS 0 WITH HEADER LINE.
CU: Reference Order Item / Instance in Configuration
DATA: IT_CUREF LIKE BAPICUREF OCCURS 0 WITH HEADER LINE.
Characteristic values of several configurations
DATA: IT_CUVAL LIKE BAPICUVAL OCCURS 0 WITH HEADER LINE.
*Number of Generated Document
DATA: L_SO LIKE BAPIVBELN-VBELN.
DATA: RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE.
START-OF-SELECTION.
Header data
PERFORM SUB_HEADER.
Internal Item Number Assignment
L_INA = 'X'.
Item Data
PERFORM SUB_ITEM.
Document Partner
PERFORM SUB_PARTN.
Schedule Line Data
PERFORM SUB_SIN.
Conditions
PERFORM SUB_COND.
Configuration: Reference Data
PERFORM SUB_CUCFG.
Configuration: Instances
PERFORM SUB_CUINS.
Part_of Entries of Several Configurations
PERFORM SUB_CUPRT.
CU: Reference Order Item / Instance in Configuration
PERFORM SUB_CUREF.
Characteristic values of several configurations
PERFORM SUB_CUVAL.
Call the BAPI to create the sales order.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
ORDER_HEADER_IN = HEADER
INT_NUMBER_ASSIGNMENT = L_INA
IMPORTING
SALESDOCUMENT = L_SO
TABLES
RETURN = RETURN
ORDER_ITEMS_IN = IT_ITEM
ORDER_PARTNERS = IT_PARTN
ORDER_SCHEDULES_IN = IT_SIN
ORDER_CONDITIONS_IN = IT_COND
ORDER_CFGS_REF = IT_CUCFG
ORDER_CFGS_INST = IT_CUINS
ORDER_CFGS_PART_OF = IT_CUPRT
ORDER_CFGS_VALUE = IT_CUVAL
ORDER_CFGS_REFINST = IT_CUREF.
Check the
RETURN TABLE.
LOOP AT
RETURN WHERE TYPE = 'E' OR TYPE = 'A'.
EXIT.
ENDLOOP.
LOOP AT RETURN.
WRITE :/
RETURN-TYPE,
RETURN-ID,
RETURN-NUMBER,
RETURN-MESSAGE,
RETURN-LOG_NO,
RETURN-LOG_MSG_NO,
RETURN-MESSAGE_V1,
RETURN-MESSAGE_V2,
RETURN-MESSAGE_V3,
RETURN-MESSAGE_V4,
RETURN-PARAMETER,
RETURN-ROW,
RETURN-FIELD,
RETURN-SYSTEM.
ENDLOOP.
IF SY-SUBRC = 0.
Commit the work.
COMMIT WORK AND WAIT.
WRITE: / 'Document ', L_SO, ' created'.
ENDIF.
*& Form SUB_HEADER
text
--> p1 text
<-- p2 text
FORM SUB_HEADER.
Sales document type
HEADER-DOC_TYPE = 'ZOEM'.
Sales organization
HEADER-SALES_ORG = '1000'.
Distribution channel
HEADER-DISTR_CHAN = '12'.
Division
HEADER-DIVISION = '03'.
Sales group
HEADER-SALES_GRP = '001'.
Sales office
HEADER-SALES_OFF = '1000'.
Requested delivery date
HEADER-REQ_DATE_H = '20070701'.
HEADER-REQ_DATE_H = SY-DATUM.
Proposed date type
HEADER-DATE_TYPE = '1'.
Customer purchase order date
HEADER-PURCH_DATE = '20070701'.
HEADER-PURCH_DATE = SY-DATUM.
Sales district
HEADER-SALES_DIST = 'CC'.
Incoterms (part 1)
HEADER-INCOTERMS1 = 'EXW'.
Incoterms (part 2)
HEADER-INCOTERMS2 = 'XIAMEN'.
Terms of payment key
HEADER-PMNTTRMS = '1000'.
Date for pricing and exchange rate
HEADER-PRICE_DATE = '20070701'.
HEADER-PRICE_DATE = SY-DATUM.
Customer purchase order number
HEADER-PURCH_NO_C = 'atest'.
SD document category
HEADER-SD_DOC_CAT = 'C'.
Shipping conditions
HEADER-SHIP_COND = '02'.
Shipping type
HEADER-SHIP_TYPE = '07'.
HEADER-PURCH_NO_S = '1100511'.
ENDFORM. " SUB_HEADER
*& Form SUB_ITEM
text
--> p1 text
<-- p2 text
FORM SUB_ITEM.
Sales document item
IT_ITEM-ITM_NUMBER = '001000'.
Higher-level item in bill of material structures
IT_ITEM-HG_LV_ITEM ='000000'.
Item Number of the Underlying Purchase Order
IT_ITEM-PO_ITM_NO = '1000'.
Material number
IT_ITEM-MATERIAL = 'VD4'.
APPEND IT_ITEM.
IT_ITEM-ITM_NUMBER = '001001'.
IT_ITEM-HG_LV_ITEM ='001000'.
IT_ITEM-PO_ITM_NO = '1001'.
IT_ITEM-MATERIAL = 'CDX8004317R3J'.
IT_ITEM-CONFIG_ID = '000001'.
IT_ITEM-INST_ID = '00000001'.
APPEND IT_ITEM.
ENDFORM. " SUB_ITEM
*& Form SUB_PARTN
text
--> p1 text
<-- p2 text
FORM SUB_PARTN.
Partner function
IT_PARTN-PARTN_ROLE = 'AP'.
Customer number
IT_PARTN-PARTN_NUMB = '0000000090'.
Item number of the SD document
IT_PARTN-ITM_NUMBER = '000000'.
APPEND IT_PARTN.
IT_PARTN-PARTN_ROLE = 'VE'.
IT_PARTN-PARTN_NUMB = '0000000107'.
IT_PARTN-ITM_NUMBER = '000000'.
APPEND IT_PARTN.
IT_PARTN-PARTN_ROLE = 'SB'.
IT_PARTN-PARTN_NUMB = 'OEM'.
IT_PARTN-ITM_NUMBER = '000000'.
APPEND IT_PARTN.
IT_PARTN-PARTN_ROLE = 'AG'.
IT_PARTN-PARTN_NUMB = '0001100511'.
IT_PARTN-ITM_NUMBER = '000000'.
APPEND IT_PARTN.
ENDFORM. " SUB_PARTN
*& Form SUB_SIN
text
--> p1 text
<-- p2 text
FORM SUB_SIN.
Sales document item
IT_SIN-ITM_NUMBER = '001000'.
Schedule line
IT_SIN-SCHED_LINE = '0000'.
Schedule line date
IT_SIN-REQ_DATE = '07-01-2007'.
Date type (day, week, month, interval)
IT_SIN-DATE_TYPE = '1'.
Order quantity in sales units
IT_SIN-REQ_QTY = 5.
APPEND IT_SIN.
IT_SIN-ITM_NUMBER = '001001'.
IT_SIN-SCHED_LINE = '0000'.
IT_SIN-REQ_DATE = '07-01-2007'.
IT_SIN-DATE_TYPE = '1'.
IT_SIN-REQ_QTY = 5.
APPEND IT_SIN.
ENDFORM. " SUB_SIN
*& Form SUB_COND
text
--> p1 text
<-- p2 text
FORM SUB_COND.
Condition item number
IT_COND-ITM_NUMBER = '001000'.
Step number
IT_COND-COND_ST_NO = '000'.
Condition counter
IT_COND-COND_COUNT = '00'.
Condition type
IT_COND-COND_TYPE = 'VA00'.
Condition rate
IT_COND-COND_VALUE = 1.
Currency Key
IT_COND-CURRENCY = 'RMB'.
APPEND IT_COND.
IT_COND-ITM_NUMBER = '001000'.
IT_COND-COND_ST_NO = '000'.
IT_COND-COND_COUNT = '00'.
IT_COND-COND_TYPE = 'PR01'.
IT_COND-COND_VALUE = 1.
IT_COND-CURRENCY = 'RMB'.
APPEND IT_COND.
IT_COND-ITM_NUMBER = '001001'.
IT_COND-COND_ST_NO = '000'.
IT_COND-COND_COUNT = '00'.
IT_COND-COND_TYPE = 'VA00'.
IT_COND-COND_VALUE = 1.
IT_COND-CURRENCY = 'RMB'.
APPEND IT_COND.
IT_COND-ITM_NUMBER = '001001'.
IT_COND-COND_ST_NO = '000'.
IT_COND-COND_COUNT = '00'.
IT_COND-COND_TYPE = 'PR01'.
IT_COND-COND_VALUE = 1.
IT_COND-CURRENCY = 'RMB'.
APPEND IT_COND.
ENDFORM. " SUB_COND
*& Form SUB_CUCFG
text
--> p1 text
<-- p2 text
FORM SUB_CUCFG.
External item number
IT_CUCFG-POSEX = '001001'.
External Configuration ID (Temporary)
IT_CUCFG-CONFIG_ID = '000001'.
Instance Number in Configuration
IT_CUCFG-ROOT_ID = '00000001'.
APPEND IT_CUCFG.
ENDFORM. " SUB_CUCFG
*& Form SUB_CUINS
text
--> p1 text
<-- p2 text
FORM SUB_CUINS.
External Configuration ID (Temporary)
IT_CUINS-CONFIG_ID = '000001'.
Instance Number in Configuration
IT_CUINS-INST_ID = '00000001'.
Object type
IT_CUINS-OBJ_TYPE = 'MARA'.
Object key
IT_CUINS-OBJ_KEY = 'D'.
APPEND IT_CUINS.
IT_CUINS-CONFIG_ID = '000001'.
IT_CUINS-INST_ID = '00000002'.
IT_CUINS-OBJ_TYPE = 'MARA'.
IT_CUINS-OBJ_KEY = 'D2'.
APPEND IT_CUINS.
ENDFORM. " SUB_CUINS
*& Form SUB_CUPRT
text
--> p1 text
<-- p2 text
FORM SUB_CUPRT.
External Configuration ID (Temporary)
IT_CUPRT-CONFIG_ID = '000001'.
Instance Number in Configuration
IT_CUPRT-PARENT_ID = '00000001'.
Instance Number in Configuration
IT_CUPRT-INST_ID = '00000002'.
Part_of item number
IT_CUPRT-PART_OF_NO = '0280'.
Object type
IT_CUPRT-OBJ_TYPE = 'MARA'.
Object key
IT_CUPRT-OBJ_KEY = 'D2'.
APPEND IT_CUPRT.
ENDFORM. " SUB_CUPRT
*& Form SUB_CUREF
text
--> p1 text
<-- p2 text
FORM SUB_CUREF.
External item number
IT_CUREF-POSEX = '001001'.
External Configuration ID (Temporary)
IT_CUREF-CONFIG_ID = '000001'.
Instance Number in Configuration
IT_CUREF-INST_ID = '00000001'.
APPEND IT_CUREF.
ENDFORM. " SUB_CUREF
*& Form SUB_CUVAL
text
--> p1 text
<-- p2 text
FORM SUB_CUVAL.
External Configuration ID (Temporary)
IT_CUVAL-CONFIG_ID = '000001'.
Instance Number in Configuration
IT_CUVAL-INST_ID = '00000001'.
Characteristic name
IT_CUVAL-CHARC = 'ZS1_LV_HEIGHT'.
Characteristic Value
IT_CUVAL-VALUE = '02'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_TOP'.
IT_CUVAL-VALUE = '04'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_LV_BOTTOM'.
IT_CUVAL-VALUE = '01'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_BOTTOM'.
IT_CUVAL-VALUE = '01'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_CB_DOOR'.
IT_CUVAL-VALUE = '01'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_FIXED_PT'.
IT_CUVAL-VALUE = '01'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_EK6'.
IT_CUVAL-VALUE = '01'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_EK6_VENDER'.
IT_CUVAL-VALUE = '01'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_AUX'.
IT_CUVAL-VALUE = '02'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_INTERL'.
IT_CUVAL-VALUE = '01'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_CA'.
IT_CUVAL-VALUE = '01'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_DXN_Q'.
IT_CUVAL-VALUE = '02'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_CAP_DIV'.
IT_CUVAL-VALUE = '02'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_PACK'.
IT_CUVAL-VALUE = '02'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_PAINT'.
IT_CUVAL-VALUE = '02'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_AUX'.
IT_CUVAL-VALUE = '02'.
APPEND IT_CUVAL.
IT_CUVAL-CONFIG_ID = '000001'.
IT_CUVAL-INST_ID = '00000001'.
IT_CUVAL-CHARC = 'ZS1_RECTIFIER'.
IT_CUVAL-VALUE = '01'.
APPEND IT_CUVAL.
ENDFORM. " SUB_CUVAL -
How to create new line item in credit memo request in rebate settlement
HI friends,
I need aimmediate help on following.
Requirenment is for given agreement all invoices for that needs to be retrieved. In those invoices we need to check the tax code or tax city for all invoices. If all are same then do nothing.
But if any of these 2 fields are different in all retrieved invoices, then we need to sum up the qty for all invoices having same tax code/city & like wise ned to create a credit memo request which will have one line item for each tax code/city.
Example:
Agreement 9999 with the relevant sales volume:
Invoice 1: Material A, tax key X, quantity 1 kg
Invoice 2: Material B, tax key X, quantity 2 kg
Invioce 3: Material C, tax key Z, quantity 4 kg
The credit memo request for agreement 9999 should look as such:
Thanks & regards,
Abhijeet.
Item line 1: SETTLEMENT MATERIAL, tax key X, 3 kg
Item line 2: SETTLEMENT MATERIAL, tax key Z, 4 kg
Please help me . I am not getting the user exit / badi for this development.
Please let me know if any one of you know from where to do this?Hi Vinod,
The relationship with main item is stored with CRMD_ORDERADM_I- Parent.
You need to pass the guid of main item to orderadm_i-parent. This will keep the relationship with main item.
Thanks
Ajay -
Revenue Recognition Category after Credit memo request generation via BAPI
Hi all,
I have used the BAPi " SD_SALESDOCUMENT_CREATE" to generate Credit Memo Request. After the generaion of the credit memo request the Revenue Recognition Catrgory [ "RR_RELTYP"(Data Element) ] is not determined. Can anyone let me know what are all to be filled to this BAPI for this field to get populated.Hello Mr. Shiva Ram,
First of all thanks a lot for your help.The problem of credit memo is now solved but to resolve the status of the existing sales order documents as per your suggestion we have run the program SDVBUK00 in SA38.Still we didn't get the desired result as the status of the completed normal sales orders are still showing "Being Processed" even after running the program.
Please suggest what else need to be done to change the status of the completed sales documents till invoice.
Regards
Priyanka Mitra -
Creation of sales order(Credit memo request) w.r.t invoice
Hi want to create a Credit memo request (sales order) with respect to a invoice.
Can any body suggest me a bapi or Fm which will directly create a sales order with input as invoice number?
Also all mandatory import export parameters to be filled?
Thanks in Advance,
Rohan.You should be able to use one of these BAPIs (depending on your release - the ...2 one is the lates and greatest, it seems):
BAPI_SALESORDER_CREATEFROMDAT1
BAPI_SALESORDER_CREATEFROMDAT2
BAPI_SALESORDER_CREATEFROMDATA
You'll find a lot of information on them anywhere, please use search. There is also a decent documentation available for each one of them.
The invoice reference will have to be entered as follows (note that it's always at line level):
order_items_in-ref_doc = <invoice number = VBRK-VBELN>.
order_items_in-ref_doc_it = <<invoice line number = VBRP-POSNR.>.
order_items_in-ref_doc_ca = 'M'. " or whatever category is applicable
Keep in mind though that BAPIs do NOT always work the same way as VA01. If, for example, you have the requirements and copy routines (VOFM), they might get bypassed when creating an order with BAPI.
Any follow-up questions I'd suggest to post in ABAP forum. Good luck! -
Credit memo request(SO) w.r.t Invoice
Hi want to create a Credit memo request (sales order) with respect to a invoice.
Can any body suggest me a bapi or Fm which will directly create a sales order with input as invoice number?
Also all mandatory import export parameters to be filled?
Thanks in Advance,
Rohan.Rohan,
SD_SALESDOCUMENT_CREATE
In that for with reference pass
REFOBJTYPE
REFOBJKEY
REFDOCTYPE
also check the BAPI's
BAPI_DRMCREDITMEMOREQ_CREATE
BAPI_DRMDEBITMEMOREQ_CREATE
Amit. -
Error while creating a credit memo with reference to invoice
HI aLL,
I am facing one issue while creating a credit memo request in VA01 with reference to invoice.
Our project stock is valuated stock.
When we try top copy the error pops up" Valuated project stock not allowed with customer stock." and the line item is not copied in the credit memo.
Diagnosis:The entered wbs manages a valuated project stock,at the same time sales order stock is maintained on sales order line item.this combo is not allowed as different valuation methods within a project is not allowed.
Tarun KapurDear Tarun!
1.Within a project we can get stock only in PROJECT or in SALES ORDER STOCK.....a single material can not be a both place at particular time ..so keep only one
Project Stock or Sales Order Stock..
2.Check DIP PRofile (ODP1) in usage BILLING AND RESULT ANALYSIS -Charectiristic -SDOC TYPE CMR.....are you selecting right document to which you want to copy .....
Rewards Points if usefull
Regards
SMITH -
Message V1478 - Credit memo request with reference to an invoice
Dear all,
Creating a credit memo request with reference to an invoice, I get the following message "Material in item 000060 does not exist in plant/storage location".
Of course, this material exists in the plant and the storage location, as we could create the invoice without any problem.
Any idea?
Best regards,
InéHello
Generally, these errors may appear due to:
- The plant is marked for deletion.
- The plant should be copied from the referenced item.
So, I would suggest you to
- Check copying control for Invoice to Credit memo request, particularly, item.
- Try and create Credit Memo Request with reference to sales order.
- Or if you want rectify a invoice, then use invoice coreection request.
Thanks & Regards
JP -
Setting up multiple billing blocks for a CMR - Credit Memo Request
I am trying to set a billing block for a credit memo request. The item category in VOV7 configuration only allows you to set one. I need to be able to set any of them and for it to block. If we do not use one; the system allows the credit memo to get created. If we choose the one that we configured in VOV7 it allows us to only use that one. The client needs to be able to select any billing block from the drop down when creating a credit memo request in VA01 instead of just one specific one. Is this possible? If so, where would I do this?
Surprising! when a billing block is applied in the sales document, then the system will NOT allow to create the billing document(in your case credit memo). Can you check in t.code OVV3, the billing blocks are assigned to billing types? After assigning, create a new document and test. The path is SPRO->Sales and distribution -> billing->billing documents ->define blocking reasons for billing->assign blocking reasons to billing types.
Regards, -
Enter sold-to party debit memo request - credit memo request
Hi Gurus,
I have a scenario here while creating a Debit memo request.
1. I create a Debit memo request with sold-to party 1000
2. I create a Credit memo request with the same sold-to party 1000.
That will be saved,
but when you enter VA02 or VA03 for CMR, a message displays "Enter a Sold-to Party".
So in VA02, I will refill it with Sold-to party 1000, then I can save it. But when I view it again, I will encounter the same message again.
However, if I use a different sold-to party 2000, the CMR will be saved normally, and if you view it via VA02, you will see it is correct (you can see sold-to party 2000).
Why? Cant I use the same sold-to party for DMR to CMR?
Please help....
RamCheck whether the partner functions are mantained properly for customer 1000. Go to VD01 and maintain.
Regards,
GSL. -
Credit Memo Request for New Sales Organisation
Hi Frnds
I have a requirement in which i need to create a Credit Memo Request for the newly created sales organisation using the old billing document number created for old sales organisation.Please kindly help me in this regard.
Thanks in Advace
Sowmmya BHi,
Did you try creating a CMR online ??
Regards -
Credit memo request with currency conversion to EURO
I have a requirement in which i need to create a Credit Memo Request for the newly created sales organisation using the old billing document number created for old sales organisation.New sales org will have its currency changed to EURO.I referred to a FM named 'Pricing' where the currency conversion is done.
The requirement is to get the current price in EURO from the price list instead of currency conversion to EUR.The current price has to be extracted from new pricelist.
Your inputs in this regard is highly appreciated.HI
Am not on SAP system now, so will try to give you
info with what i can recollect.
You can use FM: SD_SALESDOCUMENT_CREATE for creating
Credit Memo Request. Note that reference document and
reference type should be passed for identifying the
reference document as invoice. Please consider these as
initial inputs to explore on the same. Regarding the
pricing, it can be configured either at order type or
copy control to carry out new pricing so it can take
directly from condition records.
Hope the above info can help you in exploring on the same.
Kind Regards
Eswar
Maybe you are looking for
-
Has anybody seen a situation where the mouse starts to move correctly, then disappears for the last "inch" or so of the path before clicking? This has turned up in some courses created by one particular person who has since uninstalled Captivate, so
-
Including Logical Hostname as a Resource Dependency
Hi Folks, We're setting up a Calendar Server. we assign a Logical Hostname resource on which the Calendar Clients connect to. These are the steps that are used: I created a Fail Over Resource Group called MS_RG_BUDDY and bring it online scrgadm -a -g
-
Does the report server have an open Java API? I was trying to explore reporting options and this is one requirement. If so as, for any version? Any limitations, etc. Can you pass arguments or parameters to it for the report? Thanks -Doug null
-
How do I resolve a non responsive Flash Player plug in? Message received is Flash Player is not responding, do you want to continue or close?" At different times, have selected continue, close or just wait a minute and the message goes away. Somet
-
How to put Anniversaries from AddressBook into iCal
Hi, The check-box "Show Birthdays calendar" in iCal's Preferences.../General subscribes to the birthdays from the AddressBook. Is there any way to similarly subscribe to the other date field (re-namable, but called "anniversary" by default)? Thanks,