Hierarchy Child Node Insert using ABAP Program
Hi,
Requirement is to add one more child node to an existing child Node for available Custom Cost Center Hierarchy (in BI environment). To meet this requirement, ABAP Code is best solution- CMOD-Exit EXIT_SAPLRSAP_004 (ZXRSAU04).
Is there any Function modules available for inserting Hierarchy Node. I have gone to "How to Download A Hierarchy to a Flat File.pdf" document.
Any Sample Codes or any documents (on the above mentioned topic) or suggestions to achieve the result is highly appreciated.
Regards,
Sanni
Any chance you could share what you did here?
I am looking to read values from a hierarchy using ABAP, and am not sure where to start. Is there a standard table where hierarchy information is stored, or are custom tables created per hierarchy created?
Cheers,
Andrew
Similar Messages
-
Can a transaction be called in background dynamically using ABAP program??
Hi Experts,
Can a transaction be called in background dynamically using ABAP program without BDC???
Regards,
Mansi.u can create job dynamically through programming..Try this sample code..
data: jobname like tbtcjob-jobname value
' TRANSFER TRANSLATION'.
data: jobcount like tbtcjob-jobcount,
host like msxxlist-host.
data: begin of starttime.
include structure tbtcstrt.
data: end of starttime.
data: starttimeimmediate like btch0000-char1.
Job open
call function 'JOB_OPEN'
exporting
delanfrep = ' '
jobgroup = ' '
jobname = jobname
sdlstrtdt = sy-datum
sdlstrttm = sy-uzeit
importing
jobcount = jobcount
exceptions
cant_create_job = 01
invalid_job_data = 02
jobname_missing = 03.
if sy-subrc ne 0.
"error processing
endif.
Insert process into job
SUBMIT zreport and return << Here it is a static call but u can make it dynamic
with p_param1 = 'value'
with p_param2 = 'value'
user sy-uname
via job jobname
number jobcount.
if sy-subrc > 0.
"error processing
endif.
Close job
starttime-sdlstrtdt = sy-datum + 1.
starttime-sdlstrttm = '220000'.
call function 'JOB_CLOSE'
exporting
event_id = starttime-eventid
event_param = starttime-eventparm
event_periodic = starttime-periodic
jobcount = jobcount
jobname = jobname
laststrtdt = starttime-laststrtdt
laststrttm = starttime-laststrttm
prddays = 1
prdhours = 0
prdmins = 0
prdmonths = 0
prdweeks = 0
sdlstrtdt = starttime-sdlstrtdt
sdlstrttm = starttime-sdlstrttm
strtimmed = starttimeimmediate
targetsystem = host
exceptions
cant_start_immediate = 01
invalid_startdate = 02
jobname_missing = 03
job_close_failed = 04
job_nosteps = 05
job_notex = 06
lock_failed = 07
others = 99.
if sy-subrc eq 0.
"error processing
endif.
Regards,
JOy. -
(Oracle Database 11g 11.1.0.6.0)
I just ran a test to continually insert child XML nodes into an XML table and found performance slow. As the documentation states, the reason appears to be because the entire XML is being read into memory each time as a DOM before the insert.
My question is whether there is a higher performing means of performing child node inserts?
The test is as follows:
i) Create a non-schema based XML type table:
CREATE TABLE myTable1 (
id NUMBER,
XML_COLUMN XMLType
XMLTYPE COLUMN xml_document store as binary xml
ii) The table is initialized with one row of data:
0, XMLTYPE('<trace-envelope>
<metadata>
<pid>12345</pid>
<date>2008-05-30</date>
</metadata>
</trace-envelope>')
iii) Insert/append successive XML data using the following statement:
UPDATE MyTable1 SET XML_COLUMN = APPENDCHILDXML(XML_COLUMN," +
"'trace-envelope', XMLType('" + traceData + "'))";
where 'traceData' is some new XML data for insertion. The view on the row then becomes (for example):
0, XMLTYPE('<trace-envelope>
<metadata>
<pid>12345</pid>
<date>2008-05-30</date>
</metadata>
<EP>
<priceDate>
2008-05-30
</priceDate>
</EP>
</trace-envelope>')
iv) Continue appending successive child nodes.The only thing I currently can think of is maybe a negative impact of updating / re-balancing the index tree during appending in the XMLType OR structure.
SQL> select * from user_segments where segment_type like '%INDEX%'
2 order by segment_type
3 /
SEGMENT_NAME PARTITION_NAME SEGMENT_TYPE SEGMENT_SU TABLESPACE_NAME BYTES BLOCKS EXTENTS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS MAX_SIZE RETENTI MINRETENTION PCT_INCREASE FREELISTS FREELIST_GROUPS BUFFER_
SYS_C004114 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004115 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004116 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004117 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004118 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004120 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004119 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00004$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00005$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00011$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00016$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00025$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060324C00003$$ LOBINDEX ASSM USERS 131072 16 2 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060305C00004$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060328C00003$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
15 rows selected.
SQL> select * from user_segments
2 /
SEGMENT_NAME PARTITION_NAME SEGMENT_TYPE SEGMENT_SU TABLESPACE_NAME BYTES BLOCKS EXTENTS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS MAX_SIZE RETENTI MINRETENTION PCT_INCREASE FREELISTS FREELIST_GROUPS BUFFER_
ACTION_TABLE NESTED TABLE ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060305C00004$$ LOBSEGMENT ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060305C00004$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004114 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
LINEITEM_TABLE NESTED TABLE ASSM USERS 131072 16 2 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004115 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
PURCHASEORDER_OR TABLE ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060304C00004$$ LOBSEGMENT ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00004$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060304C00005$$ LOBSEGMENT ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00005$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060304C00011$$ LOBSEGMENT ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00011$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060304C00016$$ LOBSEGMENT ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00016$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060304C00025$$ LOBSEGMENT ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00025$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004116 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004117 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004118 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
PURCHASEORDER_CLOB TABLE ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060324C00003$$ LOBSEGMENT ASSM USERS 14680064 1792 29 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060324C00003$$ LOBINDEX ASSM USERS 131072 16 2 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004119 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
PURCHASEORDER_CSX TABLE ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060328C00003$$ LOBSEGMENT SECUREFILE USERS 327680 40 4 106496 1 2.147E+09 2.147E+09 DEFAULT 0 DEFAULT
SYS_IL0000060328C00003$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004120 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
28 rows selected.
SQL> select dbms_lob.getlength(t.xmldata)
2 as "XMLDocSize"
3 from PURCHASEORDER_CLOB t;
XMLDocSize
73114
1 row selected.
SQL>
SQL> select dbms_lob.getlength(t.object_value.getclobval())
2 as "XMLDocSize"
3 from PURCHASEORDER_CSX t;
XMLDocSize
68682
1 row selected.
SQL>
SQL> select dbms_lob.getlength(t.object_value.getclobval())
2 as "XMLDocSize"
3 from PURCHASEORDER_OR t;
XMLDocSize
85342
1 row selected.
SQL>
SQL> truncate table PURCHASEORDER_CLOB;
Table truncated.
SQL> truncate table PURCHASEORDER_CSX;
Table truncated.
SQL> truncate table PURCHASEORDER_OR;
Table truncated.
SQL> var DOCUMENT VARCHAR2(4000)
SQL> --
SQL> set define off
SQL> --
SQL> begin
2 :DOCUMENT :=
3 '<PurchaseOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PurchaseOrder.xsd">
4 <Reference>AMCEWEN-20030409123336271PDT</Reference>
5 <Actions>
6 <Action>
7 <User>KPARTNER</User>
8 </Action>
9 </Actions>
10 <Reject/>
11 <Requestor>Allan D. McEwen</Requestor>
12 <User>AMCEWEN</User>
13 <CostCenter>S30</CostCenter>
14 <ShippingInstructions>
15 <name>Allan D. McEwen</name>
16 <address>Oracle Plaza
17 Twin Dolphin Drive
18 Redwood Shores
19 CA
20 94065
21 USA</address>
22 <telephone>650 506 7700</telephone>
23 </ShippingInstructions>
24 <SpecialInstructions>Expidite</SpecialInstructions>
25 <LineItems>
26 <LineItem ItemNumber="1">
27 <Description>Traffic</Description>
28 <Part Id="696306038924" UnitPrice="39.95" Quantity="2"/>
29 </LineItem>
30 <LineItem ItemNumber="2">
31 <Description>General Idi Amin Dada</Description>
32 <Part Id="37429166529" UnitPrice="29.95" Quantity="3"/>
33 </LineItem>
34 <LineItem ItemNumber="3">
35 <Description>This is Spinal Tap</Description>
36 <Part Id="715515009126" UnitPrice="39.95" Quantity="3"/>
37 </LineItem>
38 <LineItem ItemNumber="4">
39 <Description>Great Expectations</Description>
40 <Part Id="37429128022" UnitPrice="39.95" Quantity="1"/>
41 </LineItem>
42 <LineItem ItemNumber="5">
43 <Description>The Unbearable Lightness Of Being</Description>
44 <Part Id="37429140222" UnitPrice="29.95" Quantity="2"/>
45 </LineItem>
46 <LineItem ItemNumber="6">
47 <Description>Blood of a Poet</Description>
48 <Part Id="37429147429" UnitPrice="0.0" Quantity="1"/>
49 </LineItem>
50 <LineItem ItemNumber="7">
51 <Description>Juliet of the Spirits</Description>
52 <Part Id="37429165829" UnitPrice="29.95" Quantity="4"/>
53 </LineItem>
54 <LineItem ItemNumber="8">
55 <Description>Insomnia</Description>
56 <Part Id="37429138229" UnitPrice="29.95" Quantity="4"/>
57 </LineItem>
58 <LineItem ItemNumber="9">
59 <Description>Picnic at Hanging Rock</Description>
60 <Part Id="37429126325" UnitPrice="29.95" Quantity="3"/>
61 </LineItem>
62 <LineItem ItemNumber="10">
63 <Description>W.C. Fields - Six Short Films</Description>
64 <Part Id="715515010726" UnitPrice="29.95" Quantity="4"/>
65 </LineItem>
66 </LineItems>
67 </PurchaseOrder>';
68 end;
69 /
PL/SQL procedure successfully completed.
SQL>
SQL> set timing on
SQL> --
SQL> insert into PURCHASEORDER_OR values ( XMLType(:DOCUMENT))
2 /
1 row created.
Elapsed: 00:00:00.06
SQL>
SQL> insert into PURCHASEORDER_CLOB values ( XMLType(:DOCUMENT))
2 /
1 row created.
Elapsed: 00:00:00.01
SQL>
SQL> insert into PURCHASEORDER_CSX values ( XMLType(:DOCUMENT))
2 /
1 row created.
Elapsed: 00:00:00.03
SQL> commit;
Commit complete.
Elapsed: 00:00:00.01
SQL> create or replace synonym PURCHASEORDER for PURCHASEORDER_OR
2 /
Synonym created.
Elapsed: 00:00:00.03
SQL> call appendLineItems(1001,2000)
2 /
Call completed.
Elapsed: 00:00:04.78
SQL> call appendLineItems(2001,3000)
2 /
Call completed.
Elapsed: 00:00:09.39
SQL> call appendLineItems(3001,4000)
2 /
Call completed.
Elapsed: 00:00:13.93
SQL> call appendLineItems(4001,5000)
2 /
Call completed.
Elapsed: 00:00:18.70
SQL> call appendLineItems(5001,6000)
2 /
Call completed.
Elapsed: 00:00:23.65
SQL> call appendLineItems(6001,7000)
2 /
Call completed.
Elapsed: 00:00:28.18
SQL> call appendLineItems(7001,8000)
2 /
Call completed.
Elapsed: 00:00:32.98
SQL> call appendLineItems(8001,9000)
2 /
Call completed.
Elapsed: 00:00:37.78
SQL> call appendLineItems(9001,10000)
2 /
Call completed.
Elapsed: 00:00:43.03
SQL> select * from user_segments where segment_type like '%INDEX%'
2 order by segment_type;
SEGMENT_NAME PARTITION_NAME SEGMENT_TYPE SEGMENT_SU TABLESPACE_NAME BYTES BLOCKS EXTENTS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS MAX_SIZE RETENTI MINRETENTION PCT_INCREASE FREELISTS FREELIST_GROUPS BUFFER_
SYS_C004114 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004115 INDEX ASSM USERS 393216 48 6 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004116 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004117 INDEX ASSM USERS 196608 24 3 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004118 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004120 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004119 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00004$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00005$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00011$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00016$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00025$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060324C00003$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060305C00004$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060328C00003$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
15 rows selected.
Elapsed: 00:00:00.17
SQL> select * from user_segments;
SEGMENT_NAME PARTITION_NAME SEGMENT_TYPE SEGMENT_SU TABLESPACE_NAME BYTES BLOCKS EXTENTS INITIAL_EXTENT NEXT_EXTENT MIN_EXTENTS MAX_EXTENTS MAX_SIZE RETENTI MINRETENTION PCT_INCREASE FREELISTS FREELIST_GROUPS BUFFER_
ACTION_TABLE NESTED TABLE ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060305C00004$$ LOBSEGMENT ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060305C00004$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004114 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
LINEITEM_TABLE NESTED TABLE ASSM USERS 917504 112 14 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004115 INDEX ASSM USERS 393216 48 6 65536 1 2.147E+09 2.147E+09 DEFAULT
PURCHASEORDER_OR TABLE ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060304C00004$$ LOBSEGMENT ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00004$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060304C00005$$ LOBSEGMENT ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00005$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060304C00011$$ LOBSEGMENT ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00011$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060304C00016$$ LOBSEGMENT ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00016$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060304C00025$$ LOBSEGMENT ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060304C00025$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004116 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004117 INDEX ASSM USERS 196608 24 3 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004118 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
PURCHASEORDER_CLOB TABLE ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060324C00003$$ LOBSEGMENT ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_IL0000060324C00003$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004119 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
PURCHASEORDER_CSX TABLE ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_LOB0000060328C00003$$ LOBSEGMENT SECUREFILE USERS 131072 16 1 106496 1 2.147E+09 2.147E+09 DEFAULT 0 DEFAULT
SYS_IL0000060328C00003$$ LOBINDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
SYS_C004120 INDEX ASSM USERS 65536 8 1 65536 1 2.147E+09 2.147E+09 DEFAULT
28 rows selected.
Elapsed: 00:00:00.17
SQL> select index_name, table_name, blevel, LEAF_BLOCKS, DISTINCT_KEYS, AVG_LEAF_BLOCKS_PER_KEY, AVG_DATA_BLOCKS_PER_KEY
2 from user_indexes
3 ;
INDEX_NAME TABLE_NAME BLEVEL LEAF_BLOCKS DISTINCT_KEYS AVG_LEAF_BLOCKS_PER_KEY AVG_DATA_BLOCKS_PER_KEY
SYS_C004114 ACTION_TABLE 0 1 1 1 1
SYS_IL0000060305C00004$$ ACTION_TABLE
SYS_C004115 LINEITEM_TABLE 1 2 511 1 1
SYS_C004119 PURCHASEORDER_CLOB 0 1 1 1 1
SYS_IL0000060324C00003$$ PURCHASEORDER_CLOB
SYS_C004120 PURCHASEORDER_CSX 0 1 1 1 1
SYS_IL0000060328C00003$$ PURCHASEORDER_CSX
SYS_C004116 PURCHASEORDER_OR 0 1 1 1 1
SYS_IL0000060304C00025$$ PURCHASEORDER_OR
SYS_IL0000060304C00016$$ PURCHASEORDER_OR
SYS_IL0000060304C00011$$ PURCHASEORDER_OR
SYS_IL0000060304C00005$$ PURCHASEORDER_OR
SYS_IL0000060304C00004$$ PURCHASEORDER_OR
SYS_C004117 PURCHASEORDER_OR 0 1 1 1 1
SYS_C004118 PURCHASEORDER_OR 0 1 1 1 1
15 rows selected.
Elapsed: 00:00:00.15
SQL> select dbms_lob.getlength(t.object_value.getclobval())
2 as "XMLDocSize"
3 from PURCHASEORDER_OR t;
XMLDocSize
1505177
1 row selected.
Elapsed: 00:00:00.42
SQL> set autotrace ON EXPLAIN
SQL> select count(*) from PURCHASEORDER, XMLTABLE (
2 '/PurchaseOrder/LineItems/LineItem' passing OBJECT_VALUE)
3 /
COUNT(*)
9010
1 row selected.
Elapsed: 00:00:00.07
Execution Plan
Plan hash value: 3089669143
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 53 | 9 (12)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 53 | | |
|* 2 | HASH JOIN | | 511 | 27083 | 9 (12)| 00:00:01 |
| 3 | TABLE ACCESS FULL| PURCHASEORDER_OR | 1 | 34 | 3 (0)| 00:00:01 |
|* 4 | TABLE ACCESS FULL| LINEITEM_TABLE | 511 | 9709 | 5 (0)| 00:00:01 |
Predicate Information (identified by operation id):
2 - access("NESTED_TABLE_ID"="PURCHASEORDER"."SYS_NC0003200033$")
4 - filter("SYS_NC_TYPEID$" IS NOT NULL) -
Is it possible to reset password for any user using abap program
Hi friends,
Is it possible to reset password for any user using abap program by specifying client number and user id. in selection screen.
if any code for that to reset password please mail me.
Thanks & Regards,
YogeshHello Yogesh,
Yes you can reset the password for any body using ABAP Code. But for that you really don't need any client number.
If this process is on regular basis, then recommended is to use BAPI for changing the user details Otherwise BDC also works fine.
=> Function Module - BAPI_USER_CHANGE
Call this in the program for resetting the password.
=> CALL TRANSACTION 'SU01' USING InternalTable
This will be executed in the BDC of SU01 transaction recording. Use the Password Change button in the application toolbar of transaction while recording.
Hope this helps.
PS If the answer solves your query, plz close the thread by marking it solved and rewarding each reply.
Regards -
Synchronizing Two Custom Z Tables Using Abap Program
Hi,
My requirement is Synchronizing two custom z tables using abap program me.
I have vendors in two tables, i have to select the common vendors from first which are existing in second table also.
In first table each vendor can have more than one supplier types in one field only. In second table these supplier types are divided into
different fields.
My requirement is I have to check supplier types in first table and i have to pass X to corresponding supplier types in second table vendor.
I have to pass X value for each depending in Second table depending upon supplier type in first table.
. How to do it can any one suggest with code.
Thanks in Advance,
Vivek
<subject edited by moderator>
Message was edited by: Manish KumarHi,
Imho, you need to get (meaning, extract into separate fields) the different supplier types from Table1 first. Your key for Table1 is the vendor no, which is also the key in Table2 (or the key for Table2 is Vendor no & Type).
For better performance, better select multiple/all required entries from Table1 instead of doing a select endselect.
Depending on the format of the vendortypes in Table1, put them in a new itab (for our purpose named Table1New where vendor no & type are the only 2 fields. For example, if the type length is fixed to 2 chars, or divided by space,... use your coding accordingly.
Next step is to select all vendor no's in Table2 which you have selected in Table1. If in Table2, the vendor no is the only key (and the all vendor types are filled in a single record), then loop check the vendor types from Table1New against the types in Table2.
If the key of Table2 is vendor no & vendor type, then do a read table for the key.
The logic in pseudo-code:
Select from Table1 into table. If you'd like to limit the selection size, add package size statement.
extract the vendor types in to itab Table1New.
Select the vendor & types from Table2 by using the for all entries option (better performance).
loop at Table1New
check in Table2:
if the unique key is vendor no: check all fields for the vendor type from Table1New
if the unique key combo is vendor no & type: check by using a read table.
If not found => add entry to Table2
endloop.
endselect Table1 (when using package size)
I guess the most difficult step is to extract the types from Table1 into separate fields, all the rest seems straight forward. Please keep in mind the itab type definitions for a better performance.
Good luck!
Best regards,
Zhou -
Fork in process chain using ABAP program
Hello everyone.
I need a fork in my chain. Depending on the values in some db table I will make a decision: do some process or skip and go further. The only solution I can see is using ABAP program. But unfortunately It doesn't return status. Any suggestion will be appreciated.Hi,
You have few process to run after the abap program. So make all those process as a different chain, and at the end of the ABAP program include a function module to trigger this chain, based on your condition.
If you like this idea, please revert for more information.
Hope this helps.
Thank you, -
How to assign ALV for parent node and child node that uses supply method.?
HI Dear friends,
I need to display header details ( VBAK ) and Item details ( VBAP ). I have created two node like HEADER_NODE inside this i have created ITEM_NODE for this item node i use supply function 'GET_ITEMS' any way it is working only when crete two separate table and binding but when i come to work with ALV i am totally confused .. i have created two 'View Controller UI Elements' when i try to map HEADER_NODE it mapped properly but for ITEM_NODE it shows mapping already defined. return status message as 'Action Cancelled' . In result both ViewContainer shows only HEADER_NODE data only.
How to achive ALV for Parent, child node that uses supply function ? ?
Thank youDelete Mapping is not enabled, that means there is no mapping done yet.
I just tried what you are saying and the application works and i am able to map the header table and item table and also again i could map the tables any number of times.. i didn't get any such message, sorry i couldn't recreate the scenario. might be there is something wrong in the context.
i just did it like this.
Please also move this to Web DynPro Discussion, Hope that would be helpful.
Message was edited by: Syed Ghulam Ali -
Unzip files using ABAP program
Hi All,
Can anybody guide me how to Unzip a .zip file using ABAP program... Appreciate your immediate reply...
actually, my scenario is to check whether zip file is created in appl.server or not.., and if zip file created then i need to check whether its blank file or any content exist inside the file...
Thanks in advance
Bhaskerhi
good
parameters: command(236) lower case.
data: std_lines(255) occurs 0 with header line.
call function 'RFC_REMOTE_PIPE'
destination 'SERVER_EXEC'
exporting
command = command
read = 'X'
tables
pipedata = std_lines
exceptions
communication_failure = 1
system_failure = 2.
You should put your Unix command in the command parameter. "gunzip /yourfilepath/yourfilename" works on my Unix system. Once you determine the proper Unix command, you should be set. This technique is also nice because it provides you with echos back from Unix in table std_lines. For more complex Unix activity, you may want to consider throwing together a Unix script, and calling that via this code.
reward point if helpful.
thanks
mrutyun^ -
Access table using ABAP program in other database
Dear SAP Expert,
We have requirement that related to SAP interface.
Our SAP system run on Oracle database 11g (Unix).
Illustration: SAP system = A non SAP system = B
We need to access a table using ABAP program (from SAP system A) in other database (system B) that are not necessarily SAP database. The non-SAP system using SQL Server 2008 (Windows).
What is the best practice for this interface
Do we need database link? If yes, please help to inform me the details step to configure it.
Thanks and RegardsHi Friend,
You try using an intermediate system..passing your input required to fetch the data..and PI should call the respective query to retrive record..once the full flow is completed you should get the return through some table in the calling program.
else.
ask the other system guy to write a function with select query and ask him to expose as RFC and that RFC we have to call it as RFC in our program to get the required values and only thing we need here is a proper connector in place.
Regards
S.Janagar -
How to print external file using ABAP program
Hello
I want to print an external file which is located in server (
20.99.0.18\GUI\xyz\8.0QUALITY\QM_TS.DOC) .....i want to print these kind of files(which i have retrieved from table 'DRAW' field 'filep' )......i need to print these files using ABAP program.
thank you
Vikram.
Message was edited by:
Vikram Bojjaextract the data and pass to script or smartform for printing
-
HOW TO creat BAR CHART using ABAP Programming
DEAR ALL,
I want some help as to how to creat GRAPHICAL display using ABAP programing (BAR CHART) any sample codes Example will be very helpful.
Regards,
VJOn earlier versions, you can do something like this.
[code]
REPORT ZRICH_0005 .
DATA: BEGIN OF ITAB_DATA OCCURS 0,
DATANAME(15),
QUANTITY1 TYPE I,
QUANTITY2 TYPE I,
QUANTITY3 TYPE I,
END OF ITAB_DATA.
Data: BEGIN OF ITAB_OPTIONS OCCURS 0,
OPTION(20),
END OF ITAB_OPTIONS.
ITAB_DATA-DATANAME = 'Maple'.
ITAB_DATA-QUANTITY1 = 5500.
ITAB_DATA-QUANTITY2 = 6200.
ITAB_DATA-QUANTITY3 = 5900.
APPEND ITAB_DATA.
ITAB_DATA-DATANAME = 'Oak'.
ITAB_DATA-QUANTITY1 = 3500.
ITAB_DATA-QUANTITY2 = 5200.
ITAB_DATA-QUANTITY3 = 4400.
APPEND ITAB_DATA.
ITAB_DATA-DATANAME = 'Cherry'.
ITAB_DATA-QUANTITY1 = 1800.
ITAB_DATA-QUANTITY2 = 2200.
ITAB_DATA-QUANTITY3 = 1900.
APPEND ITAB_DATA.
CALL FUNCTION 'GRAPH_MATRIX_3D'
EXPORTING
COL1 = 'Jan'
COL2 = 'Feb'
COL3 = 'Mar'
TITL = 'Lumber Usage in $'
TABLES
DATA = ITAB_DATA
OPTS = ITAB_OPTIONS
EXCEPTIONS
OTHERS = 1.
[/code]
Regards,
Rich Heilman -
Name the infotypes we uplode using abap programs
Hi,
can anyboby let me know, Name the infotypes we uplode using abap programs?
ThanksIT0008
IT0045
IT0589 ETC
some of them can be made through LSMW also but we use BDC . the main reason is we wont find Feilds to upload those data in templates -
How to Move file / call UNIX command using ABAP Program
Hi, ABAP Guru.
I need to Cut & Paste file (Move file from one location to another location) on Network Shared Drive using ABAP program.
But I can't figured out how to do this and what ABAP Command / FM / Method (and maybe UNIX command) that being used.
Please give me the advice.
Best regard and Thank you all.
Nattapash C.all methods for your requirements should be in class CL_GUI_FRONTEND_SERVICES
-
Create Node in Solar01 using ABAP Program
Hi Experts
In our project, the integration between ARIS and Solution Manager is not working. So the project team has decided to develop a workaround solution for this problem. The solution is we download all the BPP & BPS from ARIS into an excel file. We should upload the file and create the necessary BPP/BPS nodes in SOLAR01 using an ABAP program. Now we have the file and the below data in file.
We have the parent level SAP GUID in the file. Using this as reference we need to create the below two nodes.
ARIS Level 4 Sub-Process - This should be created as Solution Manager Business Process Node
ARIS Level 5 Task - This should be created as Solution Manager Business Process Step Node
Can anyone of you have done any similar development to the above? I will really appreciate if you can provide me with some function modules or any pseudo code or the approach to achieve this requirement.
Regards
HariHi Hari,
There is no need of creating a program
this functionality is available in Solution manager 7.1 to upload via content files like excel sheet etc
https://help.sap.com/saphelp_sm71_sp05/helpdata/en/ea/7d9d444c404849bf99a0dd19f2107a/content.htm
you can refer my below article for all the steps
SAPexperts | How to Quickly Create Business Blueprints in SAP Solution Manager 7.1 Using Content Upload Interface
Thanks
Prakhar -
How to read data from an excel using abap program?
Hi
I have to write an abap program to read the contents of ms excel across various
sheets. Can any one help me regarding this
Thanks in advance
SatishHai Satish,
<b>You save all your Excel sheets as Text Tab Delimited.</b>
And then for each teext file can be uploaded into your daabase table.
See the Report that i have done.
REPORT Z_UPLOAD_TO_DATABASE_TABLE.
TABLES:
ZDETMAST. " Database table to be uploaded
Data declaration of the structure to hold ZDETMAST(zdetcode) data *
DATA:
BEGIN OF FS_ZDETMAST,
CNT(3) TYPE C, " Client
DETCODE(15) TYPE C, " Det Code
DETCAT(1) TYPE C, " Det category
DETTYPE(2) TYPE N, " Det type
DETDESC(30) TYPE C, " Det description
PFLAG(1) TYPE C, " Det Flag
TOTALDR(10) TYPE C, " Total DR
TOTALCR(10) TYPE C, " Total CR
END OF FS_ZDETMAST.
Internal table to hold ZDETMAST(zdetcode) data *
DATA:
T_ZDETMAST LIKE STANDARD TABLE OF FS_ZDETMAST.
Function Module to upload ZDETMAST Data
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'D:/ZDETMAST_2.TXT'
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = 'DAT'
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = T_ZDETMAST
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
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. " IF SY-SUBRC <> 0.
LOOP AT T_ZDETMAST INTO FS_ZDETMAST.
WRITE:
/ FS_ZDETMAST-CNT,
FS_ZDETMAST-DETCODE,
FS_ZDETMAST-DETCAT,
FS_ZDETMAST-DETTYPE,
FS_ZDETMAST-DETDESC,
FS_ZDETMAST-PFLAG,
FS_ZDETMAST-TOTALDR,
FS_ZDETMAST-TOTALCR.
ENDLOOP. " LOOP AT T_ZDETMAST ...
LOOP AT T_ZDETMAST INTO ZDETMAST.
IF SY-TABIX GE 2.
INSERT ZDETMAST.
DELETE ZDETMAST.
ENDIF. " IF SY-TABIX EQ 2
ENDLOOP. " LOOP AT T_ZDETMAST
Hope this helps you a lot.
<b>You can also use ALSM_EXCEL_TO_INTERNAL_TABLE FM to have excel data in ITAB AND THEN YOU CAN INSERT DATA INTO DATABASE TABLE.</b>
<b>Reward points if it helps you.</b>
Regds,
Rama chary.Pammi
Maybe you are looking for
-
Using "$" character with Oracle; getting "invalid column name"
I am running the following query against an Oracle database: select price from my_table where index_name = 'CGPR_C$' and settlement_date = to_date('02/19/2001','MM/DD/YYYY') The query runs fine in TOAD. If I run this query from my java code, I get an
-
How to change where clause in VO query in bean
Hi experts I have to modify vo object query where clause on run time .. is it possible?? if yes please suggest me,
-
Can't save preferences in LXDE
I installed LXDE and I like it. I must adjust the monitor resolution from the default however. But when I reboot, it doesn't remember what I set. Do I need to save it somehow? Or perhaps there is a permission issue that it's not saving itself?
-
Copy iphone photo albums to Imac = Iphoto
I have made the mistake to erase all my photo albums from my Imac (I photo). I do still have most albums on my Iphone 3G. Hoiw cvan I move them to Iphoto on the Mac???
-
Hi, you know how when you go to a website, and in the address bar on the left side of it, theres an icon, like yahoo is a red Y and apples is a black and white apple icon? Does anyone know how to customize one and use one for a website in iweb 08? Th