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: 

Regarding GET

Former Member
0 Kudos

Hi Experts,

i want to know about GET command and criteria where it is used?

Thanks

7 REPLIES 7

Former Member

Former Member
0 Kudos

Hi,

It is used in Logical data abses (LDB's)

define and attach the required LDB in the program attributes then in the code startof selection event you can write the command GET

GET KNA1.

it is similar to select * from KNA1.

It will fetch all records from KNA1 table

You can also use

GET KNB1 LATE...

see the doc on LDB's

A logical database is a special ABAP/4 program which combines the contents of certain database tables. You can link a logical database to an ABAP/4 report program as an attribute. The logical database then supplies the report program with a set of hierarchically structured table lines which can be taken from different database tables.

LDB offers an easy-to-use selection screens. You can modify the pre-generated selection screen to your needs. It offers check functions to check whether user input is complete, correct, and plausible. It offers reasonable data selections. It contains central authorization checks for data base accesses. Enhancements such as improved performance immediately apply to all report programs that use the logical database.

Less coding s required to retrieve data compared to normal internel tables.

Tables used LDB are in hierarchial structure.

Mainly we used LDBs in HR Abap Programming.

Where all tables are highly inter related so LDBs can optimize the performance there.

Check this Document. All abt LDB's

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=...

GO THROUGH LINKS -

http://www.sap-basis-abap.com/saptab.htm

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9bfa35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.htm

/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases

www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_Logical_Database_FAQ.html

www.sap-img.com/abap/abap-interview-question.htm

www.sap-img.com/abap/quick-note-on-design-of-secondary-database-indexes-and-logical-databases.htm

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9bb935c111d1829f0000e829fbfe/content.htm

Gothru the blog which provides info on LDB's:

/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases

Regards,

Sankar

Former Member
0 Kudos

Hi

GET and GET LATE commands are used in the Logical database Programming.

GET is similar to select statement in normal ABAP programing

to get the data from KNA1 table we write SELECT * FROM KNA! .. this is similar to writing

GET KNA1. or

GET PERNR.

<b>Reward points for useful Answers</b>

Regards

Anji

former_member188827
Active Contributor
0 Kudos

write GET in editor and take F1.u'll get its documentation with examples.

rgds..

reward points if it helps

Former Member
0 Kudos

GET PARAMETER ID <key> FIELD f.

with this command u will get the value store in memory with key <key>

to variable/field f.

Reward if useful

ashish_gupta11
Explorer
0 Kudos

Hi Experts ,

Use the GET RUN TIME command to help evaluate performance. It's hard to know whether that optimization technique REALLY helps unless you test it out. Using this tool can help you know what is effective, under what kinds of conditions. The GET RUN TIME has problems under multiple CPUs, so you should use it to test small pieces of your program, rather than the whole program

Thanks

Ashish

Former Member
0 Kudos

Basic form 1

GET dbtab.

Additions

1. ... LATE

2. ... FIELDS f1 ... fn

Effect

Processing event.

Gets the table dbtab for processing while the logical database is running. You can address all the fields from dbtab in the subsequent processing. You can also refer to fields from tables in the logical database on the access path to the table dbtab .

Note

You can use the event " GET dbtab. " only once in the report.

Example

The program uses the logical database F1S which has a structure where the table BOOKING appears below the table FLIGHT .

TABLES: SFLIGHT, SBOOK.

GET SFLIGHT.

WRITE: SFLIGHT-CARRID,

SFLIGHT-CONNID,

SLFIGHT-FLDATE,

SFLIGHT-PLANETYPE.

GET SBOOK.

WRITE: SBOOK-BOOKID,

SBOOK-CUSTOMID,

SBOOK-ORDER_DATE.

Addition 1

... LATE.

Effect

Executes the code following " GET dbtab LATE. " only when all the subordinate tables have been read and processed.

Example

Count the smokers among the bookings already made.

TABLES: SFLIGHT, SBOOK.

DATA SMOKERS TYPE I.

GET SFLIGHT.

ULINE.

WRITE: / SFLIGHT-SEATSMAX,

SFLIGHT-SEATSOCC.

SMOKERS = 0.

GET SBOOK.

CHECK SBOOK-SMOKER <> SPACE.

ADD 1 TO SMOKERS.

GET FLIGHT LATE.

WRITE SMOKERS.

Addition 2

... FIELDS f1 ... fn

Effect

Performance option. Addresses only the fields f1, ..., fn of the tabelle dbtab (also possible with a dynamic ASSIGN ). Since only these fields have to be assigned values by the logical database, this can improve performance considerably.

Notes

The addition (for GET dbtab or GET dbtab LATE ) is allowed only for tables intended for field selection by the logical database (SELECTION-SCREEN FIELD SELECTION FOR TABLE dbtab ).

When executing the events GET dbtab , GET dbtab LATE or GET dbtab_2 for a subordinate table dbtab_2 in the database hierarchy, the contents of all all fields of dbtab apart from f1, ..., fn are undefined.

If both GET dbtab FIELDS f1 ...fn and GET dbtab LATE FIELDS g1 ...gm occur in the program, values are assigned to all the fields f1, ..., fn, g1, ..., gm .

In addition to the specified fields, values are also assigned to the key fields of dbtab .

If you use the FIELDS addition, you access only the specified fields. Any external PERFORM calls should be taken into account here.

A special rule applies for tables which are intended for field selection by the logical database, for which neither a GET dbtab nor a GET dbtab LATE event exists in the program, yet for which there is a subordinate table dbtab_2 with GET dbtab_2 or GET dbtab_2 LATE in the program.

If the table is declared with TABLES dbtab in the program, the work area of dbtab exists for GET dbtab_2 or GET dbtab_2 LATE and is can therfore receive values. Also, if a restricted field selection is sufficient for dbtab , you can achieve this with a GET dbtab FIELDS f1 ... fn statement (without subsequent processing).

If the program contains no TABLES dbtab statement, the system assumes no access to the work area of dbtab . In this case, therefore, only the key fields of dbatab are assigned values. If, however, you want to fill the work area of dbtab completely (e.g. for an external PERFORM call), you must include the TABLES dbtab statement in the program.

The field lists are made available to the report and the logical database in an internal table SELECT_FIELDS .

The exact definition of the object SELECT_FIELDS is stored in the TYPE-POOL RSFS and reads:

TYPES: BEGIN OF RSFS_TAB_FIELDS,

TABLENAME LIKE RSDSTABS-PRIM_TAB,

FIELDS LIKE RSFS_STRUC OCCURS 10,

END OF RSFS_TAB_FIELDS.

...

TYPES: RSFS_FIELDS TYPE RSFS_TAB_FIELDS OCCURS 10.

DATA SELECT_FIELDS TYPE RSFS_FIELDS.

SELECT_FIELDS is thus an internal table. Each line of this internal table contains a table name ( TABLENAME ) and another internal table ( FIELDS ) which contains the desired table fields ( TABLENAME ).

Neither the TYPE-POOL RSFS nor the declaration of SELECT_FIELDS have to be in the report. Both are automatically included by the system, if required. If, for some reason, you need to assign values to more fields, you can manipulate this table under INITIALIZATION or START-OF-SELECTION .

Examples

Specify the necessary fields under GET . Both SFLIGHT and SBOOK must be defined for field selection.

TABLES: SFLIGHT, SBOOK.

GET SFLIGHT FIELDS CARRID CONNID FLDATE PLANETYPE.

WRITE: SFLIGHT-CARRID,

SFLIGHT-CONNID,

SFLIGHT-FLDATE,

SFLIGHT-PLANETYPE.

GET SBOOK FIELDS BOOKID CUSTOMID ORDER_DATE.

WRITE: SBOOK-BOOKID,

SBOOK-CUSTOMID,

SBOOK-ORDER_DATE.

In the above 'smoker' example, you can also specify the required SFLIGHT fields under 'GET SFLIGHT LATE':

TABLES: SFLIGHT, SBOOK.

DATA SMOKERS TYPE I.

GET SFLIGHT.

ULINE.

WRITE: / SFLIGHT-SEATSMAX,

SFLIGHT-SEATSOCC.

SMOKERS = 0.

GET SBOOK FIELDS SMOKER.

CHECK SBOOK-SMOKER <> SPACE.

ADD 1 TO SMOKERS.

GET SFLIGHT LATE FIELDS SEATSMAX SEATSOCC.

WRITE SMOKERS.

Only fields from SBOOK are output. No TABLES SFLIGHT statement exists. Then, for the table SFLIGHT , only the key fields are read (regardless of whether the FIELDS addition is used with GET SBOOK or not).

TABLES: SBOOK.

GET SBOOK FIELDS BOOKID CUSTOMID ORDER_DATE.

WRITE: SBOOK-BOOKID,

SBOOK-CUSTOMID,

SBOOK-ORDER_DATE.

Only fields from SBOOK are output, but SFLIGHT is declared by TABLES SFLIGHT . In this case, all the fields of table SFLIGHT are read (regardless of whether the FIELDS addition is used with GET SBOOK or not).

TABLES: SFLIGHT, SBOOK.

GET SBOOK FIELDS BOOKID CUSTOMID ORDER_DATE.

WRITE: SBOOK-BOOKID,

SBOOK-CUSTOMID,

SBOOK-ORDER_DATE.

Related PUT