Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to create a transparent table(z table) dynamically

Former Member
0 Kudos
4,259

Hi,

Can anyone explain me how to create a transparent table(z table) dynamically in the program.

Any function module or suggestions welcome.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
1,052

Hi,

TO create a ZTABLE, The steps are as follows:

1.Go to SE11 Transaction.

2.Give Table name starts with Z or Y letter -->click create.

3.Give short description & Delivery class as "A", & Data Browser as "Display/Maintenace Allowed".

4.Click Field tab,give MANDT in field & Data element, click primary key check box & initial values and give Enter on dataelement.

5. Give field name which u want, this s primary key field. so click key check box & initial values, give data element name starts with Z or Y double click on that data element,popwindow wil come, in that click yes, give ur package name>save, it wil ask to create data element, so click yes.Then give short description, in Data type tab click we can choose either Domain or Buil-in type.If u want domain,select domain give any name starts with Z or Y, double click on that>yes >Save.It wil ask to Create domain>yes. Give short desc, give required data type, No.Chars & Output length -->Save --> Activate.

Note: We can use old domain values or we can create new domains.

6. In data element page, click Field label tab. Give short, medium, Long & Heading values >save>Activate.

7.Go to main table page, Give other fields which u want, here no need to give primary key. Do the same steps as told previously.

7.Go to Technical Setting at the top of the page.Give the Data class "APPL0". Select Size category as 0 or anything which u want -->click Save button --> Go back.

8.Activate the main table -->Save.

9.Go to Utilities -->Table contents --> Create Entries. Then Create the Records.

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb6e446011d189700000e8322d00/frameset.htm

Regards

2 REPLIES 2

Former Member
0 Kudos
1,053

Hi,

TO create a ZTABLE, The steps are as follows:

1.Go to SE11 Transaction.

2.Give Table name starts with Z or Y letter -->click create.

3.Give short description & Delivery class as "A", & Data Browser as "Display/Maintenace Allowed".

4.Click Field tab,give MANDT in field & Data element, click primary key check box & initial values and give Enter on dataelement.

5. Give field name which u want, this s primary key field. so click key check box & initial values, give data element name starts with Z or Y double click on that data element,popwindow wil come, in that click yes, give ur package name>save, it wil ask to create data element, so click yes.Then give short description, in Data type tab click we can choose either Domain or Buil-in type.If u want domain,select domain give any name starts with Z or Y, double click on that>yes >Save.It wil ask to Create domain>yes. Give short desc, give required data type, No.Chars & Output length -->Save --> Activate.

Note: We can use old domain values or we can create new domains.

6. In data element page, click Field label tab. Give short, medium, Long & Heading values >save>Activate.

7.Go to main table page, Give other fields which u want, here no need to give primary key. Do the same steps as told previously.

7.Go to Technical Setting at the top of the page.Give the Data class "APPL0". Select Size category as 0 or anything which u want -->click Save button --> Go back.

8.Activate the main table -->Save.

9.Go to Utilities -->Table contents --> Create Entries. Then Create the Records.

http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eb6e446011d189700000e8322d00/frameset.htm

Regards

Former Member
0 Kudos
1,052

Hi Mithun

we will not create transparent table in the program . you could do it by using native SQL in the ABAP Program . the sample is show in below .

This is a sample that show how to connect to Database directly and can use the native SQL to select , create or delete table.

PARAMETERS dbs TYPE dbcon-con_name default 'SDB'.

DATA carrid_wa TYPE scarr-carrid.

DATA lv_int TYPE i.

*Types

data: begin of ty_equi,

equipment(25) type c,

SERIALENERGY(25) type c,

end of ty_equi.

*Internal Tables

data it_equi like table of ty_equi.

data wa_equi like line of it_equi.

DATA dbtype TYPE dbcon_dbms.

SELECT SINGLE dbms

FROM dbcon

INTO dbtype

WHERE con_name = dbs.

IF dbtype = 'ORA'.

TRY.

EXEC SQL.

CONNECT TO :dbs

ENDEXEC.

IF sy-subrc <> 0.

RAISE EXCEPTION TYPE cx_sy_native_sql_error.

ENDIF.

EXEC SQL.

OPEN dbcur FOR

SELECT

EQUIPMENT,

SERIALENERGY

FROM emd.meter

ENDEXEC.

DO.

EXEC SQL.

FETCH NEXT dbcur INTO :wa_EQUI

ENDEXEC.

IF sy-subrc <> 0.

EXIT.

ELSE.

WRITE: /

wa_equi-equipment,

wa_equi-SERIALENERGY.

ENDIF.

ENDDO.

EXEC SQL.

CLOSE dbcur

ENDEXEC.

EXEC SQL.

DISCONNECT :dbs

ENDEXEC.

CATCH cx_sy_native_sql_error.

MESSAGE `Error in Native SQL.` TYPE 'I'.

ENDTRY.

ENDIF.

Regards

Wiboon