Upload XML Notas de Entrada
Boa tarde!
Gostaria de saber se há algum mecanismo disponível onde eu consiga efetuar o processo do MIRO e escrituração fiscal (J1B3N), atraves do upload do XML da Nota Fiscal de entrada, ou seja automatizar o processo.
Obrigada,
Thaís
THais,
você usa a solução SAP NF-e(GRC)?
se sim, o processo NOrmal Purchasing não te atende? Você quer apenas efetuar a escrituração sem fazer a MIGO/Inbound Delivery?
o Que você pode fazer no SAP NFE é implementar o processo FLEX.
AÍ você pode fazer a escrituração e a MIRO da forma que lhe convém.
[]'s
JN
Similar Messages
-
Special characters are not identified while uploading XML data( hypen)
Hello,
I am uploading XML file data in to sap , i am working on SAP 4.7 EE , when i am parsing the XML data it is not identifying the special characters like hyphen , aphostrophe...in place of them it is showing
Is there any way, where i can handle this ....is there any solution...otherwise is it is not possible to upload special characters from XML file.
Kinldy help me ...
Rgds.,
subashAny inputs????
-
Versão do XML errada - Notas de entrada com referencia a Saida em 1.10
Boa Tarde Pessoal,
Minha empresa emite notas fiscais em 2.0 em todas suas filiais e estou tendo problemas ao criar notas de devoluções para notas de saídas que saíram na versão 1.10.
Elas deveriam sair em 2.0 pois não emitimos mais em 1.10.
Estamos recebendo a rejeição 595 Rejeição: A versão do leiaute da NF-e utilizada não é mais válida.
Alguem sabe o que pode estar acontecendo?
Leandro Von Zubem.
Edited by: Leandro VonZubem on May 17, 2011 8:07 PMBom dia Fernando,
O problema é que o SAP esta determinando a versão 1.10 na nota que crio hoje referenciando uma nota antiga emitida em 1.10.
Não sou ABAP mas debuguei a criação da nota e segue o cenário que encontrei:
Na função J_1B_NF_MAP_TO_XML, alimentamos a estrutura wk_header com os dados da J_1BNFDOC (estrutura i_nfdoc), o campo wk_header-XMLVERS é alimentado com a versão 1.10. (E aqui esta o grande problema)
Depois disso, através da tabela J_1BNFE_CUST3 ele verifica que a versão que devemos gerar a nota é a 2.0, na função que preenche o Bloco A, eu alimento a xmlh-version com 2.0. mas o wk_header-XMLVERS continua com 1.10.
Passo pela BADI de header, e atualizo as informações necessárias, mas mantenho 2.0 nas estruturas XMLH e XMLH_BADI.
Agora eu chamo a função CALL_XI (passando a XMLH com as informações de cabeçalho), é chamada a função /XNFE/NFE_CREATE no GRC e, no validation (Função Check_ID) a variavel gc_xmlvers1_erp esta como 1.10, o que gera um erro de validação na chave de acesso (forcei esse passo para não gerar erro porque sei que se o wk_header não tivesse determinado errado, ele teria preenchido o TPEMIS e não teriamos esse erro)
Quando ele sai da função de NFE e volta pra criação standard da nota fiscal ele volta pra função J_1B_NF_DOC_INSERT_FROM_OBJECT e depois chama a função J_1B_NF_DOCUMENT_INSERT passando como parâmetro a wk_header (que continua com o XMLVERS como 1.10) e aí criamos a nota com a versão 1.10
Em resumo, se a nota de saida foi como 1.10, a nota de entrada será forçada a sair como 1.10 também devido a referência standard do SAP. Me parece que o problema esta no standard do SAP.
O que achei mais estranho é que não vi mais ninguem reclamando, então estou desconfiando que falta aplicar alguma nota em meu ERP.
Fiz um "workaround" para confirmar que daria certo, segue o que eu fiz:
Coloquei um ponto de parada na função J_1B_NF_DOC_INSERT_FROM_OBJECT (início do processamento de NFe) e alterei o wk_header-xmlvers para 2.0, após isso ele gerou a nota de devolução com a versão 2.0.
Leandro Von Zubem. -
Hello,
I am installing boot/stage server for provisioning on Oracle Enterprise Linux, so I need to install Management Agent.
Agent is installed and running. But upload XML files is not working (last successful heartbeat to OMS: unknown).
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Agent Version : 10.2.0.5.0
OMS Version : 10.2.0.5.0
Protocol Version : 10.2.0.5.0
Agent Home : /home/oracle/OracleHomes/agent10g
Agent binaries : /home/oracle/OracleHomes/agent10g
Agent Process ID : 3141
Parent Process ID : 3122
Agent URL : https://localhost.localdomain:3872/emd/main/
Repository URL : https://xxx.xx.xx:1159/em/upload
Started at : 2009-12-10 11:00:13
Started by user : oracle
Last Reload : 2009-12-10 11:00:13
Last successful upload : (none)
Last attempted upload : (none)
Total Megabytes of XML files uploaded so far : 0.00
Number of XML files pending upload : 123
Size of XML files pending upload(MB) : 3.37
Available disk space on upload filesystem : 71.78%
Last attempted heartbeat to OMS : 2009-12-10 11:44:05
Last successful heartbeat to OMS : unknown
Agent is Running and Ready
When issuing emctl upload agent receiving error:
EMD upload error: uploadXMLFiles skipped :: OMS version not checked yet..
When trying to secure, everything is fine:
Enter Agent Registration Password Agent successfully restarted... Done. Securing agent... Successful.
When trying to unsecure then getting:
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Checking Agent for HTTP... Done.
Agent successfully stopped... Done.
Unsecuring agent... Started.
OMS Upload URL - http://xxx.xx.xx:4889/em/upload/ is locked or unavailable.
Unsecuring Agent... Failed.
Agent successfully restarted... Done.
when trying to connect with telnet:
Trying 192.168.8.59...
Connected to xxx.xx.xx (192.168.8.59).
Escape character is '^]'.
then issued
^]
and received:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>501 Method Not Implemented</TITLE>
</HEAD><BODY>
<H1>Method Not Implemented</H1>
^] to /index.html not supported.<P>
Invalid method in request ^]<P>
<HR>
<ADDRESS>Oracle-Application-Server-10g/10.1.2.2.0 Oracle-HTTP-Server Server at xxx.xx.xx Port 4889</ADDRESS>
</BODY></HTML>
Connection closed by foreign host.
And sample of emagent.trc imho regarding this situation:
2009-12-10 11:00:13,661 Thread-1173184 ERROR pingManager: nmepm_pingReposURL: Did not receive a response header from repository
Help needed! What should I check? I am very new to Linux, maybe I missed something?
Waiting for any response,
Best regards,
Nikolajus
Edited by: Nikolajus on Dec 10, 2009 6:48 AMThanks for answering, Rob
My activity was:
On OMS:
[oracle@gc bin]$ ./emctl secure unlock
Oracle Enterprise Manager 10g Release 5 Grid Control
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
OMS Console is unlocked. HTTP ports too can be used to access console.
Agent Upload is unlocked. Unsecure Agents may upload over HTTP.
Then on boot_test:
./emctl unsecure agent (all completed without errors)
Then:
./emctl secure agent
Securing agent... Successful.
Then back to OMS:
[oracle@gc bin]$ ./emctl secure lock
Oracle Enterprise Manager 10g Release 5 Grid Control
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
OMS Console is locked. Access the console over HTTPS ports.
Agent Upload is locked. Agents must be secure and upload over HTTPS port.
Then on boot_test:
[oracle@boot_test bin]$ ./emctl stop agent
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Stopping agent ... stopped.
[oracle@boot_test bin]$ ./emctl start agent
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Starting agent ..... started.
[oracle@boot_test bin]$ ./emctl clearstate agent
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
EMD clearstate completed successfully
[oracle@boot_test bin]$ ./emctl upload agent
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
EMD upload error: uploadXMLFiles skipped :: OMS version not checked yet..
And the status is:
[oracle@boot_test bin]$ ./emctl status agent
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Agent Version : 10.2.0.5.0
OMS Version : 10.2.0.5.0
Protocol Version : 10.2.0.5.0
Agent Home : /home/oracle/OracleHomes/agent10g
Agent binaries : /home/oracle/OracleHomes/agent10g
Agent Process ID : 29610
Parent Process ID : 29594
Agent URL : https://localhost.localdomain:3872/emd/main/
Repository URL : https://xxx.xx.xx:1159/em/upload
Started at : 2009-12-11 09:42:54
Started by user : oracle
Last Reload : 2009-12-11 09:42:54
Last successful upload : (none)
Last attempted upload : (none)
Total Megabytes of XML files uploaded so far : 0.00
Number of XML files pending upload : 78
Size of XML files pending upload(MB) : 3.84
Available disk space on upload filesystem : 71.95%
Last attempted heartbeat to OMS : 2009-12-11 09:51:01
Last successful heartbeat to OMS : unknown
Agent is Running and Ready
So, it seems nothing changed. Am I missing something? Waiting for any help!
Best regards,
Nikolajus -
Error while uploading .xml file for Customer/Vendor List for Italy
Hi All,
We are facing problem while uploading the .xml file in DMEE transaction for the new Customer/Vendor List for Italy.
We have followed the entire process given in the OSS Note(1090857).
We have SAP 4.6c and followed the below steps:
1. Created ID-FI-IT Development class
2. Added domains
3. Added Data elements
4. Tried to upload the given .xml file and got any error saying ".xml file could not be interpreted".
Also there is a .SAR file mentioned to upload if we receive any errors while uploading .xml file.
Tried uploading the .SAR file also. STill we are recieving the same Error.
Can any one of you help us out.
Thanks in Advance.
RameshOk, we upload .SAR file in this way:
1. unpack .SAR file with SAPCAR.EXE program. Yuo obtain 2 files
R492445.P9C and K492445.P9C
2. put K492445.P9C in directory \SAPMNT\TRANS\COFILES and put R492445.P9C in directory \SAPMNT\TRANS\DATA of your system (DEV, TST or PRD)
3. Use Tx STMS. If You want create DMEE tree in DEV system, go to DEV import queue. Choose menu Extras | Other requests | Add. Insert P9CK492445 in Transp. request field.
4. Import the request. This creates the DMEE tree. You don't need ti upload XML file after. You can see the DMEE tree created with Tx DMEE and inserting
Tree type UMS1
Format tree IT_CUST_VEN_LIST
5. after continue follow the note
I hope this help you
Roberto -
I have a cloud service project with two roles (service and worker). In Visual Studio 2013 Update 4 when I choose "Publish..." from the "Solution Explorer", it opens "Microsoft Azure Activity Log" and quickly terminates.
Here the log:
9:43:47 AM - Applying Diagnostics extension.
9:44:09 AM - Published Asset Entry for Image Microsoft.Azure.Diagnostics_PaaSDiagnostics_europeall_manifest.xml not found.
All works fine when uploading the package and updating from https://manage.windowsazure.com/. It only fails from within Visual Studio.
What can I do to get it working?I have the same problem with our Azure project. Two web roles (service and worker). Just updated from SDK2.2 to SDK2.5 and Visual Studio 2013 Update 2 to Update 4. The main reason behind this was to move from log4net to WAD and in doing so, of course directly
move to the new diagnostics version.
Now, I get the same error message in Visual Studio:
11:45:24 - Checking for Remote Desktop certificate...
11:45:25 - Applying Diagnostics extension.
11:45:45 - Published Asset Entry for Image Microsoft.Azure.Diagnostics_PaaSDiagnostics_europeall_manifest.xml not found.
With my small testing project - also two roles (service and worker) - everything is fine. However, I'm looking for a solution to make by existing production service working.
Also the test project shows no Microsoft.Azure.Diagnostics_PaaSDiagnostics_europeall_manifest.xml,
but this is no problem - so what's the meaning of or solution to this error messages?
What I found so far:
I deployed the Azure project from the same development environment to another Azure test service: Deployment
showed no errors and the service is running fine! So the problem is not with the source, the development environment, library dependencies etc.
Trying Azure cmdlets for PowerShell also work fine for the new service and fails for the production service with almost the same error message:
Following http://blogs.msdn.com/b/kwill/archive/2014/12/02/windows-azure-diagnostics-upgrading-from-azure-sdk-2-4-to-azure-sdk-2-5.aspx
I tried:
PS C:\> Set-AzureServiceDiagnosticsExtension -StorageContext $storageContext -DiagnosticsConfigurationPath $public_config -ServiceName $service_name -Slot 'Staging' -Role $role_name
VERBOSE: Setting PaaSDiagnostics configuration for MyWebRole.
Set-AzureServiceDiagnosticsExtension : BadRequest : Published Asset Entry for Image
Microsoft.Azure.Diagnostics_PaaSDiagnostics_europeall_manifest.xml not found.
At line:1 char:1
+ Set-AzureServiceDiagnosticsExtension -StorageContext $storageContext -Diagnostic ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-AzureServiceDiagnosticsExtension], CloudException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.CloudException,Microsoft.WindowsAzure.Commands.ServiceManagement.
Extensions.SetAzureServiceDiagnosticsExtensionCommand
The problem seems to be related to those service configuration parts in the cloud which are not replaced
by a new deployment... So what are possible reasons or fixes for this behaviour?
Best regards,
Andreas -
Upload XML file data into internal table
Hi,
I need help from you.
I am uploading XML file from Application server.
1.In application server under directory it may have several XML files and i need to upload all the XML files when we gave only directory name. So, what is the function module for that logic . If possible code also.
2.Once we get the files into some internal table we need to upload data from that files to internal table.
So what is the logic for that , if possible code also.
I am giving sample directory:
For example in this directory assume 3 xml files are there.
I need to upload those files and data from that in to internal table.
Thanks & Regards
VSRBelow code will give you an idea.
TYPE-POOLS: ixml. "iXML Library Types
*TABLES : rbkp.
TYPE DECLERATIION
TYPES: BEGIN OF type_tabpo,
ebeln TYPE ekko-ebeln, "PO document number
ebelp TYPE ekpo-ebelp, "PO line item
END OF type_tabpo.
TYPES: BEGIN OF type_ekbe,
belnr TYPE rbkp-belnr, "Invoice document
gjahr TYPE rbkp-gjahr, "fiscal year
END OF type_ekbe.
TYPES: BEGIN OF type_invoice,
belnr TYPE rbkp-belnr, "PO document number
gjahr TYPE rbkp-gjahr, "Fiscal Year
rbstat TYPE rbkp-rbstat, "invoice status
END OF type_invoice.
TYPES: BEGIN OF t_xml_line, "Structure for holding XML data
data(256) TYPE x,
END OF t_xml_line.
INTERNAL TABLE DECLERATIION
DATA: gi_tabpo TYPE STANDARD TABLE OF type_tabpo,
gi_ekbe TYPE STANDARD TABLE OF type_ekbe,
gi_invoice TYPE STANDARD TABLE OF type_invoice,
gi_bapiret2 TYPE STANDARD TABLE OF bapiret2.
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory.
DATA: l_xml_table TYPE TABLE OF t_xml_line, " XML Table of the structure
l_xml_line TYPE t_xml_line, " Record of structure t_xml_line
l_xml_table_size TYPE i. " XML table size
DATA: l_filename TYPE string.
WORK AREA DECLARATION
DATA: gw_tabpo TYPE type_tabpo,
gw_ekbe TYPE type_ekbe,
gw_invoice TYPE type_invoice,
gw_bapiret2 TYPE bapiret2.
BEGIN OF SELECTION SCREEN
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
PARAMETERS: p_file TYPE pathintern LOWER CASE DEFAULT '/usr/sap/tmp/'.
Validation of XML file: Only DTD included in XML document is supported
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION SCREEN VALIDATION
AT SELECTION-SCREEN.
To validate p_file is not initial
PERFORM sub_validate_file.
PERFORM sub_validate_path.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
Request for filename for xml file from the application server
PERFORM sub_get_filename_appl USING p_file.
START OF SELECTION SCREEN
START-OF-SELECTION.
PERFORM sub_fetch_po_details.
PERFORM sub_get_invoice.
PERFORM sub_rel_invoice.
END OF SELECTION SCREEN
END-OF-SELECTION.
*& Form sub_validate_file
To Validate the file
FORM sub_validate_file .
IF p_file IS INITIAL.
MESSAGE e000. "specify the file path
ENDIF.
ENDFORM. " sub_validate_file
*& Form sub_get_filename_appl
form sub_get_filename_appl USING l_fname TYPE any.
DATA: l_fname TYPE filename-fileintern. " File name
*GET THE FILENAME FROM THE APPLICATION SERVER
CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
EXPORTING
directory = l_fname
filemask = '*'
IMPORTING
serverfile = l_fname
EXCEPTIONS
canceled_by_user = 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. " sub_get_filename_appl
*& Form sub_fetch_po_details
To fetch the PO details from the application server
Format of file is XML
FORM sub_fetch_po_details .
TYPE DECLERATIION
l_ixml = cl_ixml=>create( ).
Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
PERFORM get_xml_table.
LOOP AT gi_tabpo INTO gw_tabpo.
WRITE:/ gw_tabpo.
ENDLOOP.
ENDFORM. " sub_fetch_po_details
*& Form get_xml_table
Read from the xml file
FORM get_xml_table .
Local variable declarations
DATA: l_len TYPE i,
l_len2 TYPE i,
l_tab TYPE tsfixml,
l_content TYPE string,
l_str1 TYPE string,
c_conv TYPE REF TO cl_abap_conv_in_ce,
l_itab TYPE TABLE OF string.
l_filename = p_file.
code to upload data from application server
OPEN DATASET l_filename FOR INPUT IN BINARY MODE.
IF sy-subrc 0.
WRITE:/ 'invalid file path'.
ENDIF.
DO.
READ DATASET l_filename INTO l_xml_line.
IF sy-subrc EQ 0.
APPEND l_xml_line TO l_xml_table.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET l_filename.
code to find the table size
DESCRIBE TABLE l_xml_table.
l_xml_table_size = ( sy-tleng ) * ( sy-tfill ).
*code to convert hexadecimal to XML
LOOP AT l_xml_table INTO l_xml_line.
c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data
replacement
= space ).
c_conv->read( IMPORTING data = l_content len = l_len ).
CONCATENATE l_str1 l_content INTO l_str1.
ENDLOOP.
l_str1 = l_str1+0(l_xml_table_size).
SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
LOOP AT l_itab INTO l_str1.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
l_str1 WITH space.
ENDLOOP.
CALL TRANSFORMATION ('ID') " code to put in internal table
SOURCE XML l_str1
RESULT tab = gi_tabpo[].
ENDFORM. " get_xml_table -
Upload XML by Javascript (gateway problem)
I am trying to upload xml and xsl files by <xml> tag or by Javascript and never can reach them because of gateway problem. Suppose i have simple portlet.jsp file and them trying to upload XML resource like this:
<xml id="source" src="source.xml" />
This is not going to work because it's not gatwayed by portal and source file never can be found. So i have tried this way
<xml id="source" SRC="<pt:url pt:href='http://.../IWSNavigation/jsp/source.xml' xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/'/>"/>
But for some reason it's not gatwayed (if i do it by myself, means manual gatway this resource then all is OK, i can upload one).
I have tried to use JavaScript and failed again
var sourceUrl = "<pt:url xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/' pt:href='http://.../IWSNavigation/jsp/source.xml'/>";objXMLDoc.load(sourceUrl);
Please, help me to figured out the problem. I use Plumtree v 5.0.
Thank you.The gateway will always transform URLs in JavaScript which have been assigned to a location property.
So, to modify your example:
var myObj = new Object();
myObj.location = 'http://.../IWSNavigation/jsp/tree.xml';
objXMLDoc.load(myObj.location); -
Upload XML data using XSQL and HTTP Post ?
Upload XML data using XSLQ and HTTP Post: is that possible ?
An xsql contains an <xsql:insert-request table="aTable">
The XML data file follows the ROWSET/ROW paradigm.
What is the HTML form to upload the xml file to the XSQL ?
I tried:
<form action="myXSQL.xsql" method="POST" ENCTYPE="multipart/form-data">
XML data file to upload: <input type="file">
<input type="submit">
</form>
But the answer of myXSQL is:
<xsql-status action="xsql:insert-request" result="No posted document to process" />
Where is the problem ?
Thank you.Hello,
You are posting your XML file as a parameter therefore you should use the <xsql:insert-params/> tag, not the <xsql:insert-request/>. The insert-request can only handle data not posted via a parameter.
Usage:
<form action="myXSQL.xsql" method="GET" ENCTYPE="multipart/form-data">
XML data file to upload: <input type="file" name="myXML">
<input type="submit">
</form>
in combination with
<xsql>
<xsql:insert-params name="myXML" table="your table"/>
</xsql>
2 remarks:
I was not able to succesfully POST the form. The answer was <xsql-status action="xsql:insert-request" result="No posted document to process" />. With GET is was succesfull.
Second, if you use MSInternet explorer 5 or higher use could post the XML directly (not aw parameter) using an ActiveX object.
Regards,
Harm Verschuren -
Hi All,
I have a requirement where I need to upload the XML file in one client(or system)
which has been downloaded using another client(or system)
I am using
call method cl_gui_frontend_services=>gui_upload
to upload the file but it is going for dump.
I have also tried with
call method w_xml->import_from_file
but it is also going for dump as both methods are using the same FM GUI_UPLOAD.
Can anyone please tell me how to resolve this.
Regards
Harithahi
<b>Please refer to</b>
Upload XML to internal table and vice versa in SAP 4.6C
http://www.sap-img.com/abap/abap-object-oriented-spreadsheet-with-unlimited-power.htm
Visit
http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
and
http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
You need some basic idea of range object in excel.
You need to create XLS with named ranges or create ranges dynamically.
This could be a neat way to upload XLS the OO way!
The function Module zjnc_get_range reads 1 range into any Internal
table.
DATA: BEGIN OF it_test OCCURS 0,
vpd LIKE mseg-menge,
vas LIKE mkpf-budat,
vkm LIKE mseg-matnr,
END OF it_test.
CALL FUNCTION 'ZJNC_GET_RANGE'
EXPORTING
rangename = 'test'
itabname = 'IT_TEST[]'
irecname = 'it_test'
spreadsheetintf = spreadsheetintf.
=Work!$A$14:$C$16 is range "test"
Numbers & Character data are no problem BUT dates are.
In Excel default date is mm/dd/yyyy but is dependent on PC's
international setting which is normally default
To Avoid any 5-March 3-May type mix-up, I have designed the FM so that you need to
enter dates as 'dd.Mon.yyyy i.e. in Characters in "Internet Date Format"
FUNCTION zjnc_get_range.
*"*"Local interface:
*" IMPORTING
*" REFERENCE(RANGENAME) TYPE C
*" REFERENCE(ITABNAME) TYPE C
*" REFERENCE(IRECNAME) TYPE C
*" REFERENCE(SPREADSHEETINTF) TYPE REF TO I_OI_SPREADSHEET
*" REFERENCE(SPREADSHEETINTF) TYPE REF TO I_OI_SPREADSHEET
DATA:
stru_ref TYPE REF TO cl_abap_structdescr,
comp_tab TYPE abap_compdescr_tab,
one_comp TYPE abap_compdescr,
one_name TYPE string,
type_ref TYPE REF TO cl_abap_typedescr,
is_ddic TYPE abap_bool,
lt_ddic TYPE dd_x031l_table,
wa_ddic TYPE x031l.
DATA: zjncranges TYPE soi_range_list,
zjnccontents TYPE soi_generic_table,
zjnconerange TYPE soi_range_item,
zjnconeitem TYPE soi_generic_item,
prevrow(4) TYPE n,
nrow(4) TYPE n,
ncolumn(4) TYPE n,
mystring TYPE string,
mydate LIKE sy-datum.
FIELD-SYMBOLS: <fs_type> TYPE ANY,
<fs_table> TYPE STANDARD TABLE,
<fs_line> TYPE ANY.
CONCATENATE '(' sy-cprog ')' itabname INTO mystring.
ASSIGN (mystring) TO <fs_table>.
CONCATENATE '(' sy-cprog ')' irecname INTO mystring.
ASSIGN (mystring) TO <fs_line>.
stru_ref ?= cl_abap_structdescr=>describe_by_data( <fs_line> ).
comp_tab = stru_ref->components.
REFRESH zjncranges.
MOVE rangename TO zjnconerange-name.
APPEND zjnconerange TO zjncranges.
CALL METHOD spreadsheetintf->get_ranges_data
IMPORTING
contents = zjnccontents
error = zjncerror
retcode = zjncretcode
CHANGING
ranges = zjncranges.
MOVE 0 TO prevrow.
LOOP AT zjnccontents INTO zjnconeitem.
MOVE zjnconeitem-row TO nrow.
IF nrow <> prevrow.
IF prevrow <> 0.
APPEND <fs_line> TO <fs_table>.
ENDIF.
CLEAR <fs_line>.
MOVE nrow TO prevrow.
ENDIF.
MOVE zjnconeitem-column TO ncolumn.
READ TABLE comp_tab INDEX ncolumn INTO one_comp.
CONCATENATE '(' sy-cprog ')' irecname '-' one_comp-name INTO one_name.
ASSIGN (one_name) TO <fs_type>.
IF one_comp-type_kind <> 'D'.
MOVE zjnconeitem-value TO <fs_type>.
ELSE.
TRANSLATE zjnconeitem-value TO UPPER CASE.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_INPUT'
EXPORTING
input = zjnconeitem-value
IMPORTING
output = mydate.
MOVE mydate TO <fs_type>.
ENDIF.
ENDLOOP.
IF prevrow <> 0.
APPEND <fs_line> TO <fs_table>.
ENDIF.
ENDFUNCTION.
SAP has a facility called BDS.
<b>Read</b>
http://www.intelligententerprise.com/channels/applications/feature/archive/schulze.jhtml
Read http://www.sappro.com/download03.cfm?session=
There is ready code of BDS+DOI -- uses CL_BDS_DOCUMENT_SET global class.
If you wish to store a Word/Excel/AutoCad or any other document in SAP,
then you can use the Business Document Service (BDS). I did not - as
Cluster Data Directory is a simple beginning ...
<b><u>Uploading data directly from Excel file format </u></b>
* Upload data direct from excel.xls file to SAP
REPORT ZEXCELUPLOAD.
PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01,
begcol TYPE i DEFAULT 1 NO-DISPLAY,
begrow TYPE i DEFAULT 1 NO-DISPLAY,
endcol TYPE i DEFAULT 100 NO-DISPLAY,
endrow TYPE i DEFAULT 32000 NO-DISPLAY.
* Tick don't append header
PARAMETERS: kzheader AS CHECKBOX.
DATA: BEGIN OF intern OCCURS 0.
INCLUDE STRUCTURE alsmex_tabline.
DATA: END OF intern.
DATA: BEGIN OF intern1 OCCURS 0.
INCLUDE STRUCTURE alsmex_tabline.
DATA: END OF intern1.
DATA: BEGIN OF t_col OCCURS 0,
col LIKE alsmex_tabline-col,
size TYPE i.
DATA: END OF t_col.
DATA: zwlen TYPE i,
zwlines TYPE i.
DATA: BEGIN OF fieldnames OCCURS 3,
title(60),
table(6),
field(10),
kz(1),
END OF fieldnames.
* No of columns
DATA: BEGIN OF data_tab OCCURS 0,
value_0001(50),
value_0002(50),
value_0003(50),
value_0004(50),
value_0005(50),
value_0006(50),
value_0007(50),
value_0008(50),
value_0009(50),
value_0010(50),
value_0011(50),
value_0012(50),
value_0013(50),
value_0014(50),
value_0015(50),
value_0016(50),
value_0017(50),
value_0018(50),
value_0019(50),
value_0020(50),
value_0021(50),
value_0022(50),
value_0023(50),
value_0024(50),
value_0025(50),
value_0026(50),
value_0027(50),
value_0028(50),
value_0029(50),
value_0030(50),
value_0031(50),
value_0032(50),
value_0033(50),
value_0034(50),
value_0035(50),
value_0036(50),
value_0037(50),
value_0038(50),
value_0039(50),
value_0040(50),
value_0041(50),
value_0042(50),
value_0043(50),
value_0044(50),
value_0045(50),
value_0046(50),
value_0047(50),
value_0048(50),
value_0049(50),
value_0050(50),
value_0051(50),
value_0052(50),
value_0053(50),
value_0054(50),
value_0055(50),
value_0056(50),
value_0057(50),
value_0058(50),
value_0059(50),
value_0060(50),
value_0061(50),
value_0062(50),
value_0063(50),
value_0064(50),
value_0065(50),
value_0066(50),
value_0067(50),
value_0068(50),
value_0069(50),
value_0070(50),
value_0071(50),
value_0072(50),
value_0073(50),
value_0074(50),
value_0075(50),
value_0076(50),
value_0077(50),
value_0078(50),
value_0079(50),
value_0080(50),
value_0081(50),
value_0082(50),
value_0083(50),
value_0084(50),
value_0085(50),
value_0086(50),
value_0087(50),
value_0088(50),
value_0089(50),
value_0090(50),
value_0091(50),
value_0092(50),
value_0093(50),
value_0094(50),
value_0095(50),
value_0096(50),
value_0097(50),
value_0098(50),
value_0099(50),
value_0100(50).
DATA: END OF data_tab.
DATA: tind(4) TYPE n.
DATA: zwfeld(19).
FIELD-SYMBOLS: <fs1>.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
mask = '*.xls'
static = 'X'
CHANGING
file_name = filename.
START-OF-SELECTION.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = filename
i_begin_col = begcol
i_begin_row = begrow
i_end_col = endcol
i_end_row = endrow
TABLES
intern = intern
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/ 'Upload Error ', SY-SUBRC.
ENDIF.
END-OF-SELECTION.
LOOP AT intern.
intern1 = intern.
CLEAR intern1-row.
APPEND intern1.
ENDLOOP.
SORT intern1 BY col.
LOOP AT intern1.
AT NEW col.
t_col-col = intern1-col.
APPEND t_col.
ENDAT.
zwlen = strlen( intern1-value ).
READ TABLE t_col WITH KEY col = intern1-col.
IF sy-subrc EQ 0.
IF zwlen > t_col-size.
t_col-size = zwlen.
* Internal Table, Current Row Index
MODIFY t_col INDEX sy-tabix.
ENDIF.
ENDIF.
ENDLOOP.
DESCRIBE TABLE t_col LINES zwlines.
SORT intern BY row col.
IF kzheader = 'X'.
LOOP AT intern.
fieldnames-title = intern-value.
APPEND fieldnames.
AT END OF row.
EXIT.
ENDAT.
ENDLOOP.
ELSE.
DO zwlines TIMES.
WRITE sy-index TO fieldnames-title.
APPEND fieldnames.
ENDDO.
ENDIF.
SORT intern BY row col.
LOOP AT intern.
IF kzheader = 'X'
AND intern-row = 1.
CONTINUE.
ENDIF.
tind = intern-col.
CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.
ASSIGN (zwfeld) TO <fs1>.
<fs1> = intern-value.
AT END OF row.
APPEND data_tab.
CLEAR data_tab.
ENDAT.
ENDLOOP.
CALL FUNCTION 'DISPLAY_BASIC_LIST'
EXPORTING
file_name = filename
TABLES
data_tab = data_tab
fieldname_tab = fieldnames.
*-- End of Program
Reward all helpfull answers
Regards
Pavan
Message was edited by:
Pavan praveen -
Problem deploying connector: META-INF/ejb-jar.xml not found in jar file
Has anyone seen this problem:
I built Sun's Blackbox implementation and packaged
it identical to the BlackBoxNoTx.rar included with
Weblogic's 'jconnector' sample (even using the same
ra.xml and weblogic-ra.xml). When I try to deploy
it, the server reports:
java.io.FileNotFoundException:
META-INF/ejb-jar.xml not found in jar file
I have no idea why the server thinks my connector
is an EJB. If I deploy the BlackBoxNoTx.rar included
with the sample, everything works without a hitch.
The only variable that I'm changing in my BlackBoxNoTx.rar
is that I build the Blackbox classes myself--otherwise,
the RAR packagings are identical. Any assistance is
greatly appreciated since I'm banging my head against
a wall...
Thanks,
-jason
I was finally able to resolve this one. On the odd chance that someone else encounters
the same problem, here's what went wrong:
My RAR file had two directories: 'META-INF' and 'meta-inf'. The first was created
by the jar tool and contained the manifest.mf file. The second I created manually
and it contained my ra.xml and weblogic-ra.xml. When I examined the RAR using
any tools or I extracted the contents, it looked like it only contained one directory:
META-INF (because NT is case-insensitive).
"Jason L" <[email protected]> wrote:
>
>Has anyone seen this problem:
>
>I built Sun's Blackbox implementation and packaged
>it identical to the BlackBoxNoTx.rar included with
>Weblogic's 'jconnector' sample (even using the same
>ra.xml and weblogic-ra.xml). When I try to deploy
>it, the server reports:
>
>java.io.FileNotFoundException:
>META-INF/ejb-jar.xml not found in jar file
>
>I have no idea why the server thinks my connector
>is an EJB. If I deploy the BlackBoxNoTx.rar included
>with the sample, everything works without a hitch.
>The only variable that I'm changing in my BlackBoxNoTx.rar
>is that I build the Blackbox classes myself--otherwise,
>the RAR packagings are identical. Any assistance is
>greatly appreciated since I'm banging my head against
>a wall...
>
>Thanks,
>
>-jason
-
Getting error when try to upload xml file into Data Template
Hi,
Getting error when try to upload xml file into Data Template.error:"The uploaded file XXSLARPT.xml is invalid. The file should be in XML-DATA-TEMPLATE format."Plz anybody help me.
Thanks,
Prasad.Hi,
Anybody Help Plzzzzzz.
thx,
Prasad -
upgraded domain from 10.3.0 to 10.3.2
while upgrading one message was..
"no servers are detected under this directory"
and now after my upgrade is successfully done its showing me that "the config.xml not found"...If you live near an Apple Store, make a Genius Bar appointment to have the computer tested. Supposedly there is no charge for testing. Use 2nd link if not near an Apple Store or aren’t in the US. Hardware Repair - Keeping Confidential Data Safe
Genius Bar Reservation US
Authorized Service Provider -
Error: unable to copy to output directory, ReqMgmtActionsVO.xml not found
hi,
While running a page using jdeveloper am getting error like
Error: unable to copy to output directory, ReqMgmtActionsVO.xml not found.
am very thankful to the response
Thanks
SuryaHi,
I faced the same issue.
I fixed it by searching the missing file (In my case MyEO.xml which is a removed file) using JDeveloper (Menu Search/Search Files...).
It found an occurence in the related .jpr file.
In the .jpr, I deleted the related lines:
<Item>
<Key class="java.net.URL" path="xx/oracle/apps/.../MyEO.xml"/>
<Value idref="15"/>
</Item>
That's it.
Regards,
Olivier -
Upload XML file from server to itab
After failed to get a answer about download data from xml file in server to my itab, and searching and searching in hundred of post and threads i try my own solution for this issue.
I read the file with:
OPEN DATASET FICHERO FOR INPUT IN TEXT MODE ENCODING DEFAULT.
In this case the result is a table filled with register type string like this:
#<label>22222</label>
I need a table with this kind of value (example):
label | 22222
label2 | John
label3 | Smith
Therefore i have to parse the data of my table, i try with the FM:
TEXT_CONVERT_XML_TO_SAP
But dont works for me,
I am too new in ABAP.
The code for my report is very simple:
REPORT ZPRUEBA_XML.
DATA: BEGIN OF TABLA OCCURS 1,
TEXTO(256) TYPE C,
END OF TABLA.
DATA: FICHERO LIKE RLGRAP-FILENAME.
OPEN DATASET FICHERO FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC NE 0.
WRITE:/ 'ERROR'.
ENDIF.
FREE TABLA.
DO.
READ DATASET FICHERO INTO TABLA.
IF SY-SUBRC NE 0.
EXIT.
ELSE.
APPEND TABLA.
WRITE: TABLA-TEXTO.
ENDIF.
ENDDO.
CLOSE DATASET FICHERO.
And my ".xml" in the server is very simple too.
<label>222222</label>
<name>John</name>
<street>Smith, 23, NY</street>
Anyone can help me?
ThanksHi,
You could use a transformation to do that, or call FM 'TEXT_CONVERT_XML_TO_SAP'... you also have the class IF_IXML that should help you and a lot of threads on the subject, such as:
convert XML data into ABAP internal table
ABAP Class to convert XML to itab
Upload XML to internal table and vice versa in SAP 4.6C
http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e66701fc-0d01-0010-9c9a-f8a36c4e87ba
Kr,
Manu.
Maybe you are looking for
-
Is it possible to use iCloud between a MBA with Lion and a iMac with snow leopard?
I have an iMac with Mac OS X 10.6.8 and an MBA with Mac OS X 10.7.2. I want to use iCloud to synchronise my pages documents, my calendar and adressbook between the two. Is that possible?
-
Create a flash video using adobe media encoder cc 2014
How to create a flash video using adobe media encoder cc 2014?
-
System restore and no more music
Arlight, so last night I had to erase my computer completely. Now I'm in the process of reinstalling some necessary programs, such as iTunes. I have all of my music on my ipod already, it's just not in my library. I read the earlier question whose an
-
Function Module to Update PPOCE data
Hey all, Is there any MF or BAPI who can help me to update the data of an U.O in PPOCE. When i change the value of the name of an organisation and his date , and i keep in sql trace , i just found an update in T527X but any call of MF.... Thanks in a
-
Planning suggestion issue for Project item
Hi We have sales order demand and the item is assigned with project and task information. Planning suggest 2 planned order and 1 line with project and task and another line with project & task, We are in r12.1.3 version We are not able to identify wh