Opening balance against multiple invoices
Hello Experts
How can we enter opening balances of business partners invoice wise ?there may be lackhs outtsanding against each partner.How can we map payment against a particular invoice included in opening balance ?
regards
Manoj
Hi Manoj,
I Hope this Thread will help you
[Opening Balance;
Thanks
Balaji
Similar Messages
-
Problem in getting opening balance for multiple GL Account
Hi,
I am working on a Trail Balance Report in which i am trying to fetch the data for the opening balance for multiple GL Accounts but it is not coming accurate.. Here is the link to the code which i am using currently right now:-
http://docs.google.com/View?id=dfxswwff_13fgpdcbgt
here i am showing the logic for the data of previous year only... i.e. data from begining to 1 day less of the date-low.Hi,
It is a tranparent table which is getting data from the 2 other tables,the filling of this table is right. The execution of this query is right in the program but the problem comes when it is trying to calculate the opening balance for the respective GL Account present in the query it is not doing it. i.e. if there are 2 gl account ids having 3 rows of data each it is not calculating the of it in a single row.. i hope it is clear now... -
Query in Receipts application against multiple invoices
Hi,
There is a requirement to apply a single receipt against multiple invoices pertaining to different customers.For these customers ,relationship has been already set in the customer master.How to achieve the same?
Breifing: Inv.1 of Customer A.= $50
Inv.2 of Customer B= $100
Receipt1 for $150 to be applied against Inv.1 and Inv.2
Customer A and Customer B relationship set up already.
Regards,
Bala.Hi Bala,
Create a receipt with the customer from whom the money has been received and apply it to both the invoices by selecting the same in LOV.
Make sure that the "Bill To" type relationship has been created in the customer master for these two customers.
Gajendra -
Downpayment adjust against Multiple Invoice
Hello Expets..
I need your valuable suggestion for this scenario. Like Customer is paying Downpayment against salesOrder. That Down payment had to adjust in basis of collection. For ex Downpayment is for 100 and Total outstanding Bill is for ex 1000 then when collection is 500 then 50% down payment should get adjusted. I mean base on collection amount % the down payment % shoudl get adjusted..
How can we map this is into SAP
your help will b appriaciated..
Thanks a lot
Regards
PoojaPooja
I didnt get any logic behind your senario.
Any way i think its cannot be maped in SAP . Only at the time of clearing Down payment manually we have to do.
Jain -
Dear All,
I need to list down the Invoices which are open and as well as their open amount but the condition is that it should be based on a date condition. Example would be
Suppose there is a Invoice which was created in the month of June with an amount $1000.00. A payment against the same invoice was created in the month of July. So if I run the report let say 1st of July to 31st of July, the invoice should appear with the payment transaction. But if i run the report with a date selection 1st of August till 31st of August, the invoice and the payment should not be listed in the report.
Please can anyone tell me how should i achieve this?
Regards,
GaryThanks Gordon
I am facing problem in showing the open balance against the Invoice. The report should show the Invoice with the original amount i.e the doctotal and also the balance. In the balance due field for the invoice is 0 no matter what day i run the report. I am trying to achieve the history of open balances of the invoices.
Regards,
Gary -
Customer open balance analysis question
Question: How do you easily track open balance of an invoice without using residuals?
Scenario:
Create invoice using transaction FB70
Apply a partial payment to the invoice or apply a credit memo to reduce the invoice balance. We do not want to use residual items as this closes the original item and reopens an item with a new reference number.
How can we easily and quickly tell the remaining open balance on the Invoice?
Example:
Invoice 1800000000 is created for $150
Credit Memo 1600000000 is created for $50 and applied to above invoice as a partial clearing.
When the Customer Line Items are displayed, the Original Invoice, 1800000000, still shows the full amount of $150 and a partial payment of document of <$50> also shows but with no link to the original invoice. Short of using the Text Fields, is there any way to display the remaining open balance of an invoice?
Calculating the open balance is easy when the customer only has a few open items; however, this is a nightmare when the customer has more than a screen full of open records.
Any suggestions would be greatly appreciated.
Greg BrownWhen you post the partial payment, the system marks the document number of the original open item in the line item for the partial payment. The original open item and the partial payment remain open.
The system stores the document number, fiscal year and number of the invoice item in the partial payment. <b>You can find this information in the 'Payment for' field.</b> Thus you can refer to the original open item from the partial payment. When you post the remaining amount for the invoice, both the partial payment and the invoice are cleared.
This is per documentation for <a href="http://help.sap.com/erp2005_ehp_02/helpdata/en/01/a9bb94455711d182b40000e829fbfe/content.htm">partial payments</a> , you may want to test it out. Hope a similar feature is available for credit memos. -
Open Net/Gross Amount Balance - A/R Invoice
Hello experts,
First time caller, long time listener here.
Simplified Scenario:
We have a Sales Order for $1500 on which the Customer paid a 100% down payment of $1500. We processed this payment (made via Check) using Payment Means directly on the Sales Order. We then deposited the Check.
Prior to shipping the order, the Customer requested a change to the order. We then Cancelled the original Sales Order and created a new Sales Order. The new Sales Order totaled only $1300.
After Delivering the new order, we created an A/R Invoice for the $1300 order. We clicked the ... button to open the Down Payments to Draw window and changed the Net Amount To Draw to $1300 (instead of the $1500 they paid).
After Adding the A/R Invoice, we can go back into the Down Payments to Draw window on that A/R Invoice and see an Open Net Amount and Open Gross Amount of $200 for that original Down Payment Invoice. However, this $200 does not show on the Customer's Account Balance, it does not show up on the Customer's Internal Reconciliation for use against other Invoices, and it does not show up as a credit in the Customer's Outgoing Payments screen - so we can't send them a check for it.
My questions are 1) How can we associate this $200 credit to the Customer so we can use it to reconcile other invoices or use it to send them a refund?; and 2) Is this method of changing Net Amount To Draw the best way of handling this type of scenario?Well I was able to figure it out with help from my VAR. The solution was to create another A/R Invoice to the same Customer. Within that Invoice, I selected the same Down Payment Invoice from before, resulting in a negative balance for the new A/R Invoice. After adding the new A/R Invoice the over-payment credit shows on the Customer's Account Balance allowing me to reconcile against other invoices or send them a refund.
-
Clear Multiple invoices document against single payment amount frm customer
Dear Experts,
There is a requirement in the business process like we file multiple invoices to customer account and he pays the amount in single payment. So what we need here is to clear all the invoice document in customer account against that payment.
Please tell is there anyway to achieve it at FI level.
Best Regards
Arun RaiHi,
You can clear them by defining clearing rules in OB74 for customer account type D. You should have your customer posting for collection based on a defined criteria based on some assignment number or something else that you will give in OB74..Based on the criteria that you will specify in OB74 system will match the open item invoices against their payment document and clear them accordingly. e.g you give assignment number ZUONR in OB74 for clearing criteria..It means that all of your invoices should have the same assignment number in Invoices as of the assignment number entered in Collection or payment document. Afterward you can clear customer in F.13 ..
I hope this will help you.
Regards
Edited by: Atif Farooq on Oct 18, 2011 11:38 AM -
Opening & closing balance for Multiple Vendors
Hi Friends,
I have an issue. This is my code.
*& Report ZVEN_OPEN_CLOSE_BAL
REPORT ZVEN_OPEN_CLOSE_BAL.
*& Report ZVEN_OPEN_CLOSE_BAL
TABLES:lfa1,bsik.
TYPES: BEGIN OF ty_bsik,
bukrs TYPE bsik-bukrs,
lifnr TYPE bsik-lifnr,
augbl TYPE bsik-augbl,
zuonr TYPE bsik-zuonr,
gjahr TYPE bsik-gjahr,
xblnr TYPE bsik-xblnr,
belnr TYPE bsik-belnr,
buzei TYPE bsik-buzei,
blart TYPE bsik-blart,
bldat TYPE bsik-bldat,
budat TYPE bsik-budat,
shkzg TYPE bsik-shkzg,
dmbtr TYPE bsik-dmbtr,
* bal TYPE char30,
sgtxt TYPE bsik-sgtxt,
END OF ty_bsik.
TYPES: BEGIN OF ty_bsak,
bukrs TYPE bsik-bukrs,
lifnr TYPE bsak-lifnr,
augbl TYPE bsak-augbl,
zuonr TYPE bsak-zuonr,
gjahr TYPE bsik-gjahr,
belnr TYPE bsak-belnr,
buzei TYPE bsik-buzei,
budat TYPE bsak-budat,
bldat TYPE bsak-bldat,
xblnr TYPE bsak-xblnr,
blart TYPE bsak-blart,
shkzg TYPE bsak-shkzg,
dmbtr TYPE bsik-dmbtr,
* shkzg1 TYPE bsak-shkzg,
sgtxt TYPE bsak-sgtxt,
END OF ty_bsak.
TYPES: BEGIN OF ty_lfc1,
lifnr TYPE lfc1-lifnr,
bukrs TYPE lfc1-bukrs,
gjahr TYPE lfc1-gjahr,
umsav TYPE lfc1-umsav,
END OF ty_lfc1.
TYPES: BEGIN OF ty_all,
lifnr TYPE bsik-lifnr,
zuonr TYPE bsik-zuonr,
xblnr TYPE bsik-xblnr,
belnr TYPE bsik-belnr,
hkont TYPE bseg-hkont,
blart TYPE bsik-blart,
ltext TYPE text20,
bldat TYPE bsik-bldat,
budat TYPE bsik-budat,
opbal TYPE p DECIMALS 2,
deb TYPE p DECIMALS 2 ,"bsik-dmbtr,
cre TYPE p DECIMALS 2,"bsik-dmbtr,
bal TYPE p DECIMALS 2,
augbl TYPE bsik-augbl,
sgtxt TYPE bsik-sgtxt,
END OF ty_all.
TYPE-POOLS: slis.
DATA: t_layout TYPE slis_layout_alv,
s_fieldtab TYPE slis_fieldcat_alv,
t_fieldtab TYPE slis_t_fieldcat_alv,
wa_header TYPE slis_listheader,
it_header TYPE slis_t_listheader.
DATA:it_bsik TYPE TABLE OF ty_bsik,
it_bsak TYPE TABLE OF ty_bsak,
it_all TYPE TABLE OF ty_all,
it_lfc1 TYPE TABLE OF ty_lfc1,
it_t003 TYPE TABLE OF t003t,
wa_bsik TYPE ty_bsik,
wa_bsak TYPE ty_bsak,
wa_all TYPE ty_all,
wa_lfc1 TYPE ty_lfc1,
wa_t003 TYPE t003t.
DATA: gt_fldcat TYPE slis_t_fieldcat_alv,
gs_fldcat TYPE slis_fieldcat_alv,
gs_layout TYPE slis_layout_alv,
gv_save TYPE c VALUE 'X'.
types :BEGIN OF ty_bseg,
BUKRS TYPE BUKRS,
BELNR TYPE BELNR_D,
GJAHR TYPE GJAHR,
BUZEI TYPE BUZEI,
koart type koart,
HKONT TYPE HKONT,
END OF ty_bseg.
DATA: it_bseg type TABLE OF ty_bseg,
wa_bseg type ty_bseg.
data t_balence TYPE TABLE OF BAPI3008_3 WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_lifnr FOR lfa1-lifnr,
s_bukrs FOR bsik-bukrs,
s_budat FOR bsik-budat OBLIGATORY.
PARAMETERS : p_gjahr TYPE bsik-gjahr OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
PERFORM get_data.
PERFORM process_data.
PERFORM display.
*& Form GET_DATA
* text
* --> p1 text
* <-- p2 text
FORM get_data .
break naidu.
SELECT bukrs
lifnr
augbl
zuonr
gjahr
xblnr
belnr
buzei
blart
bldat
budat
shkzg
dmbtr
sgtxt FROM bsik
INTO TABLE it_bsik
WHERE lifnr IN s_lifnr AND
bukrs IN s_bukrs AND
budat IN s_budat AND
gjahr = p_gjahr .
SELECT bukrs
lifnr
augbl
zuonr
gjahr
belnr
buzei
budat
bldat
xblnr
blart
shkzg
dmbtr
sgtxt FROM bsak
INTO TABLE it_bsak
WHERE lifnr IN s_lifnr AND
bukrs IN s_bukrs AND
budat IN s_budat AND
gjahr = p_gjahr .
if it_bsik is INITIAL and it_bsak is INITIAL.
*DATA v_date type budat.
*data :year(4),
* month(2),
* date(2).
* year = s_budat-low+0(4).
* date = s_budat-low+6(2).
* month = s_budat-low+4(2).
* month = month - 01.
*CONCATENATE year month date INTO v_date .
* SELECT bukrs
* lifnr
* augbl
* zuonr
* gjahr
* xblnr
* belnr
* buzei
* blart
* bldat
* budat
* shkzg
* dmbtr
* sgtxt FROM bsik
* INTO TABLE it_bsik
* WHERE lifnr IN s_lifnr AND
* bukrs in s_bukrs and
* budat eq v_date AND
* gjahr = p_gjahr .
* SELECT bukrs
* lifnr
* augbl
* zuonr
* gjahr
* belnr
* buzei
* budat
* bldat
* xblnr
* blart
* shkzg
* dmbtr
* sgtxt FROM bsak
* INTO TABLE it_bsak
* WHERE lifnr IN s_lifnr AND
* bukrs IN s_bukrs AND
* budat eq v_date AND
* gjahr = p_gjahr .
CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'
EXPORTING
companycode = s_bukrs-low
vendor = s_lifnr-low
keydate = s_budat-low
* BALANCESPGLI = ' '
* NOTEDITEMS = ' '
* IMPORTING
* RETURN =
TABLES
keybalance = t_balence
endif.
ENDFORM. " GET_DATA
*& Form PROCESS_DATA
* text
* --> p1 text
* <-- p2 text
FORM process_data .
DATA:v_bal TYPE netpr.
LOOP AT it_bsak INTO wa_bsak.
wa_bsik-bukrs = wa_bsak-bukrs.
wa_bsik-lifnr = wa_bsak-lifnr.
wa_bsik-augbl = wa_bsak-augbl.
wa_bsik-zuonr = wa_bsak-zuonr.
wa_bsik-gjahr = wa_bsak-gjahr.
wa_bsik-belnr = wa_bsak-belnr.
wa_bsik-buzei = wa_bsak-buzei.
wa_bsik-budat = wa_bsak-budat.
wa_bsik-bldat = wa_bsak-bldat.
wa_bsik-xblnr = wa_bsak-xblnr.
wa_bsik-blart = wa_bsak-blart.
wa_bsik-shkzg = wa_bsak-shkzg.
wa_bsik-dmbtr = wa_bsak-dmbtr.
wa_bsik-sgtxt = wa_bsak-sgtxt .
APPEND wa_bsik TO it_bsik.
CLEAR:wa_bsik.
ENDLOOP.
IF it_bsik IS NOT INITIAL .
SELECT lifnr bukrs gjahr umsav
FROM lfc1
INTO TABLE it_lfc1 FOR ALL ENTRIES IN it_bsik
WHERE
lifnr EQ it_bsik-lifnr AND
bukrs EQ it_bsik-bukrs AND
gjahr EQ it_bsik-gjahr.
SELECT * FROM t003t
INTO TABLE it_t003
FOR ALL ENTRIES IN it_bsik
WHERE blart = it_bsik-blart AND
spras = 'EN'.
*&Bindu........................................
select bukrs "Company Code
belnr "Document Number
gjahr "Fiscal Year
buzei "Line item
koart "Account Type
hkont "General Ledger Account
from bseg into TABLE it_bseg
FOR ALL ENTRIES IN it_bsik
WHERE belnr eq it_bsik-belnr and
bukrs in s_bukrs and
gjahr eq p_gjahr and
BUZEI eq it_bsik-buzei.
ENDIF.
SORT it_bsik BY lifnr.
DATA:c,
l_dmbtr type p DECIMALS 2.
DATA:v1(15),
v2(3).
DATA:v_umsav(18).
DATA v_fbal TYPE umsav.
LOOP AT it_bsik INTO wa_bsik.
READ TABLE it_lfc1 INTO wa_lfc1 WITH KEY lifnr = wa_bsik-lifnr
bukrs = wa_bsik-bukrs
gjahr = wa_bsik-gjahr.
if sy-subrc = 0.
at FIRST.
v_umsav = wa_lfc1-umsav.
SPLIT v_umsav at '.' INTO v1 v2.
wa_all-LTEXT = 'Opening Balance'.
IF v2+2(1) = '-'.
wa_all-cre = wa_lfc1-umsav.
ELSE.
wa_all-deb = wa_lfc1-umsav.
ENDIF.
wa_all-bal = wa_lfc1-umsav.
v_fbal = wa_all-bal.
APPEND wa_all to it_all.
CLEAR wa_all.
endat.
endif.
AT NEW lifnr.
c = 0.
ENDAT.
wa_all-lifnr = wa_bsik-lifnr.
wa_all-zuonr = wa_bsik-zuonr.
wa_all-xblnr = wa_bsik-xblnr.
wa_all-belnr = wa_bsik-belnr.
wa_all-blart = wa_bsik-blart.
wa_all-bldat = wa_bsik-bldat.
wa_all-budat = wa_bsik-budat.
*&Bindu............
READ TABLE it_bseg into wa_bseg WITH KEY belnr = wa_bsik-belnr
buzei = wa_bsik-buzei."Bindu.......
if sy-subrc = 0.
wa_all-hkont = wa_bseg-hkont. "Bindu.....
endif.
IF wa_bsik-shkzg = 'S'.
wa_all-deb = wa_bsik-dmbtr.
ELSEIF wa_bsik-shkzg = 'H'.
wa_all-cre = wa_bsik-dmbtr.
ENDIF.
READ TABLE it_t003 INTO wa_t003 WITH KEY blart = wa_bsik-blart.
IF sy-subrc = 0.
wa_all-ltext = wa_t003-ltext.
ENDIF.
* READ TABLE it_lfc1 INTO wa_lfc1 WITH KEY lifnr = wa_bsik-lifnr
* bukrs = wa_bsik-bukrs
* gjahr = wa_bsik-gjahr.
*break naidu.
IF sy-subrc = 0.
* IF c = 0.
* clear:l_dmbtr.
* wa_all-opbal = wa_lfc1-umsav.
* c = c + 1.
* IF wa_bsik-shkzg = 'S'.
* wa_all-bal = wa_all-opbal + wa_bsik-dmbtr.
* ELSEIF wa_bsik-shkzg = 'H'.
* wa_all-bal = wa_all-opbal - wa_bsik-dmbtr.
* ENDIF.
l_dmbtr = wa_all-bal.
* ELSE.
* wa_all-bal = l_dmbtr + wa_bsik-dmbtr.
* ELSEIF wa_bsik-shkzg = 'H'.
* wa_all-bal = l_dmbtr - wa_bsik-dmbtr.
* ENDIF.
ENDIF.
* IF wa_bsik-shkzg = 'S'.
* wa_all-bal = wa_all-opbal + wa_bsik-dmbtr.
* ELSEIF wa_bsik-shkzg = 'H'.
* wa_all-bal = wa_all-opbal - wa_bsik-dmbtr.
* ENDIF.
if v_fbal is NOT INITIAL.
wa_all-bal = v_fbal + wa_all-deb - wa_all-cre.
CLEAR:v_fbal.
else.
wa_all-bal = v_bal + wa_all-deb - wa_all-cre.
ENDIF.
wa_all-augbl = wa_bsik-augbl.
wa_all-sgtxt = wa_bsik-sgtxt.
*v_balance = wa_all-bal.
APPEND wa_all TO it_all.
v_bal = wa_all-bal.
CLEAR :wa_all.
*& Closing Balence.................
at last.
wa_all-LTEXT = 'Closing Balance'.
* IF .
wa_all-BAL = v_bal.
APPEND wa_all to it_all.
CLEAR wa_all.
* ENDIF.
endat.
ENDLOOP.
ENDFORM. " PROCESS_DATA
*& Form DISPLAY
* text
* --> p1 text
* <-- p2 text
FORM display .
DATA : ls_layout TYPE slis_layout_alv.
PERFORM create_fldcat.
ls_layout-expand_all = 'X'.
ls_layout-colwidth_optimize = 'X'.
ls_layout-expand_fieldname = 'X'.
ls_layout-zebra = 'X'.
if it_all is initial .
wa_all-LTEXT = 'Opening Balance'.
wa_all-bal = t_balence-LC_BAL.
wa_all-lifnr = s_lifnr-low.
APPEND wa_all to it_all.
ENDIF.
IF it_all IS NOT INITIAL.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = ls_layout
it_fieldcat = gt_fldcat
i_save = 'X'
TABLES
t_outtab = it_all[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
ELSE.
MESSAGE 'There is no Data for the given selection screen' TYPE 'I' DISPLAY LIKE 'E'.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " DISPLAY
*& Form CREATE_FLDCAT
* text
* --> p1 text
* <-- p2 text
FORM create_fldcat .
PERFORM : append_val USING 'LIFNR' 'IT_ALL' 'vendor' '' '' 'X' ' '.
PERFORM : append_val USING 'HKONT' 'IT_ALL' 'G/L Acc' '' '' 'X' ' '.
PERFORM : append_val USING 'ZUONR' 'IT_ALL' 'account' '' '' '' ''.
PERFORM : append_val USING 'XBLNR' 'IT_ALL' 'number' '' '' 'X' ''.
PERFORM : append_val USING 'BELNR' 'IT_ALL' 'ref no' '' '' 'X' ''.
PERFORM : append_val USING 'BLART' 'IT_ALL' 'type' '' '' 'X' ''.
PERFORM : append_val USING 'LTEXT' 'IT_ALL' 'type text' '' '' 'X' ''.
PERFORM : append_val USING 'BLDAT' 'IT_ALL' 'doc date' '' '' 'X' ''.
PERFORM : append_val USING 'BUDAT' 'IT_ALL' 'post date' '' '' 'X' ''.
PERFORM : append_val USING 'OPBAL' 'IT_ALL' 'op balance' '' '' '' ''.
PERFORM : append_val USING 'DEB' 'IT_ALL' 'debit' '' '' '' ''.
PERFORM : append_val USING 'CRE' 'IT_ALL' 'credit' '' '' '' ''.
PERFORM : append_val USING 'BAL' 'IT_ALL' 'balance' '' '' '' ''.
PERFORM : append_val USING 'AUGBL' 'IT_ALL' 'clr doc' '' '' 'X' ''.
PERFORM : append_val USING 'SGTXT' 'IT_ALL' 'text ' '' '' 'X' ''.
ENDFORM. " CREATE_FLDCAT
*& Form APPEND_VAL
* text
* -->P_0578 text
* -->P_0579 text
* -->P_TEXT_010 text
* -->P_0581 text
* -->P_0582 text
* -->P_0583 text
FORM append_val USING p_a
p_b
p_c
p_d
p_e
p_f
p_g.
CLEAR gs_fldcat.
gs_fldcat-fieldname = p_a.
gs_fldcat-tabname = p_b.
gs_fldcat-seltext_m = p_c.
gs_fldcat-qfieldname = p_d.
gs_fldcat-datatype = p_e.
gs_fldcat-no_zero = p_f.
gs_fldcat-do_sum = p_g.
APPEND gs_fldcat TO gt_fldcat.
ENDFORM. " APPEND_VAL
This is working for single vendor.
Now my problem is Opening & closing balance should be displayed for multiple vendors.
Please suggest me.
Thanks in advance.Hi Friends,
I have an issue. This is my code.
*& Report ZVEN_OPEN_CLOSE_BAL
REPORT ZVEN_OPEN_CLOSE_BAL.
*& Report ZVEN_OPEN_CLOSE_BAL
TABLES:lfa1,bsik.
TYPES: BEGIN OF ty_bsik,
bukrs TYPE bsik-bukrs,
lifnr TYPE bsik-lifnr,
augbl TYPE bsik-augbl,
zuonr TYPE bsik-zuonr,
gjahr TYPE bsik-gjahr,
xblnr TYPE bsik-xblnr,
belnr TYPE bsik-belnr,
buzei TYPE bsik-buzei,
blart TYPE bsik-blart,
bldat TYPE bsik-bldat,
budat TYPE bsik-budat,
shkzg TYPE bsik-shkzg,
dmbtr TYPE bsik-dmbtr,
* bal TYPE char30,
sgtxt TYPE bsik-sgtxt,
END OF ty_bsik.
TYPES: BEGIN OF ty_bsak,
bukrs TYPE bsik-bukrs,
lifnr TYPE bsak-lifnr,
augbl TYPE bsak-augbl,
zuonr TYPE bsak-zuonr,
gjahr TYPE bsik-gjahr,
belnr TYPE bsak-belnr,
buzei TYPE bsik-buzei,
budat TYPE bsak-budat,
bldat TYPE bsak-bldat,
xblnr TYPE bsak-xblnr,
blart TYPE bsak-blart,
shkzg TYPE bsak-shkzg,
dmbtr TYPE bsik-dmbtr,
* shkzg1 TYPE bsak-shkzg,
sgtxt TYPE bsak-sgtxt,
END OF ty_bsak.
TYPES: BEGIN OF ty_lfc1,
lifnr TYPE lfc1-lifnr,
bukrs TYPE lfc1-bukrs,
gjahr TYPE lfc1-gjahr,
umsav TYPE lfc1-umsav,
END OF ty_lfc1.
TYPES: BEGIN OF ty_all,
lifnr TYPE bsik-lifnr,
zuonr TYPE bsik-zuonr,
xblnr TYPE bsik-xblnr,
belnr TYPE bsik-belnr,
hkont TYPE bseg-hkont,
blart TYPE bsik-blart,
ltext TYPE text20,
bldat TYPE bsik-bldat,
budat TYPE bsik-budat,
opbal TYPE p DECIMALS 2,
deb TYPE p DECIMALS 2 ,"bsik-dmbtr,
cre TYPE p DECIMALS 2,"bsik-dmbtr,
bal TYPE p DECIMALS 2,
augbl TYPE bsik-augbl,
sgtxt TYPE bsik-sgtxt,
END OF ty_all.
TYPE-POOLS: slis.
DATA: t_layout TYPE slis_layout_alv,
s_fieldtab TYPE slis_fieldcat_alv,
t_fieldtab TYPE slis_t_fieldcat_alv,
wa_header TYPE slis_listheader,
it_header TYPE slis_t_listheader.
DATA:it_bsik TYPE TABLE OF ty_bsik,
it_bsak TYPE TABLE OF ty_bsak,
it_all TYPE TABLE OF ty_all,
it_lfc1 TYPE TABLE OF ty_lfc1,
it_t003 TYPE TABLE OF t003t,
wa_bsik TYPE ty_bsik,
wa_bsak TYPE ty_bsak,
wa_all TYPE ty_all,
wa_lfc1 TYPE ty_lfc1,
wa_t003 TYPE t003t.
DATA: gt_fldcat TYPE slis_t_fieldcat_alv,
gs_fldcat TYPE slis_fieldcat_alv,
gs_layout TYPE slis_layout_alv,
gv_save TYPE c VALUE 'X'.
types :BEGIN OF ty_bseg,
BUKRS TYPE BUKRS,
BELNR TYPE BELNR_D,
GJAHR TYPE GJAHR,
BUZEI TYPE BUZEI,
koart type koart,
HKONT TYPE HKONT,
END OF ty_bseg.
DATA: it_bseg type TABLE OF ty_bseg,
wa_bseg type ty_bseg.
data t_balence TYPE TABLE OF BAPI3008_3 WITH HEADER LINE.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_lifnr FOR lfa1-lifnr,
s_bukrs FOR bsik-bukrs,
s_budat FOR bsik-budat OBLIGATORY.
PARAMETERS : p_gjahr TYPE bsik-gjahr OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
START-OF-SELECTION.
PERFORM get_data.
PERFORM process_data.
PERFORM display.
*& Form GET_DATA
* text
* --> p1 text
* <-- p2 text
FORM get_data .
break naidu.
SELECT bukrs
lifnr
augbl
zuonr
gjahr
xblnr
belnr
buzei
blart
bldat
budat
shkzg
dmbtr
sgtxt FROM bsik
INTO TABLE it_bsik
WHERE lifnr IN s_lifnr AND
bukrs IN s_bukrs AND
budat IN s_budat AND
gjahr = p_gjahr .
SELECT bukrs
lifnr
augbl
zuonr
gjahr
belnr
buzei
budat
bldat
xblnr
blart
shkzg
dmbtr
sgtxt FROM bsak
INTO TABLE it_bsak
WHERE lifnr IN s_lifnr AND
bukrs IN s_bukrs AND
budat IN s_budat AND
gjahr = p_gjahr .
if it_bsik is INITIAL and it_bsak is INITIAL.
*DATA v_date type budat.
*data :year(4),
* month(2),
* date(2).
* year = s_budat-low+0(4).
* date = s_budat-low+6(2).
* month = s_budat-low+4(2).
* month = month - 01.
*CONCATENATE year month date INTO v_date .
* SELECT bukrs
* lifnr
* augbl
* zuonr
* gjahr
* xblnr
* belnr
* buzei
* blart
* bldat
* budat
* shkzg
* dmbtr
* sgtxt FROM bsik
* INTO TABLE it_bsik
* WHERE lifnr IN s_lifnr AND
* bukrs in s_bukrs and
* budat eq v_date AND
* gjahr = p_gjahr .
* SELECT bukrs
* lifnr
* augbl
* zuonr
* gjahr
* belnr
* buzei
* budat
* bldat
* xblnr
* blart
* shkzg
* dmbtr
* sgtxt FROM bsak
* INTO TABLE it_bsak
* WHERE lifnr IN s_lifnr AND
* bukrs IN s_bukrs AND
* budat eq v_date AND
* gjahr = p_gjahr .
CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'
EXPORTING
companycode = s_bukrs-low
vendor = s_lifnr-low
keydate = s_budat-low
* BALANCESPGLI = ' '
* NOTEDITEMS = ' '
* IMPORTING
* RETURN =
TABLES
keybalance = t_balence
endif.
ENDFORM. " GET_DATA
*& Form PROCESS_DATA
* text
* --> p1 text
* <-- p2 text
FORM process_data .
DATA:v_bal TYPE netpr.
LOOP AT it_bsak INTO wa_bsak.
wa_bsik-bukrs = wa_bsak-bukrs.
wa_bsik-lifnr = wa_bsak-lifnr.
wa_bsik-augbl = wa_bsak-augbl.
wa_bsik-zuonr = wa_bsak-zuonr.
wa_bsik-gjahr = wa_bsak-gjahr.
wa_bsik-belnr = wa_bsak-belnr.
wa_bsik-buzei = wa_bsak-buzei.
wa_bsik-budat = wa_bsak-budat.
wa_bsik-bldat = wa_bsak-bldat.
wa_bsik-xblnr = wa_bsak-xblnr.
wa_bsik-blart = wa_bsak-blart.
wa_bsik-shkzg = wa_bsak-shkzg.
wa_bsik-dmbtr = wa_bsak-dmbtr.
wa_bsik-sgtxt = wa_bsak-sgtxt .
APPEND wa_bsik TO it_bsik.
CLEAR:wa_bsik.
ENDLOOP.
IF it_bsik IS NOT INITIAL .
SELECT lifnr bukrs gjahr umsav
FROM lfc1
INTO TABLE it_lfc1 FOR ALL ENTRIES IN it_bsik
WHERE
lifnr EQ it_bsik-lifnr AND
bukrs EQ it_bsik-bukrs AND
gjahr EQ it_bsik-gjahr.
SELECT * FROM t003t
INTO TABLE it_t003
FOR ALL ENTRIES IN it_bsik
WHERE blart = it_bsik-blart AND
spras = 'EN'.
*&Bindu........................................
select bukrs "Company Code
belnr "Document Number
gjahr "Fiscal Year
buzei "Line item
koart "Account Type
hkont "General Ledger Account
from bseg into TABLE it_bseg
FOR ALL ENTRIES IN it_bsik
WHERE belnr eq it_bsik-belnr and
bukrs in s_bukrs and
gjahr eq p_gjahr and
BUZEI eq it_bsik-buzei.
ENDIF.
SORT it_bsik BY lifnr.
DATA:c,
l_dmbtr type p DECIMALS 2.
DATA:v1(15),
v2(3).
DATA:v_umsav(18).
DATA v_fbal TYPE umsav.
LOOP AT it_bsik INTO wa_bsik.
READ TABLE it_lfc1 INTO wa_lfc1 WITH KEY lifnr = wa_bsik-lifnr
bukrs = wa_bsik-bukrs
gjahr = wa_bsik-gjahr.
if sy-subrc = 0.
at FIRST.
v_umsav = wa_lfc1-umsav.
SPLIT v_umsav at '.' INTO v1 v2.
wa_all-LTEXT = 'Opening Balance'.
IF v2+2(1) = '-'.
wa_all-cre = wa_lfc1-umsav.
ELSE.
wa_all-deb = wa_lfc1-umsav.
ENDIF.
wa_all-bal = wa_lfc1-umsav.
v_fbal = wa_all-bal.
APPEND wa_all to it_all.
CLEAR wa_all.
endat.
endif.
AT NEW lifnr.
c = 0.
ENDAT.
wa_all-lifnr = wa_bsik-lifnr.
wa_all-zuonr = wa_bsik-zuonr.
wa_all-xblnr = wa_bsik-xblnr.
wa_all-belnr = wa_bsik-belnr.
wa_all-blart = wa_bsik-blart.
wa_all-bldat = wa_bsik-bldat.
wa_all-budat = wa_bsik-budat.
*&Bindu............
READ TABLE it_bseg into wa_bseg WITH KEY belnr = wa_bsik-belnr
buzei = wa_bsik-buzei."Bindu.......
if sy-subrc = 0.
wa_all-hkont = wa_bseg-hkont. "Bindu.....
endif.
IF wa_bsik-shkzg = 'S'.
wa_all-deb = wa_bsik-dmbtr.
ELSEIF wa_bsik-shkzg = 'H'.
wa_all-cre = wa_bsik-dmbtr.
ENDIF.
READ TABLE it_t003 INTO wa_t003 WITH KEY blart = wa_bsik-blart.
IF sy-subrc = 0.
wa_all-ltext = wa_t003-ltext.
ENDIF.
* READ TABLE it_lfc1 INTO wa_lfc1 WITH KEY lifnr = wa_bsik-lifnr
* bukrs = wa_bsik-bukrs
* gjahr = wa_bsik-gjahr.
*break naidu.
IF sy-subrc = 0.
* IF c = 0.
* clear:l_dmbtr.
* wa_all-opbal = wa_lfc1-umsav.
* c = c + 1.
* IF wa_bsik-shkzg = 'S'.
* wa_all-bal = wa_all-opbal + wa_bsik-dmbtr.
* ELSEIF wa_bsik-shkzg = 'H'.
* wa_all-bal = wa_all-opbal - wa_bsik-dmbtr.
* ENDIF.
l_dmbtr = wa_all-bal.
* ELSE.
* wa_all-bal = l_dmbtr + wa_bsik-dmbtr.
* ELSEIF wa_bsik-shkzg = 'H'.
* wa_all-bal = l_dmbtr - wa_bsik-dmbtr.
* ENDIF.
ENDIF.
* IF wa_bsik-shkzg = 'S'.
* wa_all-bal = wa_all-opbal + wa_bsik-dmbtr.
* ELSEIF wa_bsik-shkzg = 'H'.
* wa_all-bal = wa_all-opbal - wa_bsik-dmbtr.
* ENDIF.
if v_fbal is NOT INITIAL.
wa_all-bal = v_fbal + wa_all-deb - wa_all-cre.
CLEAR:v_fbal.
else.
wa_all-bal = v_bal + wa_all-deb - wa_all-cre.
ENDIF.
wa_all-augbl = wa_bsik-augbl.
wa_all-sgtxt = wa_bsik-sgtxt.
*v_balance = wa_all-bal.
APPEND wa_all TO it_all.
v_bal = wa_all-bal.
CLEAR :wa_all.
*& Closing Balence.................
at last.
wa_all-LTEXT = 'Closing Balance'.
* IF .
wa_all-BAL = v_bal.
APPEND wa_all to it_all.
CLEAR wa_all.
* ENDIF.
endat.
ENDLOOP.
ENDFORM. " PROCESS_DATA
*& Form DISPLAY
* text
* --> p1 text
* <-- p2 text
FORM display .
DATA : ls_layout TYPE slis_layout_alv.
PERFORM create_fldcat.
ls_layout-expand_all = 'X'.
ls_layout-colwidth_optimize = 'X'.
ls_layout-expand_fieldname = 'X'.
ls_layout-zebra = 'X'.
if it_all is initial .
wa_all-LTEXT = 'Opening Balance'.
wa_all-bal = t_balence-LC_BAL.
wa_all-lifnr = s_lifnr-low.
APPEND wa_all to it_all.
ENDIF.
IF it_all IS NOT INITIAL.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = ls_layout
it_fieldcat = gt_fldcat
i_save = 'X'
TABLES
t_outtab = it_all[]
EXCEPTIONS
program_error = 1
OTHERS = 2.
ELSE.
MESSAGE 'There is no Data for the given selection screen' TYPE 'I' DISPLAY LIKE 'E'.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " DISPLAY
*& Form CREATE_FLDCAT
* text
* --> p1 text
* <-- p2 text
FORM create_fldcat .
PERFORM : append_val USING 'LIFNR' 'IT_ALL' 'vendor' '' '' 'X' ' '.
PERFORM : append_val USING 'HKONT' 'IT_ALL' 'G/L Acc' '' '' 'X' ' '.
PERFORM : append_val USING 'ZUONR' 'IT_ALL' 'account' '' '' '' ''.
PERFORM : append_val USING 'XBLNR' 'IT_ALL' 'number' '' '' 'X' ''.
PERFORM : append_val USING 'BELNR' 'IT_ALL' 'ref no' '' '' 'X' ''.
PERFORM : append_val USING 'BLART' 'IT_ALL' 'type' '' '' 'X' ''.
PERFORM : append_val USING 'LTEXT' 'IT_ALL' 'type text' '' '' 'X' ''.
PERFORM : append_val USING 'BLDAT' 'IT_ALL' 'doc date' '' '' 'X' ''.
PERFORM : append_val USING 'BUDAT' 'IT_ALL' 'post date' '' '' 'X' ''.
PERFORM : append_val USING 'OPBAL' 'IT_ALL' 'op balance' '' '' '' ''.
PERFORM : append_val USING 'DEB' 'IT_ALL' 'debit' '' '' '' ''.
PERFORM : append_val USING 'CRE' 'IT_ALL' 'credit' '' '' '' ''.
PERFORM : append_val USING 'BAL' 'IT_ALL' 'balance' '' '' '' ''.
PERFORM : append_val USING 'AUGBL' 'IT_ALL' 'clr doc' '' '' 'X' ''.
PERFORM : append_val USING 'SGTXT' 'IT_ALL' 'text ' '' '' 'X' ''.
ENDFORM. " CREATE_FLDCAT
*& Form APPEND_VAL
* text
* -->P_0578 text
* -->P_0579 text
* -->P_TEXT_010 text
* -->P_0581 text
* -->P_0582 text
* -->P_0583 text
FORM append_val USING p_a
p_b
p_c
p_d
p_e
p_f
p_g.
CLEAR gs_fldcat.
gs_fldcat-fieldname = p_a.
gs_fldcat-tabname = p_b.
gs_fldcat-seltext_m = p_c.
gs_fldcat-qfieldname = p_d.
gs_fldcat-datatype = p_e.
gs_fldcat-no_zero = p_f.
gs_fldcat-do_sum = p_g.
APPEND gs_fldcat TO gt_fldcat.
ENDFORM. " APPEND_VAL
This is working for single vendor.
Now my problem is Opening & closing balance should be displayed for multiple vendors.
Please suggest me.
Thanks in advance. -
Single Excise Invoice Posting against multiple Goods Receipt.
Hi,
We made a Purchase Order, say 4500000753, of 100 Qty,
The Vendor sent us the Material in two different Challans but in same date and two created two Material Documents,say 5000000772 & 5000000773 for Goods Receipt.
The Vendor sent us single Excise Invoice for both the Challans (goods receipt). Please advise how to post the Excise Invoice.
We tried to capture Invoice against Purchase Order, but the system is giving the following message:
Document 4500000753 does not contain any selectable items
My Queries / doublts
1. Is it possible to post excise document against multiple goods receipt documents.
2. In what case we excise posting against Purchase Order and what is configuration required.
3. Can we post excise invoice with two different Invoice Numbers like 123-A & 123-B
Please guide.
Regards,Hi Jeyakanthan,
Thanks for the reply.
I have gone thru the "Multiple Goods Receipts for a Single Excise Invoice " in Sap Help Documentation, what I have understood is that we can do multiple Goods Receipt against a Single Invoice. Here in this case we do the Goods Receipt against Purchase Order , do the Invoice Capture for first goods receipt againts Purchase Order and we enter the Invoice Number (say 745, sent by the Vendor) while capturing excise invoice. When the second shipment (against the same PO) comes, we do goods receipt and we refer the "Only Refer Excise Invoice" while doing the goods receipt. Finally after when we have entered all the shipments for the PO, we do the Excise Posting.
Here in our case we have already posted the Goods Receipt (without entering the Invoice Number in first goods receipt) and now we want to capture & post excise invoice for a Single Excise Invoice (Invoice No. say 745,).
Please correct me if my understanding is wrong.
Here we have got two options:
a. Reverse all the goods receipt & re-enter the goods receipt .
b. post two separate excise invoice against each goods receipt mentioning dummy excise invoice number like 745-A & 745-B.
Option a seems difficulty as we will have to reverse all the subsequent goods receipt & transfer posting documents.
Option b seems legally wrong, as per understanding.
Request you to please advise.
Regards
PK -
Single invoice against multiple sales order for a single customer PO
Hi all,
Customer provide a single order via EDI per Depot. When the order is received into SAP these are split into multiple order based on the Production or distrubtion location of the products. The customer will receive a number of deliveries to the depot from the various locations. Each delivery has his own SAP sales order and delivery note. This creates mutliple invoice against a single Purchase order sent by the customer.
We have a requirement from two customers that they only wish to receive a single invoice per depot per day. This means we need to change the way we currently invoice the customers(no multiple invoices needed).We need to be able to combine multiple deliveries with the same PO to a single invoice. This would mean that the invoice can't be generated until all the deliveries relating to the single PO have been POD flagged or 7 days have passed from PO date and invoicing is due.
how to achieve the above,whether through user exit in billing or data transfer routine in copy control(delivery to billing) or through config and how ??
regards
sachinHi Sachin,
You will have to create a new data transfer requirement on the copy control between the delivery and the invoice. In the new data transfer requirement, you will need a programmer to code when there should be an invoice split.
Regards,
Finbarr -
Import GL opening balance,AR and AP aging with each open invoice data
We tried to use Data Transfer Workbench to import GL opening balance back to 2007 year end but got an error "can not post to Control Account".
In Admin>Sys Init> Opening Balances> GL opening, Businesss Partner, 1099 opening balance can import all opening balance with AR, AP. But, can not import for each open invoice amount, invoice number, invoice date information.
If we entered those GL, AR, AP opening balance those won't affect the GL F/S, right?
We will need to close year 2007 then import each period Trial Balance Debit and Credit amount for each account then close each period to have all 2008 each account period data until May 2009.
Would like to know which is the best way to do this?
Edited by: Lily Chien on Jun 4, 2009 11:21 PMHi,
Please, use oInvoice and oPurchaseInvoice templates (as service type and offset account is opening balance account) to import opening balance. This don't affect to inventory, P/L account.
Hope this helps,
Son. -
How can i import Customer/Vendor Opening Balances - Invoice wise
I am going on a parallel run from next week onwards and the Client want to import all Customer/Vendor Opening Balances invoice wise , so that they can get the Aging Analysis report the no of days Outstanding as well as they can enter payment invoice wise.
Sanjay,
To import BP Opening Invoices or Credit Memo's,
Use the template inside DTW folder
\Templates\oInvoices for AR Invoices
\Templates\oPurchaseInvoices for AP Invoices
and so on
I presume you would want to import them as Service Invoice so
In the Document template
Set
DocNum....................................DocType......................HandWritten
original Invoice number...............dDocument_Service..............tYes
Document_lines
AccountCode
Opening Balance Account Code (Opening Balance Account is generally created in the Equity drawer and is used purely for all Opening trasactions and will balance out to zero (0) once all opening data from legacy system has been brought over)
Let me know if you need further direction
Suda -
A/R invoice was closed even there are open balance
Hi,
I had a situation here.
An invoice with amount due of US 1,000.
Create an incoming payment > payment mean > cash paid US 600,
The incoming payment indicate an open balance of US -400.
However, when I check back the invoice, the status is closed and the applied amount is US 1,000, the balance due is 0.
Isn't the balance due should be 400?
I cannot find the invoice in the incoming payments anymore
ThanksHi,
For example, you want to receive partial payment from customer and AR invoice amount is 200.
1. Open incoming payment window
2. select customer code
3. List of AR invoice will appear.
4. Select that invoice to be paid partially and change amount in "Total payment" column. For example 200 to 100.
5. Choose payment means and add amount 100.
6. After adding payment, check AR invoice status, sure it will show open status with applied amount and balance amount.
If do not change total payment column, balance amount will posted to payment of account and AR invoice will be closed.
Thanks & Regards,
Nagarajan -
FF68 - Manual Check Deposit - entering multiple invoices against one check
We are requiring the functionality to enter multiple invoice numbers into the layout against one customer and one check payment to then allow these to be cleared as part of the batch processing.
Currently it only appears to allow you to enter one invoice number per check payment or post on account to the customer and clear as a second manual step.
Has anyone implemented the multiple invoice clearing from one check within FF68?Hi Sonia
Was BDC session generated on processing FF68?
Auro
Maybe you are looking for
-
when I open a music file from a source other than apple, does itunes create it's own file and can I then delete the original mp3?
-
How to determine the field size
I am going to make a multiplatform application that hopefully will run on linux and windows 2000.If the os is 2000, then I will use vb.net/aspx else I'll use java servlets. I make the connection to the web server ( through HTTP) not directly to datab
-
Two-page spread for non-Apple printed book
This is probably going to sound complicated: I'm in a small program, and we want to create a yearbook, which we decided to do ourselves since there's so few of us. The book will have pages of events and groups, of course, but also "profile pages" whe
-
Bookmarks from structure - limit on length of text?
I am trying to create bookmarks from structure when converting a WORD 2007 document to pdf. The WORD doc contains headings in Heading 1 format. The first part of this heading appears OK in the bookmark but it is truncated i.e. only the first few d
-
Application deployment to jboss 5.1.0 GA
Hi all, I have deployed my application developed in jdev 11gR1 to jboss 5.1.0 ga I have started the jboss server in default mode i have copied the listed jars to the default/lib folder adflibfilter.jar adflogginghandler.jar adfm.jar adf-share-base.ja