BSEG X FB03
Hello!
In BSEG the column u201CPlanned amountu201D have value just for credit postings (without the corresponding debit). Is that correct or should it have postings for both Debit and Credit?
Thanks
Hi,
There are credit and debit postngs in my case.
Rgds
Murali. N
Similar Messages
-
Nee help on ALV report for Total of BSEG-BUZEI & F1 document in FB03
Hi friends,
I need to diplay line items total & when double clicked on BELNR field it should open the F1 document in FB03.
Could anyone plz guide me on this.
Waiting for response.
below is my code,
Kindly needed help.
REPORT YALV_1.
TABLES : BKPF,BSEG.
Data for ALV display
TYPE-POOLS: SLIS.
data : int_fcat type SLIS_T_FIELDCAT_ALV,
fieldcatalog type slis_t_fieldcat_alv with header line.
DATA: wa_sortinfo TYPE slis_sortinfo_alv,
i_sortcat TYPE slis_t_sortinfo_alv.
TYPES : BEGIN OF T_BKPF,
BUKRS TYPE BKPF-BUKRS,
BELNR TYPE BKPF-BELNR,
GJAHR TYPE BKPF-GJAHR,
BLART TYPE BKPF-BLART,
BLDAT TYPE BKPF-BLDAT,
BUDAT TYPE BKPF-BUDAT,
END OF T_BKPF.
types: begin of t_bseg,
BUZEI TYPE BSEG-BUZEI,
end of t_bseg.
DATA : it_bkpf TYPE STANDARD TABLE OF t_bkpf with header line,
wa_bkpf TYPE t_bkpf,
it_bseg type standard table of t_bseg.
wa_bseg type t_bseg.
field to store report name
DATA : i_repid like sy-repid.
select bukrs belnr gjahr blart bldat budat from bkpf into table
it_bkpf where blart = 'AA'.
field to check table length
*data i_lines like sy-tabix.
*Start-of-selection.
START-OF-SELECTION.
perform data_retrieval.
perform build_fieldcatalog.
PERFORM sortcat_init CHANGING i_sortcat.
perform display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
form build_fieldcatalog.
There are a number of ways to create a fieldcat.
For the purpose of this example i will build the fieldcatalog manualy
by populating the internal table fields individually and then
appending the rows. This method can be the most time consuming but
*can
also allow you more control of the final product.
Beware though, you need to ensure that all fields required are
populated. When using some of functionality available via ALV, such
*as
total. You may need to provide more information than if you were
simply displaying the result
I.e. Field type may be required in-order for
the 'TOTAL' function to work.
fieldcatalog-fieldname = 'BUKRS'.
fieldcatalog-seltext_m = 'Company Code'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 4.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'BELNR'.
fieldcatalog-seltext_m = 'Doc No'.
fieldcatalog-col_pos = 1.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'GJAHR'.
fieldcatalog-seltext_m = 'Fiscal Year'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'BLART'.
fieldcatalog-seltext_m = 'DOC Type'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'BLDAT'.
fieldcatalog-seltext_m = 'Doc Date'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'BUDAT'.
fieldcatalog-seltext_m = 'Popsting Date'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'BUZEI'.
fieldcatalog-seltext_m = 'Line Items'.
fieldcatalog-col_pos = 6.
fieldcatalog-do_sum = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
FORM sortcat_init CHANGING i_sortcat TYPE slis_t_sortinfo_alv.
CLEAR wa_sortinfo.
wa_sortinfo-fieldname = 'BUKRS'.
wa_sortinfo-tabname = 'T_BKPF'.
wa_sortinfo-spos = 1. " First sort by this field.
wa_sortinfo-up = 'X'. " Ascending
wa_sortinfo-subtot = 'X'. " Subtotal at Name1
APPEND wa_sortinfo TO i_sortcat.
CLEAR wa_sortinfo.
wa_sortinfo-fieldname = 'BELNR'.
wa_sortinfo-tabname = 'T_BKPF'.
wa_sortinfo-spos = 2. " Sec sort by this field.
wa_sortinfo-up = 'X'. " Ascending
wa_sortinfo-subtot = 'X'. " Subtotal at Name1
APPEND wa_sortinfo TO i_sortcat.
ENDFORM. " sortcat_init
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
form display_alv_report.
i_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = i_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_sort = i_sortcat
it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
is_variant = z_template
tables
t_outtab = IT_BKPF
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_ALV_REPORT
*& Form DATA_RETRIEVAL
form data_retrieval.
IF it_bkpf[] IS NOT INITIAL.
select buzei from bseg into
table it_bseg for all entries in it_bkpf
where bukrs = it_bkpf-bukrs
and belnr = it_bkpf-belnr
and gjahr = it_bkpf-gjahr.
endif.
endform. " DATA_RETRIEVAL.Hello
1.
form display_alv_report.
i_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = i_repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = IT_BKPF
exceptions
program_error = 1
others = 2.
2.
* FORM USER_COMMAND
FORM user_command USING u_com LIKE sy-ucomm sel_lin TYPE slis_selfield.
CASE u_com.
WHEN '&IC1'.
CASE sel_lin.
WHEN 'BELNR'.
read TABLE IT_BKPF INDEX sel_lin-tabindex.
SET PARAMETER ID 'BLN' FIELD IT_BKPF-BELNR.
SET PARAMETER ID 'BUK' FIELD IT_BKPF-BUKRS.
SET PARAMETER ID 'GJR' FIELD IT_BKPF-GJAHR.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDCASE.
CLEAR u_com.
ENDCASE.
ENDFORM. "USER_COMMAND -
Adding a BSEG field to the FB03 dynamic selection screen
Hello,
We have a requirement wherein we want to add a field from BSEG in the dynamic selection screen of FB03.
We found that the logical database behind this is BRF. So we created a u2018CUSu2019 selection view for the logical database and added the field from BSEG to the functional group
and checked the checkbox u201CPreselectu201D for it to appear automatically in the FB03 screen.
But we still couldnu2019t see the field in FB03 dynamic selection.
On analysis, we found that only tables are that are defined in the nodes (Extras Selection views) can be used to create the dynamic selection and BSEG was not available
as one of the node. So we added BSEG as one of the node by adding the below code to the SELECTION of the logical database.
SELECTION-SCREEN DYNAMIC SELECTIONS FOR TABLE BSEG.
Even after that, we couldnu2019t see the field from BSEG in the dynamic selection.
Are we missing anything here?
I see many threads here on similar lines but no one has posted the exact step. Any help is highly appreciated.
Thanks a lot.
Regards,
SuganyaHi
If you want to take the line item details than you can refer these t-codes rather than customizing.
S_AC0_52000887 - Receivables: Profit Center
S_AC0_52000888 - Payables: Profit Center
S_ALR_87012332 - G/L Account Statements
Here by using the dynamic selection you can get the results. Use object list display and select the layout for more fields.
Thanks -
FB03 Display document view exclude quantity (BSEG-ERFMG)
Some users have authority t-code FB03 display document.
I want these users should see document overview and line items;
exclude quantity (BSEG-ERFMG) and unit (BSEG-ERFME) fields in GL
accounts.
I mean that these users must have no authority to see quantity and
unit fields in t-code FB03 line items view.
How can I solve this proplem ? Is there a method in SAP ?
Is there any solution in Role maintenance ?
Or what should I do ?
Best regards,Please go through below link for User role and Authorization concept in SAP for your requirement:
http://help.sap.com/saphelp_wp/helpdata/en/52/6714b6439b11d1896f0000e8322d00/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/52/671285439b11d1896f0000e8322d00/content.htm
Regards,
Santosh -
Field WRBTR in FB03 and Table BSEG
Hi,
I am trying to retrieve the amount (field WRBTR)from the table BSEG for the line item . In this table the
amount is shown 2.00
When I go to FB03, i see the amount as 2.00-
Can anyone let me know how should i declare the amount field in my program?
ThanksHi
the amount is always stored with absulte value, the sign is defined by SHKZG (Debit/Credit Indicator).
SHKZG = S => SIGN = +
SHKZG = H => SIGN = -
So
IF BSEG-SHKZG = 'H'.
BSEG-WRBTR = BSEG-WRBTR * -1.
ENDIF.
Max
Message was edited by: max bianchi -
Unable to find field which i added to FB03
HI Experts,
My requirement is to add field Amount and document line items field for particular document which i usually get by double clicking of document number in FB03
Is it possibel to add field Amount,. document line items which should be available when i clicked change layout button
I try to add field by following the below procedure
"" Enhancing Selection Views in the dynamic selection of FB03, FBL3n, FBL5n and etc
Related OSS Note: 188663 and 832997
Requirement: The business requires the Doc. Header Text be added in the dynamic selection in FB03
Solution:
Execute Transaction code SE36. Click F4. Enter the table name wherein you think the field could be found. In this case the table is BKPF and the logical database is BRF
From the initial screen of SE36, Choose from the path EXTRAS>> Selection Views
Copy Selection View "SAP" to "CUS"
Change the selection views "CUS"
In the right corner, double click your table BKPF.
In the right corner, check whether what functional groups does your field belong. If it is 01 then input it beside your field name.
Then Save it afterwards.""
By following the above procedure i selected table BSEG and Logical data base BRF .I created function group 02 called document segment and mentioned 02 before requiredfield names and selected check box after field names and clicked save.When i clicked Display contents i found the entries which i made but i closed and reopen it i didnt found any changes.
Please let me know where i went wrong.Anything is Appreciable.
Thanks&Regards,
narasimha.Hi ,
I can now able to see the fields that i added to BRF logical data base in se36 but how this enhancement is related to FB03 tcode
Thanks&Regards,
narasimha. -
Hi
The Reference Key 1,2 and 3 is missing in fb03. The document i posted is a downpayment request to a vendor, The document posted while viewing in FB03, the additional data tab is not showing the Reference Key filelds1, 2 and 3. Do somebody knows how to enable these fields in SAP.
The additional fields required are BSEG-XREF1 (Reference key 1), BSEG-XREF2 (Reference key 2), BSEG-XREF3 (Reference key 2) .
i have alredy checked the field status checkings in t code OB41 and OB32 but not found any configurations missing there,
Please let me know if somebody knows how to fix this.
Regards
RaghuHi
How to enable this for layouts.
regards
Raghu -
BSAS - BSEG for cleared document
Hi financial abapers,
in table BSAD we have clearing documents for the goods/invoice received account.
In field AUGBL is the doument no. cleared.
But I do not see the fully specified key BUKRS BELNR GJAHR BUZEI for the cleared item.
How to referce it correctly and uniquely?
TIA,
Regards,
ClemensBSAD has cleared documents.
AUGBL is the clearing document and AUGDT has the business year in it. Company code is always the same as documents company code.
A clearing document has two line items with the balance of all cleared items. The two items mutually clear one another.
The cleared items can be found from FB03 via menu environment - payment usage.
I know that the clearing document number can be found in cleared line item BSEG-AUGBL.
The document number and line item are in BSAS togehther with clearing docuemnt number.
And FYI: BSIS has the same structure as BSAS but AUGT and AUGBL are initial because only open items are in BSIS. If you reset a clearing, the line will move from BSAS back to BSIS.
Regards,
Clemens -
Field BSEG-HKTID does not exist in the additional data Screen
Hi
We are facing a problem while posting the parked document. Field BSEG-HKTID does not exist in the screen SAPLF040 0331.
As we want to avoid entering the field-data at the time of payment proposal run using T.code F110, we prefer to enter at the time of posting a parked document or at the time of parking.
We had checked the field status (of Posting key and GL) and its not available.
We refered note 953374 House bank details: Account ID in the document. It asks to activate the RE-FX component. However, we are not in the real estate business hence not logical to do so. How do we need to proceed?
PPTo do the same change with the transaccion FB02 y FB03, create an enhancemente point in the program: SAPMF05L dynpro: 1301, module: DYNPRO_MODIFIKATION, at the of perform open_fi_dynpro_mod and write:
LOOP AT SCREEN.
IF sy-tcode = 'FB02'.
IF screen-name = 'BSEG-HKTID'.
screen-input = 1.
screen-invisible = 0.
screen-active = 1.
screen-output = 1.
screen-group4 = ' '.
MODIFY SCREEN.
EXIT.
ENDIF.
elseif sy-tcode = 'FB03'.
IF screen-name = 'BSEG-HKTID'.
screen-input = 0.
screen-invisible = 0.
screen-active = 1.
screen-output = 1.
screen-group4 = ' '.
MODIFY SCREEN.
EXIT.
ENDIF.
endif.
ENDLOOP.
and, all ready. -
Document in BSEG but not in BKPF. Message displays Document not in Database
Good day!
We are using SAP 4.6C.
Our client wants to display a document posted some time ago using FB03.
The message displayed, "Document not in database. Search Document archive?"
I looked for the document in BSEG and found that the document exists there.
However, the document header data are missing in BKPF.
Is there a transaction code that could have archived/removed the data in BKPF while
not changing anything in BSEG?
Could there be a way to retrieve these data?
Thank you!Good Day !
For your information, the pop up message prompting for archived mesages "Document is not in database. Search document archive? " is not present anymore in the release ECC 6.0. This pop existed in your release and this has been phased out as part of continuous product improvement after inputs from various customers.
In the newer releases instead of this pop up we have the message
"Document XXXX XXXXXXXXX XXXX is already archived" being displayed at the lower bottom of the screen. This helps you identify that the document was archived. This is the standard SAP behaviour.
Therefore, your document is archived. To able to retrieve this document again you can use Tcode FBL3N and change the Data source option (there is a button for that) to Archived Data.
The same you achieve in FB03 when you select Document List button and then Data Sources Button, mark the option Archive.
I hope this helps.
Best Regards,
Vanessa. -
Substitute item line text (BSEG-SGTXT)
Dear all,
I have some questions here. For example, in tcode FB60, we enter the vendor code, invoice date, amount, tax, etc. When click on simulate, there will be another line item for Tax Input(if we select the tax). One of my requirement is, if user enter any text at the basic data tab (SGTXT), i would like to copy the text (BSEG-SGTXT) to the TAX INPUT text (BSEG-SGTXT), means different line item. When i click save for park documents, the tax input text needs to be saved too. So when i view in tcode FB03, the Tax input text will also have the same value as the vendor line item text. As well as after i post the documents, the Tax Input text should also be there.
I have tried to use Substitution. When i click Simulate, the value did copy from vendor line item to Tax Input line item text. But after i click save, i check the document, the text at the Tax Input line item is not there.
In my Prerequisite, i put tcode = FB60. Substitution, i am using BSEG-SGTXT substitute by exit. I have copy the program RGGBS000 to a new program and assign the exit. May i know how can i pass the whole item table instead of checking in structure BSEG in the exit? Because the main point is, the vendor line item and the Tax input line item are different. I want to copy different line item text into different line item text.
Can anyone guide me into this?
Thanks a lot. Appreciate it!Hi Starry,
Use PROCESS BTE not INTERFACE BTE. Process BTE has the following Parameters :
FUNCTION ZSAMPLE_PROCESS_00001120.
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_BKDF) TYPE BKDF OPTIONAL
*" TABLES
*" T_BKPF STRUCTURE BKPF
*" T_BSEG STRUCTURE BSEG
*" T_BKPFSUB STRUCTURE BKPF_SUBST
*" T_BSEGSUB STRUCTURE BSEG_SUBST
*" T_BSEC STRUCTURE BSEC OPTIONAL
*" CHANGING
*" REFERENCE(I_BKDFSUB) TYPE BKDF_SUBST OPTIONAL
Follow the instruction which I had posted earlier. Also check the documentation of the FM. Some important part am pasting here :
The current document headers (there will be more than one for cross-company code transactions, for example), the corresponding line items and the recurring entry data for the document header and the one-time account data are transferred to the additional component, for information purposes only. You must not edit this data. Instead, two additional tables (T_BKPFSUB and T_BSEGSUB) and the structure BKDF_SUBST are also transferred. The contents of the fields that can be substituted are entered in these tables. Field TABIX contains a line number which shows from which line in T_BSEG or T_BKPF the field contents originate.
Thanks & Regards,
Faheem. -
How to add extra filed in FB03 output report
HI,
we added new field for structure BSEG_ALV but this field does not appearing in layout of FB03 report.
--GaneshHello,
There are two "standard" ways to add new fields there, but you should consider these fields will be available for trx FBL1N, FBL3N and FBL5N:
- first way: trx OBVU: here you can insert only new fields belonging to BSEG, BKPF and others tables
- second way: add the new fields to structure RFPOSX, run the report RFPOSXEXTEND in order to update RFPOSXEXT (the structure for the ALV), use the BTE 1650 to insert the code to fill the new fields.
Bye! -
Field BSEG-HKTID. does not exist in the screen SAPMF05A 0332
Dear ALL,
Our client is ECC 6.0
we are facing a problem while posting the park document
Field BSEG-HKTID. does not exist in the screen SAPMF05A 0332
Message no. 00349
Diagnosis
The specified field does not exist on the screen.
Procedure
Check your batch input data.
The above problem occurs only after the Patch level upgradation only.
SAP suggest refer your sap note 953374 House bank details : account id in the document.
It says activate the RE-FX component.
Any how we are not in the real estate business.
Please provide me your suggestion to resolve the problem.
Thanks for your cooperation
Regards,
laxminarayanTo do the same change with the transaccion FB02 y FB03, create an enhancemente point in the program: SAPMF05L dynpro: 1301, module: DYNPRO_MODIFIKATION, at the of perform open_fi_dynpro_mod and write:
LOOP AT SCREEN.
IF sy-tcode = 'FB02'.
IF screen-name = 'BSEG-HKTID'.
screen-input = 1.
screen-invisible = 0.
screen-active = 1.
screen-output = 1.
screen-group4 = ' '.
MODIFY SCREEN.
EXIT.
ENDIF.
elseif sy-tcode = 'FB03'.
IF screen-name = 'BSEG-HKTID'.
screen-input = 0.
screen-invisible = 0.
screen-active = 1.
screen-output = 1.
screen-group4 = ' '.
MODIFY SCREEN.
EXIT.
ENDIF.
endif.
ENDLOOP.
and, all ready. -
Substitute in Line Item Test (BSEG-GSBER)
Dear all,
I have some questions here. For example, in tcode MIRO, we entered the required information. When click on simulate, there will be another line item for Tax Input lines.
One of my requirement is, PICK the Business Area field (GSBER) data for the Vendor line item and update in the Taxes lines with this data in GSBER field, I would like to copy the Vendor line item text (BSEG-GSBER) to the TAX INPUT(BSEG-GSBER), means different line item.
I will copy the value of the field BSEG-GSBER on the condition WHERE BSEG-KOART = 'K'.
Now i got the business area but my QUESTION is HOW to paste this business area on the line items based on the condition WHERE BSEG-BUZID = 'T' in the structure i.e. before saving the table BSEG.
When i click save for park documents, the tax input text needs to be saved too. So when i view in tcode FB03, the Tax input text will also have the same value as the vendor line item text. As well as after i post the documents, the Tax Input text should also be there.
The main point is, the vendor line item and the Tax input line item are different. I want to copy vendor line item business area into tax input line business area i.e. different line item text into different line item text.
Can anyone guide me into this?
Thanks a lot. Appreciate it!Hello Sir,
As you said I changed EXIT-PARAM to C_EXIT_PARAM_CLASS, but after changing this debugger is not triggering. When I'm using CLASS my EXIT name is not coming in GGB1. Please suggest me where I've to make changes.
Below is my code....
exits-name = 'U197'.
exits-param = c_exit_param_class.
exits-title = 'Enhancement For Business Area In Miro'.
append exits.
form u197 using bool_data type gb002_015
changing b_result.
lt_data-bseg[] = bool_data-bseg[].
read table lt_data-bseg[] into ls_bseg with key koart = 'K'.
if sy-subrc eq 0.
v_gsber = ls_bseg-gsber.
endif.
if sy-tcode = 'MIRO'.
loop at lt_data-bseg[] into ls_bseg where koart ne 'K'.
if ls_bseg-gsber = v_gsber.
else.
b_result = b_false.
endif.
endloop.
clear ls_bseg.
endif.
Thanks in Advance.
Regards,
Hardik B -
Display Alternative Account in Additional Data screen of FB03
Dear SAP experts,
Transaction code FB03's screen does have an alternative account column. But I want to display
Alternative account when I click on each account (in line item of FB03 screen) or display
alternative account in Additional Data screen of FB03. I don't know how to do it.
Does anyone here know about configuring this, please help me.
Thank you so much.
Maxielight.Hi,
To display the "Alternative Account Number" field in report of the new General Ledger, please proceed as follows:
1) Implement Note 895609 and 939649.
2) To display "Alternative Account Number" in the line layout variant, proceed as follows:
- Call transaction O7R3 and add BSEG-LOKKT as special field.
- Then change the line layout variant. The system now displays the "Alternative Account Number" field.
3) In the line item display in the classic General Ledger (transaction FBL3N), you could enhance the custom selections in transaction SE36 as described in Note 310886. However, in the new General Ledger, the custom selection in transaction FAGLL03 has different sub-areas. Each of these areas corresponds to a structure:
G/L account master record SKA1_FS
G/L account company code SKB1_FS
G/L account line item BSIS_FS
Since the "Alternative Account Number" is not included in the structure SKB1_FS in the standard delivery, please implement the enhancement as described in Note 945932. To include more fields in the custom selections of transaction FAGLL03, you can enhance the structures using an APPEND.
Regards,
Gaurav
Maybe you are looking for
-
Problem while opening Bex query on the web
Hello BW experts, I have a problem while opening Bex query from my SAP Favorites.See below. When i double click on the query, i get the following page, with the server name KBWS01QX. But, from RSRT Tcode, select the query > query display as HTML > Cl
-
Cannot install 64bit 10.2.0.4 Client on 64 bit Vista
Please help! I am trying to install the client package located here: http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10204_winx64_vista_win2k8.html Installation just quits after unzipping the files into \user\AppData\Loca
-
Callmanager Conferencing with remote locations Issue
I am new to using callmanager, and I need a little help. I have created a meet me number on my callmanager. Once a session is begun, all local network users are able to join the conference call with no problems.. If a remote location hosts a meet me
-
Exception in executing webservice
Problem which im facing is : I have ZRFC which is exposed as a webservice and imported in webdynpro application. The webservice structure(nested) has a table which I have to populate. When I am trying to execute the webservice from my webdynpro appl
-
FileInputStream prevent from overwriting
When I put a lock on a FileInputStream (through the lock() method of its FileChannel), then the file is protected from deletion, but not from overwriting. How can I prevent the FileInputStream from overwriting?