Creating Vendor Credit Memo Using BAPI BAPI_ACC_DOCUMENT_POST
Hi,
I want to create a vendor credit memo using the bapi BAPI_ACC_DOCUMENT_POST but with posting keys as 21 and 50.Is it possible to do so.I tested the bapi passing the data to the accountgl table.Do i have to pass data to another table ?
hi Eric,
I even tried passing the data to the accounts receivable and accounts payable tables passing the GL account no in these tables.Still teh document get posted with keys 40 and 50.Also the credit entries should be assigned to COPA segment of sales order/item.
The vendor credit memo should look as follows look as follows:
Dr Vendor (PK = 21) $ 35,000
Cr Freight expense account (PK = 50) $ 10,000
.assigned to COPA segment of sales order/ item 20000397/10
Cr Freight expense account (PK = 50) $ 5,000
.assigned to COPA segment of sales order/ item 20000397/20
Cr Freight expense account (PK = 50) $ 20,000
.assigned to COPA segment of sales order/ item 20000398/10
Similar Messages
-
Dear All,
I have to create credit memo using XL file.In XL file there are following fields:
1.order type
2.sales organization/division/distribution
3.sold to party
4.order refrence
5.Material code
6.Quantity
7.Price.
Is it possible to create Credit memo using BAPI?If yes then please reccomend any BAPI.
Regards,
AMARHi,
{ Changing the Object Status to Approve
CALL FUNCTION 'I_CHANGE_STATUS'
EXPORTING
objnr = is_vbakch-objnr
estat_inactive = c_e0001
estat_active = c_e0002
EXCEPTIONS
cannot_update = 1
OTHERS = 2.
IF sy-subrc EQ 0.
is_billing-salesorg = is_vbakch-vkorg.
is_billing-distr_chan = is_vbakch-vtweg.
is_billing-division = is_vbakch-spart.
is_billing-doc_type = is_vbakch-auart.
is_billing-ref_doc = is_vbakch-vbeln.
is_billing-bill_date = sy-datum.
is_billing-sold_to = is_vbakch-kunnr.
is_billing-ref_doc_ca = c_x.
APPEND is_billing TO it_billing.
ENDIF.
ENDLOOP.
BAPI To create Billing for the Credit Memo.
CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
TABLES
billingdatain = it_billing
return = it_returncg
success = it_bilsuccess.
Please use these for Credit memo creation using upload .. If u want i can send the coding also ..
Regards,
Srinivas. -
TO CREATE A CREDIT MEMO USING CREDIT MEMO REQUEST
Hi,
I have a credit memo request 60000150 and I need to create a credit memo using the above credit memo request.Can anyone suggest a BAPI or some other method to do this and also the parameters to be passedHi,
I have a credit memo request 60000150 and I need to create a credit memo using the above credit memo request.Can anyone suggest a BAPI or some other method to do this and also the parameters to be passed -
How to change the Quantity in the Credit Memo using BAPI
Hi All,
I have a requirement in which i need to change the Quantity Value field available in the Credit Memo using BAPI.
Can anyone help me out to get any available BAPI to perform this action or any Solution to change the Quantity in the Credit Memo ?.
Regards,
Muruganand.KHi,
Try using BAPI_SALESORDER_CHANGE.
DATA: s_order_header_in LIKE bapisdh1.
DATA: s_order_header_inx LIKE bapisdh1x.
DATA: BEGIN OF i_order_item_in OCCURS 0.
INCLUDE STRUCTURE bapisditm.
DATA: END OF i_order_item_in.
DATA: BEGIN OF i_order_item_inx OCCURS 0.
INCLUDE STRUCTURE bapisditmx.
DATA: END OF i_order_item_inx.
DATA: BEGIN OF it_return OCCURS 0.
INCLUDE STRUCTURE bapiret2.
DATA: END OF it_return.
DATA: BEGIN OF i_sched OCCURS 10.
INCLUDE STRUCTURE bapischdl.
DATA: END OF i_sched.
DATA: BEGIN OF i_schedx OCCURS 10.
INCLUDE STRUCTURE bapischdlx.
DATA: END OF i_schedx.
s_order_header_inx-updateflag = 'U'.
i_order_item_in-itm_number = vbap-posnr.
i_order_item_in-TARGET_QTY = rv45a-zzqty.
i_order_item_inx-updateflag = 'U'.
i_order_item_inx-itm_number = vbap-posnr.
i_order_item_inx-TARGET_QTY = 'X'.
APPEND: i_order_item_in, i_order_item_inx.
i_sched-itm_number = vbap-posnr.
i_sched-sched_line = '0002'.
i_sched-req_qty = rv45a-zzqty.
APPEND i_sched.
i_schedx-itm_number = vbap-posnr.
i_schedx-sched_line = '0002'.
i_schedx-updateflag = 'U'.
i_schedx-req_qty = 'X'.
APPEND i_schedx.
IF sy-subrc = 0.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = xvbap-vbeln
order_header_in = s_order_header_in
order_header_inx = s_order_header_inx
behave_when_error = 'P'
TABLES
return = it_return
order_item_in = i_order_item_in
order_item_inx = i_order_item_inx
schedule_lines = i_sched
schedule_linesx = i_schedx.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
Change the fields as per your logic before populating orders item and schedule line data.
You have to pass the quantity in schedule line items as well in case you want to change quanity in order.
KR Jaideep,
Edited by: Jaideep Sharma on Jun 22, 2009 7:35 PM -
Vendor invoice creation using BAPI BAPI_ACC_DOCUMENT_POST
Hi,
I am trying to create vendor invoice(FB60) using BAPI_ACC_DOCUMENT_POST.
Could anyone please let me know what all mandatory fields we have to pass in vendor item and header to create this ?
Regards,
Anubhuti PandeyHi,
Please call the FM BAPI_ACC_DOCUMENT_POST and try with the following parameters:
Function module to post the accounting document
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
" EXPORTING
documentheader = w_documentheader
" TABLES
accountgl = i_accountgl
accountreceivable = i_accountreceivable
accountpayable = i_accountpayable
currencyamount = i_currencyamount
return = i_return
contractitem = i_contractitem.
The required fields in the header document:
w_documentheader-bus_act
w_documentheader-username = sy-uname. "Username
w_documentheader-header_txt
w_documentheader-comp_code
w_documentheader-doc_date
w_documentheader-pstng_date = sy-datum.
w_documentheader-trans_date " Transaction date value as per document date
w_documentheader-fisc_year = sy-datum(4).
w_documentheader-doc_type
Pass the necessary information in the account GL and accounts payable.
I hope this helps you in some way. -
Hi,
In transaction VA01 we are able to create credit memo request (ZRCR order type) with order category K (credit memo). Is this possible to create this order using "BAPI_SALESORDER_CREATEFROMDAT2" and BAPI_SALESORDER_CREATEFROMDAT1 function module.?
If we try to excute using this function module, following return message is appearing. "Unpermitted combination of business object BUS2032 and sales doc. category K". Any one please give me solution.
Thanks in advance,
MuraliHi,
Using below FM we can create SD.
BAPI_SALESDOCU_CREATEFROMDATA
BAPI_SALESORDER_CREATEFROMDAT1
BAPI_SALESORDER_CREATEFROMDAT2
BAPI_SALESORDER_CREATEFROMDATA
Regards
Md.MahaboobKhan -
Hello Experts,
Have anyone tried to create service Credit Memo using B1if when an AP Invoice is posted by a user for a specific vendor? or Any similar scenario?
I am new to B1if , looking into the recordings now. Can anyone advise steps or process to acheive this ?Hi,
Please refer below link where PO2SO is generate, same manner you can use CM2AP.
[https://sap.emea.pgiconnect.com/p26689556/]
Thanks
Kevin -
Internal Error -5000 when creating AP Credit Memo
hi all, i've some problem when trying to create AP Credit Memo using VB.Net via SAP B1 SDK.
My application keep throwing error "Internal Error -5000 Occured"
My friend suggest me to create AP Credit Memo using SAP B1 application first, then try using the same parameter that i inputed into the system to create AP Credit Memo using SDK, he said it ussualy works.
I already try my friend suggestion to create AP Memo using SAP B1 Screen and it
was worked.
The information that i input when creating AP Memo via SAP screen are :
- Vendor
- Item/Service Type ="Service"
- Item/Service Description
- G/L Account
- Tax Code ="VNC"
- WTaxLiable =No
But when I try to create AP Memo using VB.NET using SAP SDK, it still
throwing the same exception as before (Internal Error -5000 Occured) even
I passing the same parameter.
Bellow is my code :
For the master :
vAPmemo.DocObjectCode =
SAPbobsCOM.BoObjectTypes.oPurchaseCreditNotes
vAPmemo.DocType =
SAPbobsCOM.BoDocumentTypes.dDocument_Service
vAPmemo.CardCode = "V001" ' txtCcode.Text
vAPmemo.DocDate = Now 'DatePosting.Value
vAPmemo.DocDueDate = Now ' DateDue.Value
vAPmemo.DocCurrency = "IDR"
vAPmemo.Comments = "Based On Tagihan No. " &
dtTable.Rows(j)("JurnalMemo").ToString.Trim & "."
For The Detail :
vAPmemo.Lines.AccountCode =
dtTable.Rows(j)("AccountCode").ToString.Trim
vAPmemo.Lines.BaseType = 18 'basetype = 19 (a/p
credit memo)
vAPmemo.Lines.ItemDescription = "Test"
vAPmemo.Lines.WTLiable = SAPbobsCOM.BoYesNoEnum.tNO
vAPmemo.Lines.TaxCode = "VNC"
vAPmemo.RowTotalFC= CDbl(dtTable.Rows(j)("Credit").ToString.Trim)
Is there anything wrong in my code ?
or missing parameter?
Regards,
Herfin
Edited by: Herfin Jodana on Aug 28, 2008 3:29 AM
Edited by: Herfin Jodana on Aug 28, 2008 3:30 AMHI,
if you want ot create a A/P Credit memo, you do not have to give the basetype/BaseLine/BaseEntry fields between document lines.
the correct is:
vAPmemo.Lines.AccountCode =
dtTable.Rows(j)("AccountCode").ToString.Trim
vAPmemo.Lines.ItemDescription = "Test"
vAPmemo.Lines.WTLiable = SAPbobsCOM.BoYesNoEnum.tNO
vAPmemo.Lines.TaxCode = "VNC"
vAPmemo.RowTotalFC= CDbl(dtTable.Rows(j)("Credit").ToString.Trim)
if you want to create a A/P Credit memo based on Existing Invoice, you must have to provide the basetype/BaseLine/BaseEntry which means:
vAPmemo.Lines.BaseType = 18 'APInvoice
vAPmemo.Lines.BaseEntry = 'Refrence docentry for A/P Invoice
vAPmemo.Lines.BaseLine = 'reference to A/P Invoice linenumber
Try this, it is now working.
Best Regards,
J. -
Credit Memo using BAPI_SLSTRANSACT_CREATEMULTI
Hi All,
Is it possible to create a credit memo using FM BAPI_SLSTRANSACT_CREATEMULTI? If possible, please let me know which of the table parameters need to be populated.
Regards,
VinnyHi Vinay,
It is possible create a Credit memo using BAPI_SLSTRANSACT_CREATEMULTI.
Pleae look at the FM CMS_1O_CREATE_SINGLE_GEN which as used the above bapi to create a Credit Memo and also you can see which all paramters are required.
Best Regards,
Kiran -
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. -
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 -
BAPI to park Debit Note (Vendor credit memo) Doc Type: 'KG'
Hi All,
A friend of mine desperately needs to know any BAPI for parking Debit Note (Doc.type : KG Vendor credit memo)... Please let me know if you know about any BAPI / Funcation module to do it and a little chunk of sample code will surely help me a lot....
Thanks in Advance,
Regards,Hi Savitha,
Well, we have experiemented with this BAPI "BAPI_INCOMINGINVOICE_PARK" earlier, but we found out that it dose not work properly for Service Orders; also it dose not seem to post proper debit note. Anyways, we have used another BAPI "BAPI_ACC_GL_POSTING_POST", it worked but it posts the debit note (Vendor Credit Memo) but we only want to park the debit note and let the user review it and then the user can post it manually or so afterwards...
Regards,
Athar -
Can we use BAPI BAPI_ACC_DOCUMENT_POST to upload the vendor invoice?
Hi,
Can anybody tell me, can we use bapi BAPI_ACC_DOCUMENT_POST to upload the vender invoice?
If yes, then which parameters we have to pass, and if no, then which is the other BAPI which is used for
this purpose?
Regards,
MrunalHi Mrunal,
Yes you can use BAPI_ACC_DOCUMENT_POST to upload vendor invoices.
Parameters which are required to be passed are :
Import tab :
DOCUMENTHEADER: Mandatory fields for this specififed in documentation for this.
Table tab:
ACCOUNTGL: Enteries aganist GL account will be populated in this(check documentation for mandatory fields)
ACCOUNTPAYABLE: Enteries aganist vendors will be populated in this(check documentation for mandatory fields)
CURRENCYAMOUNT: in this currency amount aganist GL and vendor entries will specified.
ITEMNO_ACC field will act as identifier as to amount belongs to which GL or vendor enteries.
This much parameter are required to post vendor invoices.
Regards,
Brajvir -
F-04 (Vendor Clearing using BAPI-BAPI_ACC_DOCUMENT_POST)
Hello all,
i am using a BAPI - BAPI_ACC_DOCUMENT_POST for posting and clearing vendor payments but problem is that i m getting error that 'Account 3252995 in company code 5219 cannot be directly posted to', can anyone please help me?
Regards saurabh.Hi Saurabh,
I´m looking for a BAPI to clear Accounts Payable open itens (as F-30, F-28 or FB05) and I saw in your previous message that it´s possible to do this using BAPI BAPI_ACC_DOCUMENT_POST, please, could you give a clue to sove this issue? Any additional information would be well accept.
Best Regards,
Ivan Spellmeier -
Printing of Vendor Credit Memo - Urgent
Hi Experts,
I want to issue a print output of Vendor Credit Memo to vendor. Could I get the configuration steps please.
regards,
MallikIf you are talking from FI Credit memo, pls do configure the following : Under AR/AP in FI.
Define Correspondence Types
Create Report Variants for Correspondence
Assign Programs for Correspondence Types
And use T codes Fb12 and F.61 or F.62 as per your requirement.
Pls check whether the available standards applicable for your purpose.
regards
S
Maybe you are looking for
-
Flash Drive No Longer Recognized
I purchased a new PNY Turbo 3.0 128 GB Flash Drive, formatted it as Mac OSX Journaled, transferred files to it, encrypted it, used it for about 30 minutes on my iMac, then it disappeared while navigating in Finder. The flash drive does not show in Fi
-
How to access Time Machine from Another Computer?
My daughter's iBook went down and is in the shop for repair and we want to access her Time Machine back up from another computer. Does anyone know if there is any way to do that?
-
Getting list of songs on iPod into a playlist on computer
Between my wife and I we have a few iPods and I'm having some troubles getting the list of songs from our iPods into playlists in iTunes because we originally didn't transfer them the right way. We realize now that we should have created a playlist f
-
bars on screen top and bottom of picture on new blueray player . is that normal and how do i get full picture. have new panisonic 50 in plazma Solved! Go to Solution.
-
Business Content Installation in BI 7.0 (New Dev Box)
Hi Bi Experts, its my first assigment in BI 7.0 and we have a new Dev box for the BI 7.0 Now the thing is that i have identified which DS i would be working (0CO_OM_CCA_9)..the IC is 0CCA_C11 Can any body please guide me down the steps for installati