Skip to Content
author's profile photo Former Member
Former Member

Replacing GET by a SELECT query

hi all.

i have a get+check options syntax in a report.

i want to replace the code with a select query..

i want to replace GET + CHECKby SELECT+WHERE...

but when does this GET statement end? like if i replace it with select, then i would have to put ENDSELECT somewhere.. i guess there is no ENDGET in the report..

the code is like as follows...

START-OF-SELECTION.

GET ekko FIELDS bstyp ebeln ekorg ekgrp bedat ernam lifnr.

CHECK select-options.

CHECK ekko-bstyp = 'F'.

PERFORM some_subroutine

IF sy-subrc EQ 0.

"LOTS OF CODE PROCESSING"

ENDIF.

TOP-OF-PAGE.

"some code"

END-OF-SELECTION.

so, how do i replace it with the select query?

does the GET statement is executed for entire START-OF-SELECTION event?

also, whenever this GET is executed, does it fetch a single entry from the database table to work-area?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 09:16 PM

    Hi,

    data : begin of it_tab,
             bstyp like ekko-bstyp,
            ebeln like ekko-ebeln,
             ekorg like ekko-ekorg,
              ekgrp like ekko-ekgrp,
              bedat like ekko-bedat,
             ernam  like ekko-ernam,
               lifnr like ekko-lifnr,
       end of it_tab.
    
    START-OF-SELECTION.
    select bstyp ebeln ekorg ekgrp bedat ernam lifnr 
    from    ekko
    into table it_tab
    where ekko-bstyp = 'F'.
    
    PERFORM some_subroutine
    
    IF sy-subrc EQ 0.
    
    "LOTS OF CODE PROCESSING"
    
    ENDIF.
    
    TOP-OF-PAGE.
    "some code"
    
    END-OF-SELECTION.

    Thnaks

    Vikranth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 08:48 PM

    Hi Chinmay,

    Since GET and CHECK together works like SELECT and WHERE, you dont need to either put ENDGET or ENDSELECT.

    I think GET will end once it is executed. So it will select records and CHECK will filter them.

    You can easily replace it by selecting data in internal table with where clause in place and then can process data from internal table.

    thanks,

    ags.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 18, 2008 at 08:50 PM

    something like this:

    parameters:EBELN like ekko-EBELN.

    data: begin of it_ekko occurs 0,

    bstyp like ekko-bstyp,

    EBELN like ekko-EBELN,

    ekorg like ekko-ekorg,

    ekgrp like ekko-ekgrp,

    bedat like ekko-bedat,

    ernam like ekko-ernam,

    lifnr like ekko-lifnr,

    end of it_ekko.

    start-of selection

    select bstyp ebeln ekorg ekgrp bedat ernam lifnr

    into corresponding fields of table it_ekko from

    ekko where ebeln = ebeln.

    END-OF-SELECTION.

    loop at it_ekko.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.