on 02-10-2013 5:36 AM
Hi Friends,
I consumed external Web Services in our SAP successfully and i observed output structure in External View / Internal View is in XSDANY which is nothing but XML Fragment.
How to read such format and develop a ABAP report?
Regards
Ali
hi raza,
After getting the XML format, we need to parse by using function module "SMUM_XML_PARSE"
Pass XML as input and read the node value in table format, processing that according to your requirement.
regards
goudham
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Goudham,
Could you please explain bit more ... how to read data from xsdany ?
eg:
data: output1 type XSDANY.
TRY.
CALL METHOD l_proxy->SEARCH_ACCOUNT
EXPORTING
INPUT = INPUT
IMPORTING
OUTPUT = OUTPUT1.
Catch cx_ai_system_fault.
Catch CX_AI_APPLICATION_FAULT.
endtry
How to convert XSDANY to XML?
CALL FUNCTION 'SMUM_XML_PARSE'
EXPORTING
xml_input = xmldata
TABLES
xml_table = result_xml
return = return .
Regards
Raza
dear raza,
Nothing more needed.
XML has been parsed in the output table result_xml, inside the table all the values are bind with node name .
eg: if xml contains material and plant no XML looks like
<XML urf = version 8 >
<material code> 100-100 </material code>
<plant> 1000 </plant>
</>
if you want to read material code i'll write following code:
data : lv_matnr type matnr.
loop at result_xml into workarea.
case cname.
when 'material code'.
lv_matnr = workarea-cvalue.
endcase.
endloop.
after that write code depend on your requirements.
regards
goudham
dear raza,
I hope no need below code:
data: output1 type XSDANY.
TRY.
CALL METHOD l_proxy->SEARCH_ACCOUNT
EXPORTING
INPUT = INPUT
IMPORTING
OUTPUT = OUTPUT1.
Catch cx_ai_system_fault.
Catch CX_AI_APPLICATION_FAULT.
endtry
because already you are having XML data, straightway pass into above FM.
If iam wrong, please post your complete code.
regards
goudham
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.