Skip to Content
avatar image
Former Member

FIELD name with DATABASE NAME

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 -


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Oct 07, 2008 at 02:23 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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 -


  • avatar image
    Former Member
    Oct 07, 2008 at 03:17 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 15, 2008 at 04:38 AM

    Not relevent.

    Add comment
    10|10000 characters needed characters exceeded