01-06-2015 11:21 AM
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 .
01-06-2015 12:20 PM
01-06-2015 1:56 PM
Hi can any one help how to import the internal table into functional module.
01-06-2015 2: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.
01-06-2015 2:28 PM
Hi,
If you know payroll area and want to find list of pernrs under it, use the BAPI BAPI_OUTEMPLOYEE_GETLIST.
01-06-2015 3: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.
01-07-2015 7:19 AM
I have internal table "itabfinal" with fields "pernr, werks, btrtl, plan, ansal, Persk".
now i need to pass "itabfinal" into the functional module and get back the all of "itabfinal" field from the function module into the program.
for this i am creating the funtional module " ZFM1"
inside the functional module i have given the import as "itab1-type-table"
inside the functional module i have given the export as "itab2-type-table".
inside the functional module i have given the changing as "itab3-type-table"
inside the functional module i have given the Table as "itab4-type-ZFM1_STRU_T"
where "ZFM1_STRU_T" is the table type with reference to itabfinal.
in my program i am calling the functional module as below.
CALL FUNCTION 'ZFM1'
EXPORTING
itab1 = itabfinal
IMPORTING
ITAB2 = itab4
changing
itab3 = itab4.
But in functional module i had given the code as below :
FUNCTION zfm1.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(ITAB1) TYPE TABLE
*" EXPORTING
*" REFERENCE(ITAB2) TYPE TABLE
*" TABLES
*" ITAB4 TYPE ZFM1_STRU_T
*" CHANGING
*" REFERENCE(ITAB3) TYPE TABLE
*"----------------------------------------------------------------------
data: wa type ZFM1_STRU.
clear wa.
loop at itab1 into wa.
move wa to itab4.
modify itab4.
endloop.
ENDFUNCTION.
please help me to get the itabfinal into the program using above funtional module
01-07-2015 10:11 AM
Hi Vishnu,
Why you need FM?
Are you going to reuse this FM in more than one program.
Fetch the data from the respective infotype which has endda 31.12.9999.
Loop Pa0000 and read the other infotypes with key fields and pass it to workarea.
Then append the workarea to final internal table.
With Regards,
Giriesh M
01-07-2015 10:32 AM
Can you please help me how to pass the internal table to Dynamic Functional module .