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: 

Describe

Former Member
0 Kudos
123

Shall I use where condititon with Describe key word?

9 REPLIES 9

Former Member
0 Kudos
87

Hi,

There is no where condtion option with Describe keyword.

press f1 on describe keyword in abap editor.

it will take you to the syntax of keyword.

cheers.

santosh.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
87

I do not believe that the describe keyword supports a where clause. What exactly do you want to do?

Regards,

Rich Heilman

Former Member
0 Kudos
87

Below are the syntax for DESCRIBE statement

-


Return attributes of a field

- DESCRIBE FIELD f.

Return attributes of an internal table

- DESCRIBE TABLE itab.

Determine distance between two fields

- DESCRIBE DISTANCE BETWEEN f1 AND f2 INTO f3.

Return attributes of a list

- DESCRIBE LIST NUMBER OF LINES lin.

- DESCRIBE LIST NUMBER OF PAGES n.

- DESCRIBE LIST LINE lin PAGE pag.

- DESCRIBE LIST PAGE pag.

-


using the select command , you can extract all the data into table with where condition, then you can use DESCRIBE to find the properties.

Regards

Vivek

<b> Please reward points for all the helpful answers </b>

former_member181962
Active Contributor
0 Kudos
87

no you cannot use.

instead move the entries into a temp internal table usinh a where condition and use descibe over the temp table.

loop at itab where field = <ghg>.

nove-corresponding itab to itab_temp.

append itab_temp.

endloop.

describe itab_temp line v_lines.

Regards,

Ravi

Former Member
0 Kudos
87

hi Sam,

Describe key will not support where condition ..

Regards,

Santosh

ferry_lianto
Active Contributor
0 Kudos
87

Hi Sam,

No, but you can use similar like condition with DESCRIBE statement.

DESCRIBE TABLE itab [KIND knd].

Effect:

The table type of the internal table itab is determined and a corresponding one-digit identification is assigned to the data object knd. A character-type data type is expected for the data object. The identifications are "T" for standard tables, "S" for sorted tables and "H" for hashed tables. These values are also defined as constants sydes_kind-standard, sydes_kind-sorted, and sydes_kind-hashed in the type group SYDES.


TYPE-POOLS sydes. 
... 
FORM sort_descending CHANGING itab TYPE ANY TABLE. 
  DATA tabkind(1) TYPE c. 
  DESCRIBE TABLE itab KIND tabkind. 
  IF tabkind = sydes_kind-standard OR 
     tabkind = sydes_kind-hashed. 
    SORT itab DESCENDING. 
  ELSEIF tabkind = sydes_kind-sorted. 
    MESSAGE '...' TYPE 'E'. 
  ELSE. 
    MESSAGE '...' TYPE 'E'. 
  ENDIF. 
ENDFORM.

or

DESCRIBE DISTANCE BETWEEN dobj1 AND dobj2 INTO dst

IN {BYTE|CHARACTER} MODE.

Effect:

This statement assigns the distance between the starting positions of the data objects dobj1 and dobj2 to the data object dst, for which the data type i is expected. In case of deeper data types, the referenced data object is not relevant but the position of the internal reference (for strings and internal tables) or the reference variables. It is not important, in which order dobj1 and dobj2 are specified.

DATA: BEGIN OF struc, 
        comp1    TYPE i, 
        comp2(1) TYPE x, 
        comp3(4) TYPE c VALUE 'Hey', 
        comp4(4) TYPE c VALUE 'you!', 
        comp5    TYPE x, 
      END OF struc. 

DATA: off TYPE i, 
      len TYPE i. 

FIELD-SYMBOLS: <hex> TYPE x, 
               <result> TYPE c. 

DESCRIBE DISTANCE BETWEEN: 
         struc       AND struc-comp3 INTO off IN BYTE MODE, 
         struc-comp3 AND struc-comp5 INTO len IN BYTE MODE. 

ASSIGN: struc TO <hex> CASTING, 
        <hex>+off(len) TO <result> CASTING.

Hope this will help.

Regards,

Ferry Lianto

Former Member
0 Kudos
87

Hello,

No you cannot use the keyword DESCRIBE in condition.

It is used to count the no. og entries in an internal table.

Regs,

Venkat

anversha_s
Active Contributor
0 Kudos
87

hi sam,

you cannot use where condiation.

if u want there is a logic.

data : ITAB like ztable occurs 0,

itab2 like itab,

num type i.

refresh itab2.

loop at itab where condition.

append itab2 from itab.

clear itab.

endloop.

describle table itab2 lines num.

write num.

rgds

anver

mark all helpful answerss

Former Member
0 Kudos
87

Hello,

Pls. close the thread and award points if your query is answered.

Regs,

Venkat