Skip to Content
avatar image
Former Member

ALV GRID - need to display the list of pernrs at a time using the funtional module.

Hi,

can any one help me to get list of record at a time.Not one by one using the select statement.

Requirement:

I have to get the list of record (pernr) at a time to be fetched in the table using the Function module in the end of selection event and it should be exported in alv.

Right now i am getting the single perner,stat2,werks,ansal from tables pa0000, pa0001, pa0002, pa0008 record  and it is stored in the itabfinal by appending from wa_itabfinal. But now i need all the record to be fetched at a time and it should be displayed with out loop.so help me by informing the what functional module is to be used for this to fetch all the records in ALV .

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Jan 06, 2015 at 02:17 PM

    Hi,

    If you use LDB, it will process one by one pernr.

    http://wiki.scn.sap.com/wiki/display/Snippets/Report+in+HR+ABAP+-+LDB

    If you don't want to use, refer the below sample provided in the link by me.

    http://wiki.scn.sap.com/wiki/display/Snippets/Report+in+HR+ABAP+-+without+LDB

    If you know the list of pernr already, then you should loop for the above process.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 06, 2015 at 12:20 PM

    please share your code ..

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 06, 2015 at 03:03 PM

    Hi Vishnu,

    Try this sample for reference:

    TABLES: pernr.

    NODES: peras.

    data: it_pa0000 TYPE TABLE OF pa0000.

    TYPES: BEGIN OF ty_pernr,

            pernr TYPE persno,

           END OF ty_pernr.

    Data : it_pernr TYPE TABLE OF ty_pernr,

           wa_pernr TYPE ty_pernr.

    START-OF-SELECTION.

    get peras.

    wa_pernr-pernr = pernr-pernr.

    APPEND wa_pernr to it_pernr.

    CLear : wa_pernr.

    END-OF-SELECTION.

    IF it_pernr is NOT INITIAL.

    select *

      from Pa0000

      into TABLE it_pa0000

      for ALL ENTRIES IN it_pernr

      WHERE pernr = it_pernr-pernr.

    ENDIF.

    Add comment
    10|10000 characters needed characters exceeded