‎2008 Apr 24 5:08 AM
Hi All,
I have a requirement to create a function module which fetches the data from PA0001, PA0000 and PA2001,
with the following details:
Import: PA0001-BTRTL Personal sub area
(filter on Personal Area with values "DE01" and "AT22")
PA0000-PERNR Personal Number
(will be used for new employees post go live)
Export: PA2001-BEGDA (Begin Date)
PA2001-ENDDA (End Date)
PA2001-AWART (Absence Type)
PA2001-BEGUZ (Begin Time)
PA2001-ENDUZ (End Time)
PA2001-STDAZ (Number of hours)
i created import parameters BTRTL, PERNR and i created one structure " HRAbsnce" with the fields BTRTL, PERNR, BEGDA,ENDDA, AWART, BEGUZ,
ENDUZ, and STDAZ and i created the Export parameter with
this structure.
Now i am trying to write source code. Here i got confusion.
Please anybody know the solution, please let me know how to write the select statement in this function module that gets the data from all the above tables with import parameters.
i will give you the max reward points, once i get solution.
I am very thankful to you in advance.
Regards,
Nagarjuna.
‎2008 Apr 24 5:37 AM
Hi,
Try....
SELECT-OPTIONS: PERNR FOR PA0000-PERNR,
BTRTL FOR PA0001-BTRTL.
DATA: BEGIN OF IT OCCURS 0,
PERNR LIKE PA0000-PERNR,
BTRTL LIKE PA0001-BTRTL,
BEGDA LIKE PA2001-BEGDA,
ENDDA LIKE PA2001-ENDDA,
AWART LIKE PA2001-AWART,
BEGUZ LIKE PA2001-BEGUZ,
ENDUZ LIKE PA2001-ENDUZ,
STDAZ LIKE PA2001-STDAZ,
END OF IT.
SELECT I~PERNR K~BTRTL L~BEGDA L~ENDDA L~AWART L~BEGUZ L~ENDUZ L~STDAZ
INTO TABLE IT
FROM PA0000 AS I INNER JOIN PA0001 AS K ON
I~PERNR = K~PERNR INNER JOIN PA2001 AS L ON
K~PERNR = L~PERNR WHERE I~PERNR IN PERNR
AND K~BTRTL IN ('DE01','AT22').
Reward points if useful...
Regards
AK