Creation of table in ecc6
i am creating a table in ecc 6 , while creating it is warning to create enhancement category. may i know why i need to choose enhancement category.
Anybody let me know pls its urgent .
rewards will be there..
Regards,
Madhavi
Hi Madhavi,
<i><b>Intro</b></i>
Append structures permit you to append fields to a SAP standard table and structures without having to modify the table definition. An append structure is a structure which is assigned to exactly one table. There can be several append structures for a table. When a table is activated, all the active append structures for the table are found and their fields are appended to the table. If an append structure is created or changed, the table to which it is assigned is also activated and the changes also take effect there when it is activated. Like all structures, an append structure defines a type that can be used in ABAP programs.
With Release 4.6C you can define foreign keys for fields that already exist in the table using an append structure. Search helps can also be attached to fields that already exist in the table.
Customers create append structures in their namespace. The append structures are thus protected against overwriting during an upgrade. The new versions of the standard tables are imported during the upgrade. When the standard tables are activated, the fields contained in the active append structures are appended to the new standard tables. When append structures are added to a table, you do not have to manually adjust the customer modifications to the new SAP version of
the table (Transaction SPDD) during the upgrade. Since the order of the fields in the ABAP Dictionary since Release 3.0 can differ from the order on the database, a conversion is not necessary when you add an append structure or insert fields in an existing append structure. The structure is adjusted when the database catalog is adjusted (ALTER TABLE). When activating in the ABAP Dictionary, the definition of the table is changed and the new field is appended to the database table.
The new version of the SAP standard table is activated and the new field is appended to the database table.
<i><b>Hint: Please note the following points about append structures:</b></i>
No append structures may be created for pooled and cluster tables.
If a long field (data type LCHR or LRAW) occurs in a table, it cannot
be extended with appends structures. This is because such long fields
must always be in the last position of the field list (e.g. they must be
the last field of the table).
*If you as a customer add an append structure to an SAP table, the fields
in this append structure should be in the customer namespace for fields,
that is they should begin with YY or ZZ. This prevents name collisions
with new fields inserted in the standard table by SAP.
*If you as a partner have your own reserved namespace for your
developments, the fields you select in append structures should always
lie in this namespace.
Structures and tables that have been defined by SAP in the ABAP Dictionary can be subsequently enhanced by the customer in the following way:
<b><i>Customizing Includes</i></b>
With this variant, certain places within a structure or tables for enhancements
are already reserved. However, the associated Includes are first of all created
by the customer.
<i><b>Appends</b></i>
With this variant, any fields without previous reservation are appended to the
end of structures or tables.
<b>Caution: Problems due to structure enhancements</b>
Not only the enhanced structures and tables are affectted by enhancements
of this kind, but also all dependent structures that the enhancement takes
on as Include or substructure. For example, enhancements using appends,
which only have an effect at the end of the initial structure, can, for dependent
structures, also lead to adjustments within these structures.
In programs without active Unicode checking, structure enhancements
can lead to syntax and runtime errors, especially in type checks and in
connection with deep structures. In programs with active Unicode checking,
assignments, operand checks and accesses with offset and length are also
affected. Problematic here are changes if, for example, numerical or deep
components are inserted into a purely character-like structure and this leads
to the structure losing its character-like character. Enhancements are also
therefore problematic, because the fragment view is changed and checks in
assignments and comparisons which are based on this are influenced.
So that the effects pf structure enhancements are recognizable at all, structures and tables in the ABAB dictionary are classified under Extras -> Enhancement category according to the following procedure:
<b>Level </b> <b> Category</b> <b> Meaning</b>
1 Not classified The structure does not have an
enhancement category
2 Not enhanceable The structure cannot be enhanced
3 Enhanceable and
character-like
All structure components and their
enhancements must be character-like
4 Enhanceable and
character-like or
numerical
The structure and its enhancement cannot
contain any deep data types
5 Freely enhanceable The structure and its enhancements may
contain components whose data type is
optional.
Here, the elementary types C, D, N and T are describes as character-like, the
elemenatry types F, I, P and X as numerical. The deep types STRING and XSTRING are not supported. With structures and tables with Includes or substructures, the enhancement categories of the Includes and substructures cannot be larger than those of the initial structure. For example, if the initial structure contains an Include of level 4, then levels 2 and 3 are not permitted for the initial structure. Structure enhancements in Dictionary can also have an effect on internal structures in ABAP programs if Dictionary structures in the source text are used as Include or substructure. These dependencies are considered implicitly in the ABAP program check. This does not include classified structures that contain enhanceable Includes or substructures.
Regards,
Balaji Reddy G
***Rewards if answers are useful
Similar Messages
-
Problem regarding the creation of Table using CSS.
Hi ,
Here I have a Problem regarding the creation of Table using CSS.
In My Application i have a table with multiple rows(Rows are Dynamically added to the table).First i am setting the table with the following properties:
width:900px;
height : auto,
Overflow : visible,
Max-height: : 200px.
If I use above properties,I'm getting a table with 5 or 6 rows(height upto 200px).After that i am getting the Vertical ScrollBar.
The problem is when a table has many columns, Vertical and Horizontal Scrolls are coming at the time of setting the table. The table height is not Increasing dynamically.
How can i use "height" property in CSS? (I want the table height to be increased when the columns are more.)
Thanks & Regards
MadhaviHey humble user. Errr I'm trying to understand what ur trying to do. U want to create a section of a region destructively from an existing region right? If so select the option convert to new region (opt-comm-R or selecting it by right clicking). Check your audio bin to make sure. Whats the "merge" function? Are u refering to the glue tool?
-
Reg: Creation of Table Types
Hi All,
I have a small question regaridng the creation of Table type.
Let us suppose I am creating Table type for a custom table zsample which is having 5 fields. I am generally creating a structure similar to custom table and using that structure as line type for the table type. Let us suppose if there are any changes in the custom table like change in the order of fields or if new fields are added the table type will give dump.
My question is If I use the custom table itself as a line type, will there be any effect in the performance or some thing or I can go ahead and use it..
Thanks,
RaveeWhat dump are you expecting ???
It is idea behind the creation with reference to get structures and tables which always look like
the tables they refer to.
I can not see a possibilty for a dump as long as you create only an internal table.
A dump could appear, if the internal table is later used to update another db-table. But there it should be clear that the structure of an internal should be created with reference to the tables which they change.
Siegfried -
Creation of tables using JDBC or SQLJ in webdynpro application
Hi,
I am trying to create tables in javadictionary(MaxDB)using my WebDynpro application.I tried creating tables using SQLJ and JDBC.But I was not able to do it.I can select and insert data into already created tables.
Whwn I tried creating a table using JDBC I encountered the following exception.
com.sap.sql.log.OpenSQLException: The SQL statement "CREATE TABLE TMP_DEPID (DEPID varchar(10) NOT NULL,DEPNAME VARCHAR(25))" contains the syntax error[s]: Open SQL syntax error: CREATE ... TABLE is not supported
SQL syntax error: "VARCHAR" is a reserved keyword and cannot be used as an unquoted identifier
Does this mean that creating tables is not supported?
Can anyone help me in this matter?
Thanks in advance,
regards
~Pradeep ShettyHi Pradeep,
Yes, OpenSQL does not support creation of tables. But why would you need to create tables at runtime?! The natural way is to create the model at design time of your application, i.e. with the Java DataDictionary.
However, if for any reason you really need to create database tables at runtime, you can achieve this by using a non-OpenSQL datasource, e.g. you could create a VendorSQL one and use it to obtain JDBC connections in your app. See also http://help.sap.com/saphelp_nw04/helpdata/en/c0/3ad4d5cdc66447a188b582aad537d3/frameset.htm.
Hope that helps!
Vladimir -
MDM Java API (Creation of table)
Hi,
can anyone help me for creation of tables in repository using MDM java API .
Can u Provide sample code for this.
Edited by: Srikanth Josyula on Jun 26, 2008 8:52 AMHi Srikanth,
Check with this code.It may be useful.
createflattable.java
Created on June 25, 2008, 5:08 PM
To change this template, choose Tools | Options and locate the template under
the Source Creation and Management node. Right-click the template and choose
Open. You can then make changes to the template in the Source Editor.
package tabletype;
import com.sap.mdm.commands.AuthenticateRepositorySessionCommand;
import com.sap.mdm.commands.CommandException;
import com.sap.mdm.commands.CreateRepositorySessionCommand;
import com.sap.mdm.commands.GetRepositoryRegionListCommand;
import com.sap.mdm.data.MultilingualString;
import com.sap.mdm.data.RegionProperties;
import com.sap.mdm.data.RegionalString;
import com.sap.mdm.net.ConnectionException;
import com.sap.mdm.net.ConnectionPool;
import com.sap.mdm.net.ConnectionPoolFactory;
import com.sap.mdm.schema.TableProperties;
import com.sap.mdm.schema.commands.CreateTableCommand;
import com.sap.mdm.schema.commands.GetFieldListCommand;
import com.sap.mdm.schema.commands.GetTableListCommand;
import com.sap.*;
import com.sap.mdm.server.DBMSType;
import com.sap.mdm.server.RepositoryIdentifier;
import java.util.Locale;
public class createflattable {
/** Creates a new instance of createflattable */
public createflattable() {
private static MultilingualString createMultilingualString(RegionProperties[] regionPropertiesList, String baseString)
MultilingualString mlString = new MultilingualString();
for (int i = 0; i < regionPropertiesList.length; i++)
Locale locale = regionPropertiesList<i>.getLocale();
//Locale locale = regionPropertiesList<i>.getLocale();
String regionCode = regionPropertiesList<i>.getRegionCode();
String string = baseString + "_" + locale.getLanguage() + "_" + locale.getCountry();
RegionalString regionalstring = new RegionalString(string, regionCode);
mlString.set(regionalstring);
return mlString;
private static TableProperties createFlatTable(RegionProperties[] regionPropertiesList)
//MultilingualString tableName = createMultilingualString(regionPropertiesList, "NewTable" + System.currentTimeMillis());
MultilingualString tableName = createMultilingualString(regionPropertiesList, "first"+System.currentTimeMillis());
System.out.println("table is" +tableName);
TableProperties table = new TableProperties(TableProperties.FLAT);
table.setName(tableName);
table.setCode("NewCode" + System.currentTimeMillis());
table.setKeyMappable(true);
table.setDescription("");
return table;
public static void main(String[] args) {
// System Name
String tag = "";
ConnectionPool connections = null;
try {
connections = ConnectionPoolFactory.getInstance(tag);
catch (ConnectionException e)
e.printStackTrace();
return;
//////////////// specify the repository to use
//RepositoryName
String repositoryName = "";
//DataBase Name
String dbmsName = "";
RepositoryIdentifier reposId = new RepositoryIdentifier(repositoryName, dbmsName, DBMSType.MS_SQL);
/////// create a repository session
CreateRepositorySessionCommand sessionCommand = new CreateRepositorySessionCommand(connections);
sessionCommand.setRepositoryIdentifier(reposId);
try {
sessionCommand.execute();
catch (CommandException e) {
e.printStackTrace();
return;
System.out.println("Currently connected to "+reposId);
String sessionId = sessionCommand.getRepositorySession();
/////////// authenticate the repository session
String userName = "";
String userPassword = "";
AuthenticateRepositorySessionCommand authCommand = new AuthenticateRepositorySessionCommand(connections);
authCommand.setSession(sessionId);
authCommand.setUserName(userName);
authCommand.setUserPassword(userPassword);
try {
authCommand.execute();
catch (CommandException e) {
e.printStackTrace();
return;
//////////////////// retrieve the list of tables
GetTableListCommand tableListCommand = new GetTableListCommand(connections);
tableListCommand.setSession(sessionId);
try {
tableListCommand.execute();
catch (CommandException e) {
e.printStackTrace();
return;
// get change stamp
// this is required when we make any kind of changes to the repository
int changeStamp = tableListCommand.getChangeStamp();
//////get repository regionlist
//A command for retrieving the list of regions supported by the repository.
// retrieve the available regions (languages) for the repository
// we need this to set up the table name for each region
GetRepositoryRegionListCommand gm = new GetRepositoryRegionListCommand(connections);
gm.setRepositoryIdentifier(reposId);
try {
gm.execute();
catch (CommandException e) {
e.printStackTrace();
return;
// RegionProperties[] rs = gm.getRegions();
RegionProperties[] regionPropertiesList = gm.getRegions();
TableProperties newtable = createFlatTable(regionPropertiesList);
CreateTableCommand c = new CreateTableCommand (connections);
c.setSession(sessionId);
c.setTable(newtable);
c.setInChangeStamp(changeStamp);
try {
c.execute();
System.out.println("sdf");
catch (CommandException e) {
e.printStackTrace();
return; -
Capacity Planning for Creation of Table
Hello Guys,
I just need some advise here.
I have been told to work out the space needed for the creation of a table.
The table in question would have three columns with datatypes [num(10), varchar(10),date] and would be loaded with 100,000 rows. How do I go about it.
Thanks in AdvanceTry with something like this, may help you.
Prerreqs: parameter OPTIMIZER_MODE != RULE.
grant to execute DBMS_SPACE
DDL Table creation:
CREATE TABLE SAMPLE
ID NUMBER(9),
NAME VARCHAR(50),
CREATE_DATE_TIME DATE,
MOD_DATE_TIME DATE,
USER_ID VARCHAR(15)
set serveroutput on
declare
calc_used_bytes NUMBER;
calc_alloc_bytes NUMBER;
cols sys.create_table_cost_columns;
begin
cols := sys.create_table_cost_columns
sys.create_table_cost_colinfo('NUMBER', 9),
sys.create_table_cost_colinfo('VARCHAR2', 50),
sys.create_table_cost_colinfo('VARCHAR2', 15),
sys.create_table_cost_colinfo('DATE', NULL),
sys.create_table_cost_colinfo('DATE', NULL)
DBMS_SPACE.CREATE_TABLE_COST (
tablespace_name => 'USERS',
--avg_row_size => 100, quitar comentario para 11g
row_count => 5000,
pct_free => 10,
used_bytes => calc_used_bytes,
alloc_bytes => calc_alloc_bytes
dbms_output.put_line('Used (M): '||round(calc_used_bytes/(1024*1024)));
dbms_output.put_line('Allocated (M): '||round(calc_alloc_bytes/(1024*1024)));
end;
/More info: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_space.htm#i1003180
Regards.
johnxjean
Edited by: johnxjean on 18-Mar-2011 09:43
Edited by: johnxjean on 18-Mar-2011 09:44 -
Creation of table in interactive form
hai,
any one can explain me the creation of table in interactive forms transcation code(sfp)
or any can send any material because i am new to this, how to build interactive forms
advance thanks.
regards,
shravanramidi .Hi,
TRy https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cacb9a7d-0c01-0010-1281-be4962c9ab3e
Regards,
Shiva Kumar(Reward if helpful). -
Obsolete tables in ECC6.0
Hi All,
Please let us know the list of obsolete tables in ECC6.0 (after an upgrade from 4.6c).
We already have TVARV & BP000 in our list.
Thanks & Regards
AnjaliHi Anjali,
Check below thread:
Obsolete Keywords from SAP version 4.6C to ECC 6.0
Thanks
Sunny -
Significance of Initial (intial_extent)parameter while creation of table
Hi All,
I am designing a new schema for my 10g database and I am in process of creation of tablespaces and tables.
My Tablespace are extent management local autoallocate and auto segment space management.
With “segment space management Auto”, I understand that I don’t have to define storage clause in tablespace and freelist will be taken care by bitmap
My question is
while creation of tables what’s the significance of Intial (intial_extent in user_tables) parameter.?
Do I need to consider this parameter while defining large and small tables?
Is this not controlled by “auto segment space management.” Parameter of tablespace.?While it is unlikely to make a measurable impact on anything in practice, it is almost always preferable in theory, assuming perfect knowledge of the system, to have a few different tablespaces with different uniform extent sizes and to put each object in the appropriate tablespace for its size (i.e. giant tables in the tablespace with giant extent sizes, tiny tables in the tablespace with tiny extent sizes, etc.). The problem with this, however, is that you very rarely have perfect knowledge in advance about object sizes and growth and size patterns are likely to evolve over the life of the system, so you can suck up a great deal of DBA and developer time gathering and maintaining this sort of information as well as responding to changes over time (i.e. moving objects from one tablespace to another as their usage patterns change). For most systems, the potential benefit to having a perfect setup, rather than putting everything in an AUTOALLOCATE tablespace, is far smaller than the cost of actually doing so.
Unless you have some reason to believe that your application is in the minority where squeezing the last bit of storage efficiency is worth the hassle, I'd tend to suggest throwing everything in an AUTOALLOCATE tablespace.
Justin -
Good morning.
In oracle 10g is necessary specify clause storage in creation of tables??
thanks
Mauricio Briñes.Nope, it's not required.
scott@db> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for Solaris: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Elapsed: 00:00:00.00
scott@db> create table sun_test
2 ( a number);
Table created. -
DataSource for FAGLFLEXT and BSEG, or New Table in ECC6?
need to create an extractor to have all the information of FAGLFLEXT, because we need to keep the ledger information and the split of the information. However, we need to add 13 fields contained in BSEG.
Therefore we thought to reads the line items table FAGLFLEXA, and then enhace it throught BSEG table.
However, since we are using ECC6 and BI7. It is not support the creation of DataSources for FAGLFLEXA throught FAGLBW03.
Is it an option to incorporate all fields into FAGLFLEXT.
Can we creat a new table group based on FAGLFLEXT, and then adding the coding block extensions to that table -
how does new g/l and the new table group work in parallel? Which is the procedure to do it?
Documentation says we can create a new table group based on FAGLFLEXT --- its the how does it work in conjuction part...for example...the new g/l handles document splitting and one other thing georg referenced last night...will the split documents go into our new table group?
BSEG does not have the document splitter information that we need (it's incomplete data). It's missing profit centers on many items, it's missing the proper split of transactions.
Thanks for your comments.Here is more information about this post.
Client situation: Our client is implementing ECC 6 and is using the "New-GL" features. Because of business requirements, the coding block has been extended (not insignificantly - 18 extra fields at the moment) to accommodate legal, regulatory and management reporting. The reporting solution includes standard ECC reporting (e.g. report writer, report painter reports) as well as feeds to BW (BI 7).
The Challenge: Our understanding is that adding all of the coding block extensions to the New-GL tables (ie. FAGLFLEXA and FAGLFLEXT) may lead to performance degradation in the ECC system. However, we still need to accommodate the requirement to report by the additional dimensions that are not currently included in the New-GL, so our challenge has been to find a solution that minimizes performance issues, while still allowing us to have all the necessary dimensions with which to do the required reporting.
What we would like to know: How have you handled this in similar situations?
Have you added to the New-GL tables? How many fields? Performance issues encountered?
Have you created additional table group(s) based on the New-GL and then modified that structure to have the new fields? How does the additional table group work co-incident with New-GL (e.g. does the additional table group receive document splitting information?)?
Have you created custom extractors for BW? On what basis (we understand that FAGFLEXA cannot be created as a datasource to feed BW)? -
Need Notification on creation of table
Hi,
I am looking for notification as soon a table is created in a document to perform some actions on it.
I tried looking for Responder service but there is no such service available for table creation.
Can some one suggest a way for the same? If I have to use Observer then which boss class shall I use for it and what should be the subject.One approach is via CTextCommandPreProcess::InsertPreProcess(), see whether the inserted char has a table bound to it.
Note that is pretty early, e.g. at that point table attributes haven't been applied.
Later on the kTextStoryBoss subject notifies with change kTableModelBoss, protocol IID_IPRENOTIFYTABLESTRUCTURECHANGE.
This change is also seen on the kDocBoss subject so you can use a document observer.
The void* data appears to be your table's IID_ITABLELAYOUT.
The last change that I've seen with a simple table is the table style (2nd time during the bracketing kNewTableCmdBoss):
subject kDocWorkspaceBoss, change kApplyTableStyleCmdBoss, protocol IID_ITABLEMODEL given the command. -
Hi,
While creation of a Z table in Development Server, it is giving compilation error that 'You donot have permission to create a table'.
How to overcomethis problem?
Can anyone give the solution for it?
thanks
RevanthHello,
Sure, talk to your basis team, they´ll give you the rigth permissions.
Bye
Gabriel -
Creation of table of table dynamically
Hi everyone,
i have created an alv grid with a dynamic number of columns. Now i need to edit specific rows in the alv table. In the BCALV_EDIT_02 you need to create in the data table a field CELLTAB (wich is also a table), how can i do this ?
XavierHello Frederico
The once again revised version of my sample report demonstrates how to store PBO and PAI data. Please note the following naming convention:
- OUTTAB ==> itab for ALV list display with CELLTAB (i.e. a complex type)
- ITAB ==> flat itab without CELLTAB
*& Report ZUS_SDN_RTTI_CREATE_STRUCTUR_2
*& NOTE: 1st revised version of ZUS_SDN_RTTI_CREATE_STRUCTUR_1
REPORT zus_sdn_rtti_create_structur_2.
TYPE-POOLS: abap.
DATA:
celltab TYPE lvc_t_styl.
DATA:
gd_tabnam TYPE string,
gd_tabfield TYPE string,
go_table TYPE REF TO cl_salv_table,
go_sdescr TYPE REF TO cl_abap_structdescr,
go_sdescr_new TYPE REF TO cl_abap_structdescr,
go_tdescr TYPE REF TO cl_abap_tabledescr,
go_typedescr TYPE REF TO cl_abap_typedescr,
gdo_data TYPE REF TO data,
gdo_handle TYPE REF TO data,
gs_component TYPE abap_compdescr,
gs_comp TYPE abap_componentdescr,
gt_components TYPE abap_component_tab.
* name TYPE string,
* type TYPE REF TO cl_abap_datadescr,
* as_include TYPE abap_bool,
* suffix TYPE string,
FIELD-SYMBOLS:
<gd_fld> TYPE ANY, " single field
<gs_outtab> TYPE ANY, " structure with CELLTAB
<gs_itab> TYPE ANY, " structure without CELLTAB
<gt_itab_pbo> TYPE STANDARD TABLE, " without CELLTAB
<gt_itab_pai> TYPE STANDARD TABLE, " without CELLTAB
<gt_outtab_pbo> TYPE STANDARD TABLE, " with CELLTAB
<gt_outtab_pai> TYPE STANDARD TABLE. " with CELLTAB
PARAMETER:
p_tabnam TYPE tabname DEFAULT 'KNB1'.
PARAMETERS:
p_skip AS CHECKBOX DEFAULT 'X'. " skip simulation
START-OF-SELECTION.
" Describe structure
go_sdescr ?= cl_abap_structdescr=>describe_by_name( p_tabnam ).
gd_tabnam = go_sdescr->get_relative_name( ).
* Simulate dynamic addition of columns to ALV list
DO 5 TIMES.
READ TABLE go_sdescr->components INTO gs_component INDEX syst-index.
" Build fieldname
CONCATENATE gd_tabnam gs_component-name INTO gd_tabfield
SEPARATED BY '-'.
CLEAR: gs_comp.
gs_comp-type ?= cl_abap_datadescr=>describe_by_name( gd_tabfield ).
gs_comp-name = gs_component-name.
APPEND gs_comp TO gt_components.
go_sdescr_new = cl_abap_structdescr=>create( gt_components ).
go_tdescr = cl_abap_tabledescr=>create( go_sdescr_new ).
" Create data refence followed by table creation
CREATE DATA gdo_handle TYPE HANDLE go_tdescr.
ASSIGN gdo_handle->* TO <gt_outtab_pbo>.
* Dynamic select
SELECT * FROM (p_tabnam) UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE <gt_outtab_pbo>
WHERE bukrs = '2000'.
IF ( p_skip = abap_false ).
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = go_table
CHANGING
t_table = <gt_outtab_pbo>.
go_table->display( ).
CATCH cx_salv_msg .
ENDTRY.
ENDIF.
ENDDO.
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = go_table
CHANGING
t_table = <gt_outtab_pbo>.
go_table->display( ).
CATCH cx_salv_msg .
ENDTRY.
" Display component list in order to prove that indeed the field names
" are used (instead of the data element names)
TRY.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = go_table
CHANGING
t_table = gt_components.
go_table->display( ).
CATCH cx_salv_msg .
ENDTRY.
" Create data reference for structure (without CELLTAB)!!!
CREATE DATA gdo_handle TYPE HANDLE go_sdescr_new.
REFRESH: gt_components.
CLEAR: gs_comp.
gs_comp-type ?=
cl_abap_structdescr=>describe_by_data_ref( gdo_handle ).
gs_comp-name = 'DATA'.
gs_comp-as_include = abap_true.
APPEND gs_comp TO gt_components.
" Add table type as field to structure ==> complex structure
CLEAR: gs_comp.
gs_comp-type ?= cl_abap_typedescr=>describe_by_data( celltab ).
gs_comp-name = 'CELLTAB'.
APPEND gs_comp TO gt_components.
go_sdescr = cl_abap_structdescr=>create( gt_components ).
go_tdescr = cl_abap_tabledescr=>create( go_sdescr ).
CREATE DATA gdo_handle TYPE HANDLE go_tdescr.
ASSIGN gdo_handle->* TO <gt_outtab_pbo>.
* Dynamic select
SELECT * FROM (p_tabnam) UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE <gt_outtab_pbo>
WHERE bukrs = '2000'.
PERFORM fill_celltab.
" Create second itab (PAI data)
CREATE DATA gdo_handle TYPE HANDLE go_tdescr.
ASSIGN gdo_handle->* TO <gt_outtab_pai>.
<gt_outtab_pai> = <gt_outtab_pbo>. " PAI data = PBO data
" Renumbering of customer makes it easier to spot the differences
LOOP AT <gt_outtab_pai> ASSIGNING <gs_outtab>.
ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <gs_outtab> TO <gd_fld>.
<gd_fld> = syst-tabix. " new numbering of customers
ENDLOOP.
LOOP AT <gt_outtab_pbo> ASSIGNING <gs_outtab>.
ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <gs_outtab> TO <gd_fld>.
<gd_fld> = syst-tabix. " new numbering of customers
ENDLOOP.
DELETE <gt_outtab_pbo> INDEX 3. " ==> 3rd row in PAI data is new
DELETE <gt_outtab_pai> INDEX 7. " ==> 7th row in PBO data is DELE
" Shuffle data from outtab to corresponding itab (w/o CELLTAB)
PERFORM shuffle_outtab_to_itab.
" List output
PERFORM write_list.
EXIT.
" Simplified version of table creation:
CLEAR: gdo_data.
UNASSIGN <gt_outtab_pbo>.
CREATE DATA gdo_data TYPE STANDARD TABLE OF (p_tabnam).
ASSIGN gdo_data->* TO <gt_outtab_pbo>.
END-OF-SELECTION.
*& Form FILL_CELLTAB
* text
* --> p1 text
* <-- p2 text
FORM fill_celltab .
* define local data
DATA:
ls_cell TYPE lvc_s_styl,
lt_celltab TYPE lvc_t_styl.
FIELD-SYMBOLS:
<gs_struc> TYPE ANY,
<lt_celltab> TYPE lvc_t_styl.
" Create dummy entry for local CELLTAB
ls_cell-fieldname = 'BUKRS'.
ls_cell-style = cl_gui_alv_grid=>mc_style_enabled.
INSERT ls_cell INTO TABLE lt_celltab.
LOOP AT <gt_outtab_pbo> ASSIGNING <gs_struc>.
ASSIGN COMPONENT 'CELLTAB' OF STRUCTURE <gs_struc> TO <lt_celltab>.
<lt_celltab> = lt_celltab.
" No MODIFY required because we are working with the field symbol
ENDLOOP.
ENDFORM. " FILL_CELLTAB
*& Form SHUFFLE_OUTTAB_TO_ITAB
* text
* --> p1 text
* <-- p2 text
FORM shuffle_outtab_to_itab .
go_tdescr = cl_abap_tabledescr=>create( go_sdescr_new ).
CREATE DATA gdo_handle TYPE HANDLE go_tdescr.
ASSIGN gdo_handle->* TO <gt_itab_pbo>.
go_tdescr = cl_abap_tabledescr=>create( go_sdescr_new ).
CREATE DATA gdo_handle TYPE HANDLE go_tdescr.
ASSIGN gdo_handle->* TO <gt_itab_pai>.
LOOP AT <gt_outtab_pbo> ASSIGNING <gs_outtab>.
ASSIGN COMPONENT 'DATA' OF STRUCTURE <gs_outtab> TO <gs_itab>.
APPEND <gs_itab> TO <gt_itab_pbo>.
ENDLOOP.
LOOP AT <gt_outtab_pai> ASSIGNING <gs_outtab>.
ASSIGN COMPONENT 'DATA' OF STRUCTURE <gs_outtab> TO <gs_itab>.
APPEND <gs_itab> TO <gt_itab_pai>.
ENDLOOP.
ENDFORM. " SHUFFLE_OUTTAB_TO_ITAB
*& Form WRITE_LIST
* text
* --> p1 text
* <-- p2 text
FORM write_list .
WRITE: / 'PBO data:'.
LOOP AT <gt_itab_pbo> ASSIGNING <gs_itab>.
WRITE: / 'Record No.=', syst-tabix, '==>'.
DO.
ASSIGN COMPONENT syst-index OF STRUCTURE <gs_itab> TO <gd_fld>.
IF ( syst-subrc NE 0 ).
EXIT.
ENDIF.
WRITE: <gd_fld>.
ENDDO.
ENDLOOP.
SKIP 2.
WRITE: / 'PAI data:'.
LOOP AT <gt_itab_pai> ASSIGNING <gs_itab>.
WRITE: / 'Record No.=', syst-tabix, '==>'.
DO.
ASSIGN COMPONENT syst-index OF STRUCTURE <gs_itab> TO <gd_fld>.
IF ( syst-subrc NE 0 ).
EXIT.
ENDIF.
WRITE: <gd_fld>.
ENDDO.
ENDLOOP.
ENDFORM. " WRITE_LIST
Finally, if you want to know the <i>differences </i>between PAI and PBO data, that is which records have been deleted, updated or inserted have a look at my code sample
<a href="https://wiki.sdn.sap.com/wiki/display/Snippets/ComparingTwoInternalTables-AGeneric+Approach">Comparing Two Internal Tables - A Generic Approach</a>
Regards
Uwe -
How to maintain data in tables using maintenace view of the tables in ECC6
Hi,
I have two table SBUSPART (Business partner) and STRAVELAG (Travel agency).
SBUSPART is foreign key table while STRAVELAGE is a reference table. The relationships is :
SBUSPART-MANDANT = STRAVELAGE-CLIENT
SBUSPART-BUSPARTNUM = STRAVELAGE-AGENCYNUM
now, I create a maintenance view ZVI_HT_PARTNER in which SBUSPART is primary table and STRAVELAGE is secondary table. I have also created maintenace interfaces by generating maintenance modules in function group zht_fg. Authorization group is SUNI and maintenance type is one-step, the number maintenace screen is 100.
Now I want to maintain the data in tables SBUSPART and STRAVELAGE together in the maintenace view. If i want to enter a new partner dirctly I have to enter it in table SBUSPART first, only then could I enter the corresponding data in STRAVELAGE.
in older version I easyly do this by the way: in maintenace screen of zvi_ht_partner ( in se11) I choose: system/ services/table maintenace/Enhance.Tab.maintain.
but in ECC6 when I choose: system/ services/table maintenace, there is no Enhance.Tab.maintain instead there are two options Extended table maintenace and View cluster maintenace.
So in this case I don't know how to tackle this problem, Please help me if you have a solution.
Thanks,Hi,
I suppose 'Extended table maintenace ' would be same as 'Enhance.Tab.maintain'.
Regards,
Himanshu
Maybe you are looking for
-
My Apple ID has been disabled; How do I get it back?
I feel like "Peggy" on the Visa commercial when I called help support at Apple. I dont know if it happened during the "iCloud" movement...but I got an automated email stating that I have purchased something and it is awaiting to be downloaded...I ch
-
Hi, I am working in oracle9i and solaris 8.If i execute a package in Pl/sql it shows error as ora-03113 end-of-file on communication channel... but the same package if i executed in TOAD means it's working fine .... Please explain me...
-
Hi all, I am working on SOAP sychronous scenario.i.e ,Web services(Axis) to SAP R/3 system and i want the response from SAP R/3 system and it is to be displayed in web client. In this scenario I am able to send the SOAP message to SAP R/3 system thro
-
Getting message failed to load the following objects when opening any fmb
hi all, when ever i try to open any fmb to do some work i am getting the message unable to load the following objects and it gives the name like template.fmb................. on pressing ok i get another message unable to attach the following librari
-
Hi Folks, When creating a PO in ME21N, where is the line of code that tells the program to display the import tab? I know the business reason for this is when the Company code is in one EU country and the Vendor is in another EU country it displays t