OPEN DATASET in ABAP MAPPING
Hi Gurus
I'm trying to use the statement OPEN DATASET into a ABAP MAPPING but when I test in ID I get this error:
<Trace level="1" type="T">Error in mapping program ZCL_FI_CFD_MEX (type SAP-ABAP, kernel error ID UNCAUGHT_EXCEPTION) </Trace>
Also I've a ABAP program to test MAPPING and in debbuging time OPEN DATASET is everything OK.
Can I use any ABAP statement in ABAP MAPPING?
Thanks in advance.
Carlos
Hello Carlos,
Please check exception handling implementation in your ABAP mapping - precisely speaking, handling of exceptions for OPEN DATASET. From error message you receive, it is seen that the exception is raised in OPEN DATASET and this exception is not handled. List of exceptions that can occur when calling OPEN DATASET is given below (taken from ABAP documentation):
CX_SY_FILE_OPEN / DATASET_REOPEN
CX_SY_CODEPAGE_CONVERTER_INIT / CONVT_CODEPAGE_INIT
CX_SY_CONVERSION_CODEPAGE / CONVT_CODEPAGE
CX_SY_FILE_AUTHORITY /OPEN_DATASET_NO_AUTHORITY, OPEN_PIPE_NO_AUTHORITY
CX_SY_PIPES_NOT_SUPPORTED
CX_SY_TOO_MANY_FILES / DATASET_TOO_MANY_FILES
Non-catchable exception / DATASET_PIPE_POSITION
Please let me know what exactly exception occurs so that more accurate analysis of the issue could be provided to you.
Please also provide source code extract of the affected mapping program (the part where OPEN DATASET is called) if possible.
Regards,
Vadim
Similar Messages
-
Err with scheduling an abap program using open dataset
issue: have an abap program which uses "open dataset ... for input ..." to read the file.
- with manual ly running it, receive the following message "dataset_not_open".
- with scheduling it, receive same message
attempting to run an abap program as part of a process chain (ie scheduling a background job) in BI.
the abap performs the following fxns:
1) read a file on the server
2) removes delimiter, renames it
3) rewrites the file onto the server
initially used ws_upload for reading and ws_download for writing the file.
- both fxns worked fine if it is run manually --> but failed as a background (part of process chain)
- note 7925 states can't use ws_upload, download for background jobs
-so switched to "open dataset"
Any suggestions as to why the "open dataset" does not work is greatly appreciated it.
B.A.Thank you for all responses. here is more info about the err message:
sy-subrc = 8
'invalid argument'
I looked up the invalid argument in note 99155 --> due to "The destination file is no longer available during repeated file access. " So, the following steps were taken:
- file was regenerated and
- file was placed on the server to be read
have the following code:
OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE encoding default
MESSAGE D_MSG_TEXT.
also have tried the following:
OPEN DATASET d1 for input in text mode encoding default.
open dataset d1 for output in text mode encoding NON-UNICODE..
open dataset d1 for output in text mode encoding utf-8.
none had worked. system --> status shows no unicode.
THanks again for any suggestions. -
Identity abap report where is used the open dataset istruction
We need to identify the abap program where is used the open dataset istruction.
We need this because we are planning a platform change from windows to unix.
Regards
GiuseppeHi,
I am not sure but we check it either manually or by search keyword. Secondry we can use code inspector where we put the open dataset keyword. That will find all.
If you got some more information then pls. also share with me
Regds,
Rakesh -
OPEN Dataset - Peculiar problem
Hello experts!
I am facing a peculiar problem with ABAP keyword OPEN DATASET.
I have a directory to which I am adding new files using OPEN DATASET FOR OUTPUT.. this works perfectly fine in the Consolidation system. But the same thing does'nt work in the Production system! It return SY-SUBRC = 8
After reading several other posts on SDN and other forums, the following causes were touted.
1) Path incorrect
2) No Authorization
But upon checking, neither of the wo are possible because the path is maintained properly and the authorizations at OS level are given (R/W) to this folder. Moreover, the user has S_DATASET auth object!!
Then I read somewhere else that having multiple Application Servers could be a possible cause and that running the code as a background job would be afix.. Is it so?
Even if it is, the application is in ABAP Web Dynpro and is launched from the portal.. hence launching it as a background job is not an option... Any solutions?????
Any help on this would be appreciated...
Thanks in advance, AmithHi,
Yes this is true that if we are having the multiple application server then this kind of error occures if your specified directory is not mapped on the alll the avaiable sAP application servers.
I guess when ever you are running your application then system will pick the appkication server based on the present load. Hence if your directory is not mapped in that application server then you wil get this kind of issues,
so i guess check with you basis team that spctified path is avaiable in all the application server. -
Hallo,
during ABAP Mapping I have the following problem:
I want to return a message to XI Java stack in the following format:
<?xml version="1.0"?><ns0:MT_FILE_PAXAR_INB xmlns:ns0="http://logimoda.com/ns_paxar">
<Recordset>
[... child tags which values are retrieved from fields of each record of an internal table]
</Recordset>
</ns0:MT_FILE_PAXAR_INB>
I want n <Recordset>, one for each record of the internal table "t_etichette", which is populated by:
CALL FUNCTION 'ZXI_ETICHETTE_COMPOSIZIONE_PEZ'
Now, i'm not able to append n sibling <Recordset>, only one is appended to parent <ns0:MT_FILE_PAXAR_INB>.
I guess the solution is ixml_document_fragment or using someway an iteration, but I don't know how...
Any suggestion?
Thanks all in advance:)
PS below my current source code:
METHOD if_mapping~execute .
1.0 Def. Data Types - Start **********************************
DATA:
wa_t_richieste TYPE zppst_input_etichette_pezzo,
t_richieste TYPE TABLE OF zppst_input_etichette_pezzo,
wa_t_etichette TYPE zppst_output_etichette_pezzo,
t_etichette TYPE TABLE OF zppst_output_etichette_pezzo,
wa_t_logelab TYPE zppst_esito_etichette_pezzo,
t_logelab TYPE TABLE OF zppst_esito_etichette_pezzo.
1.1 Def. Data Types - End **********************************
initialize iXML
TYPE-POOLS: ixml.
CLASS cl_ixml DEFINITION LOAD.
create main factory
DATA: ixmlfactory TYPE REF TO if_ixml.
ixmlfactory = cl_ixml=>create( ).
create stream factory
DATA: streamfactory TYPE REF TO if_ixml_stream_factory.
streamfactory = ixmlfactory->create_stream_factory( ).
create input stream
DATA: istream TYPE REF TO if_ixml_istream.
istream = streamfactory->create_istream_xstring( source ).
DATA: val_nodo TYPE string,
nome_nodo TYPE string,
nome_el TYPE string
DATA: ta_data TYPE STANDARD TABLE OF ztabxml,
wa_data TYPE ztabxml.
parse input document =================================================
initialize input document
DATA: idocument TYPE REF TO if_ixml_document.
idocument = ixmlfactory->create_document( ).
parse input document
DATA: iparser TYPE REF TO if_ixml_parser.
iparser = ixmlfactory->create_parser( stream_factory = streamfactory
istream = istream
document = idocument ).
iparser->parse( ).
DATA: element TYPE REF TO if_ixml_element.
DATA: articolo TYPE REF TO if_ixml_element.
DATA: collo TYPE REF TO if_ixml_element.
DATA: l_trace TYPE string.
DATA: child TYPE REF TO if_ixml_node.
DATA: nr_art TYPE REF TO if_ixml_node_collection.
DATA: dest TYPE rfcdest,
wa_cust TYPE zxi_cust,
mandt TYPE sy-mandt.
SELECT SINGLE * FROM zxi_cust INTO wa_cust
WHERE parname1 = 'RFC_DEST'
AND parname2 = 'R/3'.
dest = wa_cust-parvalue1.
mandt = dest+7(3).
1.2 Mapping XML -> items ************************************
CLEAR nome_nodo.
CLEAR child.
CLEAR ciclo.
element = idocument->find_from_path_ns(
path =
'/RIGA'
default_uri = '' ).
nome_el = element->get_name( ).
ciclo = 'true'.
WHILE ciclo = 'true'.
Mandante
MOVE mandt TO wa_t_richieste-mandt.
IF nome_el = 'RIGA'.
child = element->get_first_child( ).
WHILE child IS BOUND.
nome_nodo = child->get_name( ).
val_nodo = child->get_value( ).
CASE nome_nodo.
WHEN 'COD_MSGEXPORT'.
Identificativo da Logimoda
MOVE val_nodo TO wa_t_richieste-zcodeidoc.
WHEN 'C0001'.
Commessa
MOVE val_nodo TO wa_t_richieste-j_3acomord.
ENDCASE.
child = child->get_next( ).
ENDWHILE.
APPEND wa_t_richieste TO t_richieste.
CLEAR: wa_t_richieste.
element ?= element->get_next( ).
IF NOT element IS BOUND.
EXIT.
ENDIF.
nome_el = element->get_name( ).
ELSE.
ciclo = 'false'.
ENDIF.
ENDWHILE.
1.3 call RFC ************************************************
DATA: return TYPE sy-subrc.
DATA: t_return TYPE TABLE OF bapiret2.
DATA: st_return TYPE bapiret2.
DATA: mess_exc TYPE string.
DATA: t_error_text TYPE string.
CLEAR: return.
CLEAR: t_return.
REFRESH: t_return.
CALL FUNCTION 'ZXI_ETICHETTE_COMPOSIZIONE_PEZ'
DESTINATION
dest
EXPORTING
TO DO: Y or N ??
fl_alv = ' '
TABLES
t_richieste = t_richieste
t_etichette = t_etichette
t_logelab = t_logelab
EXCEPTIONS
no_richieste = 1
no_etichette = 2
no_plant = 3
OTHERS = 4.
IF ( ( sy-subrc <> 0 ) AND
( dest <> 'MZ1CLNT400' )
DATA subrc TYPE sy-subrc.
CASE subrc.
WHEN 1.
LOOP AT t_logelab INTO st_logelab WHERE type EQ 'E'.
CONCATENATE 'ABAP MAPPING ERROR: '
'NO_RICHIESTE'
INTO mess_exc.
trace->trace( level = '1'
message = mess_exc ).
RAISE EXCEPTION TYPE cx_mapping_fault
EXPORTING error_code = '90'
error_text = 'NO_RICHIESTE'.
ENDLOOP.
WHEN 2.
WHEN 3.
WHEN OTHERS.
ENDCASE.
ENDIF.
1.4 build up output document *****************************************
DATA: ret_value TYPE i.
DATA: uri TYPE string.
uri = 'http://logimoda.com/ns_paxar'.
create output document
DATA: odocument TYPE REF TO if_ixml_document.
odocument = ixmlfactory->create_document( ).
Test - Start ***********
DATA: root_ns TYPE REF TO if_ixml_namespace_decl.
root_ns = odocument->create_namespace_decl(
name = 'ns0'
prefix = 'ns0'
uri = uri ).
ret_value = odocument->set_namespace_prefix(
prefix = 'ns0'
ret_value = odocument->set_namespace_uri(
uri = 'ns0'
root = odocument->create_element_ns(
name = 'ns0'
prefix = 'ns0'
uri = 'http://logimoda.com/ns_paxar'
Test - End ***********
create root XML tag
DATA: root TYPE REF TO if_ixml_element.
root = odocument->create_simple_element_ns(
name = 'MT_FILE_PAXAR_INB'
prefix = 'ns0'
uri = uri
value = temp
parent = odocument ).
DATA: ns_xml_attr TYPE REF TO if_ixml_attribute.
ns_xml_attr = odocument->create_attribute_ns(
name = 'ns0'
prefix = 'xmlns'
uri = 'http://logimoda.com/ns_paxar'
ret_value = ns_xml_attr->set_value( uri ).
ret_value = root->set_attribute_node_ns(
new_attr = ns_xml_attr
create recordset tag (<= see ref. in FTP Comm. Channel)
DATA: recordset TYPE REF TO if_ixml_element.
recordset = odocument->create_simple_element(
name = 'Recordset'
value = temp
parent = root ).
Test - Start ***********
DATA: doc_fragm TYPE REF TO if_ixml_document_fragment.
doc_fragm = odocument->create_document_fragment( ).
create recordset tag (<= see ref. in FTP Comm. Channel)
recordset = odocument->create_simple_element(
name = 'Recordset'
value = temp
parent = doc_fragm ).
DATA: ref_child TYPE REF TO if_ixml_node.
ret_value = root->insert_child(
new_child = doc_fragm
ref_child = ref_child
DATA: recordset_array TYPE REF TO if_ixml_node_collection.
recordset_array->append_item(recordset_el).
Test - End ***********
XI Inbound Message: MT_FILE_PAXAR_INB
DATA: zcodeidoc TYPE REF TO if_ixml_element.
DATA: j_3acomord TYPE REF TO if_ixml_element.
DATA: werks TYPE REF TO if_ixml_element.
DATA: trilog_yseason TYPE REF TO if_ixml_element.
DATA: temp TYPE string.
LOOP AT t_etichette INTO wa_t_etichette.
HERE IS THE PROBLEM, HOW TO DO IT ?
ret_value = root->insert_child(
new_child = recordset
ref_child = recordset
CLEAR temp.
MOVE wa_t_etichette-zcodeidoc TO temp.
zcodeidoc = odocument->create_simple_element(
name = 'ZCODEIDOC'
value = temp
parent = recordset ).
CLEAR temp.
MOVE wa_t_etichette-j_3acomord TO temp.
j_3acomord = odocument->create_simple_element(
name = 'j_3acomord'
value = temp
parent = recordset ).
CLEAR temp.
MOVE wa_t_etichette-werks TO temp.
werks = odocument->create_simple_element(
name = 'WERKS'
value = temp
parent = recordset ).
CLEAR temp.
MOVE wa_t_etichette-trilog_yseason TO temp.
trilog_yseason = odocument->create_simple_element(
name = 'trilog_yseason'
value = temp
parent = recordset ).
CLEAR wa_t_etichette.
ENDLOOP.
render document ======================================================
create output stream
DATA: ostream TYPE REF TO if_ixml_ostream.
ostream = streamfactory->create_ostream_xstring( result ).
create renderer
DATA: renderer TYPE REF TO if_ixml_renderer.
DATA irc TYPE i.
renderer = ixmlfactory->create_renderer( ostream = ostream
document = odocument ).
irc = renderer->render( ).
1.4 for debug ********************************************************
Uploading Files and Manipulating their Content
(SAP Library - Business Server Pages)
http://help.sap.com/saphelp_nw2004s/helpdata/en/ba/78d3c747b24546ab1c1499a054d8a5/content.htm
DATA: conv_out TYPE REF TO cl_abap_conv_out_ce.
conv_out = cl_abap_conv_out_ce=>create(
encoding = 'UTF-8'
endian = 'L' ).
conversion string => xstring *********************************
conv->convert( EXPORTING data = out
IMPORTING buffer = result ).
conversion xstring => string *********************************
DATA: outxml TYPE string.
DATA: conv_in TYPE REF TO cl_abap_conv_in_ce.
conv_in = cl_abap_conv_in_ce=>create( input = result ).
conv_in->read( IMPORTING data = outxml ).
store file txt on PC for test purpose - Start ********
DATA: dataset_str_xml TYPE string,
debug_allowed(1) TYPE c,
l_xml_size TYPE i.
dataset_str_xml = '/usr/sap/XIT/ZXI_PARAX_TEST_XML.xml'.
OPEN DATASET dataset_str_xml FOR OUTPUT
IN TEXT MODE ENCODING DEFAULT.
TRANSFER outxml TO dataset_str_xml.
CLOSE DATASET dataset_str_xml.
store file txt on PC for test purpose - End ********
ENDMETHOD.create recordset tag (<= see ref. in FTP Comm. Channel)
recordset = odocument->create_simple_element(
name = 'Recordset'
value = temp
parent = doc_fragm ).
this object must be created inside your loop... -
Open dataset is not working in background in PRD
Dear All,
Open dataset is not working in background in PRD .
OPEN DATASET filepath FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
Whike running in foregroundits working dev as well as prd.
but when i am running in background its giving error like file not found .
but al11 is working (i mean my file path is working ).
Thanks N Regards,
Srinivasa Reddyyour authority team shall check the batch user of that abap!
Could you please tell us the detailed error message?
grx
Andreas -
Hi guys
i am trying to open more than 100 files using open dataset input but i am getting below error
program is abending reading after 50files..
Program failing in open data set error can u help me please?
143
144 * Each file is getting into an internal table
>>> OPEN DATASET w_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
146 IF sy-subrc <> 0.
147 CONTINUE.
148 ELSE.
149 DO.
150 READ DATASET w_file INTO s700_delta.
What command I should give here
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_TOO_MANY_FILES', was not
caught and
therefore caused a runtime error.
The reason for the exception is:
The maximum number of open files (100) has been exceeded.
please let me know what should makes changes to avoid this abend?Standard programming problem, should be rather trivial to find with a quick search. Basically there's always a limit of how many open file handles you can have at a time.
Please try to consult the ABAP help next time before posting (or search on SCN). A quick check for [open dataset|http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET.htm] would've told you the following:
You can open up to 100 files per internal session. The actual maximum number of simultaneously open files may be less, depending on the platform.
Most likely you actually don't want to have all those files open at the same time and you simply forgot to use a [close dataset|http://help.sap.com/abapdocu_70/en/ABAPCLOSE_DATASET.htm] after reading each file. -
I am working on SAP XI 3.0
As per documentation i add the entry in
http://<hostname>:<portid>/exchangeProfile
com.sap.aii.repository.mapping.additionaltypes
as e.g.
R3_ABAP|Abap-class;R3_XSLT|XSL (ABAP Engine)
but i.e. not seen in the
httP://<hostname>:<portid>/rep/support/index.html
All Properties options
so what else configuration required
because one of its sentence says that:
Technically, the Integration Server calls the ABAP function CALL_PARTNER_MAPPING with the additional mapping type name as destination. Therefore, the additional mapping type name must be registered as RFC-Destination in the Integration Server, too.
so where to define RFC-Destination and how.
Thanks & Regards,
Gaurav JainHi
HERE are steps for abap mapping
1. Add additional mapping types in your
exchange profile
Open
http://<host>:<port>/exchangeProfile/ind
ex.html
Choose IntegrationBuilder ->
IntegrationBuilder.Repository ->
com.sap.aii.repository.mapping.addition
altypes
Maintain the following entry:
R3_ABAP|Abapclass;
R3_XSLT|XSL (ABAP
Engine)
2. Check whether the data has been
successfully read from the exchange profile:
Open
http://<host>:<port>/rep/support/admin/in
dex.html
Choose Administration of Properties ->
All Properties
If the value associated to parameter
com.sap.aii.repository.mapping
.additionaltypes is not correct.
3 . Create a class and implement interface IF_Mapping in that.
4. implement ABAP mapping.
Hope this will help
thanx
Vinod ahir -
Problem in parsing in ABAP mapping
Hi all , In our ABAP mapping we are trying to create a DOM tree from a XML file but we are getting the error in the following statement
l_rc = if_iparser->parse( ).
when we track the error using
i = l_error->get_line( ). (result 0)
i = l_error->get_column( ). (result 2017)
str = l_error->get_reason( ). (Expected '<' or '/>' tag)
but strange thing is we can open the file using Stylus studio/ Altova / IE ..so may the problem is not in the XML file ....Has anybody faced the problem before ??
Kind regarrds
GoutamHi,
Have a look at this link.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
I guess,your code may have problem.
Try doing this from document.
iparser = ixmlfactory->create_parser( stream_factory = streamfactory
istream = istream
document = idocument ).
iparser->parse( ).
Regards,
Akshay Jamgaonkar.
Hope this will help. -
Hi All,
The use of ABAP Proxy is nothing but the Adapterless implementation,as per my assumption.But is there any other reason for prefessing ABAP Proxy over the Adapter while the practical implenentation is done?
Also,for ABAP Mapping ,I have a qustion that when is ABAP Mapping preferred over other Mappings that is Graphical Mapping and Java Mapping while practical implementation?
Thanks and regards,
AmolHi Shweta,
To answer your first question, we prefer ABAP proxies over RFCs due to the reason that the communication happens directly between the Integration Engine of sender sap R/3 system and the IE of the XI system. It elimintes the need for Adapter Engine(On the sender side).
However, when there are standard IDOCs avaialble, then we use IDOCs instead of proxies due to the various other advantages of IDOCs like monitoring, reprocxesing etc.
But, in case the sender is not a SAP R/3 system, then obvious we can not use ABAP Proxy.
Refer this article to choose the best integration option amongst Proxy,RFC,Enterprise Services.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0e7ae66-be6d-2a10-d385-92e6e67dee10
Regarding your second question,
ABAP mapping is least preferred due to issues like Performance, Non-Portability (We cannot use the abap mapping in any other Open-source middleware).
The only time we go for it is if we have people with only ABAP skills..:)
Regards,
Ravi Kanth Talagana -
ABAP Mapping in RFC to SOAP Scenario
Hi Folks,
I have a scenario to send data from RFC to SOAP. I want to use the ABAP MApping for this case. Can anybody guide me how to do the ABAP Mapping for this case ? It will be real help if somebody can give a step by step guide ?
Regards,
SantoshHello Again,
HOW TO DO ABAP MAPPING:
Use this link and go to sec 3.1 Do exactly as mentioned in this link.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
OR
1. Open http://<host>:<port>/exchangeProfile/index.html
2. Choose IntegrationBuilder -> IntegrationBuilder.Repository ->
com.sap.aii.repository.mapping.additionaltypes
3. Maintain the following entry:
R3_ABAP|Abapclass;R3_XSLT|XSL (ABAP Engine)
4. Open http://<host>:<port>/rep/support/admin/index.html
5. Choose Administration of Properties -> All Properties
6. If the value associated to parameter com.sap.aii.repository.mapping.additionaltypes is not correct, choose REFRESH at the top of the page.
How to call XI ABAP Mapping via RFC:
/people/ricardoandres.maienza/blog/2007/04/06/how-to-call-xi-abap-mapping-via-rfc
XI: ABAP mapping blogs
/people/michal.krawczyk2/blog/2006/09/20/xi-abap-mapping-logs--more-standard-better-visibility
/people/rahul.nawale2/blog/2006/11/01/dynamically-sending-a-mail-to-the-po-creator-using-xslt-abap-mapping
PART 1
/people/r.eijpe/blog/2005/11/10/xml-dom-processing-in-abap-part-i--convert-an-abap-table-into-xml-file-using-sap-dom-approach
PART 2
/people/r.eijpe/blog/2005/11/21/xml-dom-processing-in-abap-part-ii--convert-an-xml-file-into-an-abap-table-using-sap-dom-approach
PART 3
Convert an ABAP table into XML file using SAP DOM Approach
/people/r.eijpe/blog/2006/02/19/xml-dom-processing-in-abap-part-iiia150-xml-dom-within-sap-xi-abap-mapping
Testing ABAP Mapping
/people/sameer.shadab/blog/2005/09/29/testing-abap-mapping
Regards,
Madan Agrawal -
How to get ABAP mapping option in Interface Mapping
Hi
experts
How to get ABAP mapping option in Interface Mapping . i need to do abap mapping . i didnt find the option
plz help meHi,
If u2018ABAP-classu2019 and u2018XSL(ABAP ENGINE)u2019 does not appear under the u2018Mapping Program Typeu2019 in Interface Mapping, one has to make an additional entry in the Exchange Profile.
Only a user with the J2EE security role (administrator) can make the following settings in the Exchange Profile.
It is achieved in the following manner:
1) Open http://<host>:<port>/exchangeProfile/index.html
2)Choose IntegrationBuilder ->IntegrationBuilder.Repository -> com.sap.aii.repository.mapping.additionaltypes
Add: R3_ABAP|Abap-class;R3_XSLT|XSL (ABAP Engine)
To check whether the data has been successfully read from the exchange profile:
1- Open http://<host>:<port>/rep/support/admin/index.html
2- Choose Administration of Properties -> All Properties
3- If the value associated to parameter com.sap.aii.repository.mapping.additionaltypes is not visible, press REFRESH button
After doing above check in IR, if still don't find the option for ABAP mapping then refresh the cache.
Award points if useful. -
Open Dataset fails with "Invalid Argument"
From an ABAP program I can't write to a share folder on a windows 2000 box. The share permissions are set to Everyone Full control. I can write to a share on a windows 2003 box, but not windows 2000. Here is my code:
data: filename type string.
data: open_message type string.
filename = '
servername\edi\test.txt'.
open dataset filename for output
message open_message
in text mode.
encoding non-unicode.
write: /1 open_message.
I noticed that the kernel has the following info:
ICU Version 2.6.1 Unicode Version 4.0
I was thinking there was a problem writing to a win 2000 box with an SAP Unicode Kernel.
Anyone have a clue?
Thank you,hi
the shared folder must be accessible to the os user of your R3 installation. bcoz when u run the pgm this user will be used at the os level.
for checking this logon to the R3 os and try to access the share path. it should be accessible without providing any logon credentials.
rgds
arun -
Hello Expert:
I wanna download a excel file from unix server
the file inculde some Chinese Character.
Program is:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
*& Report YTEST_17
REPORT ytest_17.
*& Report ZUPLOADTAB *
*& Example of Uploading tab delimited file *
*REPORT zuploadtab .
PARAMETERS: p_infile LIKE rlgrap-filename
OBLIGATORY DEFAULT '/usr/sap/report/BS_template.xls'.
*PARAMETERS: p_infile type string.
*DATA: ld_file LIKE rlgrap-filename.
DATA: ld_file TYPE string.
*Internal tabe to store upload data
TYPES: BEGIN OF t_record,
name1 LIKE pa0002-vorna,
name2 LIKE pa0002-name2,
age TYPE i,
END OF t_record.
DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
wa_record TYPE t_record.
*Text version of data table
TYPES: BEGIN OF t_uploadtxt,
name1(10) TYPE c,
name2(15) TYPE c,
age(5) TYPE c,
END OF t_uploadtxt.
DATA: wa_uploadtxt TYPE t_uploadtxt,
wa_upload TYPE t_record.
*String value to data in initially.
DATA: wa_string(255) TYPE c.
*constants: con_tab(2) TYPE C VALUE '09'.
*If you have Unicode check active in program attributes then you will
*need to declare constants as follows:
*class cl_abap_char_utilities definition load.
CONSTANTS:
con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
*START-OF-SELECTION
START-OF-SELECTION.
ld_file = p_infile.
OPEN DATASET ld_file FOR INPUT IN TEXT MODE encoding default.
IF sy-subrc NE 0.
ELSE.
DO.
CLEAR: wa_string, wa_uploadtxt.
READ DATASET ld_file INTO wa_string.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
wa_uploadtxt-name2
wa_uploadtxt-age.
MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
APPEND wa_upload TO it_record.
ENDIF.
ENDDO.
CLOSE DATASET ld_file.
ENDIF.
*END-OF-SELECTION
END-OF-SELECTION.
*!! Text data is now contained within the internal table IT_RECORD
<Display report data for illustration purposes
LOOP AT it_record INTO wa_record.
WRITE:/ sy-vline,
(10) wa_record-name1, sy-vline,
(10) wa_record-name2, sy-vline,
(10) wa_record-age, sy-vline.
ENDLOOP.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
but a shortdump happened, would u please give some solution
ShrtText
You cannot convert the character set.
发生了什么?
While a text was being converted from code page '4110' to '4102', one of
the following occurred:
- an character was discovered that could not be represented in one of
the two code pages;
- the system established that this conversion is not supported.
The running ABAP program, 'YTEST_17' had to be terminated, since the
conversion could cause incorrect data to be generated.
683 characters could not be represented (and thus could not converted).
If 683 = 0, a second or a different error has occurred.
thank you
Kevin
any solution, please..........
Message was edited by:
Kevin Gao<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
*& Report YTEST_17
REPORT ytest_17.
*& Report ZUPLOADTAB *
*& Example of Uploading tab delimited file *
*REPORT zuploadtab .
PARAMETERS: p_infile LIKE rlgrap-filename
OBLIGATORY DEFAULT '/usr/sap/report/BS_template.xls'.
*PARAMETERS: p_infile type string.
*DATA: ld_file LIKE rlgrap-filename.
DATA: ld_file TYPE string.
*Internal tabe to store upload data
TYPES: BEGIN OF t_record,
name1 LIKE pa0002-vorna,
name2 LIKE pa0002-name2,
age TYPE i,
END OF t_record.
DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
wa_record TYPE t_record.
*Text version of data table
TYPES: BEGIN OF t_uploadtxt,
name1(10) TYPE c,
name2(15) TYPE c,
age(5) TYPE c,
END OF t_uploadtxt.
DATA: wa_uploadtxt TYPE t_uploadtxt,
wa_upload TYPE t_record.
*String value to data in initially.
DATA: wa_string(255) TYPE c.
*constants: con_tab(2) TYPE C VALUE '09'.
*If you have Unicode check active in program attributes then you will
*need to declare constants as follows:
*class cl_abap_char_utilities definition load.
CONSTANTS:
con_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
*START-OF-SELECTION
START-OF-SELECTION.
ld_file = p_infile.
<b>
SET LOCALE LANGUAGE 'JA'. Specify the language .. JA Is for Japanese
OPEN DATASET ld_file FOR INPUT IN TEXT MODE encoding NON-UNICODE.</b>
IF sy-subrc NE 0.
ELSE.
DO.
CLEAR: wa_string, wa_uploadtxt.
READ DATASET ld_file INTO wa_string.
IF sy-subrc NE 0.
EXIT.
ELSE.
SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
wa_uploadtxt-name2
wa_uploadtxt-age.
MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
APPEND wa_upload TO it_record.
ENDIF.
ENDDO.
CLOSE DATASET ld_file.
ENDIF.
*END-OF-SELECTION
END-OF-SELECTION.
*!! Text data is now contained within the internal table IT_RECORD
<Display report data for illustration purposes
LOOP AT it_record INTO wa_record.
WRITE:/ sy-vline,
(10) wa_record-name1, sy-vline,
(10) wa_record-name2, sy-vline,
(10) wa_record-age, sy-vline.
ENDLOOP. -
Open Dataset : File creation in server
Hi Guys,
I am trying to use
Open dataset dsn for output in text mode encoding default. " dsn = '
pt-net\taskout\outfile.txt'.
loop at itab.
transfer itab to dsn.
endloop.
to write a file at a destination on a windows NT server For eg :
pt-net\taskout\outfile.txt
I see sy-subrc = 0 at both open dataset and transfer commands in the debugger. But the file is not written.
I can manually create files when I access this path in my explorer. So it is not an access issue.
Also, my SAP application server is a Unix server. But the file I am trying to write is in NT server. THis is for a 3rd party application. Where am I possibly going wrong ? I am able to write this file to the Unix application server path using the above command. But I need to write this in the Windows server.
Do I need first write to Unix path and then FTP it to Windows server ? I can manually do this. But since this program is going to run as a job, I want to automate this..
THanks in advance!!Hi,
This is my advice:
First write the file in the file system of your application server.
After that find out, what to do for transport on operation system level.
Since SAP allows system calls, you can do it in the same way by program.
I give you some code. Unfortunately it is from Windows to Windows. Nevertheless I hope you can profit by it.
*& Form file_to_l66
FORM file_to_l66 USING src_fpath
dest_fname.
- src_fpath full path of source file
- dest_fname intended file name for destination
DATA:
parcom(250),
BEGIN OF tabl OCCURS 0,
line(200),
END OF tabl,
str(250).
drive y free
parcom = 'y:'.
CALL 'SYSTEM' ID 'COMMAND' FIELD parcom
ID 'TAB' FIELD tabl-sys.
IF sy-subrc IS INITIAL.
RAISE file_to_l66_err_drive_y.
ENDIF.
mapping y
128.1.123.1 ServerL66
parcom =
'net use y:
128.1.123.1\SAPDATA passwd /user:usr01'.
CALL 'SYSTEM' ID 'COMMAND' FIELD parcom
ID 'TAB' FIELD tabl-sys.
IF NOT sy-subrc IS INITIAL.
RAISE file_to_l66_err_mapping_y.
ENDIF.
copying
CONCATENATE 'copy' src_fpath 'y:\' INTO str SEPARATED BY space.
CONCATENATE str dest_fname INTO parcom.
example:
src_fpath = 'e:\trans\l66.xml'
dest_fname = 'l66_20080531235959.xml'
-> parcom = 'copy e:\trans\l66.xml y:\l66_20080531235959.xml'.
CALL 'SYSTEM' ID 'COMMAND' FIELD parcom
ID 'TAB' FIELD tabl-sys.
IF NOT sy-subrc IS INITIAL.
RAISE file_to_l66_err_copying.
ENDIF.
release y
parcom =
'net use y: /delete'.
CALL 'SYSTEM' ID 'COMMAND' FIELD parcom
ID 'TAB' FIELD tabl-sys.
IF NOT sy-subrc IS INITIAL.
RAISE file_to_l66_err_unmapping_y.
ENDIF.
ENDFORM. " file_to_l66
Edited by: Walter Habich on May 22, 2008 4:24 PM
Maybe you are looking for
-
Can no longer boot to OS 9 with Mirrored Door Dual processor G4?
Hope someone can put me out of my misery... I've been running my Mirrored Door (MDD) Dual G4 for years and have always booted into OS 9, but today, the Mac has decided to boot to OSX. From the Startup Disk Control panel in OSX, I have selected the OS
-
Pivot not updating - Still on July issue.
Hello, My TP was activated on 8th September and updated to WebOS v3.02 soon afterwards. It's still showing the July issue of Pivot. There are no issues with WiFi connection, I can browse the App Catalog (v5.0.1600) and have downloaded several apps, e
-
Can you bring an existing website into WebTools?
My customer has a website already that would just need a few bits tweaking if he could bring it into WebTools. Is this possilbe? Has anyone done it already? Kind Regards Jan
-
Updated itunes and now songs are gone
when i updated my itunes, it deleted all the songs i had in my library. i was able to put the songs from albums back in, but all the songs i bought from the itunes music store are gone, and my back-up files were erased too. please help! dell Window
-
I'm changing to Firefox from IE. In Firefox, I can't get chats to work
My computer has the Windows Vista operating system