Access deep structures from tableView model binding
Hi,
I have a problem with accessing a deep structure component from a tableView control.
The structure is defined like this:
structure project_data
main_data type structure
data_table1 type table
data_table2 type table
end structure
The deep structure project_data is an attribute of my model class.
When I have a table attribute, it can directly be accessed by using table="//model/table_data" in the tableView.
What do I have to write in my table attribute to access the deep structure directly via model binding.
table="//model/project_data.table_data" doesn't work, it throws a bsp exception.
Thanks in advance!
So there is no direct way of doing this?
But why does it work for textEdits like this: value="//model/project_data.main_data-description"
What would I have to do in the interface methods to get it work, or is it simpler to just add the elements of the deep structure directly to my model class?
Similar Messages
-
[ECC6] Inserting data from internal table (deep structure) into db table
Hi experts,
I have a problem when inserting data from IT using deep structure into a database table. Please help:
I have one database table with 2 columns ZTest (col1, col2). Col1 is key.
In my program I have a deep structure t_screen using table type lvc_t_scol:
In 4.6c systems, the INSERT statement works well but it does not work in ECC6 systems.
DATA: BEGIN OF t_screen OCCURS 0,
rec_count(3) TYPE n,
col1 LIKE ZTest-col1,
col2 LIKE ZTest-col2.
DATA: ct TYPE lvc_t_scol.
DATA: END OF t_screen.
t_screen-col1 = 'test1'.
t_screen-col2 = 'test1'.
APPEND t_screen.
t_screen-col1 = 'test2'.
t_screen-col2 = 'test2'.
APPEND t_screen.
INSERT ZTest FROM TABLE t_screen ACCEPTING DUPLICATE KEYS.
Currently I have an idea using a temporary internal table with the same structure as ZTest. Use MOVE-CORRESPONDING statement to move data from t_screen table to temporary table before inserting --> It worked. But do you have any ideas without using temporary table?Hi
There are a large number of stataments couldn't be supported in unicode system and so it doesn't allow to do it in ECC 6.
U need to delete the deep structure from your defination:
DATA: BEGIN OF t_screen OCCURS 0,
rec_count(3) TYPE n,
col1 LIKE ZTest-col1,
col2 LIKE ZTest-col2.
DATA: ct TYPE lvc_t_scol. "<-------- Error is here
DATA: END OF t_screen.
So u need to use a structure like this to update your table:
DATA: BEGIN OF T_ZTEST OCCURS 0,
rec_count(3) TYPE n,
col1 LIKE ZTest-col1,
col2 LIKE ZTest-col2.
DATA: END OFT_ZTEST.
Max -
How can i point to a specific field in DEEP structure and populate it?
Hello,
I have declared a internal table as below,
DATA: BEGIN OF wa_data,
vkorg TYPE vkorg
vtweg TYPE vtweg
spartTYPE spart
field_name TYPE CHAR30
value TYPE CHAR50
END OF wa_data
DATA: ls_data TYPE wa_data,
lt_data TYPE STANDARD TABLE OF wa_data.
The lt_data is populated as below,
VKORG-------VTWEG-------SPART-------FIELD_NAME-------VALUE
1000-----------10-------------01------------KALKS---------------ZP00 "Pricing procedure
1000-----------10-------------01------------ZTERM---------------15 days "Payment terms
1000-----------10-------------01------------MAHNA---------------09 "Dunning
Fine.
Now, i have a DEEP DEEP DEEP structure as belowm
DATA: ls_deep TYPE cmds_ei_extern. "Pls. see this deep structure 'cmds_ei_extern' in SAP DDIC / SE11
This deep structure is part of Customer master creation. Now, i would like to POPULATE this deep structure from my lt_data itab DYNAMICALLy, i mean, with out mentioning the field names (like, ZTERM, KALKS, MAHNA etc etc), bcz its these i am pulling this lt_data from a custom table, so going further business may also ADD a new record / field like BUSAB (Accouting clerk) with a value of AL (Allen Christi), hence i want to hv dynamic and its less tediuos also bcz,
We can LOOP lt_data INTO ls_data (for example, the ls_data-field_name = KALKS)
Now, point the KALKS in the deep deep deep structure and populate it with a value of ls_data-value (= 15 days)
ENDLLOOP.
Pls. let me know How can i do this, i guess, we need to use field symbols, pls. let me know the code to achieve my requirement
Thank youHi,
Please refer below code.This will populate field kunnr of the deep structure. Once you select the data as per your requirement,you can write similar code to populate rest of the fields in the deep strucure.
TYPES : BEGIN OF ty_data,
kunnr TYPE kunnr,
END OF ty_data.
FIELD-SYMBOLS : <lfs_cmds_ei_header> TYPE cmds_ei_header,
<lfs_cmds_ei_instance> TYPE cmds_ei_instance,
<lfs_kunnr> TYPE kunnr.
DATA: lfs_cmds_ei_extern TYPE cmds_ei_extern,
lr_dytable TYPE REF TO data,
lr_dytable_wa TYPE REF TO data,
lt_data TYPE STANDARD TABLE of ty_data ,
wa_data TYPE ty_data.
SELECT kunnr
FROM yalb_kunde
UP TO 1 ROWS
INTO TABLE lt_data.
IF sy-subrc = 0.
LOOP AT lt_data INTO lwa_data.
ASSIGN COMPONENT 'HEADER' OF STRUCTURE lfs_cmds_ei_extern TO <lfs_cmds_ei_header>.
IF sy-subrc = 0.
ASSIGN COMPONENT 'OBJECT_INSTANCE' OF STRUCTURE <lfs_cmds_ei_header> TO <lfs_cmds_ei_instance>.
IF sy-subrc = 0.
ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <lfs_cmds_ei_instance> TO <lfs_kunnr>.
IF sy-subrc = 0.
<lfs_kunnr> = lwa_data-kunnr.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
Thanks,
Priya -
How to read data from the Deep structure.
Hi
How to get from the deep structure. Means i have one table in that having onother structure. i need to read data from that inner structure.
Regards
ReddyHi,
you can access in the way u use for the normal structure, u should only consider a deep structure is a table without headerline.
TABLES: BKPF, BSEG.
TYPES: TY_ITEM TYPE TABLE OF BSEG.
DATA: BEGIN OF W_DOCUMENT,
HEADER TYPE BKPF,
ITEM TYPE BSEG,
END OF W_DOCUMENT.
DATA: T_DOCUMENTS LIKE STANDARD TABLE OF W_DOCUMENT.
Insert the data:
SELECT * FROM BKPF WHERE ....
W_DOCUMENT-HEADER = BKPF.
SELECT * FROM BSEG INTO TABLE W_DOCUMENT-ITEM
WHERE BUKRS = BKPF-BUKRS
AND BELNR = BKPF-BELNR
AND GJAHR = BKPF-GJAHR.
APPEND W_DOCUMENT TO T_DOCUMENTS.
ENDSELECT.
Read the data:
LOOP AT T_DOCUMENTS INTO W_DOCMENT.
Header data
WRITE: / W_DOCUMENT-HEADER-BUKRS,
W_DOCUMENT-HEADER-BELNR,
W_DOCUMENT-HEADER-GJAHR.
Item data
LOOP AT W_DOCUMENT-ITEM INTO BSEG.
WRITE: / BSEG-BUZEI,
BSEG-WRBTR CURRENCY W_DOCUMENT-HEADER-WAERS.
ENDLOOP.
ENDLOOP.
Regards,
Padmam. -
Creating an XML From a Deep Structure using XSL Transformation
Hi ABAPers,
I have a requirement to use XSL Transformations on an ABAP deep type structure.
Currently i have an API that fills in this deep structure and by using CALL TRANSFORMATION ID.... i will get the BIG XML having having 100s of nodes . But actualy form the deep structure i need only some NODES (say 50)... So i tried writing an XSLT
in the transaction STRANS.. but on using this TRANSFORMATION which i wrote i am getting an error messgae like INVALID XML...
Am i going in right track or is there a good solution...
My sample transformation is as below...
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:value-of select="DATA/NODE_ELEMENTS/UUID_KEY/UUID"/>
<xsl:value-of select="DATA/NODE_ELEMENTS/SEMANTICAL_NAME"/>
<xsl:value-of select="DATA/NODE_ELEMENTS/STRUCT_CAT"/>
<xsl:value-of select="DATA/NODE_ELEMENTS/USAGE_CAT"/>
<xsl:value-of select="DATA/NODE_ELEMENTS/RESTRICTED_IND"/>
<xsl:value-of select="VALUES/DATA/NODE_ID"/>.
</xsl:template>
</xsl:transform>
Please help me in solving this issue....
Thanks,
Linda.Hi Linda,
I am replying based on your sample code.
Try the below following suggestions.
here 'GRPHDR' is the node where I am selecting the data.
IGRPHDR is the name of the reference.
First calling the transformation in you program.
TYPES: BEGIN OF tl_hdr,
msgid(20) TYPE c,
END OF tl_hdr.
DATA : t_hdr TYPE STANDARD TABLE OF tl_hdr.
GET REFERENCE OF t_hdr INTO l_result_xml-value.
l_result_xml-name = 'IGRPHDR'.
APPEND l_result_xml TO t_result_xml.
TRY.
CALL TRANSFORMATION yfi_xml_read
SOURCE XML it_xml_data
RESULT (t_result_xml).
CATCH cx_root INTO l_rif_ex.
l_var_text = l_rif_ex->get_text( ).
l_bapiret-type = 'E'.
l_bapiret-message = l_var_text.
APPEND l_bapiret TO errormsgs.
EXIT.
ENDTRY.
in XSL transformation
First write a block of statement to specify from which node you are taking the data.
No matter it is a node or sub-node.
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<IGRPHDR> " reference name of internal table
<xsl:apply-templates select="//GrpHdr"/>
</IGRPHDR>
</asx:values>
</asx:abap>
</xsl:template>
Next select the data from the nodes under the nodes specified in the transformation.
here msgid is the field i am selecting for value.
<xsl:template match="GrpHdr">
<item>
<MSGID> " field in the internal table t_hdr where data has to go
<xsl:value-of select="MsgId"/>
</MSGID>
</item>
</xsl:template>
reply back if further clarification is needed.
Thanks and regards,
Kannan N -
Update the database structure from entity Framework Model
Hello !
I'm using VB.net , EF6 with SQL server 2008R2 database.
This is the situation :
I have created the application. Using wizard I have created the Entity model from an existing database.
A client start using this application using this database on his computer.
After some month , I made some modifications on the database and I have updated the model on my application .
Now I have a new .exe file that has the new model from the new database.
I put the new .exe file on the client computer.
Now on his computer : The .exe file has the new database model , but the sql server database has the old structure.
I want to know : Is possible to update the database structure from the entity model on application ?
I want to add a command on application that can make ( if is possible ) this update , so the database become up to date according to entity model ?
Thank you !Hello,
From your description, it seems that you want to apply a migration for a database first approach, unfortunately, as far as I know, EF Migrations is a product targeted at Code First and doesn't support Database First operations. A workaround I know is to
use update-scripts. If your database structure would be changed frequently, it is recommended to use the Code First approach which would have a better workaround for migrations, for details, you could refer to this
video,
and with the
Entity Framework Power Tools, it is easy to create a code first based project form an existing database.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Accessing Array of Structures from Coldfusion
I am having a problem accessing an array of structures from
Coldfusion within my flex application. Here is how I make my Array:
(GetRegions is a type Query and Type is a string variable)
<cfset ReturnArray = ArrayNew(1)>
<cfset ReturnArray[1] = StructNew()>
<cfset ReturnArray[1].Query = GetRegions>
<cfset ReturnArray[2] = Type>
Within flex I am trying to access the results in the
following way:
private function dataHandler(event:ResultEvent):void{
Query_Filter = new ArrayCollection(event.result[0].QUERY as
Array);
myString = event.result[1] as String;
Can anybody help me with this. I want a way to return a query
and a string back from coldfusion.
Thanks for the help,
JeffSo now I changed my code to the following in CF:
<cfset Type = "MyString">
<cfset ReturnArray = ArrayNew(1)>
<cfset ReturnArray[1] = StructNew()>
<!--- set up query GetRegions --->
<cfset ReturnArray[1] = GetRegions>
<cfset ReturnArray[2] = Type>
<!--- Return Array --->
<cfreturn ReturnArray>
Now in flex I have the following dataHandler Function:
Alert.show("hello: "+ObjectUtil.toString(event.result[0]));
Query_Filter = new ArrayCollection(event.result as Array);
Now I set up a List box with Query_Filter as the dataprovider
but the results aren't showing correctly. The first item in the
list box is displayed as [object, Object], [object, Object] and the
second item is my String.
Does anybody know how to break up the query to a variable and
the string to its own variable in the dataHandler function.
Thanks for any and all help -
From deep structured to flat itab
Hi experts!
I need to copy three columns from an internal table <u>itab_upload</u>. I defined the structure for it in the DDIC. It contains 5 columns and another table(<u>Itab_note)</u> for possible entries. For a report I need to copy 3 columns of the itab_upload table (<u>not</u> from the itab_note) into another table and display this using ALV.
Can you please advise how to get the 3 columns from the structured into the flat table so I can use ALV for displaying?
Thanks a lot!
JohannYou can use the same internal table itab_upload to pass to the ALV Function Module. If this is a deep structure, pass only the field that contains the internal table values in that deep structure.
Ex. itab_upload-field1-field12
If you want to show only 3 fields form the internal table on the ALV, create the fieldcat manually so that only those 3 fields are present in the fieldcat that is passed to the ALV Function module.
Ex. to create a fieldcat manually :
data : it_fieldcat type slis_t_fieldcat_alv,
wa_fieldcat like line of it_fieldcat,
clear wa_fieldcat.
wrk_pos = wrk_pos + 1.
wa_fieldcat-col_pos = wrk_pos.
wa_fieldcat-tabname = 'ITAB_UPLOAD'.
wa_fieldcat-fieldname = 'FIELD1'.
wa_fieldcat-seltext_m = 'Field 1 Description'.
wa_fieldcat-emphasize = ''.
wa_fieldcat-hotspot = 'X'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wrk_pos = wrk_pos + 1.
wa_fieldcat-col_pos = wrk_pos.
wa_fieldcat-tabname = 'ITAB_UPLOAD'.
wa_fieldcat-fieldname = 'FIELD3'.
wa_fieldcat-seltext_m = 'Field 3 Description'.
wa_fieldcat-emphasize = ''.
wa_fieldcat-hotspot = ''.
append wa_fieldcat to it_fieldcat.
Also refer :
Read a Deep Structure
Programmatically copy a deep structure - exactly.
Regards,
Anish Thomas -
Can't get value from Model Binding.....
Hi.
I create a BO name Document in CAF.
with is structure:
name String
type String
content BASE64BINARY
After that
1.I create a Application Services name DocumentAS.
2.create a Operation name createDocument with a input paramter name doc which Type is Document i created.Implement it.
3.In WD,I create a model for the DocumentAS.
4.In Component controller 's context,create Model bind.
structure like this:
Context
Requet_createDocument(Node)
Document(Node)
Content(Node)
item(byte)
name(String)
type(String)
5.init model with code:
DocumentModel documentModel = new DocumentModel();
Document document = new Document(documentModel);
Request_createDocument request_createDocument = new Request_createDocument(documentModel);
wdContext.nodeRequest_createDocument().bind(request_createDocument);
wdContext.currentRequest_createDocumentElement().modelObject().setDocument(document);
6.in excute method
wdContext.currentRequest_createDocumentElement().modelObject().getDocument().setName(fileName);
wdContext.currentRequest_createDocumentElement().modelObject().getDocument().setType(fileType);
for (int i = 0; i < content.length; i++) {
wdContext.nodeContent().createAndAddContentElement().setItem(content<i>);
wdContext.currentRequest_createDocumentElement().modelObject().execute();
I run app with debug mode, In the DocumentAS 's createDocument Operation.
I found the input paramter of document's property "content" is null.But the other property is not null....
Is some problem in my init code or excute code?
Please help me!Well, you can easily check all the entries in your map with
Object key;
for (Iterator it = map.keySet().iterator(); it.hasNext();) {
key = it.next();
System.out.println(key + " : " + map.get(key));
} -
How to access the ORACLE APPS table structures from SAP
Hi Experts,
How to access the ORACLE APPS table structures from SAP? Is it possible from SAP?
Thanks in advance
ThomasHi Silviya,
you can access this database using a technique called DB Multiconnect - sometimes written as multi-connect.
Search the SAP documentation and notes for this term and you will find how to do it.
Essentially you configure the remote database connection via transaction DBCON.
If your SAP system is not running on Oracle you will need to install the db-specific kernel files for Oracle along with the Oracel db client software - SQL*Net.
Then you can access the Oracle database from ABAP using native-SQL. It works a treat!
Cheers
Graham Robbo -
Retrieving data from Excel format to internal table(deep structure)
hi all,
can anybody help me how to Retrieving data from Excel format to internal table(deep structure)
and if u have any sample code for that please send it.
my internal table is like this
DATA: BEGIN OF ty_text,
vbeln TYPE vbeln,
posnr TYPE posnr,
seqno TYPE seqno,
textid TYPE tdid,
tdline TYPE tdline,
END OF ty_text.
DATA: BEGIN OF ty_item,
vbeln TYPE vbeln,
posnr TYPE posnr,
dispct1(16),
dispct2(16),
dispct3(16),
text LIKE table of ty_text,
END OF ty_item.hi,
check this code
TABLES:zmatnr.
TYPE-POOLS truxs.
DATA : itab LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
DATA row LIKE alsmex_tabline-row.
data : gi_final like zmatnr occurs 0 with header line.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETER : pfname LIKE rlgrap-filename OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pfname.
PERFORM search.
START-OF-SELECTION.
perform process.
form process.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = pfname
i_begin_col = 1
i_begin_row = 2
i_end_col = 12
i_end_row = 65000
TABLES
intern = itab
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
describe table itab lines itab_count.
row = 1.
loop at itab.
if itab-row <> row.
append gi_final.
clear gi_final.
endif.
case itab-col.
when '1'.
gi_final-MATNR = itab-value.
when '2'.
gi_final-Maktx = itab-value.
endcase.
row = itab-row.
endloop.
append gi_final.
clear gi_final.
endform.
FORM search .
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
CHANGING
file_name = pfname.
ENDFORM.
regards
siva -
Fetching value from deep structure
Hi All,
I need to take value from deep structure into a variable.
IS_DESDLVRY_NOTIF-DELIVERY-ITEM[1]-PURCHASE_ORDER_REFERENCE-ID is that structure.
Value is available in debugger.
But in editor gives syntax error- item[1] doesnt exist,Item exist.
If i delete [1] from item i wont get value.
can you guide how to resolve error?
Thanks.
Edited by: sanj_dell on Jun 17, 2011 8:20 AMHi,
you have to read table IS_DESDLVRY_NOTIF-DELIVERY-ITEM index 1 into a matching structure!
Regards,
Klaus -
How to get selected row from a non-bind ADF table
Hi,
I have an ADF table that is based on a collectionModel built programmatically. The collectionModel is this:
model = new SortableModel(new ArrayList<ArrayList>());
Hence, it is not a binding table. My question is how to get the selectedRows from a non-bind table.
I am used to building binding ADF table and I know we can get it from voiterator.getCurrentRow, since the selectionListener is set to the binding....collectionModel.makeCurrent
<af:table value="#{bindings.ItasLookupTypesVO1.collectionModel}"
selectedRowKeys="#{bindings.ItasLookupTypesVO1.collectionModel.selectedRow}"
selectionListener="#{bindings.ItasLookupTypesVO1.collectionModel.makeCurrent}"
</af:table>
I am thinking maybe I need to write my own selectionListener, but need more advice/ideas of what's the codes in the customer selection Listener to get it from my SortableModel.
Please help.
Thanks
-MinaI'm not sure if this works in your case, but check out the selection listener I write in this blog http://wp.me/pcBZk-eu
You should use the selection event and check the added set. This should give you access to the selected row.
Timo -
How to use STRANS to translate XML to ABAP with deep structure
every experts, I want to use Tcode: STRANS to translate XML to ABAP, But it does not work well,
here is XML code,I want to translate this XML into an an Inter table gt_orders with deep structure of oeb, and colum oeb is also and intertable,how can I do this.
<?xml version="1.0" encoding="gb2312" ?><axmt410><ObjectID>setSalesOrder</ObjectID><azp01>000000</azp01><oea00>1</oea00><ta_oeaecn>SO-140227-3041</ta_oeaecn><oea03>25325017</oea03><oea02>2014-02-27 17:44:44.0</oea02><ta_oea002>2763.0</ta_oea002><ta_oea001>0.0</ta_oea001><oea14></oea14><oea15>25325017</oea15><oea23>RMB</oea23><oeaconf>S3</oeaconf><oea10></oea10><oeaud01>null</oeaud01><ta_oea007></ta_oea007><oea25>101</oea25><ta_oea008>0</ta_oea008><ta_oea009>null</ta_oea009><oeauser>Hanjingya</oeauser><ta_oeanday>2014-02-27 17:44:44.991</ta_oeanday><ta_oeamday>2014-02-28 08:30:14.866</ta_oeamday><ta_oeacday>2014-02-28 08:30:14.866</ta_oeacday><oeaud02>0</oeaud02><ta_oea030>null</ta_oea030><oeb><oeb03>1</oeb03><oeb04>7400208249</oeb04><oeb05>PCS</oeb05><oeb17>921.0</oeb17><oeb13>921.0</oeb13><oeb15></oeb15><oeb12>5</oeb12><oeb09>990001</oeb09><ta_oeb001></ta_oeb001><ta_oeb002>Yunnan</ta_oeb002><ta_oeb003>address1</ta_oeb003><ta_oeb004>zhangdagui、zhanglan</ta_oeb004><ta_oeb005>15974749998、15987782008</ta_oeb005><ta_oeb006>address and street</ta_oeb006><oebud01></oebud01></oeb><oeb><oeb03>2</oeb03><oeb04>7400208250</oeb04><oeb05>PCS</oeb05><oeb17>921.0</oeb17><oeb13>921.0</oeb13><oeb15></oeb15><oeb12>5</oeb12><oeb09>990001</oeb09><ta_oeb001></ta_oeb001><ta_oeb002>Yunnan</ta_oeb002><ta_oeb003>address2</ta_oeb003><ta_oeb004>zhangdagui、chenlan</ta_oeb004><ta_oeb005>15974749998、15987782008</ta_oeb005><ta_oeb006>address and street</ta_oeb006><oebud01></oebud01></oeb></axmt410>
I write these codes in SAP XSLT editor
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
<xsl:strip-space elements="*"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ORDERS>
<xsl:apply-templates select="//axmt410"/>
</ORDERS>
</asx:values>
</asx:abap>
</xsl:template>
<xsl:template match="axmt410">
<OBJECTID>
<xsl:value-of select="ObjectID"/>
</OBJECTID>
<AZP01>
<xsl:value-of select="azp01"/>
</AZP01>
<OEA00>
<xsl:value-of select="oea00"/>
</OEA00>
<TA_OEAECN>
<xsl:value-of select="ta_oeaecn"/>
</TA_OEAECN>
<OEA03>
<xsl:value-of select="oea03"/>
</OEA03>
<OEA05>
<xsl:value-of select="oea05"/>
</OEA05>
<OEA02>
<xsl:value-of select="oea02"/>
</OEA02>
<TA_OEA002>
<xsl:value-of select="ta_oea002"/>
</TA_OEA002>
<TA_OEA001>
<xsl:value-of select="ta_oea001"/>
</TA_OEA001>
<OEA14>
<xsl:value-of select="ora14"/>
</OEA14>
<OEA15>
<xsl:value-of select="ora15"/>
</OEA15>
<OEA23>
<xsl:value-of select="ora23"/>
</OEA23>
<OEACONF>
<xsl:value-of select="oeaconf"/>
</OEACONF>
<OEA10>
<xsl:value-of select="ora10"/>
</OEA10>
<OEAUD01>
<xsl:value-of select="oeaud01"/>
</OEAUD01>
<TA_OEA007>
<xsl:value-of select="ta_oea007"/>
</TA_OEA007>
<OEA25>
<xsl:value-of select="ora25"/>
</OEA25>
<TA_OEA008>
<xsl:value-of select="ta_oea008"/>
</TA_OEA008>
<TA_OEA009>
<xsl:value-of select="ta_oea009"/>
</TA_OEA009>
<TA_OEA013>
<xsl:value-of select="ta_oea013"/>
</TA_OEA013>
<TA_OEA014>
<xsl:value-of select="ta_oea014"/>
</TA_OEA014>
<TA_OEA015>
<xsl:value-of select="ta_oea015"/>
</TA_OEA015>
<TA_OEA016>
<xsl:value-of select="ta_oea016"/>
</TA_OEA016>
<TA_OEA017>
<xsl:value-of select="ta_oea017"/>
</TA_OEA017>
<TA_OEA018>
<xsl:value-of select="ta_oea018"/>
</TA_OEA018>
<TA_OEA019>
<xsl:value-of select="ta_oea019"/>
</TA_OEA019>
<TA_OEA020>
<xsl:value-of select="ta_oea020"/>
</TA_OEA020>
<TA_OEA021>
<xsl:value-of select="ta_oea021"/>
</TA_OEA021>
<TA_OEA022>
<xsl:value-of select="ta_oea022"/>
</TA_OEA022>
<TA_OEA028>
<xsl:value-of select="ta_oea028"/>
</TA_OEA028>
<OEAUSER>
<xsl:value-of select="oeauser"/>
</OEAUSER>
<TA_OEANDAY>
<xsl:value-of select="ta_oeanday"/>
</TA_OEANDAY>
<TA_OEAMDAY>
<xsl:value-of select="ta_oeamday"/>
</TA_OEAMDAY>
<TA_OEACDAY>
<xsl:value-of select="ta_oeacday"/>
</TA_OEACDAY>
<OEAUD02>
<xsl:value-of select="oeaud02"/>
</OEAUD02>
<TA_OEA030>
<xsl:value-of select="ta_oea030"/>
</TA_OEA030>
<OEB>
<xsl:for-each select="oeb">
<OEB03>
<xsl:value-of select="oeb03"/>
</OEB03>
<OEB04>
<xsl:value-of select="oeb04"/>
</OEB04>
<OEB05>
<xsl:value-of select="oeb05"/>
</OEB05>
<OEB17>
<xsl:value-of select="oeb17"/>
</OEB17>
<OEB13>
<xsl:value-of select="oeb13"/>
</OEB13>
<OEB15>
<xsl:value-of select="oeb15"/>
</OEB15>
<OEB12>
<xsl:value-of select="oeb12"/>
</OEB12>
<OEB09>
<xsl:value-of select="oeb09"/>
</OEB09>
<TA_OEB001>
<xsl:value-of select="ta_oeb001"/>
</TA_OEB001>
<TA_OEB002>
<xsl:value-of select="ta_oeb002"/>
</TA_OEB002>
<TA_OEB003>
<xsl:value-of select="ta_oeb003"/>
</TA_OEB003>
<TA_OEB004>
<xsl:value-of select="ta_oeb004"/>
</TA_OEB004>
<TA_OEB005>
<xsl:value-of select="ta_oeb005"/>
</TA_OEB005>
<TA_OEB006>
<xsl:value-of select="ta_oeb006"/>
</TA_OEB006>
<OEBUD01>
<xsl:value-of select="oebud01"/>
</OEBUD01>
</xsl:for-each>
</OEB>
</xsl:template>
</xsl:transform>
and I use below ABAP program for a test, but the items from XML can not translate into Interner table gt_orders-oeb[]
TYPE-POOLS abap.
CONSTANTS gs_file TYPE string VALUE 'C:\temp\order02.xml'.
* This is the structure for the data from the XML file
TYPES:
BEGIN OF typ_s_oeb,
oeb03 TYPE string, "
oeb04 TYPE string, "
oeb05 TYPE string, "
oeb17 TYPE string, "
oeb13 TYPE string,
oeb15 TYPE string,
oeb12 TYPE string, "
oeb09 TYPE string, "
ta_oeb001 TYPE string, "
ta_oeb002 TYPE string, "
ta_oeb003 TYPE string, "
ta_oeb004 TYPE string, "
ta_oeb005 TYPE string, "
ta_oeb006 TYPE string, "
ta_oeb013 TYPE string, "
ta_oeb014 TYPE string, "
ta_oeb015 TYPE string, "
ta_oeb016 TYPE string, "
ta_oeb017 TYPE string, "
ta_oeb018 TYPE string, "
ta_oeb019 TYPE string, "
ta_oeb020 TYPE string, "
ta_oeb021 TYPE string, "
ta_oeb022 TYPE string, "
oebud01 TYPE string, "
END OF typ_s_oeb.
TYPES: typ_t_oeb TYPE TABLE OF typ_s_oeb WITH KEY oeb03.
TYPES:
BEGIN OF typ_s_order,
objectid TYPE string, "
azp01 TYPE string, "
oea00 TYPE string, "
ta_oeaecn TYPE string, "
oea03 TYPE string, "
oea02 TYPE string, "
ta_oea002 TYPE string, "
ta_oea001 TYPE string, "
oea14 TYPE string, "
oea15 TYPE string,
oea23 TYPE string, "
oeaconf TYPE string, "
oea10 TYPE string, "
oeaud01 TYPE string, "
ta_oea007 TYPE string, "
oea25 TYPE string, "
ta_oea008 TYPE string, "
ta_oea009 TYPE string, "
oeauser TYPE string, "
ta_oeanday TYPE string, "
ta_oeamday TYPE string, "
ta_oeacday TYPE string, "
oeaud02 TYPE string, "
ta_oea030 TYPE string, "
ta_oea013 TYPE string,
ta_oea014 TYPE string,
ta_oea015 TYPE string,
ta_oea016 TYPE string,
ta_oea017 TYPE string,
ta_oea018 TYPE string,
ta_oea019 TYPE string,
ta_oea020 TYPE string,
ta_oea021 TYPE string,
ta_oea022 TYPE string,
ta_oea025 TYPE string,
oeb TYPE typ_t_oeb,
END OF typ_s_order.
* Table for the XML content
DATA: gt_itab TYPE STANDARD TABLE OF char2048,
gs_itab LIKE LINE OF gt_itab.
* Table and work ares for the data from the XML file
DATA: gt_orders TYPE STANDARD TABLE OF typ_s_order,
gs_orders TYPE typ_s_order.
* Result table that contains references
* of the internal tables to be filled
DATA: gt_result_xml TYPE abap_trans_resbind_tab,
gs_result_xml TYPE abap_trans_resbind.
* For error handling
DATA: gs_rif_ex TYPE REF TO cx_root,
gs_var_text TYPE string.
* Get the XML file from your client
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = gs_file
CHANGING
data_tab = gt_itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "IPERSON".
GET REFERENCE OF gt_orders INTO gs_result_xml-value.
gs_result_xml-name = 'ORDERS'.
APPEND gs_result_xml TO gt_result_xml.
* Perform the XSLT styleshee
TRY.
CALL TRANSFORMATION zfx_so_xml_to_abap
SOURCE XML gt_itab
RESULT (gt_result_xml).
CATCH cx_root INTO gs_rif_ex.
gs_var_text = gs_rif_ex->get_text( ).
MESSAGE gs_var_text TYPE 'S'.
ENDTRY.
LOOP AT gt_orders INTO gs_orders.
ENDLOOP.The simplest way seems to me is to use a XSL file for that. The <xsl:output> attributes doctype-system and doctype-public generate the DTD declaration <!DOCTYPE YOUR_ROOT SYSTEM "yourDTDfile.dtd"> and <!DOCTYPE YOUR_ROOT PUBLIC "yourDTDfile.dtd">, respectively.
When calling transformerInstance.transform() the XSLT processor performs the identity transformation - it just copies elements, attributes, content, processing instructions and comments to the result stream.
If you're using an xsl file for your transformation already, simply add <xsl:output doctype-system="yourDTDfile.dtd"/> to your existing XSL file.
If you're only using the identity transformation you'd need to change the line of code where you obtain the transformer instance from the TransformerFactory to:
t_factory.newTransformer(new StreamSource("test.xsl"));
and use this as test.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output doctype-system="yourDTDfile.dtd"/>
<!-- this is the identity transformation -->
<xsl:template match="*|@*|comment()|processing-instruction()|text()">
<xsl:copy>
<xsl:apply-templates select="*|@*|comment()|processing-instruction()|text()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>Good luck. -
Move deep structure do regular structure
HI All ,
I need to move a proxy structure (deep ) to abap regular structure (not deep)
there is general method or program which i can use ?
if not any example will help .
Thanks
James
Edited by: James Herb on Feb 4, 2010 9:52 AM
Edited by: James Herb on Feb 4, 2010 10:56 AMHi James,
Iam not completely clear with the question, but are you asking how to access values from a deep structure?
If so, check if this link helps you:
BADI_SCD_SAVE how to code IF_EX_BADI_SCD_SAVE~CHECK_COMPLETE
In this link, NETWR is being accessed from the deep structure I_SCD-X-ITEM[1]-VFKP-NETWR
Regards,
Swarna Munukoti
Maybe you are looking for
-
SOLVED: Photoshop CC 2014 crashes atiocl64.dll
SOLUTION: Navigate to C:\Program Files\Adobe\Adobe Photoshop CC 2014 Locate sniffer.exe and rename it ~sniffer.exe SOLVED This solution was offered by Adobe chat support, after a very long and almost fruitless exchange. Apparently, the support tech f
-
I have searched through this (and other) forums but haven't been able to find an answer. I have just upgraded to ADSL2 in australia. Here are my issues. I can browse (Safari 2.0.4 and 3beta) bou only SOME pages. Even www.apple.com.au will only load t
-
Hi, I want to add some selection screen parameters and hide or remove some existing parameters while using the LDB : PNP. I did a search on this and everyone talked about changing the report categories but i could not find how to change the report ca
-
I am wondering if anyone knows how to encrypt and decrypt and string of any length using the TEA which only encrypts a two element array of longs. The conversion between strings and longs is not working for me regardless of the method I choose to con
-
So I did the pre-order for the instore pickup and got the confirmation email. Where can I go online to make sure the confirmation email is authentic?