Create a Credit Memo from purchase invoice
Hi everyone,
I am trying to create a credit memo from a purchase invoice, but it retuns the following error:
"RFC is missing"
I am using the JCO classes to develop this application. this is a sample of my code:
IDocuments document = SBOCOMUtil.newDocuments(company,new Integer(19));
document.setCardCode("P00055");
document.setDocDate(new java.util.Date());
document.getLines().setBaseEntry(new Integer(2852));
document.getLines().setBaseLine(new Integer(0));
document.getLines().setBaseType(new Integer(18));
int lRetCode = document.add();
if(lRetCode != 0){
System.out.println(company.getLastError().getErrorMessage() );
Do you have any idea about what is the problem?
Many Thanks.
Hi everyone,
the problem was solve. I had to specified the FederalTaxID field on the document.
just added the following field:
document.setFederalTaxID("000000000000");
Thanks.
Similar Messages
-
Create a Credit Memo from invoice (Sales)
Hi
How Can I Create a Credit Memo from invoice (Sales)?
ThanksHi Joe,
Check our SDK sample C:\Program Files\SAP\SAP Business One SDK\Samples\COM DI\VB.NET\05.OrderAndInvoice to understand the procedure. You will have to create your own sample by using Invoice and Creditmemo you just have to instantiate your document object as oCreditNotes.
Check the documentation as well of the Document Object.
Regards,
Felipe -
Create a Credit Memo from invoice
Hi,
When I Create a Credit Memo from invoice, I get the next error : -5002 , "-"
What is that?
regardsHi Joe,
I have tested your code and it seems to me that it is working fine. Make sure that the numbers of the document that you are using is correct and that you are doing it for the same business partner. Try doing the exact same thing in SBO. Please remember that you can have different document numbers and document entries for every document. The BaseEntry refers to the DocEntry field in the OINV table and not the DocNum field. The DocNum field is the one you see on screen in top right corner of AR Invoice screen.
Hope it helps,
Adele
PS: Sorry for previous text that was in this message. I had it all wrong
Message was edited by: Adele le Roux -
DFF Values Default in Credit Memo from AR Invoice
Hi,
We have entered an AR Invoice with DFF values at the Line Level.
We are creating a Credit Memo directly from the Invoice.Almost all the information in the Credit Memo defaults from the Invoice which is being credited. The DFF information is not defaulted from the Invoice Line level.
We have to manually enter them.
Is there someway to default the DFF values from the Invoice onto the Credit Memo ?
We are on R12.1.3
Regards,
Hari CharanHi Hari Charan,
in 11i this seems to be not possible, as there is an enhancement request available for the same. However for R12 there is a patch suggested by oracle in the below documentation ...Please review the note in detail
Transactions Form Issue: Credit Memo Does Not Inherit Descriptive Flexfields of Invoice [ID 1316534.1]
Regards,
Ivruksha -
F110 - Exclude Credit Memos from original Invoice
Good afternoon,
Our go live was 1 month ago.
We have prepared automatic payment process and everything works perfectly. Mainly, we base our process in the Payment Method Supplement field. Some payment methods group documents following different rules (restricted to 7 rows or as many as request).
Our problem is that our customer does not want credit memos to be included never there (payment terms are taken from original invoice and when they pay the invoice, this credit is included). They want to identify ALWAYS what they are paying fulfilling the Payment Method Supplement field.
Is there any chance not include the credit memo in these payments? For example, not copying Payment Method Supplement from the original invoice? any other idea? Please let me know. Regards,
JavierHi Renfe Proyecto Auge ,
You can exclude Credit memos in Additional Fields there you have to select Excluded and from hidden field select document radio button and from the list select Document Type (BKPF-BLART),
after this you have to choose Document type credit memo what ever you maintained for Credit memo, accordingly system will exclude the values from Automatic Payment Run.
Regards
Sridhar -
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 -
CS: Credit memo from Repair Order (RA)
Dear Experts,
I am trying to create a credit memo from my sales orderin lieu of return of a defective product, I am using the repair procedure which generates item category IRGN for credit memo.
My question; Since using repair procedure gives me a sub-item I am not sure how to go about billing it and also can I bypass the credit memo request creation and directly create Credit memo, how?
Kindly advise with your inputs on this scenario.
ThanksSolved. Used Invoice(for Repair) to create credit memo.
-
Credit Memo from Retro Billing
Hello Gurus!!
Can anyone please help me
Scenario:
I have created a credit memo from retro-billing due to price drop, and released the credit memo to accounting.
Problem:
When we look at the accounting document of the credit memo it doesn't have a controlling document and profitability analysis.
I have simulated the document at KE4ST, and here is the error message I got
Document is not profit-related and thus could not be transferred
Message no. KF755
Diagnosis
Sales document was not transferred to Profitability Analysis (CO-PA) because it is not relevant for the analyses in CO-PA. This can be due to one of the following reasons (among others):
The document type is not profit-related, such as an inquiry
The sales document shows zero for the quantity
The sales document has been denied
The sales document is locked due to credit reasons
Please anyone give me an idea on how can I resolve this..
Thank You!!!!Hi Carla,
I saw your the issue you posted on SDN.
We are facing exactly the same problem. We could not see the solution how you resolved this problem.
Can you tell us how have you resolved this ??
Would be great help to us.
Thanks,
Apte C.M. -
Invoice and Credit Memo from ECC to SUS
Hi Gurus
Is it possible to replicate Invoice or a credit Memo from ECC to SUS if the PO was delvired to vendor through SUS.
with Regards
ManjunathHI ,
part1 :
ERS Invoice from ECC is transfered to SUS system for display purpose to Vendor in MM-SUS scenario. IDOC "GSVERF01" is used for this purpose.
part 2 : Invoices can be created in SUS system by vendor against ASN ( Advanced Shipping Notification or purchase Order . The invoice is transfered to ECC system through XI. Message Interface for the same is "InvoiceRequest_Out" .
For reference please check
http://help.sap.com/saphelp_srm70/helpdata/en/74/344c430fab4d0bbc30996d56cc293a/frameset.htm
Regards,
Kalandi -
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 -
MIRO - Credit memo posted before invoice
Hello,
I have a problem with MIRO.
User is able to introduce credit memo to purchase order even if there was no invoice yet.
The strange thing is that when he introduce PO number in MIRO (credit memo) system issue a message __M8080 Reversal quantity greater than quantity invoiced to date__ and that is ok but after user will click on multi account assignment and get the same mesaage "Reverse qty greater than qty credited so far Message no. M8476" but after he close the pop up with account assignemnt and back to main screen there is no message M8080 any more and user is abl;e to post credit memo with negative quantity what finally issue ABAP error DYNPRO_FIELD_CONVERSION
Screen name.............. "SAPLMR1M"
Screen number............ 6310
Screen field............. "DRSEG-REMNG"
Error text............... "FX015: Sign lost.".
When I would like to display invoice (credit memo) in MIR4 or from ME23n history.
But the main question is why system clears message M8080 after clik on multi account assignement.?
Thanks in advance for your help.....
Edited by: PG on Sep 2, 2011 10:19 AMHi,
THis is definetly a issue related to SAP Note.
Try this SAP note in dev.
Note 1332137 - MIR6/MIR4: Negative quantity with parked documents
Summary
Symptom
You use transaction MIR4 (Display Invoice Document) or MIR6 (Invoice Overview) to post a parked credit memo with reference to a purchase order.
You change the item quantity (MENGE) so that it is greater than the current invoice quantity (REMNG) and, without pressing "Enter", you immediately choose "Post". Even though the system executes the quantity check correctly, and error message M8 080 "Reversal quantity greater than quantity invoiced to date" is displayed in the message log, the system unexpectedly allows this credit memo to be posted.
As a result, when you display or create invoice documents for this purchase order, the ABAP short dump DYNPRO_FIELD_CONVERSION occurs.
Solution
The Support Packages for Releases 4.70, 5.00, 6.00, 6.02, 6.03 and 6.04 correct this error.
If you require an advance correction: Implement the correction instructions.
Hope this will resolve your query,
Regards,
Sandesh Sawant -
What is tcode to create a credit memo ?
What is tcode to create a credit memo ? please tell me the steps ?
Hello,
<b>Credit memo: Document type - G2</b>
1. Credit memo is generally issued in two cases - either when customer returns goods previously purchased and requires a credit or customer is credited without reference to any return of goods when goods sent to him are found to be defective and a return delivery or a repair would exceed the cost. in this case the customer is requested to scrap the material sent and is given an account credit.
2. Another case is when the customer is over charged for goods he purchased and we only realise that after billing.
3. when configuring the sales document type credit memo request G2 you can automatically set a billing block that can be released by an authorised person during processing prior to billing.
4. It is the billing in the finance dept, which in turn is the actual creation of a credit note that is sent to the customer.
5. It is suggested to make the rejection reason, reference to billing document (invoice) and billing block in credit memo a mandatory field to ensure the traceability.
6. standard item category used is G2N; order related billing type G2 (invoice)
7. Items in contracts and credit memo requests do not have schedule lines as there is no movement of material involved.
8. Update document flow is activated when using copy control rules for copying from an invoice to a credit memo request.
<b>REWARD POINTS IF HELPFUL.</b>
Regards
Sai -
Error while creating an Credit memo in AR + R12
Hi All,
I am trying to create a credit memo in AR, based on the transaction i.e., an invoice of AR.
But i am not able to create.
I am encounter the following error
"Your credit memo transaction can only credit an invoice or a debit memo line
Failure encountered in AR_CREDIT_MEMO_API_PUB.Create_request call to arw_cmreq_cover.ar_request_cm".
My code is as follows:
DECLARE
l_dummy varchar2(240);
l_customer_trx_id ra_customer_trx.customer_trx_id%type;
l_line_credits_flag ra_cm_requests.line_credits_flag%type;
l_line_amount number;
l_freight_amount number := 0;
l_cm_lines_tbl arw_cmreq_cover.cm_line_tbl_type_cover;
l_cm_reason_code varchar2(150);
l_comments varchar2(150);
l_msg_count number := 0;
l_msg_data varchar2(20000) := null;
l_return_status varchar2(1);
l_request_id NUMBER;
l_batch_source_name varchar2(150) default null;
cm_trx_id number;
BEGIN
fnd_global.apps_initialize(1018094,50559,222,0);
mo_global.set_policy_context('S',204);
arp_global.init_global;
l_customer_trx_id := 549724 ; --527689;
l_comments := 'Creation of Credit memo';
l_batch_source_name := 'Invoice';
l_cm_lines_tbl(1).customer_trx_line_id := 833940;
l_cm_lines_tbl(1).quantity_credited := -1;
l_cm_lines_tbl(1).price := 1000.00;
l_cm_lines_tbl(1).extended_amount := -1000.00;
l_cm_lines_tbl(2).customer_trx_line_id := 833941;
l_cm_lines_tbl(2).quantity_credited := -2;
l_cm_lines_tbl(2).price := 1000.00;
l_cm_lines_tbl(2).extended_amount := -2000.00;
AR_CREDIT_MEMO_API_PUB.CREATE_REQUEST(
P_API_VERSION => 1.0,
P_INIT_MSG_LIST => FND_API.G_TRUE,
P_COMMIT => FND_API.G_FALSE,
P_VALIDATION_LEVEL => FND_API.G_VALID_LEVEL_FULL,
P_CUSTOMER_TRX_ID => l_customer_trx_id,
P_LINE_CREDIT_FLAG => 'N',
P_CM_REASON_CODE => 'DAMAGED PRODUCT',
P_CM_LINE_TBL => l_cm_lines_tbl,
P_SKIP_WORKFLOW_FLAG => 'Y',
P_CREDIT_METHOD_INSTALLMENTS => null,
P_CREDIT_METHOD_RULES => null,
P_BATCH_SOURCE_NAME => l_batch_source_name,
P_ORG_ID => 204,
X_REQUEST_ID => l_request_id,
X_RETURN_STATUS => l_return_status,
X_MSG_COUNT => l_msg_count,
X_MSG_DATA => l_msg_data);
FND_MSG_PUB.count_and_get (
p_encoded => FND_API.g_false,
p_count => l_msg_count,
p_data => l_msg_data );
dbms_output.put_line('Return Status ==> '||l_return_status);
dbms_output.put_line('Credit Memo request_id ==> '||l_request_id);
dbms_output.put_line('l_msg_count ==> '||l_msg_count);
FOR I IN 1..L_MSG_COUNT LOOP
DBMS_OUTPUT.PUT_LINE(SUBSTR(FND_MSG_PUB.GET(P_MSG_INDEX => I, P_ENCODED => 'F'), 1, 254));
END LOOP;
IF l_return_status <> 'S' THEN
NULL;
ELSE
select cm_customer_trx_id
into cm_trx_id
from ra_cm_requests_all
where request_id = l_request_id;
dbms_output.put_line(' CM trx_id = '|| cm_trx_id );
END IF;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('exception error!');
dbms_output.put_line(substr(sqlerrm, 1, 80));
fnd_message.retrieve(l_dummy);
dbms_output.put_line(l_dummy);
END;
Please advise me where i am wrong .... Thanks in Advance.
Regards,
Basha.
Edited by: zaheer on Aug 1, 2011 8:43 PMI am encounter the following error
"Your credit memo transaction can only credit an invoice or a debit memo line
Failure encountered in AR_CREDIT_MEMO_API_PUB.Create_request call to arw_cmreq_cover.ar_request_cm".Please see these docs.
Listing of AutoInvoice Error Messages and Troubleshooting Tips to Resolve each Error [ID 1138254.1]
Credit Memo Errors During Autoinvoice Process - Invalid reference line attribute value (REFERENCE_LINE_ATTRIBUTE1-15) [ID 405445.1]
Thanks,
Hussein -
Correspondance for the credit memo combined with invoice
Hi All,
I have to create the printout for the credit memos. But also need to show the corresponding invoice details.
Which is the best correspondance type, I should use, as I can see only the separtae one for credit memo and separate one for invoice.
Regds,
ServeshHi,
When you create print outs, it is always on customised layout as per the requirements of the customer. In this form, it is possible to print the details of both your credit memo and the invoice associated with it. So you have to finalise the layout the credit memo with your business user and then inform the logic to the developer to print all those fields. He will enable the coding for the same. You can test and release it.
For a credit memo, you have to find out the credit memo request from the VBFA table and then using this credit memo request you can find out the invoice number again from VBFA table. This number can be printed in the form in the desired place.
Hope it helps you -
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,
JohnThe 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
Maybe you are looking for
-
Switched from iphone 4 to iphone 5 - where are my photos?
I switched from iphone 4 to iphone 5 - where are my photos?
-
Problems with B2B Editor validating HL7 Messages
Hi all, I am having some problems related to B2B Document Editor and HL7 messages. When we ran the Analyzer with the following document: MSH|^~\&|ALERT|CHVNG|CPCHS|CHVNG|20070409145826+0000||OMG^O19^OMG_O19|1|P|2.4| PID|||303030^^^SONHO^NS||Patient^A
-
How to use Java WebStart with EJB ?
hi forum... how to use Java WebStart with EJB ? examples ? thanks mindu
-
How to delete unwanted text caller
I keep getting unsolicited text messages. I can edit it and delete the conversation, but not the caller contact number. How can i delete that?
-
Customer specific prices in Catalog SAP ERP E-Commerce
Hi Experts, We have implemented SAP ERP E-commerce -- ECC 6.0 ISA 5.0 Initially we implemented a B2B scenario without TREX engine. VMC component is active (IPC). In the catalog we don't see customer specific prices. What are the steps to enable cust