FBL1N issue......
Hi,
I am having issue with downloading of data from FBL1N and also from some other reports where i am saving data in Excel to desktop and then it is appearing as blank when i am opening that excel.
But same file if i open from other computer, then it is reflecting the output. But in my system file is appearing as blank.
Do we need to do any setting in sap.
Could anybody suggest on this.
Regards......
Hello,
Open Excel Sheet in your Computer.
Then
Tools ==> Macro ==> Security
Security Level ==> Medium
Trusted Publishers Tab:
Make Sure you have ticked both the check boxes.
a) Trust all installed add-ins and templates
b) Trust access to Visual Basic Project.
The come out and test it and should work.
Thanks,
Ravi
Similar Messages
-
FBL1N Issue (Sap Guru back with a bang)
Hi Frends,
I configured Payment Request,,,where the system will automatically run the payment run(F111) and clear the vendor.
In my case,,,i created payment request and it generated the payment run successful.But it is posting to two bank clearing accounts.so in FBL1N it is showing as open items.i want to make it as green(cleared),,,
what is the solution for this...
Thanks
Sap GuruThe clearing should be done when receiving the confirmation of the bank in the bank statement. If you have a process for Electronic Bank Statement, it should be able to clear the accounts automaticaly.
-
Performance Issue For Opening And Closing Balance In FBL1N/3N/5N
Dear experts,
I Am Having Requirement to Bring Opening And Closing Balance In FBL1N, FBL3N, FBL5N.
For This requirement I Used BADI : FI_ITEMS_CH_DATA~CHANGE_ITEMS, below is my Code For FBL1N, And I've Done the same For 3N/5N...With Related BAPI
* IF SY-TCODE = 'FBL1N'.
* LOOP AT ct_items INTO gs_items.
* CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
* EXPORTING
* date = gs_items-budat
* days = '01'
* months = '00'
* signum = '-'
* years = '00'
* IMPORTING
* calc_date = lv_date.
* CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'
* EXPORTING
* companycode = gs_items-bukrs
* vendor = gs_items-konto
* keydate = lv_date
** BALANCESPGLI = ' '
** NOTEDITEMS = ' '
** IMPORTING
** RETURN =
* TABLES
* keybalance = lv_obal.
* CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE'
* EXPORTING
* companycode = gs_items-bukrs
* vendor = gs_items-konto
* keydate = gs_items-budat
** BALANCESPGLI = ' '
** NOTEDITEMS = ' '
** IMPORTING
** RETURN =
* TABLES
* keybalance = lv_cbal
* READ TABLE lv_cbal INTO gs_cbal INDEX 1.
* gs_items-cbal = gs_cbal-lc_bal.
* READ TABLE lv_obal INTO gs_obal INDEX 1.
* gs_items-obal = gs_obal-lc_bal.
* MODIFY ct_items FROM gs_items TRANSPORTING obal cbal.
* CLEAR: gs_items,gs_obal,gs_cbal.
* ENDLOOP.
* ENDIF.
So, Above Code Causing Me the Performance Issue, Kindly Suggest Me the Solution..
Regards,
uday.Hi Uday,
I am sending you the code i used for the creation a Zreport based on FBL5N. Please check if it can of any help.
*& Report ZFBL5N *
REPORT zfbl5n_new .
TABLES : bsid,knc1,lfc1.
TYPE-POOLS: slis.
TYPES: BEGIN OF ty_bsid,
bukrs TYPE bsid-bukrs,
kunnr TYPE bsid-kunnr,
belnr TYPE bsid-belnr,
buzei TYPE bsid-buzei,
bldat TYPE bsid-bldat,
blart TYPE bsid-blart,
bschl TYPE bsid-bschl,
shkzg TYPE bsid-shkzg,
dmbtr TYPE bsid-dmbtr,
augdt TYPE bsid-augdt,
augbl TYPE bsid-augbl,
zuonr TYPE bsid-zuonr,
sgtxt TYPE bsid-sgtxt,
zfbdt TYPE bsid-zfbdt,
zterm TYPE bsid-zterm,
zbd1t TYPE bsid-zbd1t,
zbd2t TYPE bsid-zbd2t,
zbd3t TYPE bsid-zbd3t,
kkber TYPE bsid-kkber,
bstat TYPE bsid-bstat,
umskz TYPE bsid-umskz,
END OF ty_bsid.
TYPES: BEGIN OF ty_bsik,
bukrs TYPE bsik-bukrs,
lifnr TYPE bsik-lifnr,
belnr TYPE bsik-belnr,
buzei TYPE bsik-buzei,
bldat TYPE bsik-bldat,
blart TYPE bsik-blart,
bschl TYPE bsik-bschl,
shkzg TYPE bsik-shkzg,
dmbtr TYPE bsik-dmbtr,
augdt TYPE bsik-augdt,
augbl TYPE bsik-augbl,
zuonr TYPE bsik-zuonr,
sgtxt TYPE bsik-sgtxt,
zfbdt TYPE bsik-zfbdt,
* KKBER TYPE bsik-kkber,
zterm TYPE bsik-zterm,
zbd1t TYPE bsik-zbd1t,
zbd2t TYPE bsik-zbd2t,
zbd3t TYPE bsik-zbd3t,
bstat TYPE bsid-bstat,
umskz TYPE bsid-umskz,
END OF ty_bsik.
TYPES: BEGIN OF ty_final,
belnr TYPE bsid-belnr,
* buzei TYPE bsak-buzei,
bldat TYPE bsid-bldat,
blart TYPE bsid-blart,
chq TYPE bsid-zuonr,
debit TYPE bsid-dmbtr,
credit TYPE bsid-dmbtr,
txt TYPE bsid-sgtxt,
date TYPE bsid-zfbdt,
kkber TYPE bsid-kkber,
zterm TYPE bsid-zterm,
augbl TYPE bsid-augbl,
augdt TYPE bsid-augdt,
flag TYPE c,
END OF ty_final.
TYPES : BEGIN OF gs_openbal,
bukrs TYPE bapi3007_2-comp_code,
kunnr TYPE bapi3007_2-customer,
dmbtr TYPE bapi3007_2-lc_amount,
END OF gs_openbal.
DATA: it_bsid TYPE STANDARD TABLE OF ty_bsid,
it_bsik TYPE STANDARD TABLE OF ty_bsik,
it_final TYPE STANDARD TABLE OF ty_final.
DATA: wa_bsid TYPE ty_bsid,
wa_bsik TYPE ty_bsik,
wa_final TYPE ty_final.
DATA: w_days TYPE t5a4a-dlydy,
w_month TYPE t5a4a-dlymo,
w_year TYPE t5a4a-dlyyr,
w_date TYPE p0001-begda,
w_name1 TYPE kna1-name1,
w_ort01 TYPE kna1-ort01,
w_lifnr TYPE kna1-lifnr,
w_dmbtr1 TYPE bsid-dmbtr,
w_dmbtr2 TYPE bsid-dmbtr,
w_dmbtr3 TYPE bsad-dmbtr,
w_dmbtr4 TYPE bsad-dmbtr,
w_opbal TYPE bsid-dmbtr,
w_credit TYPE bsik-dmbtr,
w_debit TYPE bsik-dmbtr,
w_clobal TYPE bsik-dmbtr,
w_credit1 TYPE bsik-dmbtr,
w_debit1 TYPE bsik-dmbtr,
w_clobal1 TYPE bsik-dmbtr.
DATA: ld_yrper LIKE rwcoom-fiscper,
kunnr LIKE kna1-kunnr,
x_norm TYPE c,
x_park,
x_apar,
x_merk,
ok_code(4),
wa_x001 LIKE x001,
return LIKE bapireturn,
line_count LIKE sy-loopc,
number_of_records TYPE i,
xindex LIKE sy-tabix,
open LIKE knc1-um01s,
temp(20),
close LIKE knc1-um01s,
gjahr LIKE bsid-gjahr,
period LIKE bkpf-monat,
f(1),
v_char(2),
closec(20),
openc(20),
debit LIKE bapi3007_2-lc_amount,
credit LIKE debit.
DATA : v_dmbtr LIKE bsid-dmbtr.
*DATA : tot_debit LIKE t_ar-debit,
* tot_credit LIKE t_ar-credit.
DATA : t_kna1 LIKE kna1 OCCURS 1 WITH HEADER LINE,
t_knb1 LIKE knb1 OCCURS 10 WITH HEADER LINE.
DATA ibsid LIKE bsid OCCURS 0 WITH HEADER LINE.
DATA ibsad LIKE bsad OCCURS 0 WITH HEADER LINE.
DATA ibsik LIKE bsik OCCURS 0 WITH HEADER LINE.
DATA ibsak LIKE bsak OCCURS 0 WITH HEADER LINE.
DATA : it_fieldcat_alv TYPE slis_t_fieldcat_alv,
wa_fieldcat_alv TYPE slis_fieldcat_alv,
is_layout_alv TYPE slis_layout_alv,
wa_layout_alv TYPE slis_layout_alv,
it_list_top_of_page TYPE slis_t_listheader,
it_events TYPE slis_t_event,
wa_events TYPE LINE OF slis_t_event.
DATA : BEGIN OF ibukrs OCCURS 0,
bukrs LIKE t001-bukrs,
END OF ibukrs.
DATA : BEGIN OF ikunnr1 OCCURS 0,
kunnr LIKE knc1-kunnr,
END OF ikunnr1.
DATA : BEGIN OF ikunnr OCCURS 0,
kunnr LIKE knc1-kunnr,
bukrs LIKE t001-bukrs,
lifnr LIKE lfc1-lifnr,
END OF ikunnr.
DATA: it_sort TYPE slis_t_sortinfo_alv,
wa_sort TYPE slis_sortinfo_alv.
DATA: r_bschl TYPE RANGE OF bschl,
wa_bschl LIKE LINE OF r_bschl.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS : p_kunnr TYPE bsid-kunnr OBLIGATORY,
p_bukrs TYPE bsid-bukrs OBLIGATORY.
SELECT-OPTIONS: so_budat FOR bsid-budat .
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS : p_normal AS CHECKBOX,
p_spl AS CHECKBOX,
p_vendor AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK b2.
PERFORM get_data.
PERFORM process_data.
*PERFORM calculate_openbal. " Commented by anish
PERFORM calculate_open_bal.
PERFORM calculate_closing_bal.
PERFORM build_catalog_sort USING it_sort.
PERFORM reuse_alv_events_get .
PERFORM display_data.
*& Form GET_DATA
* text
* --> p1 text
* <-- p2 text
FORM get_data .
SELECT bukrs kunnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t kkber
bstat umskz FROM bsid
INTO TABLE it_bsid
WHERE bukrs = p_bukrs
AND kunnr = p_kunnr
AND budat IN so_budat.
SELECT bukrs kunnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t kkber
bstat umskz FROM bsad
APPENDING TABLE it_bsid
WHERE bukrs = p_bukrs
AND kunnr = p_kunnr
AND budat IN so_budat.
SELECT SINGLE name1 ort01 lifnr FROM kna1
INTO (w_name1 , w_ort01 , w_lifnr)
WHERE kunnr = p_kunnr.
IF p_vendor IS NOT INITIAL.
SELECT bukrs lifnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t
bstat umskz FROM bsik
APPENDING TABLE it_bsik
WHERE bukrs = p_bukrs
AND lifnr = w_lifnr
AND budat IN so_budat.
SELECT bukrs lifnr belnr buzei bldat blart bschl shkzg dmbtr augdt augbl zuonr sgtxt zfbdt zterm zbd1t zbd2t zbd3t
bstat umskz FROM bsak
APPENDING TABLE it_bsik
WHERE bukrs = p_bukrs
AND lifnr = w_lifnr
AND budat IN so_budat.
ENDIF.
SORT it_bsid BY bschl.
DELETE it_bsid WHERE bschl = '04'.
DELETE it_bsid WHERE bschl = '07'.
DELETE it_bsid WHERE bschl = '17'.
DELETE it_bsid WHERE bschl = '34'.
DELETE it_bsid WHERE bschl = '27'.
DELETE it_bsid WHERE bschl = '37'.
SORT it_bsik BY bschl.
DELETE it_bsik WHERE bschl = '04'.
DELETE it_bsik WHERE bschl = '07'.
DELETE it_bsik WHERE bschl = '17'.
DELETE it_bsik WHERE bschl = '34'.
DELETE it_bsik WHERE bschl = '27'.
DELETE it_bsik WHERE bschl = '37'.
ENDFORM. " GET_DATA
*& Form PROCESS_DATA
* text
* --> p1 text
* <-- p2 text
FORM process_data .
DATA:okay TYPE c VALUE space.
w_month = '00'.
w_year = '00'.
SORT it_bsid BY bldat .
LOOP AT it_bsid INTO wa_bsid.
PERFORM check_item_ok USING p_normal
p_spl
p_vendor
* x_park
wa_bsid
CHANGING okay.
CHECK okay = 'X'.
wa_final-belnr = wa_bsid-belnr.
wa_final-bldat = wa_bsid-bldat.
wa_final-blart = wa_bsid-blart.
wa_final-txt = wa_bsid-sgtxt.
wa_final-kkber = wa_bsid-kkber.
wa_final-zterm = wa_bsid-zterm.
wa_final-augbl = wa_bsid-augbl.
wa_final-augdt = wa_bsid-augdt.
wa_final-flag = 'C'.
IF wa_bsid-blart = 'DZ'.
wa_final-chq = wa_bsid-zuonr.
ENDIF.
IF wa_bsid-shkzg = 'S'.
wa_final-debit = wa_bsid-dmbtr.
ELSEIF wa_bsid-shkzg = 'H'.
wa_final-credit = wa_bsid-dmbtr.
ENDIF.
w_credit = w_credit + wa_final-credit.
w_debit = w_debit + wa_final-debit.
****** Net due date
IF wa_bsid-zbd1t IS NOT INITIAL.
w_days = wa_bsid-zbd1t.
ELSEIF wa_bsid-zbd2t IS NOT INITIAL.
w_days = wa_bsid-zbd2t.
ELSEIF wa_bsid-zbd3t IS NOT INITIAL.
w_days = wa_bsid-zbd3t.
ENDIF.
IF w_days IS INITIAL.
wa_final-date = wa_bsid-zfbdt.
ELSE.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = wa_bsid-zfbdt
days = w_days
months = w_month
signum = '+'
years = w_year
IMPORTING
calc_date = w_date.
wa_final-date = w_date.
ENDIF.
APPEND wa_final TO it_final.
CLEAR: w_days , w_date , wa_final .
ENDLOOP.
IF it_bsik IS NOT INITIAL.
CLEAR: w_days , w_date.
SORT it_bsik BY bldat.
LOOP AT it_bsik INTO wa_bsik.
wa_final-belnr = wa_bsik-belnr.
wa_final-bldat = wa_bsik-bldat.
wa_final-blart = wa_bsik-blart.
wa_final-txt = wa_bsik-sgtxt.
* wa_final-kkber = wa_bsik-kkber.
wa_final-zterm = wa_bsik-zterm.
wa_final-augbl = wa_bsik-augbl.
wa_final-augdt = wa_bsik-augdt.
wa_final-flag = 'V'.
IF wa_bsik-blart = 'DZ'.
wa_final-chq = wa_bsik-zuonr.
ENDIF.
IF wa_bsik-shkzg = 'S'.
wa_final-debit = wa_bsik-dmbtr.
ELSEIF wa_bsik-shkzg = 'H'.
wa_final-credit = wa_bsik-dmbtr.
ENDIF.
w_credit1 = w_credit1 + wa_final-credit.
w_debit1 = w_debit1 + wa_final-debit.
******* Net Due date
IF wa_bsik-zbd1t IS NOT INITIAL.
w_days = wa_bsik-zbd1t.
ELSEIF wa_bsik-zbd2t IS NOT INITIAL.
w_days = wa_bsik-zbd2t.
ELSEIF wa_bsik-zbd3t IS NOT INITIAL.
w_days = wa_bsik-zbd3t.
ENDIF.
IF w_days IS INITIAL.
wa_final-date = wa_bsik-zfbdt.
ELSE.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = wa_bsik-zfbdt
days = w_days
months = w_month
signum = '+'
years = w_year
IMPORTING
calc_date = w_date.
ENDIF.
wa_final-date = w_date.
APPEND wa_final TO it_final.
CLEAR: wa_final.
ENDLOOP.
ENDIF.
ENDFORM. " PROCESS_DATA
*& Form DISPLAY_DATA
* text
* --> p1 text
* <-- p2 text
FORM display_data .
wa_fieldcat_alv-fieldname = 'BELNR'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-003.
wa_fieldcat_alv-outputlen = '11'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'BLDAT'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-004.
wa_fieldcat_alv-outputlen = '13'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'BLART'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-005.
wa_fieldcat_alv-outputlen = '02'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'CHQ'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-006.
wa_fieldcat_alv-outputlen = '09'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'DEBIT'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-007.
wa_fieldcat_alv-outputlen = '15'.
wa_fieldcat_alv-do_sum = 'X'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'CREDIT'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-008.
wa_fieldcat_alv-outputlen = '15'.
wa_fieldcat_alv-do_sum = 'X'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'TXT'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-009.
wa_fieldcat_alv-outputlen = '50'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'DATE'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-010.
wa_fieldcat_alv-outputlen = '12'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'KKBER'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-011.
wa_fieldcat_alv-outputlen = '04'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'ZTERM'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-012.
wa_fieldcat_alv-outputlen = '13'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'AUGBL'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-013.
wa_fieldcat_alv-outputlen = '15'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'AUGDT'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-seltext_l = text-014.
wa_fieldcat_alv-outputlen = '17'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
wa_fieldcat_alv-fieldname = 'FLAG'.
wa_fieldcat_alv-tabname = 'IT_FINAL'.
wa_fieldcat_alv-tech = 'X'.
APPEND wa_fieldcat_alv TO it_fieldcat_alv.
CLEAR wa_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = wa_layout_alv
it_fieldcat = it_fieldcat_alv
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
it_sort = it_sort
it_events = it_events
i_save = 'A'
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
* EXPORTING
* i_callback_program = sy-repid
* i_callback_top_of_page = 'TOP_OF_PAGE'
* is_layout = wa_layout_alv
* it_fieldcat = it_fieldcat_alv
* it_sort = it_sort
*** I_DEFAULT = 'X'
** i_save = 'A'
*** IT_EVENTS =
* TABLES
* t_outtab = it_final
* EXCEPTIONS
* program_error = 1
* OTHERS = 2
* IF sy-subrc <> 0.
*** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
ENDFORM. " DISPLAY_DATA
*& Form TOP_OF_PAGE
* Header at top of page.
FORM top_of_page.
SKIP 1.
WRITE: AT 35 'Account Statement from' , so_budat-low , 'to' , so_budat-high.
SKIP 2.
WRITE: AT /5 'CUSTOMER:' , p_kunnr.
WRITE: AT 35 'Name:' , w_name1.
WRITE: AT /5 'Company:' , p_bukrs.
WRITE: AT 35 'City:' , w_ort01.
SKIP 1.
WRITE: AT /5 'Opening Balance as on' , so_budat-low , ' ' , w_opbal LEFT-JUSTIFIED.
SKIP 2.
ENDFORM. "TOP_OF_PAGE
*& Form END_OF_PAGE
* Footer at End of page.
FORM end_of_page.
SKIP 2.
IF so_budat-high IS NOT INITIAL.
WRITE: AT 5 'Closing Balance as on' , so_budat-high , ' ' , w_clobal LEFT-JUSTIFIED.
ELSE.
WRITE: AT 5 'Closing Balance ' , w_clobal LEFT-JUSTIFIED.
ENDIF.
ENDFORM. "end_of_page
*& Form CALCULATE_OPENBAL
* text
* --> p1 text
* <-- p2 text
FORM calculate_openbal .
DATA:v_gjahr TYPE bsid-gjahr.
DATA: v_period LIKE t009b-poper,v_monat LIKE t001-periv.
CALL FUNCTION 'FI_PERIOD_DETERMINE'
EXPORTING
i_budat = so_budat-low
i_bukrs = p_bukrs
* I_PERIV = ' '
* I_GJAHR = 0000
* I_MONAT = 00
* X_XMO16 = ' '
IMPORTING
e_gjahr = v_gjahr
* e_monat = v_monat
e_poper = v_period.
IF sy-subrc NE 0.
ENDIF.
DATA: f_date LIKE sy-datum.
CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
EXPORTING
i_gjahr = v_gjahr
i_monmit = 00
i_periv = 'V3'
i_poper = v_period
IMPORTING
e_date = f_date.
period = v_period - 1.
gjahr = v_gjahr.
DATA wa_kna1 LIKE kna1.
CALL FUNCTION 'READ_KNA1'
EXPORTING
xkunnr = p_kunnr
IMPORTING
xkna1 = wa_kna1
EXCEPTIONS
key_incomplete = 1
not_authorized = 2
not_found = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE w023(zwww).
CALL SCREEN 0010.
ENDIF.
MOVE-CORRESPONDING wa_kna1 TO t_kna1.
APPEND t_kna1.
SELECT kunnr FROM kna1 INTO TABLE ikunnr1
WHERE kunnr = p_kunnr.
SELECT bukrs FROM t001 INTO TABLE ibukrs
FOR ALL ENTRIES IN t_knb1
WHERE bukrs = t_knb1-bukrs.
LOOP AT ikunnr1.
LOOP AT ibukrs.
ikunnr-kunnr = ikunnr1-kunnr.
ikunnr-bukrs = ibukrs-bukrs.
READ TABLE t_kna1 WITH KEY kunnr = ikunnr1-kunnr.
ikunnr-lifnr = t_kna1-lifnr.
APPEND ikunnr.
ENDLOOP.
ENDLOOP.
DELETE ikunnr WHERE bukrs NE p_bukrs.
LOOP AT ikunnr.
CLEAR: knc1,lfc1,f.
IF NOT ( ikunnr-kunnr IS INITIAL ) AND NOT ( p_vendor IS INITIAL ).
SELECT SINGLE * FROM lfc1
WHERE gjahr = gjahr AND bukrs = ikunnr-bukrs
AND lifnr = ikunnr-lifnr.
ENDIF.
SELECT SINGLE * FROM knc1
WHERE gjahr = gjahr AND bukrs = p_bukrs
AND kunnr = p_kunnr.
IF sy-subrc = 0.
CASE period .
WHEN 12.
open = knc1-umsav +
knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h +
knc1-um11s - knc1-um11h + knc1-um12s - knc1-um12h.
IF NOT ( lfc1 IS INITIAL ).
open = open + lfc1-umsav +
lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h +
lfc1-um11s - lfc1-um11h + lfc1-um12s - lfc1-um12h.
ENDIF.
WHEN 11.
open = knc1-umsav +
knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h +
knc1-um11s - knc1-um11h.
IF NOT ( lfc1 IS INITIAL ) .
open = open + lfc1-umsav +
lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h +
lfc1-um11s - lfc1-um11h.
ENDIF.
WHEN 10.
open = knc1-umsav +
knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
knc1-um09s - knc1-um09h + knc1-um10s - knc1-um10h .
IF NOT ( lfc1 IS INITIAL ) .
open = open + lfc1-umsav +
lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
lfc1-um09s - lfc1-um09h + lfc1-um10s - lfc1-um10h.
ENDIF.
WHEN 9.
open = knc1-umsav +
knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h +
knc1-um09s - knc1-um09h .
IF NOT ( lfc1 IS INITIAL ) .
open = open + lfc1-umsav +
lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h +
lfc1-um09s - lfc1-um09h.
ENDIF.
WHEN 8.
open = knc1-umsav +
knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
knc1-um07s - knc1-um07h + knc1-um08s - knc1-um08h.
IF NOT ( lfc1 IS INITIAL ) .
open = open + lfc1-umsav +
lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
lfc1-um05s - lfc1-um05h + lfc1-um06s - lfc1-um06h +
lfc1-um07s - lfc1-um07h + lfc1-um08s - lfc1-um08h .
ENDIF.
WHEN 7.
open = knc1-umsav +
knc1-um01s - knc1-um01h + knc1-um02s - knc1-um02h +
knc1-um03s - knc1-um03h + knc1-um04s - knc1-um04h +
knc1-um05s - knc1-um05h + knc1-um06s - knc1-um06h +
knc1-um07s - knc1-um07h .
IF NOT ( lfc1 IS INITIAL ) .
open = open + lfc1-umsav +
lfc1-um01s - lfc1-um01h + lfc1-um02s - lfc1-um02h +
lfc1-um03s - lfc1-um03h + lfc1-um04s - lfc1-um04h +
lfc1-um05s - lfc1-um -
Issue in Printing of FBL1N ( Line Item Display)
Hi,
I have an issue with the printing of the report FBL1N...
When I execute the report with the Standard Layout "1SAP". The dispaly on the screen is correct. But when I tried print the output the display on the print out, excludes the Last Line item of the report & the Total's coloumn.
But when I try to Print the Formats Created by User's the Output is coming accurately
Can any one please inform me, what could be the issue, I tried printing of differnent printers, but the output is the same, also i tried adjusting the Rows & columns in Print Settings
Regards
Ash KHi,
When you print the report, try printing with some other printing layout like X_65_255.
I hope this will help you.
Regards,
Niraj -
Issue: - FBL1N - is showing wrong values
Issue: - FBL1N - is showing wrong values
Hi SAP experts,
We are executing T Code FBL1N and selecting all open enteries, and select all items like special normal items, G/L Transaction, noted items, parked items and customer items, we found that the balance is showing wrong for intercompany vendors.
For Ex, if vendor is not created in company Code A and customer items are available in Company Code A then that items are coming for some line items and for some line items it is not?
I have attached one example for the same. for all vendors data is coming properly but for indivisual vendor is it not.
Please suggest why?
Regards,
VijayExample :
Vendor number 99 ans for the same customer nO is C12 is created in company code ABC but vendor is not created and customer C12 is in PQR, now i am executing fbl1n for Company Code PQR for open item selecting all options like normal items, special G/L transaction, customer items noted items and parked items, the line items related to Vendor number 99 for company Code PQR should not display, as vendor is not created but customer items are there, please let me know for some cases it is showing result and in same cases it is not why?
Regards,
Vijay -
Reset Cleared Documents and Vendor Open Items Report FBL1N
Hi all,
I have following scenario:
- In last month, we had 2 documents (invoice and payment) cleared against each other. We created open items report as well as open items correspondence sent to Vendor. Obviously, the docs were not included in report.
- In this month, we have reset and reverse clearing document of the documents. We create report again with the open key date as in last month. It should not include the 2 docs but it did with whichever key date we chose.
Is there any setting that open item report doesn't include cleared item at the key date when we run report for previous month?
Thanks and Regards,
DauHi Dau,
If i understand you correctly then you posted and paid invoice in Jan 2012 and generated the open line item report for Jan which correctly did not include this cleared invoice.
Now in Feb 2012 you reset and reversed this payment document.
The issue is when you execute the report FBL1N again then you get the open line item for this invoice correct. Please confirm what is the open item key date that you are using here for generating this report
If you keep it 31.01.2012 then definetly this invoice should not appear in the report but if you keep that 29.12.2012 then this line item would for sure appear.
The importance of key date is to limit the report to certain date. The system selects all items posted up to and including the specified key date and open for this period.
so I think your issue is with the key date.
Hope this helps you.
Regards,
Prasad -
Issue in Vendor A/c clearing
Hi
We have an issue in which we have paid some advance to vendor in EURO at a certain rate say 1 EURO = 1.25 USD. Now at the same rate we have booked the vendor invoice in USD because the bills from vendor have come in USD. Thus both the down payment and invoice are shown of same value in INR when we view the items in FBL1N. But when we try to clear the vendor account the system is picking the rate maintained in exchange rate table, thus showing a difference in invoice amount in INR. How can we clear the open advance in EURO against the vendor invoice in USD, when actually there is no change of rate?
Pls help
Regards
RahulThere is some config info that would be required before giving out a solution. What is your local curr., group curr., and which one is the doc curr?
Assuming EUR is your local curr., and USD is your doc curr (foreign curr.), then the indicator in company code global parameters (Indicator: No ex.rate difference when clearing in local crcy) t.code OBY6 should help. This indicator states that when items in foreign currency are cleared in local currency, the local currency amount stored in the document is used as the amount to be cleared, irrespective of the actual exchange rate prevailing at the time of the clearing.
However, if the above assumption is incorrect, the above solution might not work.
Please remember to assign points if found useful.
Regards,
Gulshan -
Hi Experts,
We have set up the payment request settings (Spl. GL indicator u2018Pu2019) in D01. We made a payment against a MIRO invoice & paid through APP (Automatic payment program). However when try to clear the payment with the vendor invoice using F-44, those two lines are not getting displayed whereas those lines are shown as open items in FBL1N.
Could you also try and help us understand what could have been the reason?
Regards
AravindHi Experts,
We made the payment for this invoice through a payment request (f-59).
Now that we already made the payment, we want to clear the invoice and the payment (two lines shown in the screen image which I hv sent).
We donu2019t want to pay the invoice now. There is no issue with APP
Regards
Aravind -
Vendor open item clearing issue
Hi sap gurus,
i have a very urgent issue that;
when we take the report fbl1n we see two open item for a spesific vendor;
1- 100 usd (debit)
2- 100 usd (credit)
however when we try to clear these two open items from t.code f-44 which clear each other the system says "no open item found"
i checked from table BSIK and see that there are two open item. fbl1n report shows two open item, but why i cannot clear it from f-44?
this is very interesting to me!
thx for your help.i have solved the problem,
the open items were in payment list in F110.
we deleted payment list and the problem has been solved. -
Clear from Vendor open line item (FBL1N).
Dear,
I have Posted the Invoice and cancelled the same invoice which was in the Blocked status without Release.So its showing in Vendor open line item (FBL1N).
Now we can not release these two docs in MRBR bcz the invoice was cancelled and also it can not be cleared in F.13 bcz which was blocked for paymentu2026
Kindly help me how can i solve this issue and my user is askinig me to clear the same from the vendor line items.
Also suggest how the same will affect the business impact.
regards,
Kannan BPl post it in ERP Financials,to get faster replies SAP ERP Financials
-
Line items are not showing in fbl1n/fk10n
hello all,
Again i needs your help. this time i am not able to see the line items in fbl1n and fk10n. system shows 360 line items are displayed but no line item are showing in screen.In fk10n i am just able to see the period wise balance. but line item not showing. this issue is only with my 5 vendor. in case of other vendor, i am able to see as i wish.
please suggest me how to solve it.
regards
konishkoHi,
check the Reconciliation of that vendor.for that recon account line display should be selected.
For other vendors, reconciliation account is with line item display .selected. That might be the reason to show line items for remaining items.
check GL master of Recon acccount. -
Hi,
We have created a payment run 1a for a range o vendors 1 - 200 scheduled the payment run, vendor no 10 was included. Then 10 mins later scheduled another payment run for vendor number 10 only the payment run was scheduled. Now the issue is for both payment runs the backgorund jobs are still running after 4 hours!
In FBL1n for the vendor 10 invoices have been cleared by both payment runs, which is ok. In SM50 both background jobs I can see they are stuck in program "CL_BCS_EMAIL_ADDRESS==========CP" this is the part of the BTC used to determine the email address of the vendor.
Has anyone come across this issue before?
thanks
JoeHi,
yes, though couldn't figure out the reason, however if you check SP02 in the spool area you will be able to view all the advices.
best regds
Subha -
Unable to view the postings in fb03 or in fbl1n.
Hi All,
I'm facing a issue regarding viewing the posted transactions. I've posted a transaction in f-43( vendor invoice) and saved the document. Document no xxxxxxx has been generated.I'm able to view the current number in OBA7(Document Number Ranges) But when i'm viewing in fbl3n or in Vendor List(FBL1N) it is now showing no document list generated. I've activated document Splitting also .
Can anyone help me regarding this issue.
Thanks and Regards
Naaga SaiDear expert
Solution fot this
For e.g; i've posted a transaction on 23.12.2011 and able to view but when i posting transaction(26.12.2011) from yesterday unable to view.
Check the Related GL account, that GL a/c does have Line item tick under Control tab in FS00.
Due to this reason your not able to drill down line item wise report
Solution:
1. In FS00 select the GL a/c with Line item tick.
2. Block the Respective GL a/c,
3. Go to Transaction Code u2013 SE38 and execute RFSEPA01,Execute give GL.
Finally you have to un block eh GL.
once executed , check the line items from ReportFBL1N or FBL5n
Trough this way u can see all details
Regards
Ajeesh.s -
Issue in creating Credit Note for road carrier invoice from SAP TM system
Dear All,
I am facing issue in creating Credit Note for road carrier invoice from SAP TM system.
The following steps I have performed:
1)
1) 1) Create Freight order with Amount 20,100
2) 2) Create Freight Settlement Doc and send it to ECC. Hence PO and SES will be created in ECC with Amount 20,100
3) 3) Invoice verification (MIRO) done w.r.t. FO in ECC with Amount 20,100 and following entries posted :
Carrier A/c - 20,100Cr
GR/IR A/c – 20,100 Dr
4) 4) Created Credit Note in SAP TM against freight order with Amount 1,010 and transfer it to SAP ECC.
5) 5) By this a new PO and SES was created with negative values (with amount 1,010) in SAP ECC
6) 6) In transaction MIRO, Credit Memo was created against the freight order.
7) 7) By this it is showing value 21,110 by adding the line items of Original Purchase Order and Credit Note Purchase Order as 20,100 and 1,010 respectively.
8) 8) By posting this following are the accounting entries which is not correct:
Carrier A/c – 21,110 Dr
GR/IR – 20,100 Cr
GR/IR – 1,010 Cr
9) 9) In report FBL1N which is showing the remaining liability of value 1,010(21,100 – 20,100) instead of 19,090 (20,100-1,010=19,090) for the carrier.
Please suggest how to resolve the issue and get the correct accounting for credit memo?
Regards,
Vibhu GuptaHello,
Like my reply in Linkedin group, I got the same issue and solved with BADI in TM side(REQREQ...).
Regards, Marcelo Lauria -
Business area is not appearing in the FBL1N
Hello Experts,
Please give me your valuable suggestions for below issue.
Business area is not appearing for few transactions for particular vendor in TC: FBL1N, We are using Ecc 6.0. Please advice.
Thanks,
Ratnam VPlease review note 549182 FAQ: Business Area Accounting
in particular see point 3.
3. Question:
With customer and vendor items, why can you not enter a business area?
Answer:
Open items are assigned to business areas depending on the expense and
revenue items of the invoice.
Because of this dependency, open items can be assigned to several
business areas. Thus the assignment is no longer unique. There is a
function available in the balance sheet adjustment that enables a
subsequent assignment.
With a unique dependency, the business area is copied into the open
items not assigned to a business area during the posting of the
document.
Also consider SAP Note 41294 in this context.
Maybe you are looking for
-
How do I sync game progress between iphone and ipad
I have several "long term progress" games on my iphone 5.I bought an ipad mini and would like to sync the progress of each game on both devises.I have have game game progress erased in the past, possible from incorrect procedure. What is the best wa
-
Linking Contract Master to Work Orders & Materials
Hello, I'm researching the possibility of linking (tying) stock to a Service Order (in a Work Order) and/or Sales Orders before it arrived on the PO. This is for provisioning stock to customers. Is there any possibility that this could be done via Pr
-
I have ran mcafee anti-virus which has not found any viruses. Hope someone can help. Thanks
-
How can I find my in app purchases on my iPad mini?
I Purchased something in a specific app. Asked for my password and asked if I wanted to buy the in app product. I said yes, it said it was purchased and I got nothing! How can I find out if the purchase went through on my iPad or do I just have to wa
-
AP1602I autonomous to lighweight conversion problem
Hi guys, I'm doing migration from autonomous to LWAPP for some 1602i APs. I followed the usual procedure with the recovery image but after downloading and rebooting the AP keeps its ip/gw settings and is neither using the DHCP option 43 nor the DNS e