ABAP Mapping Programm error Urgent
I am getting mapping error in ABAP Mapping programm. plz help me how to solve
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!--
Request Message Mapping
-->
- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">APPLICATION_PROGRAM_ERROR</SAP:Code>
<SAP:P1>Z_HBS_PAYROLL_MAPPING</SAP:P1>
<SAP:P2>SAP-ABAP</SAP:P2>
<SAP:P3>UNCAUGHT_EXCEPTION</SAP:P3>
<SAP:P4>Program Z_HBS_PAYROLL_MAPPING=========CP Include Z_HBS_PAYROLL_MAPPING=========CM001 Line 1</SAP:P4>
<SAP:AdditionalText />
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack>Error in mapping program Z_HBS_PAYROLL_MAPPING (type SAP-ABAP, kernel error ID UNCAUGHT_EXCEPTION) An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handled locally, nor declared in a RAISING clause Dereferencing of the NULL reference</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
Hi,
I think this exception you need to catch it in the ABAP..
This may help u- http://help.sap.com/saphelp_47x200/helpdata/en/55/bff20efe8c11d4b54a006094b9456f/content.htm
just cross verify with this guide-
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
Regards,
moorthy
Similar Messages
-
ABAP Mapping for Error handling in Proxy to JDBC
Hi All,
I am working on a proxy to jdbc scenario in which we have to throw validation errors to NWPM(Net Weaver Process Monitor Tool)
I am following the below steps,
step 1 - In message mapping a UDF is created to catch errors and store them in a variable using dynamic configuration
step 2 - writing abap mapping for handling this thrown exception and im reading the dynamic configuration in the abap class and raising exception. The exception format expected is
SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SAP:Category>XIServer</SAP:Category>
<SAP:Code area="RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC</SAP:Code>
<SAP:P1>ZPI_THROW_EXCEPTION</SAP:P1>
<SAP:P2>001</SAP:P2/>
<SAP:P3>Mandatory field is missing[BUKRS] </SAP:P3>
<SAP:AdditionalText />
<SAP:Stack>No receiver could be determined</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
I have written the following ABAP code to achieve this:
method IF_MAPPING~EXECUTE.
DATA l_record type mpp_dynamic.
DATA error type String.
getting dynamic configuration value
filled in by any previous mapping
CALL METHOD DYNAMIC_CONFIGURATION->GET_RECORD
EXPORTING
NAMESPACE = 'http://sap.com/xi/XI/System/ERROR'
NAME = 'ERROR'
RECEIVING
RECORD = l_record.
error = l_record-value.
*raising exception with our message
RAISE EXCEPTION TYPE CX_MAPPING_FAULT
EXPORTING
TEXTID =
PREVIOUS =
ERROR_CODE = '001'
ERROR_TEXT = error .
RAISE EXCEPTION TYPE CX_MAPPING_FAULT
EXPORTING
TEXTID =
PREVIOUS =
ERROR_CODE = '003'
ERROR_TEXT = error .
endmethod.
I am gettign the following message for our code:
SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SAP:Category>XIServer</SAP:Category>
<SAP:Code area="RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC</SAP:Code>
<SAP:P1 />
<SAP:P2 />
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText />
<SAP:Stack>No receiver could be determined</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
Could you please help in finding the solution for getting currect error message from ABAP class?
Edited by: SwethaC on Jan 21, 2011 8:18 AMThe error is due to RFC Call fail from PI system to your ECC Application System.
Check your RFC Destination for ECC System type 3 in PI System.
When you are receiving data from ECC System using Proxies & again you are going to ECC System for Validation.
Why you are not doing this validation on ECC System only in your proxy code ?
In your proxy code, it will be much better for performance to check your data there on same system. -
DTP-ABAP run time error- Urgent
Hi All
I had put Sales order as the key in my COPA DSO,due to which i was getting summarised records, nw i removed this key and put the Lowest granular detail key and i.e BW doc # (0doc_num) & then i have activated my DSO.Now when i do the DTP frm COPA Datasource to my DSO, the Records get updated but in DTP run i get ABAP run time Error as 'ASSIGN_TYPE_CONFLICT'
Short Text: Type Conflict with ASSIGN in program "GP493C06NEDFLBYD3SN1KJR3EDX"Can any1 please advice on this as this is quiet urgent.
Points are assured
ThanksHi Noor,
Regarding your problem, p/s do this:
1. Go to tx: RSSGPCLA
2. Highlight the RSTRAN_MASTER_TMPL then click set status button
3. Re-execute the DTP.
Or you can see it : Notes: 908427
As your references.
Hopefully it can help you a lot.
Best regards,
Niel.
thanks for the points you choose to assign. -
IDOC-XI-FILE Scenario: Error in ABAP Mapping
Dear All,
I am working on IDOC-XI-Flat FIle scenario in which I am using ABAP Mapping as per document "How To Convert an IDoc-XML
structure to a flat file and vice versa in XI 3.0".
I created one customized Idoc for this. The Idoc is reacing XI but its flat file is not getting created. Its giving me following error:
<SAP:Stack>Error in mapping program Z_ABAP_MAPPING_PACKING_LIST (type SAP-ABAP, kernel error ID UNCAUGHT_EXCEPTION) An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handled locally, nor declared in a RAISING clause Dereferencing of the NULL reference.</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
I have also gone thru threads posted for the same topic earlier but still I am not been to resolve this error.
Please help me out in resolving this error.
Regards,
N.JainHI,
Log saying that, u have problem in the mapping program.
i.e Z_ABAP_MAPPING_PACKING_LIST
the problem is due declaration of data.
i hope that, you have some methods.
those are declared under intialization section in mapping program.
please use start of selection before the method.
other wise, it will come under intilization section.
warm regards
mahesh. -
Error in ABAP Mapping (type SAP-ABAP, kernel error ID UNCAUGHT_EXCEPTION)
Hi ,
Scenario: Manually Purchase Order is created, automatically Sales Order should be created in the Target System through PI,
I have used Message Mapping which is working fine for single Customer and Vendor,
For Multiple Customers and Vendors i am using one ZTABLE, Only Message Mapping is not sufficient to my requirement.
Now i am using both Message Mapping and ABAP Mapping at a time in Interface Mapping. I created the class and done the development., whene i run the scenario i am getting the error as below,
*<SAP:Stack>Error in mapping program ZCL_SD_IDTO_POSO (type SAP-ABAP, kernel error ID UNCAUGHT_EXCEPTION) An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handled locally, nor declared in a RAISING clause Dereferencing of the NULL reference</SAP:Stack>*
*<SAP:Retry>M</SAP:Retry>*
*</SAP:Error>*
Please let me know.
Best Regards
VamsiHave u seen the ABAP mapping guide?
Refer this series to the ABAP mapping section.https:///people/sravya.talanki2/blog/2006/12/26/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-ii
It will be very handy and useful. -
Abap Mapping: error in accessing to DynamicConfiguration.
Hi All,
I have been trying to put a value into Dynamic Configuration repository with the following abap code.
DATA: l_record TYPE MPP_DYNAMIC.
l_record-namespace = 'http://name1/ca/result1'.
l_record-name = 'FileName'.
l_record-value = '/mydir/dir1/File01.xml'.
CALL METHOD dynamic_configuration->add_record
EXPORTING
record = l_record.
I receive the following dump.
Runtime Errors OBJECTS_OBJREF_NOT_ASSIGNED_NO
Except. CX_SY_REF_IS_INITIAL
Date and Time 25.03.2009 11:06:10
Short text
Access using a 'ZERO' object reference is not possible.
What happened?
Error in the ABAP application program.
The current ABAP program "Z_XI_MAPPING_TEST_03==========CP" had to be
interrupted because it contains
a statement that cannot be executed.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was n
caught in
procedure "IF_MAPPING~EXECUTE" "(METHOD)", nor was it propagated by a R
clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
An attempt was made to access a component with a 'ZERO' object
reference (points to 'nothing').
An object reference must point to an object (an instance of a class)
before it can be used to access a component.
Either the reference has not yet been set or it was set to 'ZERO' using
a CLEAR statement.
I am executing my test outside PI, by launching the report Z_MAPPING_TEST as explained in a blog.
In java evironment it is necessary to create an istance of a object for saving the value of the variable 'FileName' inside the Dynamic Configuration repository.
I do not know if it is necessary to create (before) an istance of the Dynamic Configuration in abap mapping or if the method add_record do this.
The meaning of my test is to get the name file from the Dynamic Configuration repository set in a previous step in a flow where the abap mapping will be launched.
Any suggestion will be well appreciated.
Many thanks in advance for your kind cooperation.
Regard,
GiovanniHi,
in your ABAP mapping code, instead of l_record-namespace = 'http://name1/ca/result1' use below:
l_record-namespace = 'http://sap.com/xi/XI/System'.
Then re-run your scenario.
Regards,
Rajeev Gupta -
Hi ,
i am using the following ABAP mapping program
method if_mapping~execute .
data: t_edidc type table of edi_dc40,
ls_edidc type edi_dc40,
ls_edidc_h type edi_dc40,
t_edidd type table of edi_dd40,
ls_edidd_h type edi_dd40,
ls_idx_xmb type idx_xmb,
t_result type string,
t_resultc type string,
t_resultd type string.
data: ls_idx1 type idxporsm59.
data: t_segtyp type table of edilsegtyp,
el_segtyp type edilsegtyp,
el_released type segdefrel,
el_error_text type string.
=======================
0. parse input document
=======================
initialize iXML
type-pools: ixml.
break-point.
class cl_ixml definition load.
create main factory
data: ixmlfactory type ref to if_ixml.
break-point.
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 ).
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( ).
=================================================
1. get IDoc header data and connection parameters
=================================================
data: el_message_id type sxmsguid.
el_message_id = param->get( if_mapping_param=>message_id ).
data: el_element type ref to if_ixml_element.
el_element = idocument->find_from_name( 'TABNAM' ).
ls_edidc-tabnam = el_element->get_value( ).
el_element = idocument->find_from_name( 'MANDT' ).
ls_edidc-mandt = el_element->get_value( ).
el_element = idocument->find_from_name( 'DOCNUM' ).
ls_edidc-docnum = el_element->get_value( ).
el_element = idocument->find_from_name( 'STATUS' ).
ls_edidc-status = el_element->get_value( ).
el_element = idocument->find_from_name( 'OUTMOD' ).
ls_edidc-outmod = el_element->get_value( ).
el_element = idocument->find_from_name( 'TEST' ).
if not el_element is initial.
ls_edidc-test = el_element->get_value( ).
endif.
el_element = idocument->find_from_name( 'IDOCTYP' ).
ls_edidc-idoctyp = el_element->get_value( ).
el_element = idocument->find_from_name( 'CIMTYP' ).
if not el_element is initial.
ls_edidc-cimtyp = el_element->get_value( ).
endif.
el_element = idocument->find_from_name( 'MESTYP' ).
ls_edidc-mestyp = el_element->get_value( ).
el_element = idocument->find_from_name( 'STDVRS' ).
if not el_element is initial.
ls_edidc-stdvrs = el_element->get_value( ).
endif.
el_element = idocument->find_from_name( 'STD' ).
if not el_element is initial.
ls_edidc-std = el_element->get_value( ).
endif.
el_element = idocument->find_from_name( 'STDMES' ).
ls_edidc-stdmes = el_element->get_value( ).
el_element = idocument->find_from_name( 'SNDPOR' ).
ls_edidc-sndpor = el_element->get_value( ).
el_element = idocument->find_from_name( 'SNDPRT' ).
ls_edidc-sndprt = el_element->get_value( ).
el_element = idocument->find_from_name( 'SNDPRN' ).
ls_edidc-sndprn = el_element->get_value( ).
el_element = idocument->find_from_name( 'RCVPOR' ).
ls_edidc-rcvpor = el_element->get_value( ).
el_element = idocument->find_from_name( 'RCVPRT' ).
ls_edidc-rcvprt = el_element->get_value( ).
el_element = idocument->find_from_name( 'RCVPRN' ).
ls_edidc-rcvprn = el_element->get_value( ).
el_element = idocument->find_from_name( 'CREDAT' ).
ls_edidc-credat = el_element->get_value( ).
el_element = idocument->find_from_name( 'CRETIM' ).
ls_edidc-cretim = el_element->get_value( ).
el_element = idocument->find_from_name( 'SERIAL' ).
ls_edidc-serial = el_element->get_value( ).
ls_edidc-direct = '2'.
move-corresponding ls_edidc to ls_idx_xmb.
Connection data to application system to get IDoc metadata
select single * from idxporsm59 into ls_idx1
where port = ls_edidc-sndpor
and client = ls_edidc-mandt.
ls_idx_xmb-port = ls_edidc-sndpor.
ls_idx_xmb-rfcdest = 'NONE'. "not necessary
Get DOCREL and SAPREL
el_element = idocument->find_from_name( 'DOCREL' ).
if not el_element is initial.
ls_edidc-docrel = el_element->get_value( ).
else.
select segtyp into table t_segtyp from idxidocsyn
where port = ls_edidc-sndpor
and idoctyp = ls_edidc-idoctyp
and cimtyp = ls_edidc-cimtyp.
loop at t_segtyp into el_segtyp.
select released into el_released from idxedisdef
where port = ls_edidc-sndpor
and segtyp = el_segtyp
and actrelease = 'X'.
endselect.
if el_released gt ls_edidc-docrel.
ls_edidc-docrel = el_released.
endif.
endloop.
endif.
======================================
2. convert XML to IDoc table structure
======================================
break-point.
call function 'IDX_XML_TO_IDOC'
exporting
xml_data = source
guid = el_message_id
edidc40 = ls_edidc
idx_xmb = ls_idx_xmb
typ_def = 'X'
tables
idoc_control_40 = t_edidc
idoc_data_40 = t_edidd
exceptions
unknown_xml = 1
customizing_error = 2
no_data_found = 3
syntax_error = 4
others = 5.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
To keep the original DOCNUM uncomment the following 8 lines of coding
Otherwise a new DOCNUM will be created
LOOP AT t_edidc into ls_edidc_h.
ls_edidc_h-DOCNUM = ls_edidc-DOCNUM.
modify t_edidc from ls_edidc_h.
ENDLOOP.
LOOP AT t_edidd into ls_edidd_h.
ls_edidd_h-DOCNUM = ls_edidc-DOCNUM.
modify t_edidd from ls_edidd_h.
ENDLOOP.
=========================================
3. convert IDoc table structure to string
=========================================
call function 'ZSOTR_SERV_TABLE_TO_STRING'
EXPORTING
FLAG_NO_LINE_BREAKS = ' '
LINE_LENGTH = 0
LANGU = SY-LANGU
importing
text = t_resultc
tables
text_tab = t_edidc.
convert IDoc table structure to string
call function 'ZSOTR_SERV_TABLE_TO_STRING'
EXPORTING
FLAG_NO_LINE_BREAKS = ' '
LINE_LENGTH = 0
LANGU = SY-LANGU
importing
text = t_resultd
tables
text_tab = t_edidd.
concatenate t_resultc t_resultd into t_result.
convert string to xstring
call function 'SCMS_STRING_TO_XSTRING'
exporting
text = t_result
MIMETYPE = ' '
ENCODING =
importing
buffer = result.
EXCEPTIONS
FAILED = 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.
endmethod.
<b> i am getting the following parse error in FM IDX_XML_TO_IDOC :
" unexpected symbol; expected '<', '</', entity reference, character data, CDATA section, processing instruction or comment "
can anybody help
points will be given
Regards</b>HI,
is it possible that you have to use "-" instead of "=" in this [ixmlfactory = cl_ixml=>create( ).] line ?
regards,
gordon -
ABAP MAPPING : Getting An Error
hi all
i am using a scenario where i am sending data from r/3(prog)>xi>R/3(RFC).
in between i am using ABAP MAPPING
i am getting an error:
ERROR: "" MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7: com.sap.aii.af.rfc.afcommunication.RfcAFWException: java.lang.StringIndexOutOfBoundsException: String index out of range: -7""
the ABAP MAPPING which i am using:
METHOD IF_MAPPING~EXECUTE.
BREAK-POINT.
* initialize iXML
TYPE-POOLS: IXML.
TYPE-POOLS: IXML.
DATA: L_IXML TYPE REF TO IF_IXML.
*creating the Interface by calling the create method in class C_IXML
CALL METHOD CL_IXML=>CREATE
EXPORTING
TYPE = 0
RECEIVING
RVAL = L_IXML.
create stream factory
DATA: STREAMFACTORY TYPE REF TO IF_IXML_STREAM_FACTORY.
CALL METHOD L_IXML->CREATE_STREAM_FACTORY
RECEIVING
RVAL = STREAMFACTORY.
create input stream
DATA: ISTREAM TYPE REF TO IF_IXML_ISTREAM.
CALL METHOD STREAMFACTORY->CREATE_ISTREAM_XSTRING
EXPORTING
STRING = SOURCE
RECEIVING
RVAL = ISTREAM.
*This iXML factory can create an empty XML document object named IDOCUMENT.
initialize input document
DATA: IDOCUMENT TYPE REF TO IF_IXML_DOCUMENT.
CALL METHOD L_IXML->CREATE_DOCUMENT
RECEIVING
RVAL = IDOCUMENT.
parse input document
DATA: IPARSER TYPE REF TO IF_IXML_PARSER.
CALL METHOD L_IXML->CREATE_PARSER
EXPORTING
DOCUMENT = IDOCUMENT
ISTREAM = ISTREAM
STREAM_FACTORY = STREAMFACTORY
RECEIVING
RVAL = IPARSER.
IPARSER->PARSE( ).
DATA: ROOT TYPE REF TO IF_IXML_ELEMENT.
get message content of tag
DATA: INCODE TYPE REF TO IF_IXML_NODE_COLLECTION,
INCODE1 TYPE REF TO IF_IXML_NODE_COLLECTION,
INCODE2 TYPE REF TO IF_IXML_NODE_COLLECTION,
INCODE0 TYPE REF TO IF_IXML_NODE_COLLECTION.
CALL METHOD IDOCUMENT->GET_ELEMENTS_BY_TAG_NAME
EXPORTING
DEPTH = 0
NAME = 'MANDT'
NAMESPACE = ''
RECEIVING
RVAL = INCODE0 .
CALL METHOD IDOCUMENT->GET_ELEMENTS_BY_TAG_NAME
EXPORTING
DEPTH = 0
NAME = 'EMPNO'
NAMESPACE = ''
RECEIVING
RVAL = INCODE.
CALL METHOD IDOCUMENT->GET_ELEMENTS_BY_TAG_NAME
EXPORTING
DEPTH = 0
NAME = 'EMPNAME'
NAMESPACE = ''
RECEIVING
RVAL = INCODE1.
CALL METHOD IDOCUMENT->GET_ELEMENTS_BY_TAG_NAME
EXPORTING
DEPTH = 0
NAME = 'DEPARTMENTNAME'
NAMESPACE = ''
RECEIVING
RVAL = INCODE2.
DATA: URI TYPE STRING.
URI = 'urn:sap-com:document:sap:rfc:functions'.
* build up output document =============================================
create output document
DATA: ODOCUMENT TYPE REF TO IF_IXML_DOCUMENT.
CALL METHOD L_IXML->CREATE_DOCUMENT
RECEIVING
RVAL = ODOCUMENT.
DATA: RET_VALUE TYPE I.
*At this point you can add the nodes (elements, attributes) into the document. First you have to declare the root element node.
DATA: L_ELEMENT_ROOT TYPE REF TO IF_IXML_ELEMENT.
CALL METHOD ODOCUMENT->CREATE_ELEMENT_NS
EXPORTING
NAME = 'ZTEST1'
PREFIX = 'ns1'
URI = 'urn:sap-com:document:sap:rfc:functions'
RECEIVING
RVAL = L_ELEMENT_ROOT.
DATA: L_ELEMENT_NODE TYPE REF TO IF_IXML_ELEMENT.
CALL METHOD ODOCUMENT->CREATE_SIMPLE_ELEMENT
EXPORTING
NAME = 'ZTEST1'
NAMESPACE = 'xmlns ns1 urn:sap-com:document:sap:rfc:functions'
PARENT = ODOCUMENT
VALUE = '?xml version="1.0" encoding="UTF-8"?'
RECEIVING
RVAL = L_ELEMENT_ROOT.
DATA: ATTRIBUTE TYPE REF TO IF_IXML_ATTRIBUTE.
CALL METHOD ODOCUMENT->CREATE_ATTRIBUTE_NS
EXPORTING
NAME = 'ZTEST1'
PREFIX = 'xmlns'" ns1="urn:sap-com:document:sap:rfc:functions"'
URI = 'urn:sap-com:document:sap:rfc:functions'
RECEIVING
RVAL = ATTRIBUTE.
RET_VALUE = ODOCUMENT->SET_NAMESPACE_PREFIX(
PREFIX = 'ns1').
CALL METHOD ATTRIBUTE->SET_VALUE
EXPORTING
VALUE = URI
RECEIVING
RVAL = RET_VALUE.
CALL METHOD L_ELEMENT_ROOT->SET_ATTRIBUTE_NODE_NS
EXPORTING
NEW_ATTR = ATTRIBUTE
RECEIVING
RVAL = RET_VALUE.
DATA: NODE_LIST_COLLECTION TYPE REF TO IF_IXML_NODE_COLLECTION.
add node to the output document
DATA: OUTCODE0 TYPE REF TO IF_IXML_NODE.
DATA: OUTCODE TYPE REF TO IF_IXML_NODE.
DATA: OUTCODE1 TYPE REF TO IF_IXML_NODE.
DATA: OUTCODE2 TYPE REF TO IF_IXML_NODE.
DATA: INDEX1 TYPE SY-INDEX.
DATA: INDEX TYPE SY-INDEX.
DATA IRC TYPE I.
CALL METHOD IDOCUMENT->GET_ELEMENTS_BY_TAG_NAME
EXPORTING
DEPTH = 0
NAME = 'MANDT'
NAMESPACE = ''
RECEIVING
RVAL = NODE_LIST_COLLECTION.
DATA: LENGTH TYPE I.
CALL METHOD NODE_LIST_COLLECTION->GET_LENGTH
RECEIVING
RVAL = LENGTH.
WHILE INDEX < LENGTH.
CALL METHOD IDOCUMENT->CREATE_SIMPLE_ELEMENT
EXPORTING
NAME = 'DATA'
NAMESPACE = ''
PARENT = L_ELEMENT_ROOT
VALUE =
RECEIVING
RVAL = L_ELEMENT_NODE .
CALL METHOD INCODE0->GET_ITEM
EXPORTING
INDEX = INDEX
RECEIVING
RVAL = OUTCODE0.
CALL METHOD INCODE->GET_ITEM
EXPORTING
INDEX = INDEX
RECEIVING
RVAL = OUTCODE.
CALL METHOD INCODE1->GET_ITEM
EXPORTING
INDEX = INDEX
RECEIVING
RVAL = OUTCODE1.
CALL METHOD INCODE2->GET_ITEM
EXPORTING
INDEX = INDEX
RECEIVING
RVAL = OUTCODE2.
CALL METHOD L_ELEMENT_NODE->APPEND_CHILD
EXPORTING
NEW_CHILD = OUTCODE0
RECEIVING
RVAL = IRC.
CALL METHOD L_ELEMENT_NODE->APPEND_CHILD
EXPORTING
NEW_CHILD = OUTCODE
RECEIVING
RVAL = IRC.
CALL METHOD L_ELEMENT_NODE->APPEND_CHILD
EXPORTING
NEW_CHILD = OUTCODE1
RECEIVING
RVAL = IRC.
CALL METHOD L_ELEMENT_NODE->APPEND_CHILD
EXPORTING
NEW_CHILD = OUTCODE2
RECEIVING
RVAL = IRC.
ADD 1 TO INDEX.
ENDWHILE.
render document ======================================================
create output stream
DATA: OSTREAM TYPE REF TO IF_IXML_OSTREAM.
CALL METHOD STREAMFACTORY->CREATE_OSTREAM_XSTRING
EXPORTING
STRING = RESULT
RECEIVING
RVAL = OSTREAM.
DATA: IPARSER TYPE REF TO IF_IXML_PARSER.
CALL METHOD L_IXML->CREATE_PARSER
EXPORTING
DOCUMENT = ODOCUMENT
ISTREAM = ISTREAM
STREAM_FACTORY = STREAMFACTORY
RECEIVING
RVAL = IPARSER.
IPARSER->PARSE( ).
create renderer
DATA: RENDERER TYPE REF TO IF_IXML_RENDERER.
CALL METHOD L_IXML->CREATE_RENDERER
EXPORTING
DOCUMENT = ODOCUMENT
OSTREAM = OSTREAM
RECEIVING
RVAL = RENDERER.
IRC = RENDERER->RENDER( ).
ENDMETHOD.
plz help me out ASAP
thnks
kalyanhi
all
now the situation is that i am able to send the data to R/3,
But in RWB-->MessageMonitoring ->version>Message Contents i am getting a error :
*XML Parsing Error: not well-formed
Location: http://aipid:50000/mdt/messagecontentservlet?attachment=0
Line Number 1, Column 176:*
<?xml version="1.0"?><ns1:ZTEST1 xmlns:ns1="urn:sap-com:document:sap:rfc:functions"><DATA><MANDT>210</MANDT><EMPNO>000000000023</EMPNO><EMPNAME>C</EMPNAME></DATA></ns1:ZTEST1 xmlns:ns1="urn:sap-com:document:sap:rfc:functions">
it is not converted into XML ,the underline is the error which it is showing.
it would be great if any one can figure it out what might be the cause of this error
thanks
kalyan -
Hi,
My system is running on XI 3.0 SP9, I am using abap mapping for conversion idoc xml structure to flat file structure. But I am getting the error as shown below.
Appreciate for your response.
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!-- Request Message Mapping
-->
- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">APPLICATION_PROGRAM_ERROR</SAP:Code>
<SAP:P1>ZCL_ABAP_MAPPING4X</SAP:P1>
<SAP:P2>R3_ABAP</SAP:P2>
<SAP:P3>UNCAUGHT_EXCEPTION</SAP:P3>
<SAP:P4 />
<SAP:AdditionalText />
<SAP:ApplicationFaultMessage namespace="" />
<SAP:Stack>Error in mapping program ZCL_ABAP_MAPPING4X (type R3_ABAP, kernel error ID UNCAUGHT_EXCEPTION)</SAP:Stack>
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
Regardsm
Mallikarjun.MHave u seen the ABAP mapping guide?
Refer this series to the ABAP mapping section.https:///people/sravya.talanki2/blog/2006/12/26/aspirant-to-learn-sap-xiyou-won-the-jackpot-if-you-read-this-part-ii
It will be very handy and useful. -
Abap mapping - Error in Control Framework
Hi Gurus,
Scenario: IDOC - -- XI -
Http (post)
i am using ABAP mapping for IDOC to XML. I am able to test it using sxi_mapping_test which gives me output XML. But, when i test the scenario from RWB, it fails with "SYSFAIL" error in inbound queue as per moni.
error - "Error in Control Framework".
Looks like it did not even go to message mapping pipeline step.
Please help.
Thank you,
mkHI,
Hope you have done all the necessary pre-requisites for ABAP mapping
This may help u- http://help.sap.com/saphelp_47x200/helpdata/en/55/bff20efe8c11d4b54a006094b9456f/content.htm
just cross verify with this guide-
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e3ead790-0201-0010-64bb-9e4d67a466b4
Please also try to debug as follows...
put a break point inside your class/method....
goto tcode SXI_MAPPING_TEST....give in the configuation details of your scenario...and when you execute, give the IDOC-XML, copy it from SXMB_MONI where you are getting the error....
when you execute, it shoudl stop at the break point that you had set in your class....continue debugging using 'F6' function key, and check where you are hitting this error...
The chances are that the FM that converts IDOC-XML to flat file format might not have been executed correctly...
Thanks
Swarup -
Error text missing in raising exception (In ABAP mapping)
Hi,
iam using ABAP Mapping for 1 interface.
Based on some condition i am raising exception with error text. When i executed this in SXI_Mapping_test it's showing the Error text. But when i execute the interface directly error text is missing in the Error details.
can any one figure out y its not coming..
regards
KishoreHi,
I think you need to write the error to mapping trace.
http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
Regards
Vijaya -
I followied the how to guids "How To convert an IDoc-XML structure to a flat file and vice versa in XI 3.0" and "How to Use ABAP-Mapping in XI 3.0".
After I built created the ABAP-OO class Z_ABAP_MAPPING_IDOC_TO_FLAT and implemented every thing, during the testing, I got the error "Exception CX_SY_NO_HANDLER triggered, An exception with the type CX_SY_REF_IS_INITIAL occurred, but was neither handl".
Please help.
Thanks!Please debug as follows...
put a break point inside your class/method....
goto tcode SXI_MAPPING_TEST....give in the configuation details of your scenario...and when you execute, give the IDOC-XML, copy it from SXMB_MONI where you are getting the error....
when you execute, it shoudl stop at the break point that you had set in your class....continue debugging using 'F6' function key, and check where you are hitting this error...
The chances are that the FM that converts IDOC-XML to flat file format might not have been executed correctly...
Thanks. -
Abap mapping and variable substitution in File adapter
Hi experts!!.
I am new in abap mapping, but I can do one abap mapping succesfully, but my problem is:
I need to do a variable substitution in my file receiver adapter:
Target directory = %cliente&/out
File Name Scheme = TC%Fecha%.EFI
¿Using abap mapping is this possible? How I can do it?.
Please is very urgent.
Thanks in advance, and best regarts.Yes you can,.
DynamicConfigurationKey key = DynamicConfigurationKey.create(
http://sap.com/xi/XI/System/File,
FileName);
will become
DynamicConfigurationKey key = DynamicConfigurationKey.create(
http://sap.com/xi/XI/System/File,
Directory);
In the receive file adapter all you would need to do is select Adapter Specifc Attributes --> File Name and Directory and givce some dummy values for the filename and directroy. In the runtime values will be taken from the SOAP header which you set in the mapping.
Regards
Bhavesh -
Dynamic configuration in ABAP Mapping
Dear All,
I have requirement to use the filename's name in the mapping to the target message.
e.g: Filename is Victor.303, i need to take this 303 and map it to the target message.
I understand i can get that value using dynamic configuration in Adapter-Specific Attributes.
But all the samples are using Java code used in UDF.
How to do the same in ABAP Mapping?
I tried:
record = dynamic_configuration->get_record( namespace = 'http://sap.com/xi/XI/System/File'
name = 'FileName').
But record-value return blank.
Best Regards,
Victor.Dear Prateek,
I changed my code with:
DATA: record TYPE mpp_dynamic.
CALL METHOD dynamic_configuration->get_record
EXPORTING
namespace = 'http://sap.com/xi/XI/System/File'
name = 'FileName'
RECEIVING
record = record.
but record-value still return as blank.
I have doubt in this, do i need to populate the FileName in the dynamic configuration (in the graphical mapping) first before i can get the value in the ABAP mapping? or System should filled it and i just can use it directly in the ABAP mapping?
How we know what is the available name and namespace in that dynamic configuration-->get record??
(e.g: my case is FileName, and in the link that you gave is ERROR.)
Any link for this?
Best Regards,
Victor. -
Java Mapping, XSLT Mapping, ABAP Mapping
Hi Experts,
Could any one explain what is the main features of the following Mapping. How to pick the mapping?
Java Mapping - When to use and what is the advantage.
ABAP Mapping - When to use and what is the advantage.
XSLT Mapping - When to use and what is the advantage.
Graphical Mapping - When to use and what is the advantage.
cheers,
SuneeThere are 4 types of mapping in XI
1. Graphical Mapping
2. XSLT Mapping
3. JAVA Mapping
4. ABAP Mapping
When to use Message mapping
1 When the logic for your mapping is simple and straight forward, you can use
Advantages of message mapping
1)Easy to use.
2) has GUI drag and drop.
3) used for simple mapping cases
4) it does not involve any complex logic
Disadvantages of message mapping
1)has limitation in terms of complex hierarchy
When to use Java mapping
1) Java mapping are used when graphical mapping cannot help you.
Advantages of Java Mapping
1)you can use Java APIs and Classes in it.
2) file look up or a DB lookup is possible
3) DOM is easier to use with lots of classes to help you create nodes and elements.
Disadvantages of Java mapping
1)SAX parser is not easy to develop
2)DOM parser is intensive
3) Java knowledge is required
4) bit complexer
XSLT Mapping - When to use
1)When the required output is other than XML like Text, Html or XHTML (html displayed as XML )
2)When default namespace coming from graphical mapping is not required or is to be changed as per requirements.
3)When data is to be filtered based on certain fields (considering File as source)
4)When data is to be sorted based on certain field (considering File as source)
5)When data is to be grouped based on certain field (considering File as source)
Advantages of using XSLT mapping
1)XSLT program itself defines its own target structure.
2)XSLT programs can be imported into SAP XI. Message mapping step can be avoided. One can directly go for interface mapping once message interfaces are created and mapping is imported.
3)XSLT provides use of number of standard XPath functions that can replaces graphical mapping involving user defined java functions easily.
4)File content conversion at receiver side can be avoided in case of text or html output.
5)Multiple occurrences of node within tree (source XML) can be handled easily.
6)XSLT can be used in combination with graphical mapping.
7)Multi-mapping is also possible using xslt.
8)XSLT can be used with ABAP and JAVA Extensions
Disadvantages of using XSLT mapping
1)Resultant XML payload can not be viewed in SXMB_MONI if not in XML format (for service packs < SP14).
2)Interface mapping testing does not show proper error description. So errors in XSLT programs are difficult to trace in XI but can be easily identified outside XI using browser.
3)XSLT mapping requires more memory than mapping classes generated in Java.
4)XSLT program become lengthier as source structure fields grows in numbers.
5)XSLT program sometimes become complex to meet desired functionality.
6)Some XSL functions are dependent on version of browser.
Advantages of Abap Mapping
1) A person comfortable with OOABAP can go for ABAP mapping instead.
Disadvantages of Abap Mapping
1) Abap knowledge is required
2) bit compexer
For further info on each of the mapping, refer to these links,
Graphical Mapping,
http://help.sap.com/saphelp_nw04/helpdata/en/6d/aadd3e6ecb1f39e10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
XSLT Mapping
http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
http://www.w3.org/TR/xslt20/
Java Mapping
http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
DOM parser API
http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html
Check this blog on Mapping:
/people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
Also, check this thread for more info,
Different types of Mapping in XI
Maybe you are looking for
-
Gallery not detecting files from memory card -N80
I'm using N80, the gallery is not showing any gallery files in the memory card, if i switch the camera settings to phone memory, the camera images are being shown Any idea ?? thanks " Never think of the negative unless you have fully discovered the p
-
Combining two different programs on one plate form
I have two different programs(calaender and addressbook)in two different classes (Each one has a "main").How do i bring them together on a single plateform so that clicking one button will run one of them and clicking other will run the other. Could
-
Please help: Not using 2 screens, but iMovie thinks I am!
This is a really odd one and has stopped me using iMovie for 3 months now. Here is the problem: The last time iMovie was used I had the MB hooked into an external monitor, it sat to the right of the MB screen and was arranged that way in the display
-
Can't find songs on my computer after transfer.
I'm in ipod ****! I was on the forum last night and got help transferring songs from old laptop to new one. I played many songs afterwards and everything was working fine (apparently not). I went to play them this morning and I'm getting a message th
-
How long does the extraction process of installing Dreamweaver trial usually take?
The trial version of Dreamweaver has been extracting for over ten hours. Is this common? If so how long does it usually take? Thank you!