‎2008 Jan 07 8:04 AM
Hi all,
Here is the code part of bdcrecxx.
FORM OPEN_DATASET USING P_DATASET.
OPEN DATASET P_DATASET IN TEXT MODE.
>>Error is here above: open dataset...
IF SY-SUBRC <> 0.
WRITE: / TEXT-E00, SY-SUBRC.
STOP.
ENDIF.
ENDFORM.
The error message is;
One of the additions "FOR INPUT", "FOR OUTPUT", "FOR APPENDING" or "FOR UPDATE" was expected.
What is the problem?
Thanks.
‎2008 Jan 07 8:08 AM
hi,
This is a syntax error.
OPEN DATASET command wants what has to be done with the data that you are referring to.
Do an F1 on OPEN DATASET and u'll know the syntax
Reward if helpful.
Regards,
Preeti
‎2008 Jan 07 8:08 AM
hi,
This is a syntax error.
OPEN DATASET command wants what has to be done with the data that you are referring to.
Do an F1 on OPEN DATASET and u'll know the syntax
Reward if helpful.
Regards,
Preeti
‎2008 Jan 07 8:19 AM
Thank you Preeti Yadav,
However it is not possible to change a line of BDCRECXX.
if I attemp to change it, I am forced to enter Access key.
This sam code runs at version 4.6 and not working at 4.7.
I am carrying the same code.
Thanks.
‎2008 Jan 07 8:23 AM
Hello,
In 4.6 'for input' is the default mode whereas in 4.7 onwards you need to explicitly specify the mode
The program BDCRECXX has the appropriate changes in version 4.7
Edited by: Kris Donald on Jan 7, 2008 1:57 PM
‎2008 Jan 07 8:10 AM
Hi,
The Correct Syntax is..
OPEN DATASET P_DATASET FOR OUTPUT/INPUT/APPENDING IN TEXT MODE ENCODING DEFAULT.
‎2008 Jan 07 8:10 AM
hi,
when u want to transfer the file data to application server.
OPEN DATASET P_DATASET
FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC 0.
WRITE: / TEXT-E00, SY-SUBRC.
STOP.
ENDIF.
use this code u can trasfer the data to file
‎2008 Jan 07 8:11 AM
The syntax for OPEN DATASET is as follows:
Syntax
OPEN DATASET dset FOR access IN mode [position]
[ os_addition]
[error_handling].
So, OPEN DATASET should be followed by "FOR input" or FOR output..then it shud be followed by in TEXT mode..
OPEN DATASET FOR INPUT IN TEXT MODE. is the correct syntax.
CHeers
Shakir
‎2008 Jan 07 8:11 AM
Hello Deniz,
You need to open a file either to write to or to read from
Use
OPEN DATASET P_DATASET for input IN TEXT MODE.
(to read from the file)
or
OPEN DATASET P_DATASET for output IN TEXT MODE.
(to write to the file)
('encoding default' may be needed at the end of the line, depending on your SAP version)
‎2008 Jan 07 8:20 AM
Hi,
To create/read a file on application server OPEN DATASET is used.
You must open the file according to the requirement.
FOR OUTPUT : To create a new file or to overwrite the existing file.
FOR INPUT : Open file in read mode. so that writing is not possible.
FOR APPENDING: Open file in append mode. i.e., previous data will not be erased. control will be placed at the end of the file and data can be writen to the file.
Hence while using open dataset, one of these options should be used.