In-Memory Ordering
Hi
Background:
I've been asked to persuade Kodo to work correctly with some foreign key
constraints which have been implemented as triggers (rather than
standard foreign keys). Since triggers cannot be deferred, this
unfortunately means that statement ordering must be used. Removing the
triggers is not an option.
The ordering is the same as if they were standard foreign keys (inserts
into the parent table made before inserts into the child tables). I've
been playing around, adding fake foreign keys (ones that don't exist in
the database) to the Kodo schema in an attempt to fool Kodo into
ordering my statements correctly. I'm pretty sure that the fake foreign
keys are in there but I seem to be missing something that's needed to
make the in memory ordering work correctly.
I'm using Kodo 3.1.4.
Questions:
1. Does anyone know of any better approaches to this problem? (For
example, is it possible to provide Kodo with a static ordering?)
2. Does anyone have any tips or tricks which will help to persuade the
in memory order to order based on my foreign keys?
3. Does anyone know of any more details about how the Kodo ordering works?
TIA
Robert
What driver version are you using? Can you try with the 9.0.1 driver?
(Some versions have some issues with FKs in certain situations...
regardless of order).
Does the SQL generated appear to bein the right order?
Robert Donkin wrote:
Patrick Linskey wrote:
[email protected] wrote:<snip>
3. Does anyone know of any more details about how the Kodo ordering
works?It works quite well, actually. But that's probably not the answer you
were looking for...The ordering doesn't seem to be working at all well for me. I'm using
Weblogic 8.1 against Oracle 9.2. (Before anyone asks,
ForeignKeyConstraints is set to true in the rar.xml.)
Anyone have any ideas about how to go about debugging the kodo in-memory
ordering system or any information about how it works so that I can try
to narrow down the problem?
Robert--
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com
Similar Messages
-
Memory usage gets high and stays high
I'll use my current project as an example, but I've been noticing this issue ever since I started monitoring my computer's memory usage. If I have an hour long Premiere CC timeline and render it, during rendering my computer's memory will go up to about 90%. After rendering is done, task manager shows that Premiere is still using about the same amount of memory, and it stays that way until I restart my computer. It's like it has locked into using certain resources and cannot let go. Any way to remedy this? I currently have 10gb memory (ordered 2gb more that is arriving this week), so it's not the fastest machine around, but should handle memory better in my opinion. I am fine with the rendering speed itself, it's just the tied up resources afterwards that seem like it could be fixed.
One more point - one solution is forcing Premiere and all its components to close. This gets the memory back to normal. Unfortunately, sometimes after I render a long timeline and force restart Premiere, when I get back all my render files don't properly reconnect and I'm forced to re-render the timeline. The fact that it doesn't reconnect to the render files is another related-issue I need help with too, if anyone can offer feedback. Thanks!On the lost renders.
http://forums.adobe.com/thread/1144624?tstart=30
On the memory issue, I'm not sure anything is wrong here. You say PP releases it when you close PP. That's the expected behavior. -
Hello All,
I've got this message error during procedure's execution into QA environment.
*ORA-04030: OUT OF PROCESS MEMORY WHEN TRYING TO ALLOCATE 254476 BYTES (CALLHEAP,KLLCQAS:KLLSLTBA)
ORA-04030: out of process memory when trying to allocate 16396 bytes (koh-kghu call ,pmuccst: adt/record)*
The same procedure executed into PRD environment is running fine.
How can I know a how much memory is needed to solve this issue?
Thanks,
Martin
P.S.: Do you have any other recommendation that isn't "just add RAM memory"?Sorry folks, but I couldn't solved it yet.
The error is the same as was yesterday, ORA-04030: out of process memory when trying to allocate 123404 bytes (QERHJ hash-joi,kllcqas:kllsltba) - -4030.
I had identified how to reproduce this code, while running a stored procedure what does some inserts (at least 10M-rows) with BULK Collect senteces... I got this ORA error.
I did an alter session set SQL_TRACE = TRUE; to trace the process execution but I couldn't find any useful inside this tracefile.
Could you help me? How should I procede with this kind of issue?
Thanks,
Martin
P.S:
user@server:~ $ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) unlimited
max memory size (kbytes, -m) unlimited
open files (-n) 65536
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) unlimited
cpu time (seconds, -t) unlimited
max user processes (-u) 16384
virtual memory (kbytes, -v) unlimited
SELECT SUM(value) / 1024 / 1024 Mb
FROM v$sesstat s,
v$statname n
WHERE n.STATISTIC# = s.STATISTIC#
AND name = 'session pga memory';
MB
116.75286102294921875
SELECT sid,
name ,
value / 1024 Kb
FROM v$statname n,
v$sesstat s
where n.STATISTIC# = s.STATISTIC#
AND name LIKE 'session%memory%'
ORDER BY 3 DESC;
SID NAME KB
842 session pga memory max 3874.9921875
842 session uga memory max 1986.19140625
842 session pga memory 1698.9921875
842 session uga memory 1368.69140625
Edited by: martinmorono on Sep 30, 2008 6:07 PM
Some parameters are:
sga_max_size 1694498816
pre_page_sga FALSE
sga_target 1694498816
processes 800
shared_pool_reserved_size 18454937
If you need some other data about my problem, please let me know.
Thanks
Martin
Edited by: martinmorono on Sep 30, 2008 6:08 PM -
SGA/PGA (Memory) in RAC environment.
Guys,
I would like to get your inputs on SGA / PGA settings on a RAC database.. Does LMS/LMON/LMD process use memory which is part of PGA or these process allocate memory at OS level ?
I would like to see the usage of Memory used by a database.
below sql from Mr. Kyte's website i have used. Somehow i am not getting real usage of the system. Any help would be appreciated.
Thanks
select
ssst.sid,
stn.name ,
round(ssst.value/1024/1024,2) memory ,
USERNAME,
COMMAND,
OSUSER,
MACHINE,
TERMINAL,
PROGRAM ,
ssst.STATISTIC#
from v$statname stn,v$sesstat ssst , v$session ses
where stn.STATISTIC# = ssst.STATISTIC# and
ssst.sid = ses.sid and
name like 'session%pga%memory%'
order by 3 asc ;
Edited by: P explorer on Aug 28, 2009 9:56 PMFrom sql script, that get "session pga memory","session pga memory max" each of session in oracle database(on that node)
You'll see
sid: session id
memory:
if "session pga memory" = pga memory in this session now
if "session pga memory max"= maximum pga memory in this session.
program: os program name
More deatails abour v$session http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/dynviews_2088.htm#REFRN30223
If need to know all PGA size in that node
"session pga memory":
select
round(sum(ssst.value)/1024/1024,2) memory
from v$statname stn,v$sesstat ssst , v$session ses
where stn.STATISTIC# = ssst.STATISTIC# and
ssst.sid = ses.sid and
name ='session pga memory';
"session pga memory max":
select
round(sum(ssst.value)/1024/1024,2) memory
from v$statname stn,v$sesstat ssst , v$session ses
where stn.STATISTIC# = ssst.STATISTIC# and
ssst.sid = ses.sid and
name ='session pga memory max';
Or if you need to check PGA memory all nodes (RAC)
COLUMN username FORMAT A20
COLUMN module FORMAT A20
SELECT a.inst_id,
NVL(a.username,'(oracle)') AS username,
a.module,
a.program,
Trunc(b.value/1024) AS memory_kb
FROM gv$session a,
gv$sesstat b,
gv$statname c
WHERE a.sid = b.sid
AND a.inst_id = b.inst_id
AND b.statistic# = c.statistic#
AND b.inst_id = c.inst_id
AND c.name = 'session pga memory'
AND a.program IS NOT NULL
ORDER BY b.value DESC; -
[LV2013SP1] Strange cluster ordering from a database
Hello,
I'm not an expert in LabView since I come from the
embedded world (C/C++) yet I found something
quite strange when reading from a database.
Here's attached some screen captures of the
database content and structure, then the LabView
diagram with the probe output (yeah, had to stretch
it wide because there is no word wrap option).
Finally there is a little Excel snapshot of the result.
The database reading is performed with a certain
column ordering, the "casting" cluster do mirror
the same order and datatype, yet 'Variant to Data'
scramble things.
And even though I do use dis/assemble cluster
by name to avoid confusion, the resulting cluster
at probe 20 is right. Go figure...
Could someone help and explain what's going
on under the hood ? At least with C/C++ you have
a little grasp on how memory is ordered, but
LabView really bogs me...
David
Attachments:
capture_001_10092014_171106.png 170 KB
capture_002_10092014_171116.png 125 KB
capture_003_10092014_171213.png 129 KBOk, I've found the bug in LabView 2013 SP1.
The 'Pdt_D' cluster had suffered several modifications and
reordering, but 'Variant to Data' doesn't follow the cluster
virtual ordering but the cluster's memory ordering.
In short, if you create a cluster one way, delete members,
add some more, adapted and reorder, the 'Variant to Data'
VI will take the members' order in which they were added
to the cluster, regardless of the hypathetic ordering you
might have specified afterward.
Probably a problem of chained list, one listing the members
as they are added, one listing the members in the specified
ordering, perhaps the bug comes from pointing the wrong
list.
If you delete the 'Pdt_D' cluster, create a brand new cluster
constant, then add one by one the members of the right
datatype, 'Variant to Data' works like expected and dispatch
the variant's data into the belonging members.
There's is no use providing you with a snapshot because
it will all look the same that I have already provided you with,
just that the cluster has been recreated from scratch and
not been reordered. That's a rather annoying spurious bug
you'd better be strong hearthed to deal with.
And for the VI, it's a rather complex proprietary application
I cannot disclose, but I'll create an example VI further in
time so that you can witness it by yourself.
Sorry for not being specific enough with my problem.
David -
Memory being used by which pl/sql objects
Hello
Does anyone know if it is possible to run a query to see which objects are using what memory in a given session? I'm getting:
ORA-04030: out of process memory when trying to allocate 28 bytes
(kxs-heap-w,kxsclb in kxscfreg)when I'm doing a bulk collect that results in, at most, 120k of data. So there's a package or something contained within the process I'm calling that is using up a considerable amount of memory - and I need to find out which one it is.
Any ideas will be highly appreciated.
Thanks
DavidThis is very strange.
The problem is arising from a select from a view inside a procedure. If I select from that view in SQL*plus, it returns all the rows in a couple of minutes. If I execute the exact same select inside the procedure, it just hangs. Using:
select
sid,
name,
value / 1024 /1024
from
v$statname n,
v$sesstat s
where
n.STATISTIC# = s.STATISTIC#
and
name like 'session%memory%'
order by
3 asc;For the two sessions, you can see that the memory usage for the one being called from the package is massive in comparisson:
SQL> /
SID NAME VALUE/1024/1024
427 session uga memory .524459839
427 session pga memory 1.17162323
427 session uga memory max 2.46628571
427 session pga memory max 8.35912323
419 session uga memory 1941.7644
419 session uga memory max 1941.7644
419 session pga memory 1944.23412
419 session pga memory max 1944.23412
8 rows selected.427 is the one run through SQL*Plus and 419 is the one running in the package.
It doesn't seem to matter if I use a straight cursor loop or use bulk collect, the result is the same in the package.
Any ideas? Is this a support job?
David
Also, I tried executing the select in an anonymous PL/SQL block, and it worked fine and allocated slightly more memory than the straight select.
david_tyler -
Sessions that consume a lot of Memory
Hi,
How to retrieve sessions that consume a lot of Memory (Database 11.2.0.2) ?
Regards,791550 wrote:
Hi,
How to retrieve sessions that consume a lot of Memory (Database 11.2.0.2) ?
Regards,Hi. You can query v$sesstat,v$statname and can join with v$session then you will get which session consume how much memory like below query
select
username,
sess.sid,
value,
name
from v$sesstat sst,
v$statname sn,
v$session sess
where sst.statistic#=sn.statistic# and
sess.sid=sst.sid and
username is not null and
upper(sn.name) like '%MEMORY%'
order by username -
Ok i got the 875p neo Fisr pcb 2.9
I have a p4 2.8(800) atm , but im thinking of ordering a 3.0 or 3.2 since i dont overclock much...
Decided to go with kingmax ramm unless someone saiys else i got a reply earlier that someone has this and it works. only thing i worry is they dont come in a duel kit so im gonna order 2 from prolly a bulk load... pc3200 kingmax . newegg has them for 80 a pop. 512 meg a stick. one thing that worries me is they are rated at 2.5 volts and if needed to crank them suckers to 2.7 then i might change the memory order if you guys think that will be a problem.
Got a bfg geforce 600gt coming from best buy for 399.(434 w/tax.)
Gonna get a vantec 520 watt psu, has oveer 25 amps anthe 12, has over everythng LOL.
I dont know what bios this new mobo is so i am wondering if after i install all if i should flash to the latest bios or not to worry about flasshing??
Woot im finally getting close to ordering , only thing i might change is no pcu if you think a 32. from a 2.8 wont make a bigg difference , or if you think the kingmax ramm rated at 2.5 volts might give me a problem . Im afraid to go corsair or very low clas like 2. these are 2.5 . Im my last board the pcb 1.0 after i bios flashed from somethng ( i dont remember which i had i could no longer run in ultra turbo)Ohh ye i had 1.92 b at that time. but for some reason it worked . My only concern is that i wont be able to run in ultr turbo, i could still run in slow on my last mobo but i lost scores in all benchmarks. Well well see what happs this time.
Ill let ya know . thanx for all of you that replied.the neo lsr or fisr should be great boards . mine kicked butt until i messed with it and i guess the flashing which i did correctly on my board didnt undo when i went back. So all with a pcb 1.0 if it works, dont mess with it. LOL . Worked great and was very fast .
I hope the new pcb 2.0 is just as good.
ohh that was geforce6800 gt not 600 LOL. Sorry im tired been up and stressed over what i should order...
Im out .
Peace ! -
ByteBuffer has reverse order in native Code [WIN32]
Hello all!
I use JNI to access a Windows specific API. But there is a Problem which I do not understand. For example, when I put the following byte array in a newly direct-allocated ByteBuffer which should map a DWORD in native Code:
new byte[] { 0x01, 0x02, 0x03, 0x04 }And in native Code I print the value like this:
LPDWORD lpDWORD = (LPDWORD) env->GetDirectBufferAddress(versionsRequired);
printf("0x%X\n", *lpDWORD);I get this Output: *0x4030201*
protected int offset = 0;
protected ByteBuffer memory = ByteBuffer.allocateDirect(4);
public void put(byte[] src) { // src = new byte[] { 0x01, 0x02, 0x03, 0x04 }
memory.position(offset);
memory.put(src);
}First I thought it was a problem with the native ByteOrder, but setting the ByteBuffer's order to Big-/Little-Endian didn't changed anything?
Can somebody explain my the reason for this behaviour?
Thanks you,
BillieI did know that Windows uses LITTLE_ENDIAN, but why for example the following version of the put-Method returns the same result:
public void put(byte[] src) { // src = new byte[] { 0x01, 0x02, 0x03, 0x04 }
memory.order(ByteOrder.LITTLE_ENDIAN); // set Windows byte order
memory.position(offset);
memory.put(src);
}So the ByteBuffer's put(byte[])-Method does not care about the ByteBuffer's byte order?
Edited by: Billie_AT on May 22, 2010 1:05 AM -
Alv : drill down not working.
Hi All,
Could you please tell me whats wrong with this code ? its not drilling down to show 'ebeln' with me22n. Am I missing something ?
Please help.
Hrishi
code is :-
REPORT Z_VENDOR_BACKORDER_REPORT_ALV .
TABLES: EKKO, LFA1, MAKT, EKET, EKPO, AFPO, MARC.
*Data Declaration
DATA: BEGIN OF ITAB OCCURS 0 ,
ebeln LIKE ekko-ebeln , " PO number
aedat LIKE ekko-aedat , " creation date
ebelp LIKE ekpo-ebelp , " item no
lifnr LIKE ekko-lifnr , " vendor number
name1 LIKE lfa1-name1 , " vendor name
RESWK LIKE EKKO-RESWK , " PLANT NO
MEMORY LIKE EKKO-MEMORY , " ORDER INCOMPLETE
matnr LIKE ekpo-matnr , " material number
werks like ekpo-werks , " plant
txz01 LIKE ekpo-txz01 , " material description
eindt LIKE eket-eindt , " Promised date
menge LIKE eket-menge , " quantity
wemng LIKE eket-wemng , " delivered quantity
netpr like ekpo-netpr , " value in AUD
peinh like ekpo-peinh , " price unit
banfn like ekpo-banfn , " PR no
aufnr like ebkn-aufnr , " Production order no
MAABC LIKE MARC-MAABC , " MATERIAL ABC Indicator
maktx like makt-maktx , " material long description
open_quant type p decimals 2, " quantity - delivered
VALUE TYPE p decimals 2, " $ VALUE * OPEN QUANTITY
end of ITAB.
data: wa like itab.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: TEMP TYPE EKKO-LIFNR.
data: opt like CTU_PARAMS.
*DATA: WA TYPE FINAL.
all ALV declarations
type-pools: slis. "ALV Declarations
DATA: fieldcatalog TYPE slis_t_fieldcat_alv with header line,
G_REPID TYPE SY-REPID,
GS_PRINT TYPE SLIS_PRINT_ALV,
GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
GT_EVENTS TYPE SLIS_T_EVENT,
GT_SORT TYPE SLIS_T_SORTINFO_ALV,
GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
COL_POS TYPE I.
-----------------SELECTION SCREEN----------------------
selection-screen begin of block b1 with frame title text-001.
select-options VENDORNO for ekko-lifnr.
select-options MATERIAL for ekpo-matnr.
SELECT-OPTIONS PLANT FOR EKKO-RESWK.
select-options REQDAT for eket-eindt.
selection-screen end of block b1.
*................... GET DATA..................
START-OF-SELECTION.
PERFORM GATHER_DATA.
END-OF-SELECTION.
FORM USER_COMMAND USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
CASE rs_selfield-sel_tab_field.
WHEN 'ITAB-EBELN'.
CHECK NOT rs_selfield-value IS INITIAL.
SET PARAMETER ID 'BUS' FIELD rs_selfield-value.
CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.
Do something at 'Sales document type' field selection
when 'ITAB-MATNR'.
SET PARAMETER ID 'BUS' FIELD rs_selfield-value.
CALL TRANSACTION 'MD04' AND SKIP FIRST SCREEN.
ENDCASE.
ENDCASE.
ENDFORM.
form gather_data.
SELECT EKKO~EBELN
EKKO~AEDAT
EKKO~LIFNR
EKKO~MEMORY
EKKO~RESWK
EKPO~EBELP
EKPO~MATNR
ekpo~werks
ekpo~netpr
ekpo~peinh
ekpo~banfn
ekpo~txz01
makt~maktx
EKET~EINDT
EKET~MENGE
EKET~WEMNG
LFA1~NAME1
INTO corresponding fields of ITAB
FROM (
EKKO inner JOIN EKPO
ON EKKOEBELN = EKPOEBELN
inner JOIN EKET
ON EKPOEBELN = EKETEBELN
AND EKPOEBELP = EKETEBELP
inner JOIN LFA1
ON EKKOLIFNR = LFA1LIFNR
*left outer join makt
*on ekpomatnr = maktmatnr
WHERE EKKO~LIFNR IN VENDORNO
AND EKKO~RESWK IN PLANT
and EKPO~MATNR IN MATERIAL
and ekpo~elikz eq ' '
and ekpo~loekz ne 'L'
and eket~eindt in REQDAT.
append itab.
CLEAR ITAB.
endselect.
clear temp.
sort itab by lifnr.
loop at itab .
ITAB-OPEN_QUANT = ITAB-MENGE - ITAB-WEMNG.
if itab-matnr eq ''.
select single aufnr from ebkn into itab-aufnr where banfn = itab-banfn.
select single matnr from afpo into itab-matnr where aufnr = itab-aufnr.
endif.
select single maktx from makt into itab-maktx where matnr = itab-matnr.
select single maabc from MARC INTO ITAB-MAABC WHERE MATNR = ITAB-MATNR.
ITAB-VALUE = ITAB-NETPR * ITAB-OPEN_QUANT / itab-peinh.
modify itab.
endloop.
SKIP.
fieldcatalog-tabname = 'ITAB'.
fieldcatalog-fieldname = 'LIFNR'.
fieldcatalog-seltext_m = 'vendor no'.
fieldcatalog-col_pos = 1.
fieldcatalog-outputlen = 15.
fieldcatalog-inttype = 'C'.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-tabname = 'ITAB'.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'po Number'.
fieldcatalog-col_pos = 2.
fieldcatalog-inttype = 'C'.
fieldcatalog-emphasize = 'C401'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-tabname = 'ITAB'.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'po date'.
fieldcatalog-col_pos = 3.
fieldcatalog-inttype = 'C'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-tabname = 'ITAB'.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'item number'.
fieldcatalog-col_pos = 4.
fieldcatalog-inttype = 'C'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-tabname = 'ITAB'.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-no_zero = 'X'.
fieldcatalog-seltext_m = 'material number'.
fieldcatalog-col_pos = 5.
fieldcatalog-inttype = 'C'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-tabname = 'ITAB'.
fieldcatalog-fieldname = 'MAABC'.
fieldcatalog-seltext_m = 'material type'.
fieldcatalog-col_pos = 6.
fieldcatalog-inttype = 'C'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-tabname = 'ITAB'.
fieldcatalog-fieldname = 'TXZ01'.
fieldcatalog-seltext_m = 'short text'.
fieldcatalog-col_pos = 7.
fieldcatalog-inttype = 'C'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-tabname = 'ITAB'.
fieldcatalog-fieldname = 'MAKTX'.
fieldcatalog-seltext_m = 'long text'.
fieldcatalog-col_pos = 8.
fieldcatalog-inttype = 'C'.
fieldcatalog-outputlen = 15.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-tabname = 'ITAB'.
fieldcatalog-fieldname = 'EINDT'.
fieldcatalog-seltext_m = 'date promised'.
fieldcatalog-col_pos = 9.
fieldcatalog-inttype = 'C'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-tabname = 'ITAB'.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'Quantity'.
fieldcatalog-col_pos = 10.
fieldcatalog-inttype = 'C'.
fieldcatalog-outputlen = 15.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-tabname = 'ITAB'.
fieldcatalog-fieldname = 'WEMNG'.
fieldcatalog-seltext_m = 'Delivered'.
fieldcatalog-col_pos = 11.
fieldcatalog-inttype = 'C'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-tabname = 'ITAB'.
fieldcatalog-fieldname = 'OPEN_QUANT'.
fieldcatalog-seltext_m = 'Open quantity'.
fieldcatalog-col_pos = 12.
fieldcatalog-inttype = 'C'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-tabname = 'ITAB'.
fieldcatalog-fieldname = 'VALUE'.
fieldcatalog-seltext_m = '$ value'.
fieldcatalog-col_pos = 13.
fieldcatalog-inttype = 'C'.
fieldcatalog-do_sum = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = g_repid
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
it_fieldcat = fieldcatalog[]
is_layout = GS_layout
IT_SORT = gt_sort
I_DEFAULT = 'X'
I_SAVE = 'X'
is_variant = z_template
tables
t_outtab = ITAB
exceptions
program_error = 1
others = 2.
endform.hi,
please run the code below.
REPORT yfi7g_ing_mic_001 .
*PROGRAM YFI7G_ING_MIC_001.
TABLES: vbak .
TABLES: mara .
TYPES: BEGIN OF tp_vbak ,
vbeln TYPE vbak-vbeln,
erdat TYPE vbak-erdat,
erzet TYPE vbak-erzet,
ernam TYPE vbak-ernam,
vbtyp TYPE vbak-vbtyp,
trvog TYPE vbak-trvog,
auart TYPE vbak-auart,
lifsk TYPE vbak-lifsk,
faksk TYPE vbak-faksk,
waerk TYPE vbak-waerk,
vkorg TYPE vbak-vkorg,
kunnr TYPE vbak-kunnr,
vgbel TYPE vbak-vgbel,
vgtyp TYPE vbak-vgtyp,
END OF tp_vbak .
TYPES: BEGIN OF tp_mara ,
matnr TYPE mara-matnr,
END OF tp_mara .
TYPES: BEGIN OF tp_alv1_data.
INCLUDE TYPE tp_vbak .
TYPES: END OF tp_alv1_data.
TYPES: BEGIN OF tp_alv2_data.
INCLUDE TYPE tp_mara .
TYPES: END OF tp_alv2_data.
TYPE-POOLS: slis.
DATA: gt_vbak TYPE STANDARD TABLE OF tp_vbak WITH HEADER LINE.
DATA: gt_mara TYPE STANDARD TABLE OF tp_mara WITH HEADER LINE.
DATA: gs_variant LIKE disvariant.
DATA: gt_alv1_data TYPE STANDARD TABLE OF tp_alv1_data WITH HEADER LINE.
DATA: gt_alv2_data TYPE STANDARD TABLE OF tp_alv2_data WITH HEADER LINE.
SELECTION-SCREEN *
BLOCK b0 *
SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln. "<field not defined?>
PARAMETERS: p_matnr LIKE mara-matnr. "<field not defined?>
SELECTION-SCREEN END OF BLOCK b0.
BLOCK bvar *
SELECTION-SCREEN BEGIN OF BLOCK bvar WITH FRAME.
PARAMETERS: p_vari LIKE disvariant-variant.
SELECTION-SCREEN END OF BLOCK bvar.
BLOCK bbox *
SELECTION-SCREEN BEGIN OF BLOCK bbox WITH FRAME.
PARAMETERS: p_box_up RADIOBUTTON GROUP b1,
p_box_do RADIOBUTTON GROUP b1 DEFAULT 'X',
p_box_no RADIOBUTTON GROUP b1.
SELECTION-SCREEN END OF BLOCK bbox.
AT SELECTION-SCREEN ON P_VARI *
AT SELECTION-SCREEN ON p_vari.
PERFORM alv_variant_existence USING p_vari
CHANGING gs_variant.
AT SELECTION-SCREEN ON VALUE REQUEST FOR P_VARI *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
PERFORM alv_variant_f4 CHANGING p_vari
gs_variant.
INITIALIZATION *
INITIALIZATION.
START-OF-SELECTION *
START-OF-SELECTION.
PERFORM authority_check.
PERFORM get_control_data.
PERFORM get_transaction_data.
PERFORM process_transaction_data.
END-OF-SELECTION *
END-OF-SELECTION.
PERFORM output_data.
F O R M S *
FORM AUTHORITY_CHECK *
Perform authority checks for the report *
FORM authority_check.
!!! Note: authorisation checks are application-dependent.
!!! Some common cases are listed below - please select one of them
!!! or add new authorisation checks.
!!! If the report is creating batch input session or using LDB
!!! it may be sufficient to use automatic SAP auth.checks.
Authorisation for displaying documents in a single company code
authority-check object 'F_BKPF_BUK'
id 'BUKRS' field p_bukrs
id 'ACTVT' field '03'.
if sy-subrc <> 0.
message e001(z9) with 'No authorisation to display documents'
'in company code' p_bukrs.
endif.
Displaying documents from a list of company codes (select-options)
call function 'Y_BUKRS_AUTHORITY_CHECK'
EXPORTING
ACTVT = '03'
NOMESSAGE = ' '
tables
s_bukrs = s_bukrs.
ENDFORM. " AUTHORITY_CHECK
FORM GET_CONTROL_DATA *
Read configuration etc. *
FORM get_control_data.
ENDFORM. " GET_CONTROL_DATA
FORM GET_TRANSACTION_DATA *
Read documents etc. *
FORM get_transaction_data.
!!! Data selection statement below has been generated automatically.
!!! Please check if it is correct and complete.
!!! Use table joins or 'SELECT FOR ALL ENTRIES' when selecting data
!!! from related tables.
SELECT
vbeln
erdat
erzet
ernam
FROM vbak
INTO CORRESPONDING FIELDS OF TABLE gt_vbak
CHECK NOT gt_vbak[] IS INITIAL.
SELECT
matnr
FROM mara
INTO CORRESPONDING FIELDS OF TABLE gt_mara
FOR ALL ENTRIES IN gt_vbak
WHERE ernam = gt_vbak-ernam
ENDFORM. " GET_TRANSACTION_DATA
FORM PROCESS_TRANSACTION_DATA *
FORM process_transaction_data.
LOOP AT gt_vbak .
MOVE-CORRESPONDING gt_vbak TO gt_alv1_data .
APPEND gt_alv1_data .
ENDLOOP.
FREE gt_vbak .
LOOP AT gt_mara .
MOVE-CORRESPONDING gt_mara TO gt_alv2_data .
APPEND gt_alv2_data .
ENDLOOP.
FREE gt_mara .
ENDFORM. " PROCESS_TRANSACTION_DATA
FORM OUTPUT_DATA *
FORM output_data.
PERFORM alv_list_display.
ENDFORM. " OUTPUT_DATA
FORM DISPLAY_RECORD *
Display object associated with the current ALV line *
FORM display_record USING is_selfield TYPE slis_selfield.
READ TABLE gt_alv1_data INDEX is_selfield-tabindex.
CHECK sy-subrc = 0.
!!! SAMPLE IMPLEMENTATION FOR DISPLAYING FI DOCUMENTS:
SET PARAMETER ID 'BUK' FIELD gt_alv1_data-vbeln.
set parameter id 'BLN' field gt_alv1_data-belnr.
set parameter id 'GJR' field gt_alv1_data-gjahr.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDFORM. " DISPLAY_RECORD
FORM ALV_LIST_DISPLAY *
Invoke main ALV function to format and show the report *
FORM alv_list_display.
DATA: ls_layout TYPE slis_layout_alv,
ls_print TYPE slis_print_alv,
ls_keyinfo TYPE slis_keyinfo_alv,
lt_fieldcat TYPE slis_t_fieldcat_alv,
lt_exctab TYPE slis_t_extab,
lt_sorttab TYPE slis_t_sortinfo_alv,
lt_events TYPE slis_t_event.
PERFORM alv_init_report_events TABLES lt_events.
PERFORM alv_init_report_layout TABLES lt_fieldcat
lt_exctab
lt_sorttab
CHANGING ls_layout
ls_print
ls_keyinfo.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
i_interface_check = ' '
i_callback_program = sy-cprog
is_layout = ls_layout
it_fieldcat = lt_fieldcat
it_excluding = lt_exctab
IT_SPECIAL_GROUPS =
it_sort = lt_sorttab
IT_FILTER =
IS_SEL_HIDE =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_DEFAULT = 'X'
i_save = 'A'
is_variant = gs_variant
it_events = lt_events
IT_EVENT_EXIT =
i_tabname_header = 'GT_ALV1_DATA'
i_tabname_item = 'GT_ALV2_DATA'
I_STRUCTURE_NAME_HEADER =
I_STRUCTURE_NAME_ITEM =
is_keyinfo = ls_keyinfo
is_print = ls_print
IS_REPREP_ID =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab_header = gt_alv1_data
t_outtab_item = gt_alv2_data.
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " ALV_LIST_DISPLAY
FORM ALV_INIT_REPORT_LAYOUT *
Set up report layout definition for ALV_LIST_DISPLAY *
<-- OT_FIELDCAT list of fields *
<-- OT_EXCTAB excluded menu options *
<-- OT_SORTTAB sorting/grouping definition *
<-- OS_LAYOUT global report layout settings *
<-- OS_PRINT global report printout settings *
<-- OS_KEYINFO itab key fields (required only for hier.lists) *
FORM alv_init_report_layout TABLES ot_fieldcat TYPE slis_t_fieldcat_alv
ot_exctab TYPE slis_t_extab
ot_sorttab TYPE slis_t_sortinfo_alv
CHANGING cs_layout TYPE slis_layout_alv
cs_print TYPE slis_print_alv
cs_keyinfo TYPE slis_keyinfo_alv.
add menu items to be excluded to ot_exctab.
REFRESH ot_exctab.
REFRESH ot_fieldcat.
REFRESH ot_sorttab.
!!! List all ALV data fields for display here:
DD-struct = data dictionary structure name
DD-field = field of data dictionary structure
itab = internal table for output data
itab-field = internal table field name
key = set to 'X' if key field
sum = set to 'X' for totals
hid = set to 'X' if field is initially hidden
row = list row number (multi-line list if >1)
DD-struct DD-field itab itab-field key sum hid row
PERFORM alv_build_fieldcat TABLES ot_fieldcat USING:
'VBAK' 'VBELN' 'GT_ALV1_DATA' 'VBELN' ' ' ' ' ' ' 1 ,
'VBAK' 'ERDAT' 'GT_ALV1_DATA' 'ERDAT' ' ' ' ' ' ' 1 ,
'VBAK' 'ERZET' 'GT_ALV1_DATA' 'ERZET' ' ' ' ' ' ' 1 ,
'VBAK' 'ERNAM' 'GT_ALV1_DATA' 'ERNAM' ' ' ' ' ' ' 1.
PERFORM alv_build_fieldcat TABLES ot_fieldcat USING:
'MARA' 'MATNR' 'GT_ALV2_DATA' 'MATNR' ' ' ' ' ' ' 1 .
!!! List all ALV data fields for sorting/grouping here
itab = internal table for output data
itab-field = internal table field name
up = sort ascending
down = sort descending
grp = group by
comp = group initially compressed
pos = field position in sort sequence
itab field up down grp comp pos
PERFORM alv_build_sorttab TABLES ot_sorttab USING:
'GT_ALV1_DATA' 'VBELN' 'X' ' ' ' ' ' ' 1.
PERFORM alv_build_sorttab TABLES ot_sorttab USING:
'GT_ALV2_DATA' 'MATNR' 'X' ' ' ' ' ' ' 1.
!!! key definition - required only for hierarchical display (2 itabs)
cs_keyinfo-header01 = 'VBELN' .
cs_keyinfo-item01 = 'MATNR' .
!!! See the declaration of type SLIS_LAYOUT_ALV and set the fields
!!! of OS_LAYOUT record to change list-level attributes
os_layout-no_colhead = 'X'. " no headings
cs_layout-zebra = 'X'. " stripped pattern
os_layout-no_vline = 'X'. " columns separated by space
os_layout-totals_only = 'X'. " show only totals
os_layout-totals_text = 'Total'. " totals line label
os_layout-subtotals_text = 'Subtotal'. " subtotals line label
os_layout-subtotals_text = 'Subtotal'. " subtotals line label
os_layout-key_hotspot = 'X'. " keys as hotspot
os_layout-expand_all = 'X'. " Expand all positions
os_layout...
cs_print-no_print_selinfos = 'X'. " Skip selection statistics
cs_print-no_print_listinfos = 'X'. " Skip list statistics
os_print-...
ENDFORM. " INIT_REPORT_LAYOUT
FORM ALV_BUILD_FIELDCAT *
Format a single line for ALV_INIT_REPORT_LAYOUT *
FORM alv_build_fieldcat TABLES ot_fieldcat
USING iv_ref_tabname "ref to a table/field
iv_ref_fieldname
iv_tabname "actual table/field name
iv_fieldname
iv_key
iv_do_sum
iv_no_out
iv_row_pos.
status variables for auto-numbering of field column position
(column number reset when a new table or row begins)
STATICS: sv_last_tabname TYPE slis_tabname,
sv_last_row_pos TYPE i,
sv_current_col TYPE i.
IF sv_last_tabname <> iv_tabname OR sv_last_row_pos <> iv_row_pos.
sv_current_col = 1.
ELSE.
ADD 1 TO sv_current_col.
ENDIF.
sv_last_tabname = iv_tabname.
sv_last_row_pos = iv_row_pos.
DATA: ls_fieldcat TYPE slis_fieldcat_alv.
DATA: lv_fieldname TYPE slis_fieldname.
lv_fieldname = iv_fieldname.
!!! List all the special formatting requirements in cases below
case lv_fieldname.
when 'WRBTR'. "<-- link with currency required
ls_fieldcat-cfieldname = 'WAERS'.
ls_fieldcat-ctabname = iv_tabname.
when 'HKONT'. "<-- change default column header
ls_fieldcat-seltext_s = 'GL Acc.'.
ls_fieldcat-ddictxt = 'S'. " (S)hort (M)iddle (L)ong
when 'SOME_NUMBER' "<-- change number formatting
ls_fieldcat-nosign = 'X'.
ls_fieldcat-nozero = 'X'.
ls_fieldcat-just = 'L'. " (L)eft (R)ight (C)enter
endcase.
ls_fieldcat-ref_tabname = iv_ref_tabname.
ls_fieldcat-ref_fieldname = iv_ref_fieldname.
ls_fieldcat-tabname = iv_tabname.
ls_fieldcat-fieldname = iv_fieldname.
ls_fieldcat-key = iv_key.
ls_fieldcat-do_sum = iv_do_sum.
ls_fieldcat-no_out = iv_no_out.
ls_fieldcat-row_pos = iv_row_pos.
ls_fieldcat-col_pos = sv_current_col.
APPEND ls_fieldcat TO ot_fieldcat.
ENDFORM. " ALV_BUILD_FIELDCAT
FORM ALV_BUILD_SORTTAB *
Set up sorting information for ALV_INIT_REPORT_LAYOUT *
FORM alv_build_sorttab TABLES ot_sorttab TYPE slis_t_sortinfo_alv
USING iv_tabname TYPE slis_fieldname
iv_fieldname TYPE slis_fieldname
iv_up TYPE c
iv_down TYPE c
iv_subtot TYPE c
iv_comp TYPE c
iv_spos TYPE n.
ot_sorttab-spos = iv_spos.
ot_sorttab-fieldname = iv_fieldname.
ot_sorttab-tabname = iv_tabname.
ot_sorttab-up = iv_up.
ot_sorttab-down = iv_down.
ot_sorttab-subtot = iv_subtot.
ot_sorttab-comp = iv_comp.
APPEND ot_sorttab.
ENDFORM. " ALV_BUILD_SORTTAB
FORM ALV_INIT_REPORT_EVENTS *
Set up program events for ALV_LIST_DISPLAY *
<-- OT_EVENTS list of events and associated report subroutines *
FORM alv_init_report_events TABLES ot_events TYPE slis_t_event.
CLEAR ot_events.
REFRESH ot_events.
ot_events-name = slis_ev_user_command.
ot_events-form = 'USER_COMMAND'.
APPEND ot_events.
ot_events-name = slis_ev_pf_status_set.
ot_events-form = ''. "'PF_STATUS_SET'.
APPEND ot_events.
ot_events-name = slis_ev_top_of_list.
ot_events-form = 'TOP_OF_LIST'.
APPEND ot_events.
ot_events-name = slis_ev_end_of_list.
ot_events-form = 'END_OF_LIST'.
APPEND ot_events.
ot_events-name = slis_ev_top_of_page.
ot_events-form = 'TOP_OF_PAGE'.
APPEND ot_events.
ot_events-name = slis_ev_end_of_page.
ot_events-form = 'END_OF_PAGE'.
APPEND ot_events.
ot_events-name = slis_ev_foreign_top_of_page.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_foreign_end_of_page.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_top_of_coverpage.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_end_of_coverpage.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_before_line_output.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_after_line_output.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_caller_exit_at_start.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_list_modify.
ot_events-form = ''.
APPEND ot_events.
ot_events-name = slis_ev_subtotal_text.
ot_events-form = ''.
APPEND ot_events.
ENDFORM. " ALV_INIT_REPORT_EVENTS
FORM USER_COMMAND *
Subroutine attached as callback form to ABAP List Viewer *
--> UCOMM - user command code passed from ALV *
--> SELFIELD - information record describing current line/field *
FORM user_command USING value(iv_ucomm) LIKE sy-ucomm
is_selfield TYPE slis_selfield.
CASE iv_ucomm.
WHEN '&IC1'. "ALV record selection
PERFORM display_record USING is_selfield.
when ...
ENDCASE.
ENDFORM. " USER_COMMAND
FORM PF_STATUS_SET *
Subroutine attached as callback form to ABAP List Viewer, *
allows setting alternative menu. If necessary: *
1. Copy 'STANDARD' menu from SAPLKKBL and modify as required, *
2. Activate callback *
FORM pf_status_set USING it_exctab TYPE slis_t_extab.
set pf-status 'STANDARD' excluding it_exctab.
ENDFORM. " PF_STATUS_SET
FORM TOP_OF_LIST *
Subroutine attached as callback form to ABAP List Viewer, *
executed once at the start of list output. *
FORM top_of_list.
DATA: lt_seltab TYPE STANDARD TABLE OF rsparams WITH HEADER LINE.
DATA: lv_report LIKE sy-repid.
lv_report = sy-repid. "do not pass sy-repid to function!
IF p_box_up = 'X'. "display select options at report start
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = lv_report
TABLES
selection_table = lt_seltab.
remove 'technical' parameters with 'DELETE LT_SELTAB WHERE...'
before display, if necessary
CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
EXPORTING
report = lv_report
seltext = 'X'
dyn_range =
newpage = ' '
screennr = 1000
TABLES
sel_tab = lt_seltab
EXCEPTIONS
sel_tab_empty = 1.
ENDIF. "p_box_up = 'X'
ENDFORM. " TOP_OF_LIST
FORM END_OF_LIST *
Subroutine attached as callback form to ABAP List Viewer *
executed once at the end of list output. *
FORM end_of_list.
DATA: lt_seltab TYPE STANDARD TABLE OF rsparams WITH HEADER LINE.
DATA: lv_report LIKE sy-repid.
lv_report = sy-repid. "do not pass sy-repid to function!
IF p_box_do = 'X'. "display select options at report end
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = lv_report
TABLES
selection_table = lt_seltab.
remove 'technical' parameters with 'DELETE LT_SELTAB WHERE...'
before display, if necessary
CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
EXPORTING
report = lv_report
seltext = 'X'
dyn_range =
newpage = ' '
screennr = 1000
TABLES
sel_tab = lt_seltab
EXCEPTIONS
sel_tab_empty = 1.
ENDIF. "p_box_do = 'X'
ENDFORM. " END_OF_LIST
FORM TOP_OF_PAGE *
Subroutine attached as callback form to ABAP List Viewer *
FORM top_of_page.
standard Ingram Micro report page heading
DATA: lv_coco_pos TYPE i, "CurPos of 'Company confidential'
lv_title_pos TYPE i, "CurPos of report title
lv_title(70) TYPE c, "Truncated report title
lv_page_pos TYPE i, "CurPos of page number
lv_date_pos TYPE i, "CurPos of date and time
lv_page_no(10) TYPE c,
lv_date(25) TYPE c,
lv_time(20) TYPE c,
lv_page(10) TYPE c.
We may need to truncate title if the line size is < 81.
IF sy-linsz < 81.
lv_title = sy-title+0(50).
ELSE.
lv_title = sy-title.
ENDIF.
Decide on positioning of text depending on width of page
lv_title_pos = ( sy-linsz / 2 ) - ( STRLEN( lv_title ) / 2 ).
lv_coco_pos = sy-linsz - 20.
FORMAT COLOR COL_HEADING INTENSIFIED ON.
WRITE: / 'Ingram Micro',
AT lv_title_pos lv_title,
AT lv_coco_pos 'Company Confidential'.
Setup data correctly in the correct format for the display fields.
lv_page = sy-pagno.
SHIFT lv_page LEFT DELETING LEADING ' '.
CONCATENATE sy-datum6(2) sy-datum4(2) sy-datum+0(4)
INTO lv_date SEPARATED BY '.'.
CONCATENATE sy-uzeit0(2) ':' sy-uzeit2(2) INTO lv_time.
CONCATENATE lv_date lv_time INTO lv_date SEPARATED BY ' '.
CONCATENATE 'Page' lv_page INTO lv_page_no SEPARATED BY ' '.
Decide on positioning of text depending on width of page.
lv_page_pos = sy-linsz - ( STRLEN( lv_page_no ) ).
WRITE: / lv_date,
AT lv_page_pos lv_page_no.
ULINE.
ENDFORM. " TOP_OF_PAGE
FORM END_OF_PAGE *
Subroutine attached as callback form to ABAP List Viewer *
FORM end_of_page.
ENDFORM. " END_OF_PAGE
Form ALV_VARIANT_EXISTENCE
Reads ALV variant definition
FORM alv_variant_existence USING iv_variant LIKE disvariant-variant
CHANGING os_variant LIKE disvariant.
CHECK NOT iv_variant IS INITIAL.
os_variant-report = sy-repid.
os_variant-variant = iv_variant.
IF iv_variant CP '/*'. "user-specific variants begin with slash
os_variant-username = sy-uname.
ENDIF.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = 'A'
CHANGING
cs_variant = os_variant
EXCEPTIONS
wrong_input = 1
not_found = 2
program_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE e001(z9) WITH 'Please select a valid display variant.'.
ENDIF.
ENDFORM. " ALV_VARIANT_EXISTENCE
FORM ALV_VARIANT_F4 *
Display list of layout variants on report selection screen *
FORM alv_variant_f4 CHANGING cv_varname LIKE disvariant-variant
cs_variant LIKE disvariant.
DATA: lv_exit(1) TYPE c.
cs_variant-report = sy-repid.
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = cs_variant
i_save = 'A'
it_default_fieldcat =
IMPORTING
e_exit = lv_exit
es_variant = cs_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
IF lv_exit = space.
cv_varname = cs_variant-variant.
ENDIF.
ENDIF.
hope this will help.
see form user_command.
regards,
Ruchika -
Hi,
I am trying to show 'me22n' ( PO details) by drilling down on ebeln in my alv report. but for some reason this is NOT happening. can somebody pls help.
the alv is been shown properly the it does not drill down on po number "ebeln".
Please find the enclosed code.
Thanks & Regards
Hrishi
REPORT Z_VENDOR_BACKORDER_REPORT_ALV line-size 400.
TABLES: EKKO, LFA1, MAKT, EKET, EKPO, AFPO, MARC.
*Data Declaration
DATA: BEGIN OF ITAB OCCURS 0 ,
ebeln LIKE ekko-ebeln , " PO number
aedat LIKE ekko-aedat , " creation date
ebelp LIKE ekpo-ebelp , " item no
lifnr LIKE ekko-lifnr , " vendor number
name1 LIKE lfa1-name1 , " vendor name
RESWK LIKE EKKO-RESWK , " PLANT NO
MEMORY LIKE EKKO-MEMORY , " ORDER INCOMPLETE
matnr LIKE ekpo-matnr , " material number
werks like ekpo-werks , " plant
txz01 LIKE ekpo-txz01 , " material description
eindt LIKE eket-eindt , " Promised date
menge LIKE eket-menge , " quantity
wemng LIKE eket-wemng , " delivered quantity
netpr like ekpo-netpr , " value in AUD
peinh like ekpo-peinh , " price unit
banfn like ekpo-banfn , " PR no
aufnr like ebkn-aufnr , " Production order no
MAABC LIKE MARC-MAABC , " MATERIAL ABC Indicator
maktx like makt-maktx , " material long description
open_quant type p decimals 2, " quantity - delivered
VALUE TYPE p decimals 2, " $ VALUE * OPEN QUANTITY
end of ITAB.
data: wa like itab.
DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
DATA: TEMP TYPE EKKO-LIFNR.
data: opt like CTU_PARAMS.
*DATA: WA TYPE FINAL.
all ALV declarations
type-pools: slis. "ALV Declarations
DATA: fieldcatalog TYPE slis_t_fieldcat_alv with header line,
G_REPID TYPE SY-REPID,
GS_PRINT TYPE SLIS_PRINT_ALV,
GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER,
GT_EVENTS TYPE SLIS_T_EVENT,
GT_SORT TYPE SLIS_T_SORTINFO_ALV,
GS_LAYOUT TYPE SLIS_LAYOUT_ALV,
COL_POS TYPE I.
-----------------SELECTION SCREEN----------------------
selection-screen begin of block b1 with frame title text-001.
select-options VENDORNO for ekko-lifnr.
select-options MATERIAL for ekpo-matnr.
SELECT-OPTIONS PLANT FOR EKKO-RESWK.
select-options REQDAT for eket-eindt.
selection-screen end of block b1.
*................... GET DATA..................
SELECT EKKO~EBELN
EKKO~AEDAT
EKKO~LIFNR
EKKO~MEMORY
EKKO~RESWK
EKPO~EBELP
EKPO~MATNR
ekpo~werks
ekpo~netpr
ekpo~peinh
ekpo~banfn
ekpo~txz01
makt~maktx
EKET~EINDT
EKET~MENGE
EKET~WEMNG
LFA1~NAME1
INTO corresponding fields of ITAB
FROM (
EKKO inner JOIN EKPO
ON EKKOEBELN = EKPOEBELN
inner JOIN EKET
ON EKPOEBELN = EKETEBELN
AND EKPOEBELP = EKETEBELP
inner JOIN LFA1
ON EKKOLIFNR = LFA1LIFNR
*left outer join makt
*on ekpomatnr = maktmatnr
WHERE EKKO~LIFNR IN VENDORNO
AND EKKO~RESWK IN PLANT
and EKPO~MATNR IN MATERIAL
and ekpo~elikz eq ' '
and ekpo~loekz ne 'L'
and eket~eindt in REQDAT.
append itab.
CLEAR ITAB.
endselect.
clear temp.
sort itab by lifnr.
loop at itab .
ITAB-OPEN_QUANT = ITAB-MENGE - ITAB-WEMNG.
if itab-matnr eq ''.
select single aufnr from ebkn into itab-aufnr where banfn = itab-banfn.
select single matnr from afpo into itab-matnr where aufnr = itab-aufnr.
endif.
select single maktx from makt into itab-maktx where matnr = itab-matnr.
select single maabc from MARC INTO ITAB-MAABC WHERE MATNR = ITAB-MATNR.
ITAB-VALUE = ITAB-NETPR * ITAB-OPEN_QUANT / itab-peinh.
modify itab.
endloop.
SKIP.
fieldcatalog-fieldname = 'LIFNR'.
fieldcatalog-seltext_m = 'vendor no'.
fieldcatalog-col_pos = 1.
fieldcatalog-outputlen = 15.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'po Number'.
fieldcatalog-col_pos = 2.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'po date'.
fieldcatalog-col_pos = 3.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'item number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'material number'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MAABC'.
fieldcatalog-seltext_m = 'material type'.
fieldcatalog-col_pos = 6.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'TXZ01'.
fieldcatalog-seltext_m = 'short text'.
fieldcatalog-col_pos = 7.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MAKTX'.
fieldcatalog-seltext_m = 'long text'.
fieldcatalog-col_pos = 8.
fieldcatalog-outputlen = 15.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'EINDT'.
fieldcatalog-seltext_m = 'date promised'.
fieldcatalog-col_pos = 9.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'Quantity'.
fieldcatalog-col_pos = 10.
fieldcatalog-outputlen = 15.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'WEMNG'.
fieldcatalog-seltext_m = 'Delivered'.
fieldcatalog-col_pos = 11.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'OPEN_QUANT'.
fieldcatalog-seltext_m = 'Open quantity'.
fieldcatalog-col_pos = 12.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'VALUE'.
fieldcatalog-seltext_m = '$ value'.
fieldcatalog-col_pos = 13.
fieldcatalog-do_sum = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = g_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
it_fieldcat = fieldcatalog[]
is_layout = GS_layout
is_variant = z_template
tables
t_outtab = itab
exceptions
program_error = 1
others = 2.
FORM USE_COMMAND USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE r_ucomm.
WHEN '&IC1'.
CASE rs_selfield-sel_tab_field.
WHEN 'ITAB-LIFNR'.
WHEN 'ITAB-EBELN'.
CHECK NOT rs_selfield-value IS INITIAL.
SET PARAMETER ID 'BUS' FIELD rs_selfield-value.
CALL TRANSACTION 'ME22N' AND SKIP FIRST SCREEN.
ENDCASE.
ENDCASE.Problem solved. changed the code as follows and it did work
Regards
Hrishi
form display_alv_report.
g_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = g_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gs_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
it_events = gt_events
is_print = gd_prntparams
i_save = 'X'
is_variant = z_template
tables
t_outtab = itAB
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endform. " DISPLAY_ALV_REPORT
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE ITAB INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
IF rs_selfield-fieldname = 'MATNR'.
READ TABLE ITAB INTO wa_ekko INDEX rs_selfield-tabindex.
SET PARAMETER ID 'MAT' FIELD wa_ekko-matnr.
CALL TRANSACTION 'MD04' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM. -
DCache Misses and Line Replacements in disabled mode
The Dcache is write through which i believe operate in following modes
1.What are the situations that need the Dcache to operate in Disabled mode?
2.In the disabled mode all the data is fetched from L2 regardless of a cache hit or miss?
3.In normal mode does only TSO compliant stores that miss the data cache bring the line back to Dcache or missed stores dont allocate a line in Dcache?
4.So in RMO stores misses the line is never brought to cache from L2?The Dcache is write-through, and stores are non-allocating.
1. By "disabled mode", I assume you mean D-cache disabled. D-cache is disabled when the processor is reset. Part of the reset process is to zero out all the valid bits for all ways and indexes before the D-cache can be enabled. The system would only run with D-cache disabled if there were some defect that prevented the D-cache from operating correctly.
2. In disabled mode, all loads go to the miss buffer, which forwards them to L2. When data comes back, D-cache is not updated. Stores are handled pretty much the same, because they are non-allocating, and write-through. L2 will never indicate a store hit in D-cache, so the D-cache will never be updated by the store.
3. As discussed before, stores that miss the D-cache are non allocating. Stores that hit the D-cache are updated only after L2 responds with store-ack, indicating D-cache hit.
4. RMO stores (RMO stands for Relaxed Memory Ordering). With RMO stores, there is no requirement that loads occurring after a store should see the stored value. It's a don't care. RMO stores are de-queued from the store queue immediately after they are sent to L2. RMO stores never update the D-cache. If L2 returns a store ack indicating D-cache hit, the line is invalidated. What does this mean? If a load follows an RMO store to the same address, it may see either the old value or the new stored value, depending on the timing. If the load occurs before the store buffer sends the store to L2, it may hit in the store buffer (It's an implementation detail. I don't know whether loads are allowed to hit on RMO stores or not). After the RMO store is sent to L2, it is de-allocated from the store queue. the load might hit in D-cache, which would supply the old value of that location. After the store ack is received, the D-cache line is invalidated, so a load request must be sent to L2, which will supply the new value.
formalGuy -
Hi,
I have the below sql query,
select pool round((bytes/1024/1024),2) "Bytes in MB" from v$sgastat where name='free memory' order by pool;
POOL Bytes in MB
java pool 448
large pool 7029
shared pool 576
I wish to write a crosstab sql query to get the output as below,
java pool large pool shared pool
448 7029 576
How to wirte this sql ?
Thanks.select max(case when pool = 'java pool' then mb end) "Java Pool"
, max(case when pool = 'large pool' then mb end) "Large Pool"
, max(case when pool = 'shared pool' then mb end) "Shared Pool"
from ( select pool
, round((bytes/1024/1024),2) mb
from v$sgastat
where name ='free memory'
order by pool
);or
select max(case when pool = 'java pool' then round((bytes/1024/1024),2) end) "Java Pool"
, max(case when pool = 'large pool' then round((bytes/1024/1024),2) end) "Large Pool"
, max(case when pool = 'shared pool' then round((bytes/1024/1024),2) end) "Shared Pool"
from v$sgastat
where name ='free memory';Edited by: hoek on May 5, 2010 2:58 PM -
One Unix process and multiple Oracle sessions
Hi All,
When I checked one particular Unix process, I have seen that in the database there are 3 different Oracle sessions spanning days between them. Can you please tell me how this is possible.
Regards
SatishHi Yas,
The query I ran is tghe following.
SELECT Substr(a.username,1,15) "Username",
a.osuser "OS User",
a.sid "Session ID",
a.serial# "Serial No",
d.spid "Process ID",
a.lockwait "LockWait",
a.status "Status",
Trunc(b.value/1024) "PGA (Kb)",
Trunc(e.value/1024) "UGA (Kb)",
a.module "Module",
Substr(a.machine,1,15) "Machine",
a.program "Program",
Substr(To_Char(a.logon_Time,'DD-Mon-YYYY HH24:MI:SS'),1,20) "Time"
FROM v$session a,
v$sesstat b,
v$statname c,
v$process d,
v$sesstat e,
v$statname f
WHERE d.spid=29789 and
a.paddr = d.addr
AND a.sid = b.sid
AND b.statistic# = c.statistic#
AND c.name = 'session pga memory'
AND a.sid = e.sid
AND e.statistic# = f.statistic#
AND f.name = 'session uga memory'
ORDER BY 1,2;
I passed spid to it.
Regards
Satish -
Hi,
I am looking for a UPS for my Editing Suite, As a backup for Power cuts.
are there any recomendations or type of ups I should look out for, APC Seem to be popluar here in the UK.
Thanks
BazPeru Bob wrote:
Remember that people are more likely to submit a review about a problem with a product than they are to say that it works. (Although I've never seen a bad review of ADK)
While that is true and people simply assembling their computer or installing parts incorrectly is a source for even more bad reviews, newegg is large enough that you'll get the real truth. Then there's people like me who review almost everything I buy there just to help out other people. For example:
http://www.newegg.com/Product/Product.aspx?Item=N82E16827135204
2,717 5 star reviews.
http://www.newegg.com/Product/Product.aspx?Item=N82E16811129021
5,942 total reviews
They carry 554 cases. That's the best one. See, you can find out that easily lol.
It works for brands too. 7 out of the top 10 sets of RAM are made by Gskill.
http://www.newegg.com/Store/SubCategory.aspx?SubCategory=147&name=Desktop-Memory&Order=RAT ING
Someone on this forum earlier was saying Gskill was awful. THE WORST! Well, about 10,000 reviews say something different, lol.
Why use outdated, biased opinions about a brand when you can simply see what thousands of other people thought of it. If 1000 people say one thing and you think another, chances are the 1000 are more accurate. That's why I love newegg.
Maybe you are looking for
-
Question on linkage of idoc with document number created in SAP R/3
Hi all, I have a query related to IDOC. When inbound IDOC is posted into SAP R/3 it creates Material document number or billing document number is generated in SAP R/3. Question: <b>Do we have interface monitor in SAP R/3 Where I can see the linkage
-
How to create a chart with x and y input arrays
I am trying to create a chart that receives chunks of data from a while loop. I know how to create a chart in order to append new data points to those points already in the display, but a regular chart doesn't let me specify the x axis data points.
-
BDC uploading on the basis on first row
hi experts, my requirement is, i have a flat file in excel with csv format, and i have the details of bank details with company name and debit account number and etc., in the first row, and from second row all the transactions done in that debit acco
-
Wire bracket in iBookG4 - can't clip in airport extreme card
The airport extreme card is installed and works but I can't put back the keyboard because i can't get the clip to sit back in the slots. Others too have tried. Any ideas please or should I just use pliers? Thanks.
-
How can I force a HTTP/1.0 response from a java servlet running on oc4j?