Application Development and Automation 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: 
Read only

create a table with structure

Former Member
0 Likes
873

hi all

how to create a table with the following fields.

they are requesting to create text occurs 3.

How to create a table like this .

Specification

Harmonisation

Derogation Y/N

Derogation date from date

Derogation date to date

Derogation Text X(80) occurs 3

Address

Extra address text X(80) occurs 3

Label validation Y/N

Regards,

Madhavi

7 REPLIES 7
Read only

Former Member
0 Likes
832

hi all

how to create a table with the following fields.

they are requesting to create text occurs 3.

How to create a table like this .

Specification

Harmonisation

Derogation Y/N

Derogation date from date

Derogation date to date

Derogation Text X(80) occurs 3

Address

Extra address text X(80) occurs 3

Label validation Y/N

Regards,

Madhavi

Hi Dear,

What I understand by the Specs is :

Field 1 :

Read only

0 Likes
832

Hi all,

how to create a table with the following fields.

they are requesting to create text occurs 3.

How to create a table like this ( with the following fields)

fSpecification

Harmonisation

Derogation Y/N

Derogation date from date

Derogation date to date

Derogation Text X(80) occurs 3

Address

Extra address text X(80) occurs 3

Label validation Y/N

Regards,

Madhavi

Read only

0 Likes
832

Hi Madavi

Go To se11.

Specify the table name.

And create the following fields with specified length or by creating data element.

And for Derogation Text X(80) occurs 3 field create a data element with character type (Length = 80)

mention the fields as Derogation Text1, Derogation Text2, Derogation Text3 with the same data element.

and do the same for Extra address text X(80) occurs 3.

Reward points if you find it helpful.

Regards,

Prasanna

Read only

0 Likes
832

Hi Dear,

What I understand by the Specs is :

Fields Field Name            Type           Length
 1     : Harmonisation         C              1
 2     : Derogation            C              1
 3     : From Date             D              8
 4     : To Date               D              8
 5     : Derog. Text       Structure       [ ][ ][ ][][]
   5.1: X                      C             80
 6     : Address               C             80
 7     : Extra address     Structure       [ ][ ][ ][][] 
   7.1: X                      C             80
 8     : Label validation      C             1

So you need to declare two structures first and then include them in the Table declaration.....

  • Note: Table Declaration using 'Occurs n' is an obsolete statement, so please avoid it using.

As follows in the code...

* Structure type Declaration for Derogation Text X(80).

TYPES:
            BEGIN OF derogation_text,
                X(80),
            END OF derogation_text.

TYPES:
            fs_derogation_text TYPE 
                    STANDARD TABLE 
                                 OF derogation_text
                           INITIAL LINE SIZE 3.

* Structure type Extra Address for Extra Address X(80).

TYPES:
            BEGIN OF extra_address,
                X(80),
            END OF extra_address.

TYPES:
           fs_extra_address TYPE
                 STANDARD TABLE
                              OF extra_address
                        INITIAL LINE SIZE 3.

* Structure Type of the Main Table according to requirement.

TYPES:
            BEGIN OF type_table,
               Harmonisation TYPE C,
               Derogation       TYPE C,
               From_Date       TYPE D,
               To_Date           TYPE D,
               der_text           TYPE fs_derogation_text,
               Address(80)     TYPE C,
               extra_address  TYPE fs_extra_address, 
               Label_validation TYPE C,
           END OF type_table.        

DATA:
        itab TYPE type_table. 

INITIAL LINE SIZE n is the replacement for Occurs n.

If you use Occurs n statement in ABAP OBJECTS, it throws an error.......

So please dont use obsolete statements in you report programs.....

Thank you,

Inspire me more if this is needful,

Warm Regards,

Abhi

Read only

0 Likes
832

Hi all,

I need to create a table in Dictionary

How i can declare the structure in table with like this.

Your code is ok with report and how can we create in Dictionary.

Read only

Former Member
0 Likes
832

First method:

first create the structue in the dictonary( T-code Se11 ) with the those fields mentined.

then again go to dictionary and create one table in that table include this structure ,

jus chek the table MARA and see how the structure EMARA is included.

Second method:

Create a table first in the dictionary , in the application tool bar of the table you can find

APPEND STRUCTURE , click that it will ask for a structure name give the name of that structure

and give the field names and the there techincal as well as symantic attributes.

then you will get a table as required

Read only

Former Member
0 Likes
832

thanks