Generic table structure
Hi all,
I am creating a FM which will have an input field as a table name and structures to the corresponding table. So is there any generic structure available in the DDIC that can be used as a base for the fields coming in.
If not available what should i consider while creating a structure for the same.
Regards,
Stock
I intend to have an IMPORT parameters as
TABLE --> any DB table (dynamic as per requirement)
WA_STRUCT---> a single record entry with all the columns for the above table
Can we specify the same in the importing section and have the same functionality as in tables section.
IMPORT
wa_struct
without the type and associated type.
Regds,
Stock
Similar Messages
-
Method GET_STATIC_ATTRIBUTES with generic table-structure
Hi ,
I am trying to select some rows of a web dynpro alv .
LS_ALL-TABNAME = VAR_NAME_OF_TABLE.
CREATE DATA LS_ALL-OBJECT TYPE TABLE OF (VAR_NAME_OF_TABLE). "<<<<<
INSERT LS_ALL INTO TABLE LT_ALL.
LOOP AT LT_ALL INTO LS_ALL.
ASSIGN LS_ALL-OBJECT->* TO <FS_TABLE>. "<<<<<
ENDLOOP.
LT_ELEMENTS = WD_THIS->DYN_NODE->GET_SELECTED_ELEMENTS( INCLUDING_LEAD_SELECTION = ABAP_TRUE ).
LOOP AT LT_ELEMENTS INTO LR_ELEMENT.
LR_ELEMENT->GET_STATIC_ATTRIBUTES( IMPORTING STATIC_ATTRIBUTES = <FS_TABLE> ).
"coding...
ENDLOOP.
My problem: It's a generic web dynpro alv (with a dynamic context node) and i only have the tablename (and so it's structure) of the alv at runtime in a variable.
I want to select some rows of this alv and get the data of the selected rows, so I try to work with field-symbols, but because of the move-corresponding in the coding of the method IF_WD_CONTEXT_ELEMENT~GET_STATIC_ATTRIBUTES...:
method IF_WD_CONTEXT_ELEMENT~GET_STATIC_ATTRIBUTES .
field-symbols:
<values> type data.
assign me->static_attributes->* to <values>.
move-corresponding <values> to static_attributes.
endmethod.
...i get the short-dump:
German:
Falscher Typ eines Operanden bei der Anweisung MOVE-CORRESPONDING.
English:
Wrong type of operands during the assignment MOVE-CORRESPONDING.
So how can i get the structure of my generic table and do a move-corresponding with the method above?
Many thanks in advance!
Regards,
Ludwig
Edited by: Ludwig Heinz on Mar 13, 2008 9:45 AMOk - but how can i make a declaration of dref_tab?
my coding:
TYPES: BEGIN OF TS_ALL,
TABNAME TYPE DD02L-TABNAME,
OBJECT TYPE REF TO DATA,
END OF TS_ALL.
"dref_tab TYPE HASHED TABLE OF TS_ALL
" WITH UNIQUE KEY TABNAME,
FIELD-SYMBOLS:
<FS_LINE> TYPE ANY,
<FS_STRUCT> TYPE ANY,
"<FS_TABLE> TYPE ANY TABLE.
CREATE DATA LS_ALL-OBJECT TYPE (LF_TABLENAME).
INSERT LS_ALL INTO TABLE LT_ALL.
"CREATE DATA dref_tab TYPE TABLE OF (LF_TABLENAME).
"ASSIGN dref_tab->* TO <FS_TABLE>.
LOOP AT LT_ALL INTO LS_ALL.
ASSIGN LS_ALL-OBJECT->* TO <FS_STRUCT>.
ENDLOOP.
LT_ELEMENTS = WD_THIS->DYN_NODE->GET_SELECTED_ELEMENTS( INCLUDING_LEAD_SELECTION = ABAP_TRUE ).
LOOP AT LT_ELEMENTS INTO LR_ELEMENT.
LR_ELEMENT->GET_STATIC_ATTRIBUTES( IMPORTING STATIC_ATTRIBUTES = <FS_STRUCT> ).
" append <FS_STRUCT> to <FS_TABLE>.
ENDLOOP.
syntax-error:
"dref_tab" is not a datareference-variable.
So how is the right declarion of "dref_tab" ?
Many thanks - i've you can solve this - i think i can finish it
Regards,
Ludwig -
Hello,
I have an internal table containing selection parameters determined at run-time.
eg. it_ipak_selections contains the entries.....
FIELDNAME SIGN OPT LOW
FISCVARNT I EQ K4
FISCPER I EQ 2006011
RBUKRS I EQ CH15
Using these entries I need to retrieve entries from database table rsseldone.
This (BW) table contains requests based on selection parameters.
Unfortunately the table structure is generic, field Fieldname can contain any selection parameter e.g. 'BUKRS'. and for one request there can be 'N' entries, depending on the number of selection parameters.
Here is the table structure with an example.
REQUEST FIELDNAME SIGN OPT LOW HIGH
REQU_123 BUKRS I EQ DE3
REQU_123 FISCPER I BT 2005001 2005003
REQU_987 BUKRS I EQ CH15
For this reason a "Select.... for all entries" statement retrieves too much data.
SELECT rnr fieldname iobjnm sign opt low high
FROM rsseldone INTO CORRESPONDING FIELDS OF TABLE lt_rsseldone
FOR ALL ENTRIES IN it_ipak_selections
WHERE fieldname = it_ipak_selections-fieldname
AND iobjnm = it_ipak_selections-iobjnm
AND sign = it_ipak_selections-sign
AND opt = it_ipak_selections-opt
AND low = it_ipak_selections-low
AND high = it_ipak_selections-high.
Does anyone know an efficient way to select the data?
Thank you,
RodHi,
Your code will work perfectly. Please do the following modification?
<b>If it_ipak_selections[] is not initial.</b>
SELECT rnr fieldname iobjnm sign opt low high
FROM rsseldone INTO TABLE lt_rsseldone
FOR ALL ENTRIES IN it_ipak_selections
WHERE fieldname = it_ipak_selections-fieldname
AND iobjnm = it_ipak_selections-iobjnm
AND sign = it_ipak_selections-sign
AND opt = it_ipak_selections-opt
AND low = it_ipak_selections-low
AND high = it_ipak_selections-high.
<b>endif.</b>
If still not working please let me know. I will help you.
CORRESPONDING FIELDS clause won't work properly.
Regards
Bhupal Reddy
Message was edited by:
Bhupal Reddy Vendidandi -
[SQL SERVER 2000] Generic table exporter
Hello every body.
First of all sorry for my bad english but I'm french ;-)
My internship consits into making a generic table exporter (with a table list). Export into csv files.
I have tried 2 solutions :
1 - Create a DTS with a Dynamic Properties Task. The problem is I can easily change the destination file but when I change the table source I don't know how to remap the transformations between source and destination (do you see what I mean ?). Any idea ?
2 - Use the bcp command. Very simple but how to do when tables contains the separator caracter ? for example : If a table line is "toto" | "I am , very happy" --> the csv file will look like this : toto, I am , very happy --> problem to get back the data ( to much comma ).
Does someone has a solution ?
Last point is how to export the table structure ? For the moment, using the table structure, I generate an sql query which creates a table (I write this query in a file). Isn't there any "cleaner" solution ?
Thanks in advance and have a nice day allAnswers,
1. Use ActiveX script to transform. Refer
http://technet.microsoft.com/en-us/library/aa933459(v=sql.80).aspx
2. Replace the pipe delimiter first with comma if it is a single column and use bcp command. Refer
http://technet.microsoft.com/en-us/library/aa174646(v=sql.80).aspx
3. Regarding generating script refer
http://stackoverflow.com/questions/4058977/exporting-tables-and-indexes-from-one-sql-server-2000-database-to-another
Regards, RSingh -
Question about reading generic tables with keys
Hello
I'm wondering if it's possible to read a generic table with key statement:
FIELD-SYMBOLS:
<lv_key> TYPE zconf_key,
<lt_data_bi> TYPE INDEX TABLE,
<lt_data_ai> TYPE INDEX TABLE,
<ls_data_bi> TYPE any,
<ls_data_ai> TYPE any.
* create data types
CREATE DATA lt_data_bi TYPE (ls_node-data_table_type).
ASSIGN lt_data_bi->* TO <lt_data_bi>.
CREATE DATA lt_data_ai TYPE (ls_node-data_table_type).
ASSIGN lt_data_ai->* TO <lt_data_ai>.
* do check
LOOP AT <lt_data_ai> ASSIGNING <ls_data_ai>.
ASSIGN COMPONENT 'KEY' OF STRUCTURE <ls_data_ai> TO <lv_key>.
READ TABLE <lt_data_bi> WITH KEY key = <lv_key>
ASSIGNING <ls_data_bi> BINARY SEARCH.
I receive the message: "The specified type has no structure and therefore no component called KEY" in the read statement above.
Does anyone has an idea what I can do here?
Regards,
MathiasMathias Glockner wrote:
> READ TABLE <lt_data_bi> WITH KEY key = <lv_key>
In your structure ls_data_bi there is no field called KEY . please check whether you have field KEY in structure
a®s -
BI 7 : Command to export a table structure of SAP R/3 into a script/text ?
Hi All.
Greetings.
Am New to SAP R/3 system. And request help.
We are trying to pull data from SAP R/3 thro Bussiness Objects Data Services into Oracle.
For now : we create a target oracle table looking at the table structure of SAP R/3 from SE 11.
In BODS, We then do the query transformation, and use the oracle target table created by us manually.
This works absolutely fine.
We would like to know the command by which we could export the table structure of any existing table
in SAP R/3 into a script / or to text file,
which we could use to create the same table structure in oracle.
Rather than manually typing some 200 field names for each tables.
Can anyone advise on this.
Thanks
InduHello,
The problem is caused due to the spaces in your directories
C:\SAP Dumps\Core Release SR1 Export_CD1_51019634/DB/ADA/DBSIZE.XML
Replace the spaces with underscores and restart the installation from from scratch.
Cheers
Bert -
Hi,
I have a situation where i have to load data from one server/database table to multiple servers/databases.
Example:
I need to load data from dbo.TABLE_A (on Server: Server_A & Database: Database_A) to the same table on the list of server databases like
Server: Server_B , Database: Database_B
Server: Server_C , Database: Database_C
Server: Server_D , Database: Database_D
Server: Server_E , Database: Database_E
Server: Server_F , Database: Database_F
Server: Server_G , Database: Database_G
Server: Server_H , Database: Database_H
so on and so forth on 250 such server database combinations.
The table structure is the same on all the servers.
If i make the source or destination dynamic, it throws an error while mapping ?
I cannot get Linked server permissions and SQL Server Config thing doesn't work as well.
Please suggest on how to load data from one source to multiple server/databases.
Thank you.I just need to transfer one table's data. its like i have to use a query to pick data for
the most recent data. So i use something like, select A, B, C, D from dbo.table where ETL_TIMESTAMP > (the max(etltimestamp) in the destination on different server). There are no foreign key relationships and the data should not be truncated. it just had
to append the new records. -
TIPS(18) : CREATING SCRIPTS TO RECREATE A TABLE STRUCTURE
제품 : SQL*PLUS
작성날짜 : 1996-11-12
TIPS(18) : Creating Scripts to Recreate a Table Structure
=========================================================
The script creates scripts that can be used to recreate a table structure.
For example, this script can be used when a table has become fragmented or to
get a defintion that can be run on another database.
CREATES SCRIPT TO RECREATE A TABLE-STRUCTURE
INCL. STORAGE, CONSTRAINTS, TRIGGERS ETC.
This script creates scripts to recreate a table structure.
Use the script to reorganise a table that has become fragmented,
to get a definition that can be run on another database/schema or
as a basis for altering the table structure (eg. drop a column!).
IMPORTANT: Running the script is safe as it only creates two new scripts and
does not do anything to your database! To get anything done you have to run the
scripts created.
The created scripts does the following:
1. save the content of the table
2. drop any foreign key constraints referencing the table
3. drop the table
4. creates the table with an Initial storage parameter that
will accomodate the entire content of the table. The Next
parameter is 25% of the initial.
The storage parameters are picked from the following list:
64K, 128K, 256K, 512K, multiples of 1M.
5. create table and column comments
6. fill the table with the original content
7. create all the indexes incl storage parameters as above.
8. add primary, unique key and check constraints.
9. add foreign key constraints for the table and for referencing
tables.
10.Create the table's triggers.
11.Compile any depending objects (cascading).
12.Grant table and column privileges.
13.Create synonyms.
This script must be run as the owner of the table.
If your table contains a LONG-column, use the COPY
command in SQL*Plus to store/restore the data.
USAGE
from SQL*Plus:
start reorgtb
This will create the scripts REORGS1.SQL and REORGS2.SQL
REORGS1.SQL contains code to save the current content of the table.
REORGS2.SQL contains code to rebuild the table structure.
undef tab;
set echo off
column a1 new_val stor
column b1 new_val nxt
select
decode(sign(1024-sum(bytes)/1024),-1,to_char((round(sum(bytes)/(1024*1
024))+1))||'M', /* > 1M new rounded up to nearest Megabyte */
decode(sign(512-sum(bytes)/1024), -1,'1M',
decode(sign(256-sum(bytes)/1024), -1,'512K',
decode(sign(128-sum(bytes)/1024), -1,'256K',
decode(sign(64-sum(bytes)/1024) , -1,'128K',
'64K'
a1,
decode(sign(1024-sum(bytes)/4096),-1,to_char((round(sum(bytes)/(4096*1
024))+1))||'M', /* > 1M new rounded up to nearest Megabyte */
decode(sign(512-sum(bytes)/4096), -1,'1M',
decode(sign(256-sum(bytes)/4096), -1,'512K',
decode(sign(128-sum(bytes)/4096), -1,'256K',
decode(sign(64-sum(bytes)/4096) , -1,'128K',
'64K'
b1
from user_extents
where segment_name=upper('&1');
set pages 0 feed off verify off lines 150
col c1 format a80
spool reorgs1.sql
PROMPT drop table bk_&1
prompt /
PROMPT create table bk_&1 storage (initial &stor) as select * from &1
prompt /
spool off
spool reorgs2.sql
PROMPT spool reorgs2
select 'alter table '||table_name||' drop constraint
'||constraint_name||';'
from user_constraints where r_constraint_name
in (select constraint_name from user_constraints where
table_name=upper('&1')
and constraint_type in ('P','U'));
PROMPT drop table &1
prompt /
prompt create table &1
select decode(column_id,1,'(',',')
||rpad(column_name,40)
||decode(data_type,'DATE' ,'DATE '
,'LONG' ,'LONG '
,'LONG RAW','LONG RAW '
,'RAW' ,'RAW '
,'CHAR' ,'CHAR '
,'VARCHAR' ,'VARCHAR '
,'VARCHAR2','VARCHAR2 '
,'NUMBER' ,'NUMBER '
,'unknown')
||rpad(
decode(data_type,'DATE' ,null
,'LONG' ,null
,'LONG RAW',null
,'RAW' ,decode(data_length,null,null
,'('||data_length||')')
,'CHAR' ,decode(data_length,null,null
,'('||data_length||')')
,'VARCHAR' ,decode(data_length,null,null
,'('||data_length||')')
,'VARCHAR2',decode(data_length,null,null
,'('||data_length||')')
,'NUMBER' ,decode(data_precision,null,' '
,'('||data_precision||
decode(data_scale,null,null
,','||data_scale)||')')
,'unknown'),8,' ')
||decode(nullable,'Y','NULL','NOT NULL') c1
from user_tab_columns
where table_name = upper('&1')
order by column_id
prompt )
select 'pctfree '||t.pct_free c1
,'pctused '||t.pct_used c1
,'initrans '||t.ini_trans c1
,'maxtrans '||t.max_trans c1
,'tablespace '||s.tablespace_name c1
,'storage (initial '||'&stor' c1
,' next '||'&stor' c1
,' minextents '||t.min_extents c1
,' maxextents '||t.max_extents c1
,' pctincrease '||t.pct_increase||')' c1
from user_Segments s, user_tables t
where s.segment_name = upper('&1') and
t.table_name = upper('&1')
and s.segment_type = 'TABLE'
prompt /
select 'comment on table &1 is '''||comments||''';' c1 from
user_tab_comments
where table_name=upper('&1');
select 'comment on column &1..'||column_name||
' is '''||comments||''';' c1 from user_col_comments
where table_name=upper('&1');
prompt insert into &1 select * from bk_&1
prompt /
set serveroutput on
declare
cursor c1 is select index_name,decode(uniqueness,'UNIQUE','UNIQUE')
unq
from user_indexes where
table_name = upper('&1');
indname varchar2(50);
cursor c2 is select
decode(column_position,1,'(',',')||rpad(column_name,40) cl
from user_ind_columns where table_name = upper('&1') and
index_name = indname
order by column_position;
l1 varchar2(100);
l2 varchar2(100);
l3 varchar2(100);
l4 varchar2(100);
l5 varchar2(100);
l6 varchar2(100);
l7 varchar2(100);
l8 varchar2(100);
l9 varchar2(100);
begin
dbms_output.enable(100000);
for c in c1 loop
dbms_output.put_line('create '||c.unq||' index '||c.index_name||' on
&1');
indname := c.index_name;
for q in c2 loop
dbms_output.put_line(q.cl);
end loop;
dbms_output.put_line(')');
select 'pctfree '||i.pct_free ,
'initrans '||i.ini_trans ,
'maxtrans '||i.max_trans ,
'tablespace '||i.tablespace_name ,
'storage (initial '||
decode(sign(1024-sum(e.bytes)/1024),-1,
to_char((round(sum(e.bytes)/(1024*1024))+1))||'M',
decode(sign(512-sum(e.bytes)/1024), -1,'1M',
decode(sign(256-sum(e.bytes)/1024), -1,'512K',
decode(sign(128-sum(e.bytes)/1024), -1,'256K',
decode(sign(64-sum(e.bytes)/1024) , -1,'128K',
'64K'))))) ,
' next '||
decode(sign(1024-sum(e.bytes)/4096),-1,
to_char((round(sum(e.bytes)/(4096*1024))+1))||'M',
decode(sign(512-sum(e.bytes)/4096), -1,'1M',
decode(sign(256-sum(e.bytes)/4096), -1,'512K',
decode(sign(128-sum(e.bytes)/4096), -1,'256K',
decode(sign(64-sum(e.bytes)/4096) , -1,'128K',
'64K'))))) ,
' minextents '||s.min_extents ,
' maxextents '||s.max_extents ,
' pctincrease '||s.pct_increase||')'
into l1,l2,l3,l4,l5,l6,l7,l8,l9
from user_extents e,user_segments s, user_indexes i
where s.segment_name = c.index_name
and s.segment_type = 'INDEX'
and i.index_name = c.index_name
and e.segment_name=s.segment_name
group by s.min_extents,s.max_extents,s.pct_increase,
i.pct_free,i.ini_trans,i.max_trans,i.tablespace_name ;
dbms_output.put_line(l1);
dbms_output.put_line(l2);
dbms_output.put_line(l3);
dbms_output.put_line(l4);
dbms_output.put_line(l5);
dbms_output.put_line(l6);
dbms_output.put_line(l7);
dbms_output.put_line(l8);
dbms_output.put_line(l9);
dbms_output.put_line('/');
end loop;
end;
declare
cursor c1 is
select constraint_name, decode(constraint_type,'U',' UNIQUE',' PRIMARY
KEY') typ,
decode(status,'DISABLED','DISABLE',' ') status from user_constraints
where table_name = upper('&1')
and constraint_type in ('U','P');
cname varchar2(100);
cursor c2 is
select decode(position,1,'(',',')||rpad(column_name,40) coln
from user_cons_columns
where table_name = upper('&1')
and constraint_name = cname
order by position;
begin
for q1 in c1 loop
cname := q1.constraint_name;
dbms_output.put_line('alter table &1');
dbms_output.put_line('add constraint '||cname||q1.typ);
for q2 in c2 loop
dbms_output.put_line(q2.coln);
end loop;
dbms_output.put_line(')' ||q1.status);
dbms_output.put_line('/');
end loop;
end;
declare
cursor c1 is
select c.constraint_name,c.r_constraint_name cname2,
c.table_name table1, r.table_name table2,
decode(c.status,'DISABLED','DISABLE',' ') status,
decode(c.delete_rule,'CASCADE',' on delete cascade ',' ')
delete_rule
from user_constraints c,
user_constraints r
where c.constraint_type='R' and
c.r_constraint_name = r.constraint_name and
c.table_name = upper('&1')
union
select c.constraint_name,c.r_constraint_name cname2,
c.table_name table1, r.table_name table2,
decode(c.status,'DISABLED','DISABLE',' ') status,
decode(c.delete_rule,'CASCADE',' on delete cascade ',' ')
delete_rule
from user_constraints c,
user_constraints r
where c.constraint_type='R' and
c.r_constraint_name = r.constraint_name and
r.table_name = upper('&1');
cname varchar2(50);
cname2 varchar2(50);
cursor c2 is
select decode(position,1,'(',',')||rpad(column_name,40) colname
from user_cons_columns
where constraint_name = cname
order by position;
cursor c3 is
select decode(position,1,'(',',')||rpad(column_name,40) refcol
from user_cons_columns
where constraint_name = cname2
order by position;
begin
dbms_output.enable(100000);
for q1 in c1 loop
cname := q1.constraint_name;
cname2 := q1.cname2;
dbms_output.put_line('alter table '||q1.table1||' add constraint ');
dbms_output.put_line(cname||' foreign key');
for q2 in c2 loop
dbms_output.put_line(q2.colname);
end loop;
dbms_output.put_line(') references '||q1.table2);
for q3 in c3 loop
dbms_output.put_line(q3.refcol);
end loop;
dbms_output.put_line(') '||q1.delete_rule||q1.status);
dbms_output.put_line('/');
end loop;
end;
col c1 format a79 word_wrap
set long 32000
set arraysize 1
select 'create or replace trigger ' c1,
description c1,
'WHEN ('||when_clause||')' c1,
trigger_body ,
'/' c1
from user_triggers
where table_name = upper('&1') and when_clause is not null
select 'create or replace trigger ' c1,
description c1,
trigger_body ,
'/' c1
from user_triggers
where table_name = upper('&1') and when_clause is null
select 'alter trigger '||trigger_name||decode(status,'DISABLED','
DISABLE',' ENABLE')
from user_Triggers where table_name='&1';
set serveroutput on
declare
cursor c1 is
select 'alter table
'||'&1'||decode(substr(constraint_name,1,4),'SYS_',' ',
' add constraint ') a1,
decode(substr(constraint_name,1,4),'SYS_','
',constraint_name)||' check (' a2,
search_condition a3,
') '||decode(status,'DISABLED','DISABLE','') a4,
'/' a5
from user_constraints
where table_name = upper('&1') and
constraint_type='C';
b1 varchar2(100);
b2 varchar2(100);
b3 varchar2(32000);
b4 varchar2(100);
b5 varchar2(100);
fl number;
begin
open c1;
loop
fetch c1 into b1,b2,b3,b4,b5;
exit when c1%NOTFOUND;
select count(*) into fl from user_tab_columns where table_name =
upper('&1') and
upper(column_name)||' IS NOT NULL' = upper(b3);
if fl = 0 then
dbms_output.put_line(b1);
dbms_output.put_line(b2);
dbms_output.put_line(b3);
dbms_output.put_line(b4);
dbms_output.put_line(b5);
end if;
end loop;
end;
create or replace procedure dumzxcvreorg_dep(nam varchar2,typ
varchar2) as
cursor cur is
select type,decode(type,'PACKAGE BODY','PACKAGE',type) type1,
name from user_dependencies
where referenced_name=upper(nam) and referenced_type=upper(typ);
begin
dbms_output.enable(500000);
for c in cur loop
dbms_output.put_line('alter '||c.type1||' '||c.name||' compile;');
dumzxcvreorg_dep(c.name,c.type);
end loop;
end;
exec dumzxcvreorg_dep('&1','TABLE');
drop procedure dumzxcvreorg_Dep;
select 'grant '||privilege||' on '||table_name||' to '||grantee||
decode(grantable,'YES',' with grant option;',';') from
user_tab_privs where table_name = upper('&1');
select 'grant '||privilege||' ('||column_name||') on &1 to
'||grantee||
decode(grantable,'YES',' with grant option;',';')
from user_col_privs where grantor=user and
table_name=upper('&1')
order by grantee, privilege;
select 'create synonym '||synonym_name||' for
'||table_owner||'.'||table_name||';'
from user_synonyms where table_name=upper('&1');
PROMPT REM
PROMPT REM YOU MAY HAVE TO LOG ON AS SYSTEM TO BE
PROMPT REM ABLE TO CREATE ANY OF THE PUBLIC SYNONYMS!
PROMPT REM
select 'create public synonym '||synonym_name||' for
'||table_owner||'.'||table_name||';'
from all_synonyms where owner='PUBLIC' and table_name=upper('&1') and
table_owner=user;
prompt spool off
spool off
set echo on feed on verify on
The scripts REORGS1.SQL and REORGS2.SQL have been
created. Alter these script as necesarry.
To recreate the table-structure, first run REORGS1.SQL.
This script saves the content of your table in a table
called bk_.
If this script runs successfully run REORGS2.SQL.
The result is spooled to REORGTB.LST.
Check this file before dropping the bk_ table.
*/Please do NOT cross-postings: create a deep structure for dynamic internal table
Regards
Uwe -
Vendor-Customer balances in group currency-table/structure/function module?
Hi All,
Which table/structure/function module can be used to get balances for vendors and customers in group currency? We just wnat to extract balances in group currency so FBL1N and FBL5N are not options. Is there any SAP report which can provide these balances for both vendors and customers?
Thanks and regards,
PinkyHi Pinky,
I came across one report S_ALR_87012079 - Transaction Figures: Account Balance, Program RFSRRCUA, which extracts Account Balances of Vendor. Once the report is executed, you can do Currency Translation from one currency to different currencies. In the output screen, in the Top Menu, select 'Settings -> Currency' and you can convert to another currency. I am not sure, if this helps you. If this helps, kindly update your comments here.
Thank you.
Suresh Jayanthi. -
Generic Table Control in ABUMN for multiple transfer of assets
Hi Experts,
Problem Description
We are trying to use transaction ABUMN for multiple asset transfer.
We need to transfer more than one assets to multiple assets by quantity
and value.
Our Efforts/Observation
Instead of going ahead with BDC/LSMW, we tried using table control to utilize standard SAP functionality.
For making this happen, we are trying to use the Generic Table control which is available in ABUMN once you click on "Multiple assets" button.
However, even though we are making fields like
EL7, EL8 etc available in the screen (by removing check from the "Invisible" check box), they are in display mode and are not giving me any option to select quantity and value that needs to be transferred from each asset.
We need to assign these fields to some field like quantity/percentage so that they can be used.
If you see, the column header is also blank.
We need to transfer hundreds of assets, hence requesting you to please
fix this urgently so that we can transfer assets and close the quarter.
Thanks in advance for your help and support,
Nitish Gupta
+919867458892Hi Nitish,
I'm sorry, transaction ABUMN will never get this functionality you requested.
For mass transfer, customers have the possibilities to use batch input on transaction ABUM or BAPI.
Please refer customer to the following note : 216806 New posting transactions and batch input
regards Bernhard -
How to get the name of a Data Element of a generic Table!
Hi guys!
In my function i have the following import paramenter
i_outtab type standard table
now i import a table and i want to get the dataelement of the fields.
is there a way to do this??Hello Thomas
Perhaps the following sample report may be useful for you.
*& Report ZUS_SDN_RTTI_STRUCT_COMPONENTS
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1145711"></a>
*& Thread: How to get the name of a Data Element of a generic Table!
REPORT zus_sdn_rtti_struct_components.
TYPE-POOLS: abap.
TYPES: BEGIN OF ty_s_outtab.
TYPES: bukrs TYPE bukrs.
TYPES: kunnr TYPE kunnr.
TYPES: END OF ty_s_outtab.
DATA: gdo_data TYPE REF TO data.
DATA: gs_outtab TYPE ty_s_outtab.
DATA: go_typedescr TYPE REF TO cl_abap_typedescr,
go_structdescr TYPE REF TO cl_abap_structdescr,
go_datadescr type ref to cl_abap_datadescr.
DATA: gs_comp TYPE abap_compdescr,
gd_dtel type string,
gt_dfies type ddfields.
FIELD-SYMBOLS:
<gs_struct> TYPE ANY.
START-OF-SELECTION.
BREAK-POINT.
GET REFERENCE OF gs_outtab INTO gdo_data.
ASSIGN gdo_data->* TO <gs_struct>.
go_typedescr = cl_abap_typedescr=>describe_by_data( <gs_struct> ).
go_structdescr ?= go_typedescr.
BREAK-POINT.
LOOP AT go_structdescr->components INTO gs_comp.
go_datadescr = GO_STRUCTDESCR->GET_COMPONENT_TYPE( gs_comp-name ).
gd_dtel = go_datadescr->get_relative_name( ).
write: / syst-tabix, 'Data element =', gd_dtel.
ENDLOOP.
END-OF-SELECTION.
Regards
Uwe -
In our current implementation we have a Blank page with Text Field [field format Rich Text] on generated PDF Document.
Once the PDF document is generated, user can copy paste content form any word/rtf document to into the Text Field.
Pasted content retains all text formatting [Bold, Italic, Underline, Indentation] except the Table format. Text Field is removing table metadata from the content and converting it into plant text.
Is there anyway to copy paste table structure as it is from word document into Text Field?Hi,
I don't think you can! While you can paste formatted text into the rich text field, the table metadata means nothing to the textfield.
Niall -
Insert multiple text files to multiple tables that have different table structures
Hi All,
I have a small problem. I have lots of text files in a folder location. Say for an example Company.txt, Code.txt. I need to insert all these files to tables similar to the file structure. Company file to Company table and Code file to Code table. The catch
is that all these table structures differ one to another.
How can i do this using SSIS? I guess using a for each loop with some data flow task would be a start.
Can some body give me a step by step example on how i can achieve this.
Thanks
LMIt is very complicated to accomplish the above requirement using the standard Data Flow Task. You have to essentially setup a separate task for each table layout. If you can use third-party solutions, check the commercial CozyRoc
Data Flow Task Plus. It is an extension of the standard Data Flow Task, with ability to do dynamic data flows at runtime. You can load all your tables and layouts with only one Data Flow Task. The other benefit is the solution doesn't require programming.SSIS Tasks Components Scripts Services | http://www.cozyroc.com/ -
Table structure and constraints in HTML table
This script creates a html file (Structure.html) that contains structure of a specific table.
When the following script is executed in sql * plus, it asks for the table name for which
structure information is needed. after entering the table name, it writes the table structure
into structure.html file.
SET LINESIZE 150
SET PAGESIZE 150
SET FEEDBACK OFF
SET VERIFY OFF
COLUMN "COLUMN NAME" FORMAT A50
COLUMN "DATA TYPE" FORMAT A15
COLUMN "IS NULL" FORMAT A15
COLUMN CONSTRAINTS FORMAT A15
PROMPT Enter table name:
ACCEPT TABNAME
SET MARK HTML ON
SPOOL STRUCTURE.html
PROMPT &TABNAME
-- Query ---
SELECT TRIM(A.COLUMN_NAME) AS "COLUMN NAME",
TRIM(DATA_TYPE||'('||DECODE(A.DATA_LENGTH,22,A.DATA_PRECISION||','||A.DATA_SCALE,
A.DATA_LENGTH) || ')') AS "DATA TYPE",
TRIM(DECODE(A.NULLABLE,'Y',' ','NOT NULL')) AS "IS NULL",
TRIM(DECODE(C.CONSTRAINT_TYPE,'P','PRIMARY KEY','R','FOREIGN KEY('||D.TABLE_NAME||')','U','UNIQUE', 'C','CHECK')) AS CONSTRAINTS,
TRIM(C.CONSTRAINT_NAME) AS "CONSTRAINT NAME",
C.SEARCH_CONDITION AS "CHECK CONDITION",
A.DATA_DEFAULT AS "DEFAULT VALUE"
FROM USER_TAB_COLS A,
USER_CONS_COLUMNS B,
USER_CONSTRAINTS C,
USER_CONS_COLUMNS D
WHERE
A.TABLE_NAME = '&TABNAME' AND
A.TABLE_NAME = B.TABLE_NAME(+) AND
A.COLUMN_NAME = B.COLUMN_NAME(+) AND
B.CONSTRAINT_NAME = C.CONSTRAINT_NAME(+) AND
C.R_CONSTRAINT_NAME = D.CONSTRAINT_NAME(+);
SPOOL OFF
SET MARK HTML OFFHi,
For Head Count you can use 0HR_PA_0 datasource and the other Employee details like start date and end date you can get them from employee master data and FTE can be calculated from the Emloyee Master Data and Head count data.
Hope this helps...
Thanks, -
Flex 3: Update SQLite Table Structure?
I don't have any issues with creating my table when it doesn't exist but I have a quesion about updating the table structure. For instance I want to add two new fields if they don't exist.
Does anyone have an example of updating table structure? Process flow would have to first check for table, if it doesn't exits then create it. If it does exist then check it has all the correct fields. If it doesn't then update table structure.
Is there a built in way to do this with SQLite?
Here is my current code...
private function getRecords():void
var sqlQuery:String = "CREATE TABLE IF NOT EXISTS Roster (" +
"selected TEXT DEFAULT 'false' NOT NULL,"+
"name TEXT NOT NULL," +
"time TEXT NOT NULL," +
"gender TEXT NOT NULL" +
dbStatement = new SQLStatement();
dbStatement.itemClass = Roster;
dbStatement.sqlConnection = exampleDB;
dbStatement.text = sqlQuery;
dbStatement.addEventListener(SQLEvent.RESULT, onDBStatementSelectResult);
dbStatement.execute();
sqlQuery= "select * from Roster";
dbStatement.text = sqlQuery;
dbStatement.addEventListener(SQLEvent.RESULT, onDBStatementSelectResult);
dbStatement.execute();
I want to add in two new fields is possible without asking user to delete the table first.
"wins TEXT DEFAULT '0' NOT NULL," +
"loses TEXT DEFAULT '0' NOT NULL" +
Thanks in advance.Looks like you need a single column to identify the type of user (M,C or A) Much better this scenario described here
http://vyaskn.tripod.com/row_level_security_in_sql_server_databases.htm
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence
Maybe you are looking for
-
ITunes corrupting my m4a files
Hi, Occasionally, a song that I ripped from CD into iTunes just stops playing or starts to skip. It becomes corrupted by iTunes somehow after playing fine for months. I am using the latest iTunes (9.0.1) on Windows XP. I also have an iPhone 3GS with
-
How do I make Photoshop the default in Dreamweaver
Hi, PhotoImpact is currently my default program in Dreamweaver CS6. I want to change the default to PhotoShop. I used Associated type or protocol to change from PhotoImpact to PhotoShop, but when I click on a jpg file in Dreamweaver, PhotoImpact stil
-
Song has been purchased but can't be downloaded.
I recently bought a new album (TALKING IS HARD by WALK THE MOON) and all but one of the songs has downloaded to my computer. The song in question (Sidekick), shows up in the iTunes Store as "Purchased" but does not give me the option to download it.
-
What should i do? my macbook air got stolen.
hi, it has been 3 days since my macbook air got stolen, when i try to locate it on find my iphone it always says offline. unfortunately i removed the password, i want to know if my find my iphone feature in mac is still on, or it will still show up i
-
Can i install photoshop on 2 computers
can i install photoshop on 2 computers?