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: 

FIELD name with DATABASE NAME

Former Member
0 Kudos

Hi All,

In a SELECT query, field names can be specified with Database Name or without it.

Where to use these two options?

With Thanks &

Regards,

R.Nagarajan.

-


We can -


4 REPLIES 4

Former Member
0 Kudos

Hi Nagarajan,

We can use the same name Fields similar to Database, if we declare our tables with the fields needed can be different too.

eg: Types : begin of ty_mkpf,

zmblnr type MKPF-MBLNR,

zmjahr type MKPF-MJAHR,

zvgart type MKPF-VGART,

end of mkpf.

Data : wa_mkpf type ty_mkpf,

tbl_mkpf type table of ty_mkpf.

select mblnr mjahr vgart FROM MKPF

INTO CORRESPONDING FIELDS OF TABLE TBL_MKPF

where condition.

Regards,

sg

0 Kudos

Hi Suneel Kumar Gopisetty,

Thanks for you response.

We have options like Field name with Database name and Field name without Database name.

In what scenario or when it will be opt to use these options in a SELECT query?

Regards,

R.Nagarajan.

-


We can -


uwe_schieferstein
Active Contributor
0 Kudos

Hello Nagarajan

You may use names other than the DB field names if you want to use the selected data for a specific purpose, e.g.:


  data: gr_kunnr    TYPE RANGE OF kunnr,
          gs_rng       LIKE LINE OF gr_kunnr.

" Select customers into a range itab
  SELECT kunnr as low from knb1 into CORRESPONDING FIELDS OF TABLE gr_kunnr
    WHERE bukrs = '1000'.

  gs_rng-sign    = 'I'.
  gs_rng-option = 'EQ'.
  MODIFY gr_kunnr FROM gs_rng
    TRANSPORTING sign option
    WHERE ( low IS NOT INITIAL ).

Regards

Uwe

Former Member
0 Kudos

Not relevent.