Ddic structure to XML
Hi,
is there an easy way to create a xml string based on a ddic structure?
Its a nested structure and I want to avoid to create all elements manually.
Perfect way would be that i could fill the structure with data and then transform this into a xml string.
for instance:
ls_test-header-name = 'tester'
ls_test-header-county = 'germany'
ls_test-item-material = '4711'
ls_test-item-pos = '1'
should be transformed to:
<?xml version="1.0"?>
<ls_test>
<header>
<name>tester</name>
<country>germany</country>
</header>
<item>
<material>4711</material>
<pos>1</pos>
</item>
</ls_test>
Thanks,
Christoph
Hi Christoph,
following link describes the xml transformation suggested above:
http://help.sap.com/saphelp_erp2005vp/helpdata/en/e3/7d4719ca581441b6841f1054ff1326/frameset.htm
and here is a small example
http://help.sap.com/saphelp_erp2005vp/helpdata/en/ae/101640a991c742e10000000a1550b0/frameset.htm
Hope this is helpful.
Regards
Bernd
Similar Messages
-
Simple transformation with reference to ddic structures
Hi, experts,
we decide to use xml as the format when exchanging massive data with other applications. and we want to use simple transformation because according to the document it's more fast.
actually our file structure is determined by certain ddic structures, one xml file main contain several ddic structures , and they are all flat one, not deep structure.
the xml file may look like this:
<data>
<ddic1>[components of ddic structure 1 ]</ddic1>
<ddic2>[components of ddic structure 2 ]</ddic2>
</data>
i am new to ST,i am wondering that is it possible to make the ST more easy with the help of ddic structure? do i still need to declare the components one by one in the ST program?
BR.
junIt only runs ok with 2 internal tables because of the way you set up the XML string. It will run ok with 3 internal tables too. If you strip out the '<C>' nodes or move the '<C>' nodes around, you'll see what I mean (move the C nodes to the last B node). Each time you start a loop in a simple transformation, the internal table is initialized. So, you need to form your sample XML string differently, declare your internal tables differently (nested), or use XSLT for a little more power.
-
Anything for DDIC-structure to XSD transformation available???
Hi,
do you know a function module/class/transaction that allows <b>to transform any ddic structure to its XSD representation</b>?
I know that with "CALL TRANSFORMATION" you can transform ddic structures to an XML representation. But I need a simple XSD (Scheme) representation.
Any idea??Hi Christian,
the XSD editor is part of the XI Integration Builder and is running in the design part (Java). There you can create manually data types and the editor is converting that to XSD automatically. Another option there is to import existing XSD... My problem is I have a lot of ddic structures in R/3 and I need them for XI. -> import
I have asked this question also in the XI forum - not really helpful answers yet.
I thought there must be a standard SAP function module to create that XSD presentation. If not you have to create complex structures manually within XI. Nice work
Thanks anyway and best regards to Dr. Muller -
Deep DDIC-Structure - Method to get the Comp.Type of a sub-structure
Dear colleagues,
thought the subsequent piece of coding might be helpful for the following problem:
In DDIC you have created a deep/nested Structure e.g. a complete Business Document representation like
s_doc_header type struct_doc_header
(incl.) item type tab_item
(incl) party type tab_party etc.
Now for some purpose you need to access somewhere a sub-part of this structure, e.g. the party-part. You only know (dynamically) the component name "party", but need for dynamic access also the Component Type ("tab_party") (in order to make use of a "CREATE DATA lr_reftodata TYPE (determined_comp_type)." )
The following piece of coding should help to query any start component type (here "struct_doc_header") for its embedded components.
Its a recursive use of features provided by the very nice class(set) of cl_abap_structdescr.
I implemented it as a static method.
When doing so, you need to ensure, that the TYPE-GROUP "ABAP" is linked to the class (class properties --> forward declarations),
Let me know if you find it useful.
And apologies in advance, if the same problem was already posted in the forum. I did only a rough search before due to a lag of ideas for appropriate search-strings ...
Best regards,
Rudy
Signature:
Importing:
IV_COMPNAME TYPE ABAP_COMPNAME
IV_START_STRUCTR TYPE KOMP_TYPE
Exporting/returning
EV_DDIC_STRUCT TYPE KOMP_TYPE
METHOD search_deep_ddic_by_comp.
* Description -------------------------------------------
* Methods looks into a deep DDIC-Structure and returns the
* corresponding TYPE
* Prerequsite for usage: Structures component names are unique.
* Local Data Defintions --------------------------------------
* Locals -----------------------------------------------------
* TYPES:
DATA: lv_compname TYPE abap_compname.
DATA: lt_componenttable TYPE abap_component_tab.
DATA: lv_relative_name TYPE string.
DATA: lv_ddic_header TYPE x030l.
DATA: lv_ddic_struct TYPE komp_type.
DATA: lv_start_struct TYPE komp_type.
* supporting
DATA: lv_lines TYPE i.
DATA: lv_message TYPE string.
DATA: lt_selopt TYPE sesf_selection_parameters_tab.
DATA: ls_selopt TYPE sesf_selection_parameter.
* References -------------------------------------------------
DATA: lo_struct_descr TYPE REF TO cl_abap_structdescr.
DATA: lo_type_descr TYPE REF TO cl_abap_typedescr.
* Field-Symbols ----------------------------------------------
FIELD-SYMBOLS:
<fs_struct_descr_component> TYPE abap_componentdescr.
lo_struct_descr ?= cl_abap_structdescr=>describe_by_name( p_name = iv_start_structr ).
IF lo_struct_descr IS BOUND.
* get all sub-structures/components of iv_start_structr
CALL METHOD lo_struct_descr->get_components
RECEIVING
p_result = lt_componenttable.
lv_compname = iv_compname.
READ TABLE lt_componenttable ASSIGNING <fs_struct_descr_component>
WITH KEY name = lv_compname.
IF sy-subrc = 0.
* matching component found - search for DDIC structure
CALL METHOD <fs_struct_descr_component>-type->get_relative_name
RECEIVING
p_relative_name = lv_relative_name.
ASSERT lv_relative_name IS NOT INITIAL.
CASE <fs_struct_descr_component>-type->type_kind.
WHEN 'u' OR 'v'. "structure
ev_ddic_struct = lv_relative_name.
RETURN.
WHEN 'h'. "table type - derive the line type
lo_type_descr ?= cl_abap_datadescr=>describe_by_name( p_name = lv_relative_name ).
CALL METHOD lo_type_descr->get_ddic_header
RECEIVING
p_header = lv_ddic_header.
IF sy-subrc = 0.
ev_ddic_struct = lv_ddic_header-refname.
RETURN.
ELSE.
"error
ENDIF.
WHEN OTHERS.
"error
ENDCASE.
ELSE.
* go deeper into structure and look into each sub-structure via recursion
LOOP AT lt_componenttable ASSIGNING <fs_struct_descr_component>.
CALL METHOD <fs_struct_descr_component>-type->get_relative_name
RECEIVING
p_relative_name = lv_relative_name.
ASSERT lv_relative_name IS NOT INITIAL.
CASE <fs_struct_descr_component>-type->type_kind.
WHEN 'u' OR 'v'. "structure
WHEN 'h'. "table type - derive the line type
lo_type_descr ?= cl_abap_datadescr=>describe_by_name( p_name = lv_relative_name ).
CALL METHOD lo_type_descr->get_ddic_header
RECEIVING
p_header = lv_ddic_header.
IF sy-subrc = 0.
lv_relative_name = lv_ddic_header-refname.
ELSE.
"error
ENDIF.
WHEN OTHERS.
EXIT. "next loop, investigate only struct and table
ENDCASE.
* lv_compname = <fs_struct_descr_component>-name.
lv_start_struct = lv_relative_name.
CALL METHOD /scmtms/cl_ddic_utility=>search_deep_ddic_by_comp
EXPORTING
iv_compname = iv_compname
iv_start_structr = lv_start_struct
IMPORTING
ev_ddic_struct = lv_ddic_struct.
IF lv_ddic_struct IS NOT INITIAL.
ev_ddic_struct = lv_ddic_struct.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
ENDMETHOD.Using command:
ASSIGN COMPONENT idx OF STRUCTURE struc TO <fs>.
For example:
DESCRIBE FIELD pi_output TYPE pi_output COMPONENTS lv_columns. "For number of columns
DO lv_columns TIMES.
ASSIGN COMPONENT SY-INDEX OF
STRUCTURE (name of structure) TO <l_fs_output>. "<l_fs_output> - field of structure
DESCRIBE FIELD <l_fs_output>... "with other options.
ENDDO. -
Can we express batch relationship structure in XML in the database table
Hi
please help me ..
i have a batch XML batch structure ...can we express batch relationship structure in XML in tha database table?
yes..then how?
Thanks
Amu
Edited by: amu_2007 on Mar 25, 2010 6:57 PM
Edited by: amu_2007 on Mar 25, 2010 7:03 PMBut what is the problem with the initial solution given that split the XML into the data?
I mean you could do something like this?
SQL> create table batch (customer VARCHAR2(10)
2 ,cust_name VARCHAR2(10)
3 ,cust_type VARCHAR2(10)
4 )
5 /
Table created.
SQL>
SQL> create table section (customer VARCHAR2(10)
2 ,sect_name VARCHAR2(10)
3 ,sect_depend VARCHAR2(10)
4 )
5 /
Table created.
SQL> create table job_sections (customer VARCHAR2(10)
2 ,sect_name VARCHAR2(10)
3 ,job_sect_name VARCHAR2(10)
4 ,job_sect_depend VARCHAR2(10)
5 )
6 /
Table created.
SQL> create table job (customer VARCHAR2(10)
2 ,sect_name VARCHAR2(10)
3 ,job_sect_name VARCHAR2(10)
4 ,job_type VARCHAR2(10)
5 ,job_sub_type VARCHAR2(10)
6 ,job_depend VARCHAR2(10)
7 )
8 /
Table created.
SQL>
SQL>
SQL> insert all
2 when batch_rn = 1 then
3 into batch (customer, cust_name, cust_type) values (customer, cust_name, cust_type)
4 when section_rn = 1 then
5 into section (customer, sect_name, sect_depend) values (customer, sect_name, sect_dependency)
6 when job_sections_rn = 1 then
7 into job_sections (customer, sect_name, job_sect_name, job_sect_depend) values (customer, sect_name, job_sect_name, job_sect_dependency)
8 when 1=1 then
9 into job (customer, sect_name, job_sect_name, job_type, job_sub_type, job_depend) values (customer, sect_name, job_sect_name, job_type, jo
10 --
11 WITH t as (select XMLTYPE('
12 <BATCH customer="ABC" name="ABC1" type="ABC_TYPE">
13 <BATCH_SECTIONS>
14 <SECTION name="X" dependency="NULL">
15 <JOB_SECTIONS name="JOB1" dependency="NULL" >
16 <JOBS>
17 <JOB type="X" sub_type="xx" dependency="NULL" />
18 <JOB type="X" sub_type="yy" dependency="NULL" />
19 <JOB type="X" sub_type="zz" dependency="NULL" />
20 </JOBS>
21 </JOB_SECTIONS>
22 </SECTION>
23 <SECTION name="Y" dependency="X">
24 <JOB_SECTIONS name="JOB2" dependency="X" >
25 <JOBS>
26 <JOB type="Y" sub_type="xx" dependency="X" />
27 <JOB type="Y" sub_type="yy" dependency="X" />
28 <JOB type="Y" sub_type="zz" dependency="X" />
29 </JOBS>
30 </JOB_SECTIONS>
31 </SECTION>
32 <SECTION name="Z" dependency="Y">
33 <JOB_SECTIONS name="JOB3" dependency="NULL" >
34 <JOBS>
35 <JOB type="....." sub_type="...." dependency="NULL" />
36 </JOBS>
37 </JOB_SECTIONS>
38 <JOB_SECTIONS name="JOB4" dependency="NULL">
39 <JOBS>
40 <JOB type="...." sub_type="...." dependency="NULL" />
41 </JOBS>
42 </JOB_SECTIONS>
43 </SECTION>
44 </BATCH_SECTIONS>
45 </BATCH>
46 ') as xml from dual)
47 --
48 -- END OF TEST DATA
49 --
50 ,flat as (select a.customer, a.cust_name, a.cust_type
51 ,b.sect_name, NULLIF(b.sect_dependency,'NULL') as sect_dependency
52 ,c.job_sect_name, NULLIF(c.job_sect_dependency,'NULL') as job_sect_dependency
53 ,d.job_type, d.job_sub_type, NULLIF(d.job_dependency,'NULL') as job_dependency
54 from t
55 ,XMLTABLE('/BATCH'
56 PASSING t.xml
57 COLUMNS customer VARCHAR2(10) PATH '/BATCH/@customer'
58 ,cust_name VARCHAR2(10) PATH '/BATCH/@name'
59 ,cust_type VARCHAR2(10) PATH '/BATCH/@type'
60 ,bat_sections XMLTYPE PATH '/BATCH/BATCH_SECTIONS'
61 ) a
62 ,XMLTABLE('/BATCH_SECTIONS/SECTION'
63 PASSING a.bat_sections
64 COLUMNS sect_name VARCHAR2(10) PATH '/SECTION/@name'
65 ,sect_dependency VARCHAR2(10) PATH '/SECTION/@dependency'
66 ,section XMLTYPE PATH '/SECTION'
67 ) b
68 ,XMLTABLE('/SECTION/JOB_SECTIONS'
69 PASSING b.section
70 COLUMNS job_sect_name VARCHAR2(10) PATH '/JOB_SECTIONS/@name'
71 ,job_sect_dependency VARCHAR2(10) PATH '/JOB_SECTIONS/@dependency'
72 ,job_sections XMLTYPE PATH '/JOB_SECTIONS'
73 ) c
74 ,XMLTABLE('/JOB_SECTIONS/JOBS/JOB'
75 PASSING c.job_sections
76 COLUMNS job_type VARCHAR2(10) PATH '/JOB/@type'
77 ,job_sub_type VARCHAR2(10) PATH '/JOB/@sub_type'
78 ,job_dependency VARCHAR2(10) PATH '/JOB/@dependency'
79 ) d
80 )
81 --
82 select customer, cust_name, cust_type, sect_name, sect_dependency, job_sect_name, job_sect_dependency, job_type, job_sub_type, job_dependency
83 ,row_number() over (partition by customer order by 1) as batch_rn
84 ,row_number() over (partition by customer, sect_name order by 1) as section_rn
85 ,row_number() over (partition by customer, sect_name, job_sect_name order by 1) as job_sections_rn
86 from flat
87 /
16 rows created.
SQL> select * from batch;
CUSTOMER CUST_NAME CUST_TYPE
ABC ABC1 ABC_TYPE
SQL> select * from section;
CUSTOMER SECT_NAME SECT_DEPEN
ABC X
ABC Y X
ABC Z Y
SQL> select * from job_sections;
CUSTOMER SECT_NAME JOB_SECT_N JOB_SECT_D
ABC X JOB1
ABC Y JOB2 X
ABC Z JOB3
ABC Z JOB4
SQL> select * from job;
CUSTOMER SECT_NAME JOB_SECT_N JOB_TYPE JOB_SUB_TY JOB_DEPEND
ABC X JOB1 X xx
ABC X JOB1 X yy
ABC X JOB1 X zz
ABC Y JOB2 Y xx X
ABC Y JOB2 Y yy X
ABC Y JOB2 Y zz X
ABC Z JOB3 ..... ....
ABC Z JOB4 .... ....
8 rows selected.
SQL>But it would depend what you are actually after in terms of primary keys, and table relationships etc.
Let me put this simply for you...
h1. IF YOU DON'T DEMONSTRATE TO US WHAT OUTPUT YOU REQUIRE, WE CAN'T GIVE YOU AN ANSWER -
CDIR is a DDIC structure used in the IMPORT DIRECTORY
CDIR is a DDIC structure used in the IMPORT DIRECTORY statementmy question is is it usqable for all cluster databases we make indeoendently apart from INDX or just for INDX
I have no real details, but based on your question I am guessing Thunderbird does not check the drive letter only the path. so H:\Stuff and G:\Stuff would be the same thing. Try a change to the actual folder names.
-
How to enhance the length of standard UI element which maps to DDIC structure?
Dear Webdynpro Expert,
I got a requirement to enhance the length of UI element which maps to DDIC structure attribute. I have tried by using
View Enhancement by hiding the standard UI element,
Adding the required field in the standard structure through append structure,
mapping the appended structure field to the UI element.
But it shows error as data compatibility.
Can you please share some light on it.
Thanks.Hi Mohsin,
When and where are you getting this data compatibility error???
Try to create a new context attribute and add your new DE.
BR,
RAM. -
Easy way how to convert deep structure to XML
Hi,
is there any easy way how to convert a complex deep structure to XML. I have XSLT transformation ready for using, but when I look on examples on using CALL TRANSFORMATION, I am finding only examples for internal tables.
Something like this CALL TRANSFORMATION SOURCE tab = sometab[].
Instead of this I need to convert a comlex deep structure.
Any help is appreciated.
Thanks.
MarianHi,
is there any easy way how to convert a complex deep structure to XML. I have XSLT transformation ready for using, but when I look on examples on using CALL TRANSFORMATION, I am finding only examples for internal tables.
Something like this CALL TRANSFORMATION SOURCE tab = sometab[].
Instead of this I need to convert a comlex deep structure.
Any help is appreciated.
Thanks.
Marian -
How do I format the structure of xml
from:
<root><news><title>title
text</title><body>body
text</body></news></root>
to:
<root>
<news>
<title>title text</title>
<body>body text</body>
</news>
</root>
//code
var news_xml:XML = new XML();
news_xml.ignoreWhite = true;
AddNewsEntry();
function AddNewsEntry() {
var newsRoot:XMLNode = news_xml.createElement("root");
var newsNode:XMLNode = news_xml.createElement("news");
var titleNode:XMLNode = news_xml.createElement("title");
var bodyNode:XMLNode = news_xml.createElement("body");
var titleText:XMLNode = news_xml.createTextNode("title
text");
var bodyText:XMLNode = news_xml.createTextNode("body text");
news_xml.appendChild(newsRoot);
newsNode.appendChild(titleNode);
newsNode.appendChild(bodyNode);
newsRoot.appendChild(newsNode);
titleNode.appendChild(titleText);
bodyNode.appendChild(bodyText);
trace(news_xml);Try the attached code. It will convert the XML into a string
that should be formatted correctly. -
How to see the IDOC structure in XML format
Hi, I am ver new to MII. I configured connection between SAPand SAP MII and IDOC is triggering in SAP MII. I can see the idoc triggered in Message monitor.
Now my query is how to see the IDOC structure in XML format? I written a transaction where I am assigning transaction.xml to my Local.xml and trying to display with message action block. When I display the message I am getting message as below
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
There is no data in the xml, but in SAP side i seen data and segment which sent to MII as a IDOC. Please help me how to resolve this issue.Hi, Thanks for quick response.
In Message monitor I seen the IDOC list after executing POIT transaction code in SAP.
But the display button is disabled always in message monitor screen. I want to take this IDOC and save it in my SQL database. So I want to see this IDOC structure in XML format. Where i can see this structure? -
How to structure an XML doc using schema?
Hi there,
I have an XML file with a grouped <employee> tags like,
<employee>
<employeename>John</employeename>
<employeename>Dave</employeename>
</employee>
I want to structure above xml file to be like this
<employee>
<employeename>John</employeename>
</employee>
<employee>
<employeename>Dave</employeename>
</employee>
Can I do that in a XML schema (.xsd file)? If I can, how do I do that?
Thanks,
ChandiHi Dave,
Thanks for your response.
I create this XML from .xsd files using a tool (MapForce by Altova which allows me to do the mappings between relational database table columns and elements in the .xsd file, and it creates Java code for me), the data is read from a database to compose this XML file.
Everything works fine with this XML file, I just want to change the structure of the XML file when it composes it, I was wondering if I could do that by changing the existing .xsd file?
Its not easy to use XSLT, I�m dealing with over 600 hierarchical elements with over 15 .xsd files.
So, what are my options?
All I want to know is, what should I change in the .xsd in order to compose this XML in the structure that I want.
It groups all the employee names (<employeename> tag) under one <employee> tag, instead I want to have individual <employee> tags for each and every <employeename> tags (<employee> tag around <employeename> tag for each and every employee)
Is it possible at all?
Thanks,
Chandi -
BRFplus: DDIC Structure as Function Parameter results in Dump
Hi all,
I want to use Data Dictionary structure VBAK as a (signature) parameter to a BRFplus Function.
I have created a Data Object VBAK bound to the DDIC structure VBAK, and defined it as a parameter to my Function.
In my code to call the BRF function, I have:
DATA:
lo_context TYPE REF TO if_fdt_context,
lo_function TYPE REF TO if_fdt_function.
DATA:
ls_vbak TYPE VBAK.
lo_context = lo_function->get_process_context( ).
lo_context->set_value(
EXPORTING
iv_name = 'VBAK'
ia_value = ls_vbak ).
The SET_VALUE method results in a runtime error (program dump) of type UC_OBJECTS_NOT_CONVERTIBLE description u201CData objects in Unicode programs cannot be convertedu201D.
On investigation this seems to be because certain fields are represented differently in BRF. For example, the DDIC field VBAK-ERDAT (type DATS) is stored in BRF as TIMEPOINT, which is itself a structure (type FDT_S_TIMEPOINT). Trying to move the date value to the timepoint value is not possible and results in the dump.
How do I get around this ? Or in practice is it not feasible to use DDIC structures containing dates, times and possibly numbers as function parameters ??
Running on SAP NW 7.0 EHP1 SP5.
Thanks,
GroganTherefore you best create an internal structure reusing the types in IF_FDT_TYPES. Then you copy the data into the BRFplus internal format and then you process the function.
Is there a method to do this, or do I have to develop my own using RTTI / RTTC ?
NW 701 - *sigh*.
Thanks & regards,
Grogan -
DDIC-Structure - Need Byte Length of a DDIC-STRUCTURE!!!
Hello,
how can I write a Report/ Function that becomes in Input each DDIC-Structurename and gives the user an Output back, that contains the whole Byte Length of the STRUCTURE.
For Example, we have an DDIC-Structure with name structure_example:
Name TYPE c LENGTH 15,
Firstname TYPE c LENGTH 10,
Street TYPE c LENGTH 30,
ZIP-Code TYPE int2 LENGTH 5.
Their must existing a Functionality which can used the structurename and gives the user the Byte Length of the Structure back.
In our example the user gets for "structure_Example" the Output "60" Bytes back.
Input: structure_example
Output: 60
I hope someone can give me a solution to solve this problem.
Thanks for all help in this forum.
With kind regards
ETNHi,
check out the below code...
my be this might help you.
TYPES:
BEGIN OF my_struct,
comp_a type i,
comp_b type f,
END OF my_struct.
DATA:
my_data TYPE my_struct,
descr_ref TYPE ref to cl_abap_structdescr.
FIELD-SYMBOLS:
<comp_wa> TYPE abap_compdescr.
START-OF-SELECTION.
descr_ref ?= cl_abap_typedescr=>describe_by_data( my_data ).
WRITE: / 'Typename :', descr_ref->absolute_name.
WRITE: / 'Kind :', descr_ref->type_kind.
*WRITE: / 'Length :', descr_ref->length.*
WRITE: / 'Decimals :', descr_ref->decimals.
WRITE: / 'Struct Kind :', descr_ref->struct_kind.
WRITE: / 'Components'.
WRITE: / 'Name Kind Length Decimals'.
LOOP AT descr_ref->components ASSIGNING <comp_wa>.
WRITE: / <comp_wa>-name, <comp_wa>-type_kind,
<comp_wa>-length, <comp_wa>-decimals.
ENDLOOP.
regards,
Santosh Thorat -
How to create and add table type to a DDIC Structure in sap 3.1H
How to create and add table type to a DDIC Structure in sap 3.1H
How to create and add table type to a DDIC Structure in sap 3.1H
-
Dynamic DDIC structure - work at runtime with changes
Hi Experts,
I have a problem in a method of Web Dynpro Abap. Ich have a database structure /SME/DED_DYN and change its fields at runtime. I do that with the function DDIF_TABL_PUT and the activation with DDIF_TABL_ACTIVATE.
I have:
COMMIT WORK and wait.
CALL FUNCTION 'DDIF_TABL_PUT'
EXPORTING
NAME = '/SME/DED_DYN'
TABLES
DD03P_TAB = DD03P_TAB
DD05M_TAB = DD05M_TAB
DD08V_TAB = DD08V_TAB
DD35V_TAB = DD35V_TAB
DD36M_TAB = DD36M_TAB
EXCEPTIONS
tabl_not_found = 1
name_inconsistent = 2
tabl_inconsistent = 3
put_failure = 4
put_refused = 5
others = 6.
COMMIT WORK and wait.
if sy-subrc = 0.
call function 'DDIF_TABL_ACTIVATE'
exporting
name = '/SME/DED_DYN'
IMPORTING
rc = rc
exceptions
not_found = 1
put_failure = 2
others = 3.
endif.
The fields of the DDIC structure /SME/DED_DYN are changed at runtime dynamicly. Not their value, the fields themselves with fieldname and datatype. I need to work with these NEW fields of the DDIC structure at the same runtime. But somewhere the OLD /SME/DED_DYN is buffered I think, because the method only reads this old structure although in Transaction SE11 it changes to the NEW one at runtime correctly. I have to refresh my whole Web Dynpro Application in the browser and then it works with the new structure.What buffer could this be and how can I clear it, so that my method in WebDynpro can proceed with the new DDIC structure?
I hope you understand my problem.
Thanks for your help!!
Best regards,
IngmarHi,
I create a database table which name is ZTABL1 .
The fields of this table are MANDT and FIELDS1 .
Then i write the code below .
It changes the dbtable dynamically and the values of the fields.
I hope this help you.
DATA : DD03P_TAB LIKE DD03P OCCURS 0 WITH HEADER LINE .
DATA : DD05M_TAB LIKE DD05M OCCURS 0 WITH HEADER LINE .
DATA : DD08V_TAB LIKE DD08V OCCURS 0 WITH HEADER LINE .
DATA : DD12V_TAB LIKE DD12V OCCURS 0 WITH HEADER LINE .
DATA : DD17V_TAB LIKE DD17V OCCURS 0 WITH HEADER LINE .
DATA : DD35V_TAB LIKE DD35V OCCURS 0 WITH HEADER LINE .
DATA : DD36M_TAB LIKE DD36M OCCURS 0 WITH HEADER LINE .
DATA : lt_fcat TYPE lvc_t_fcat ,
ls_fcat TYPE lvc_s_fcat .
DATA : lt_table TYPE REF TO data.
DATA : ZTABL1 .
CALL FUNCTION 'DDIF_TABL_GET'
EXPORTING
NAME = 'ZTABL1'
TABLES
DD03P_TAB = DD03P_TAB
DD05M_TAB = DD05M_TAB
DD08V_TAB = DD08V_TAB
DD12V_TAB = DD12V_TAB
DD17V_TAB = DD17V_TAB
DD35V_TAB = DD35V_TAB
DD36M_TAB = DD36M_TAB
EXCEPTIONS
ILLEGAL_INPUT = 1
OTHERS = 2
LOOP AT DD05M_TAB WHERE FIELDNAME NE 'MANDT' .
DD05M_TAB-FIELDNAME = 'FIELD2' .
MODIFY DD05M_TAB .
ENDLOOP.
LOOP AT DD03P_TAB WHERE FIELDNAME NE 'MANDT'
DD03P_TAB-FIELDNAME = 'FIELD2' .
MODIFY DD03P_TAB .
ENDLOOP.
LOOP AT DD08V_TAB WHERE FIELDNAME NE 'MANDT' .
DD08V_TAB-FIELDNAME = 'FIELD2' .
APPEND DD08V_TAB .
ENDLOOP.
LOOP AT DD35V_TAB WHERE FIELDNAME NE 'MANDT' .
DD35V_TAB-FIELDNAME = 'FIELD2' .
MODIFY DD35V_TAB .
ENDLOOP.
LOOP AT DD36M_TAB WHERE FIELDNAME NE 'MANDT' .
DD36M_TAB-FIELDNAME = 'FIELD2' .
MODIFY DD36M_TAB .
ENDLOOP.
CALL FUNCTION 'DDIF_TABL_PUT'
EXPORTING
NAME = 'ZTABL1'
TABLES
DD03P_TAB = DD03P_TAB
DD05M_TAB = DD05M_TAB
DD08V_TAB = DD08V_TAB
DD35V_TAB = DD35V_TAB
DD36M_TAB = DD36M_TAB
EXCEPTIONS
TABL_NOT_FOUND = 1
NAME_INCONSISTENT = 2
TABL_INCONSISTENT = 3
PUT_FAILURE = 4
PUT_REFUSED = 5
OTHERS = 6
COMMIT WORK AND WAIT .
DATA : lv_subrc like sy-subrc .
CALL FUNCTION 'DDIF_TABL_ACTIVATE'
EXPORTING
NAME = 'ZTABL1'
AUTH_CHK = ' '
IMPORTING
RC = lv_subrc
EXCEPTIONS
NOT_FOUND = 1
PUT_FAILURE = 2
OTHERS = 3
COMMIT WORK AND WAIT .
clear : lt_fcat , lt_fcat[] .
LOOP AT DD03P_TAB .
MOVE-CORRESPONDING DD03P_TAB TO ls_fcat .
APPEND ls_fcat TO lt_fcat .
ENDLOOP.
PERFORM process.
*& Form process
form process.
FIELD-SYMBOLS : <table> TYPE table .
FIELD-SYMBOLS : <s_table> TYPE ANY .
FIELD-SYMBOLS : <f_1> TYPE ANY .
DATA : ls_ZTABL1 type ZTABL1 .
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING it_fieldcatalog = lt_fcat
IMPORTING ep_table = lt_table.
ASSIGN lt_table->* TO <table>.
ASSIGN LOCAL COPY OF INITIAL LINE OF <table> TO <s_table>.
LOOP AT lt_fcat INTO ls_fcat.
IF ls_fcat-fieldname = 'FIELD2' .
ASSIGN COMPONENT ls_fcat-fieldname OF STRUCTURE <s_table> TO <f_1> .
<f_1> = 'A' .
ENDIF.
ENDLOOP.
MOVE-CORRESPONDING <s_table> TO ls_ZTABL1 .
INSERT INTO ZTABL1 values ls_ZTABL1.
endform. " process
Maybe you are looking for
-
Aaaaaarrrrrrggggggghhhhhhhh!!!!!! I was typing along and then all of the sudden my cursor disappeared! I can't find it. I've tried shutting down my Mac, but I can't do that because the box pops up when I hit the on/off button asking if I want to rest
-
The video out is NOT WORKING under 10.5.2
*APPLE please read this;* The video out on the MacBook Pro is NOT WORKING under 10.5.2, or precisely is working with a possibility of 10%! Monitors doesn't find signal in, or when they find it, the image is unstable with green shadows. _I tried 28 ex
-
Business Rules:Non-oracle db connections not shown in the ADF-BC Facts sect
Hi everyone I'm working with Oracle BPM 11.1.1.5.0 JDeverloper: 11.1.1.5.0 Database : SQL Server 2008. I'm trying to create some rules based on some value in my tables in the database. The problem: My non-oracle DB connections are not shown in my Bus
-
Getting report info (report name, selection criteria) from ACTIVE session
hello - trying to get some insight how this can be done for a query that is ALREADY running. when i spot a long-running query/report in SM50/66, it's easy enough to see what it's doing in ST04 at the DB level (Oracle is our dbms). then i can look in
-
Sup, I have a prob. I am trying to use imageicons in a JTree. The program displays Classes (ie Class Class) as a Jtree. The tree displays multiple classes. The class is a node, which can be expanded to display the methods and interfaces of the class.