PNPBEGDA and PNPENDDA
Hello,
I am using the PNP logical database along with HR Report category set to HRDEOD01.
The selection screen works fine for 'Payroll Period' tab.
However, if I were to choose date range from 'period' like - Today / Current Month / Current year, etc,
after executing the GET PERNR statement,
PNPBEGDA and PNPENDDA are blank. They should ideally have dates corresponding to the radio button selected.
Please can anyone suggest a fix to this problem?
Hi Vaishali,
PNPBEGDA & PNENDDA will only be filled when you select the Other period radiobutton and fill the dates in the Data Selection Period. You can always use the PN-BEGDA & PN-ENDDA fields in the Report.
Regards,
Suresh Datti
Similar Messages
-
HR - PNPbegda/PNPendda ......PN-begda/PN-endda
Hi,
I am going through some of the sample codes on internet. While querying on any infotype table I find that begin date/ end date on selection screen is referred as PNPbegda/PNPendda some times and PN-begda/PN-endda some times. Is there any some reason for this? what is the difference between use of these in two different ways?
Thanks
SDN POWEREDHi,
pnpbegda and pnpendda refer to the date fields on the selection screen.
when you use macros like RP_PROVIDE_FROM_FRST and
RP_PROVIDE_FROM_LAST you can see the pn-begda and pn-endda.
That means during the program pnpbegda and pnpendda are
assigned to pn-begda and pn-endda.
Ex: RP_PROVIDE_FROM_FRST p0001 space pn-begda pn-endda.
you can change pn- begda and pn-endda values.
Ex: pn-begda = '20080101'.
pn-endda = '20081231'.
Ex: RP_PROVIDE_FROM_LAST p0001 space pn-begda pn-endda.
you can directly use the dates even.
EX:RP_PROVIDE_FROM_LAST p0001 space '20080101' '20081231'.
For better understanding go through the programs
SAPDBPNP and SAPDBPNPCE. -
Can we modify the pnp selection screen and get only month and year?
Dear Freinds,
I have requirement where i have to modify the PNP selection screen. So with the help of report category and coding in AT SELECTION-SCREEN OUTPUT , i have modified all the fields relating to dates . i.e i have removed all the radio buttons (i.e Today, Current month,current year etc) and finally
i have landed with only Period ( PNPBEGDA & PNPENDDA range) . But i dont want the PNPBEGDA & PNPENDDA range , but i want only is the month and year ( i.e just like the PNPPABRP & PNPPABRJ)
on my selection screen along with the pernr .
i have used the below code to close all the fields except pnpbegda and pnpendda.
AT Selection-Screen output.
loop at screen.
IF screen-group4 = '098' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
IF screen-group4 = '092' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
IF screen-group4 = '094' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
IF screen-group4 = '100' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
IF screen-group4 = '104' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
MODIFY SCREEN.
endloop.
i.e on my selection screen i want only month & year combination and pernr -
when iam using the logical database PNP . Could any one please let me know how can i get only mon & year only on my selection screen .
If it is possible please let me know .
Thanks & regards
divya.Hi ,
The requirement is that the user doesnt want to enter the date range i.e for ex: 01012008 to 31012008.
As per the requirement the user will enter only the month and year only . so i on the selection screen
i want only the month and year only . Is there any means i can modify the date period which is there by
default (PNPbegda and PNPendda) on PNP selection screen. Instead of we givign to the user the
PNPBEGDA and PNPPENDA i want is only month and year .
AS already the code has already been written and now they have asked that they want only the month and year on the selection screen.
Please suggest me in this regard.If iam hiding all the buttons relating the dates fields, and now if iam adding the parameters for the month and year it is coming below below the fields pernr , personnel ara and subara , company code , payroll area, employee group of the standard fields of PNP selection screen , there by any body could please suggest me how to change.
regards
divya. -
Calculations for 6 months from todays date
Need to calculate the total of all the months starting from today's date for the next 6 months from the current date.
For ex
Month Total
01.07.2008 10
01.08.2008 20
01.09.2008 50
01.10.2008 72
01.11.2008 85
01.12.2008 15
Please advice how to work on this.
Can we use ranges?
Thanks in advance.Hi dolly,
Ref this code.....
TYPE-POOLS :
slis.
TABLES :
pernr.
INFOTYPES :
0000,
0001,
0002.
TYPES :
BEGIN OF t_final,
srlno TYPE i, "Serial No
pernr TYPE p0000-pernr, "Employee No
vorna TYPE p0002-vorna, "First Name
nachn TYPE p0002-nachn, "Last Name
btrtl TYPE p0001-btrtl, "PERSONAL SUB AREA / SEGMENT
btext TYPE t001p-btext, " SEGMENT DESC
begda TYPE p0000-begda, " JOINING DATE
pdate TYPE p0000-begda, " Probation period date.
END OF t_final,
BEGIN OF t_t001p,
btrtl TYPE t001p-btrtl,
btext TYPE t001p-btext,
END OF t_t001p.
DATA :
v_year(4) TYPE n,
v_year1 TYPE i,
count TYPE i,
v_mont(2) TYPE n,
v_dt(2) TYPE n,
v_date(8),
it_final TYPE STANDARD TABLE OF t_final,
it_temp TYPE STANDARD TABLE OF t_final,
it_t001p TYPE STANDARD TABLE OF t_t001p,
wa_t001p TYPE t_t001p,
wa_temp TYPE t_final,
wa_final TYPE t_final.
ALV Grid Declarations *
DATA : it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat LIKE LINE OF it_fieldcat,
wa_layout TYPE slis_layout_alv,
it_sortcat TYPE slis_t_sortinfo_alv,
wa_sortcat LIKE LINE OF it_sortcat.
START-OF-SELECTION.
PERFORM fill_itabs.
GET pernr.
rp-provide-from-frst p0000 space '18000101' '99991231'.
IF pnp-sw-found = 1.
IF p0000-stat2 = 3. " Checking for status.
MOVE :
p0000-begda TO wa_temp-begda,
p0000-pernr TO wa_temp-pernr.
rp-provide-from-last p0001 space pnpbegda pnpendda.
IF pnp-sw-found = 1.
MOVE :
p0001-btrtl TO wa_temp-btrtl.
CLEAR : wa_t001p.
READ TABLE it_t001p INTO wa_t001p WITH KEY btrtl = wa_temp-btrtl.
IF sy-subrc = 0.
MOVE : wa_t001p-btext TO wa_temp-btext.
ENDIF.
ENDIF.
rp-provide-from-last p0001 space pnpbegda pnpendda.
IF pnp-sw-found = 1.
MOVE :
p0002-vorna TO wa_temp-vorna,
p0002-nachn TO wa_temp-nachn.
ENDIF.
APPEND wa_temp TO it_temp.
CLEAR : wa_temp.
ENDIF. "if p0000-stat2 = 3.
ENDIF. "if pn-sw-found = 1.
END-OF-SELECTION.
PERFORM process_data.
PERFORM build_catalog.
PERFORM display_data.
*& Form PROCESS_DATA
text
--> p1 text
<-- p2 text
FORM process_data .
LOOP AT it_temp INTO wa_temp.
IF wa_temp-begda+4(2) > 6.
v_year = wa_temp-begda(4) + 1.
v_mont = wa_temp-begda+4(2) + 6.
v_dt = wa_temp-begda+6(2).
IF WA_TEMP-BEGDA+4(2) = '08'.
IF wa_temp-begda+6(2) = '29' OR
wa_temp-begda+6(2) = '30' OR
wa_temp-begda+6(2) = '31'.
v_dt = '28'.
ENDIF.
ENDIF.
IF v_mont > 12.
v_mont = v_mont - 12.
CONCATENATE v_year v_mont v_dt INTO v_date.
MOVE : v_date TO wa_temp-pdate.
ENDIF.
ELSE.
v_mont = wa_temp-begda+4(2) + 6.
CONCATENATE wa_temp-begda(4) v_mont wa_temp-begda6(2) INTO v_date.
wa_temp-pdate = v_date.
ENDIF.
MODIFY it_temp FROM wa_temp .
CLEAR : v_date, v_year, v_mont.
ENDLOOP.
LOOP AT it_temp INTO wa_temp WHERE pdate BETWEEN pnpbegda AND pnpendda.
MOVE : wa_temp-pernr TO wa_final-pernr,
wa_temp-vorna TO wa_final-vorna,
wa_temp-nachn TO wa_final-nachn,
wa_temp-begda TO wa_final-begda,
wa_temp-btrtl TO wa_final-btrtl,
wa_temp-btext TO wa_final-btext.
CASE wa_temp-pdate+4(2).
WHEN '04' OR '06' OR '09' OR '11'.
IF wa_temp-pdate+6(2) > '30'.
CONCATENATE wa_temp-pdate(4) wa_temp-pdate4(2) '30' INTO v_date.
MOVE : v_date TO wa_final-pdate.
ELSE.
MOVE wa_temp-pdate TO wa_final-pdate.
ENDIF.
WHEN '02'.
v_year1 = wa_temp-pdate+(4) MOD 4.
IF v_year1 = 0 AND wa_temp-pdate+6(2) > '29'.
CONCATENATE wa_temp-pdate(4) wa_temp-pdate4(2) '29' INTO v_date.
MOVE : v_date TO wa_final-pdate.
ELSEIF v_year1 NE 0 AND wa_temp-pdate+6(2) > '28'.
CONCATENATE wa_temp-pdate(4) wa_temp-pdate4(2) '28' INTO v_date.
MOVE : v_date TO wa_final-pdate.
ELSE.
MOVE wa_temp-pdate TO wa_final-pdate.
ENDIF.
WHEN OTHERS.
MOVE wa_temp-pdate TO wa_final-pdate.
ENDCASE.
count = count + 1.
MOVE : count TO wa_final-srlno.
APPEND wa_final TO it_final.
CLEAR : wa_final, v_year1 , v_date.
ENDLOOP.
ENDFORM. " PROCESS_DATA
*& Form BUILD_CATALOG
FORM build_catalog .
DEFINE m_fieldcat.
add 1 to wa_fieldcat-col_pos.
wa_fieldcat-fieldname = &1.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-seltext_m = &2.
wa_fieldcat-outputlen = &3.
append wa_fieldcat to it_fieldcat.
END-OF-DEFINITION.
m_fieldcat 'SRLNO' 'S No' '8' .
m_fieldcat 'PERNR' 'Employee No' '15'.
m_fieldcat 'VORNA' 'First Name' '15' .
m_fieldcat 'NACHN' 'Last Name' '15' .
m_fieldcat 'BTRTL' 'Segment' '15' .
m_fieldcat 'BTEXT' 'Segment Desc' '15' .
m_fieldcat 'BEGDA' 'Date of Joining' '15'.
m_fieldcat 'PDATE' 'Probation End Date' '15' .
ENDFORM. " BUILD_CATALOG
*& Form DISPLAY_DATA
FORM display_data .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = ls_layout
it_fieldcat = it_fieldcat
it_sort = it_sortcat
TABLES
t_outtab = it_final.
ENDFORM. " DISPLAY_DATA
*& Form FILL_ITABS
FORM fill_itabs .
SELECT btrtl
btext
FROM t001p
INTO TABLE it_t001p.
ENDFORM. " FILL_ITABS -
New Provide statement in ECC 6.0
Hi All,
I am getting infotype 0001 information by using function module HR_READ_INFOTYPE.Now i need to check the Employee subgroup (PERSK) change from 11 to 12 .For this i need to use PROVIDE statment and if change happens i need to make a returning parameter false.
How can i use the new provide statement
l_sub is a flag.
*provide fields * from p0001 into l_temp VALID l_sub*
BOUNDS persk AND persk BETWEEN l_begda AND l_endda.
i am not getting any records while running this query.Can you please help me out.What l_temp returns if the loop pass success.In bound what i need to give here i need to check the persk value.
Thanks
ChanduHi Chandu,
When you are using the bounds statement in a provide field statement,
the two fields on which the bound condition is being applied have to be
different columns of same type of the table from which you are selecting the values..
For eg
PROVIDE fields * from p0001 into itab valid flag1 BOUNDS begda AND endda
BETWEEN pnpbegda AND pnpendda.
What you are using is not giving any values is because it is referring to only
one column of the table p0001.
Get Back if u still have Doubts
Ira !! -
Not able to hide all fields on PNP selection screen.
Dear Freinds,
i wanted to hide all the field which are given on PNP selection screen, with the help of the
report category i have hided all the field including the Person selection period as i require only the
Data selection period. further through coding as below iam able to remove all the radio buttons
Today, Current month,Current year, from today, upto today,Other Period . But i am getting spaces above period (PNPBEGDA and PNPENDA) . i.e in the frame Period i have spaces being left due to
the radio buttons being Hidden . Could any one let me know how to remove the spaces so that
Period range will set exactly in the frame.
LOOP AT SCREEN.
IF screen-name = 'PNPTIMR4' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
IF screen-name = 'PNPTIMR2 .
screen-input = '0'.
screen-invisible = '1'.
ENDIF
IF screen-group4 = '090' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
IF screen-name = 'PNPTIMR1' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
IF screen-group4 = '092' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
IF screen-group4 = '094' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
IF screen-group4 = '100' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
MODIFY SCREEN.
ENDLOOP
Please could any one let me know how can i push up the Period date (PNPBEGDA and PNPENDDA)
so that i will not have any blank space left out in the frame(Period) .
Thanks & Regards
Divya.
Edited by: Divya Kumari on Jan 4, 2009 1:53 PMhi, sorry i think i misunderstand you question,
if i can understand it right now? the following code can help you i am using "PNP" Screen no '900'.
tables:pc207, hrp1000,pernr, pyorgscreen.
infotypes: 0001. "Organizational Assignments
nodes: payroll type pay99_result.
at selection-screen output.
loop at screen.
if ( screen-group1 = 'RES' or screen-group1 = 'YB1' or
screen-group1 = 'YB2' or screen-group1 = 'YB3' ).
screen-active = '0'.
screen-invisible = '1'.
modify screen.
endif.
endloop.
try the following too,
TABLES:pc207, hrp1000,pernr, pyorgscreen.
INFOTYPES: 0001. "Organizational Assignments
NODES: payroll TYPE pay99_result.
AT SELECTION-SCREEN OUTPUT.
BREAK-POINT.
LOOP AT SCREEN.
IF (
* screen-name = '%BYB1005_BLOCK_1000'
screen-name = '%FYTI007_1000'
or screen-name = '%FBIS010_1000'
or screen-name = 'PYVW0_0'
or screen-name = '%_PYPERNR_%_APP_%-TEXT'
or screen-name = 'PYPERNR-LOW'
or screen-name = '%_PYPERNR_%_APP_%-VALU_PUSH'
screen-active = '0'.
screen-invisible = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Replay if any problem,
Kind Regards,
Faisal
Edited by: Faisal Altaf on Jan 4, 2009 6:55 PM -
I am creating HR report using pnp LDB selection screen, In this selection screen the selection block titled period is not working ...means i cant sort my data using periods titled selection screen of pnp LDB selection screen...what i should do for this......
I have made many reports but in non of them it is working...
If u want to take a look at start of-selection-part of my code, it is mentioned below.....i think problem may lies here.....if u dint get me pls do reply
START-OF-SELECTION.
GET pernr.
PROVIDE werks pernr ename orgeh plans begda FROM p0001
gbdat FROM p0002
ausbi FROM p0022
bet01 bet02 FROM p0008
endda begda FROM p0023
BETWEEN pnpbegda AND pnpendda
WHERE p0001-werks IN pnpwerks.
ENDPROVIDE.
PERFORM output.
*& End-of-Selection
END-OF-SELECTION. -
[HR-PY] Querying PNP LDB infotype - wise
Hello !
I got a question about optimizing data fetching from LDB.
Nowdays i do something like :
INFOTYPES: 0657.
GET pernr.
LOOP AT P0657 WHERE somefield IN criteria.
"do stuff here
ENDLOOP.
Problem with this approach is Preformance - i only want to process records that have IT0657 entry - but since no select options are given on screen GET pernr fetches every personal number - is there any way to restrict that ?
i know i could do SELECT to db and then insert its results as LDB params to loop only on the relevant records - problem with that is that my Selection Options regarding PERNR in LDB get lost that way - is there something more accurate ?Can P0657 be queried with OpenSQL as usual ?
Yes.
i guess with mode N the only diffrence between LDB and physical DB is that LDB results are filtered by provided selection screen ?
Correct
Does PNP have any other nodes than PERNR ? how do i know what nodes i can use ?
Go to SE36-> type in PNP -> here you have all nodes available in PNP -> select PERNR and choose table icon
or
Go to SE11-> structure PERNR
All these fields are transported during GET PERNR event, so always try to restrict them to those which you really need
Can you please give some example of such query - it's my 1st approach to LDBs and i dont know how to deal with it exactly.
SELECT-OPTIONS so FOR field.
INFOTYPES: 0657 mode n. "table empty at GET pernr event.
GET PERNR FIELDS pernr ....
SELECT field field2 field3 FROM PA0657 into corresponding fields of table PA0657
where pernr = pernr-pernr
and field in so.
if sy-dbcnt = 0.
"entry exists
else.
"no entry
REJECT. "reject EE and proceed to next node -> here next PERNR
endif.
This could help a litte bit with performamance but I think the best would be filtering at LDB level, so using select options for payrol area, company code, org unit, cost center etc (all Emoplyees processing should really never been performed, because it is time intensive) . Also giving dates PNPBEGDS and PNPENDDS restricts picking EEs to those who are at least one day active (PA0000-stat2 = 3) within this date range. On the other hand, PNPBEGDA and PNPENDDA only restrict fetching infotype table, so here it is of no relevance as we instructed it not to do it (mode N).
Regards
Marcin -
Hi,
can anybody provide me demo code for using PNP ldb?
abctables pernr.
infotypes 0002.
data: begin of itab occurs 0,
vorna like pa0002-vorna,
end of itab.
data wa like line of itab.
*write 'abc'.
get pernr.
provide * from p0002
BETWEEN PNPbegda AND PNPENDDA.
move p0002-vorna to itab-vorna.
append itab.
clear itab.
endprovide.
end-of-selection.
loop at itab.
write:/ itab-vorna.
endloop. -
Rp_provide_from_last p2001 space pn-begda pn-endda
Hi Guru's,
I am using PNP as LDB and after ,
My requirement is to fetch the records from p2001 for a specific time period mentioned in the selection screen.
Code :
Get Perner.
rp_provide_from_last p2001 space pn-begda pn-endda.
the output of the above is giving all the data from P2001 irrespective of the dates (Pn-begda & pn-endda.)
But i want the data with in the dates (Pn-begda & pn-endda.).
Plz suggest.
Thanks.Hi,
PROVIDE * FROM P2001
BETWEEN Pnpbegda AND Pnpendda.
write: p2001-pernr,p2001-begda.
ENDPROVIDE.
use this code..........
Regards,
vamshidhar .
Edited by: vamshi naini on Apr 23, 2008 2:06 PM -
Program in which i am downloading p0002-pernr , pernr-ename , p0002-sp
I have written a program in which i am downloading p0002-pernr , pernr-ename , p0002-sprsl in to c:\temp in csv format , i am able to download the file but the program continue running its not stoping its acting like an infinite loop program is given bellow . i am using logical database in this (pnp) . and when the downloading part is removed and given the write command its writting result with out delay . only when downloading i am getting problem I am using function module GUI_DOWNLOAD to download .
*-- Declaration
TABLES: pernr.
INFOTYPES: 0002. "Personal Data
*-- Selection screen
INITIALIZATION.
*-- Processing
DATA: Begin of it_final OCCURS 0,
text(1000) TYPE C,
END OF it_final.
DATA: Begin of it_final1 OCCURS 0,
text(1000) TYPE C,
END OF it_final1.
GET pernr.
PROVIDE pernr sprsl from p0002 BETWEEN pnpbegda AND pnpendda.
CONCATENATE p0002-pernr pernr-ename p0002-sprsl into it_final-text separated by ',' .
write it_final-text.
ENDPROVIDE.
append it_final.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = 'c:\temp\test.csv'
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
IMPORTING
FILELENGTH =
tables
data_tab = it_final
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.Look at the BOLD part ...
Declaration
TABLES: pernr.
INFOTYPES: 0002. "Personal Data
Selection screen
INITIALIZATION.
Processing
DATA: Begin of it_final OCCURS 0,
text(1000) TYPE C,
END OF it_final.
DATA: Begin of it_final1 OCCURS 0,
text(1000) TYPE C,
END OF it_final1.
start-of-selection. <--- add this
GET pernr.
PROVIDE pernr sprsl from p0002 BETWEEN pnpbegda AND pnpendda.
CONCATENATE p0002-pernr pernr-ename p0002-sprsl into it_final-text separated by ',' .
write it_final-text.
ENDPROVIDE.
append it_final.
end-of-selection. <--- add this
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = 'c:\temp\test.csv'
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
IMPORTING
FILELENGTH =
tables
data_tab = it_final
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Dear All,
IN HR I am able to get the payslip into PDF file, I am able to create PDF file but Unable to know where it is stored , it is displaying the messgae that PDF of 4320 bytes are created. in 4.7 version.
Now my concern is how to find that PDF file and how to send it as mail
if SO_NEW_DOCUMENT_ATT_SEND_ALI1 fM is to be used for mailing then can anyone please explain me about the parameters to be passed.
Thanks in Advance,
Regards,
Satya.Thanks for your Swift Response ...
C I am pasting the other kind of code which I have developed
But it is saying File cannot be sent.
Mr.Sreenivas thank you very much for the code you have given but the thing is I need to work on Payslip which is not Smartform.
So I request you to please let me know where to specify PDF and mail details.
I am pasting that code please check it.
REPORT ZHR_PAYSLIP_PDF .
TABLES: PERNR,
PCL1,
PCL2,
PA0105.
INFOTYPES : 0105.
*INTERNATIONAL INCLUDE
INCLUDE RPC2CD09. "Cluster CD data definition
INCLUDE RPC2CA00. "Cluster CA Data-Definition
INCLUDE RPPPXD00. "Data Definition buffer PCL1/PCL2 Buffer
INCLUDE RPPPXD10. "Common part buffer PCL1/PCL2
INCLUDE RPPPXM00. "Buffer Handling routine
*COUNTRY SPECIFIC INCLUDE
INCLUDE PC2RXIN0. "Cluster IN data definition
INCLUDE RPC2RX09.
*INCLUDE RPC2R1X9.
DATA: SEQNR LIKE PC261-SEQNR,
it_rgdir LIKE pc261 OCCURS 0 WITH HEADER LINE,
PAYSLIP LIKE BAPI7004_PAYSLIP OCCURS 0 WITH HEADER
LINE,
RETURN LIKE BAPIRETURN1.
Data: docdata like sodocchgi1,
objpack like sopcklsti1 occurs 1 with header line,
objhead like solisti1 occurs 1 with header line,
objtxt like solisti1 occurs 10 with header line,
objbin like solisti1 occurs 10 with header line,
objhex like solix occurs 10 with header line,
reclist like somlreci1 occurs 1 with header line,
listobject like abaplist occurs 1 with header line,
tab_lines type i,
doc_size type i,
att_type like SOODK-OBJTP.
START-OF-SELECTION .
GET PERNR.
PERFORM GET_IT0105_DATA.
PERFORM GET_PAYROLL_DATA.
PERFORM PAYSLIP_DATA.
form GET_PAYROLL_DATA .
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
persnr = pernr-pernr
TABLES
in_rgdir = it_rgdir
EXCEPTIONS
no_record_found = 1
OTHERS = 2.
IF sy-subrc = 0 .
SORT IT_RGDIR BY SEQNR.
LOOP AT it_rgdir WHERE fpbeg BETWEEN pnpbegda AND pnpendda .
IF ( it_rgdir-fpper = it_rgdir-inper
AND IT_RGDIR-SRTZA = 'A' ).
SEQNR = IT_RGDIR-SEQNR.
ENDIF . " end of Strza
ENDLOOP.
ENDIF.
endform.
form PAYSLIP_DATA .
DATA:
FUNAME TYPE SYREPID,
LINES TYPE I,
P_FORM LIKE PC408 OCCURS 0 WITH HEADER LINE,
P_INFO LIKE PC407.
DATA : PACKING_LIST LIKE SOPCKLSTI1.
init
CLEAR: P_FORM, P_INFO, PAYSLIP, FUNAME.
REFRESH: P_FORM, PAYSLIP.
determine name of function module
depending on CE or non CE
CALL FUNCTION 'HRO1_GET_FUNAME'
EXPORTING
pernr = PERNR-PERNR
IMPORTING
FUNAME = funame.
get raw version of payslip
CALL FUNCTION funame
EXPORTING
EMPLOYEE_NUMBER = PERNR-PERNR
SEQUENCE_NUMBER = SEQNR
PAYSLIP_VARIANT = 'AMP3'
IMPORTING
P_INFO = P_INFO
RETURN = RETURN
TABLES
P_FORM = P_FORM.
any errors occured
CHECK RETURN IS INITIAL.
DESCRIBE TABLE P_FORM LINES LINES.
IF LINES LE 0.
PERFORM FILL_RETURN USING 'I' '3G' 824 RETURN.
ERROR MESSAGE.
EXIT.
ENDIF.
CALL FUNCTION 'CONVERT_PAYSLIP_TO_SAPSCRIPT'
EXPORTING
P_INFO = p_info
TABLES
payslip = payslip
p_form = p_form
EXCEPTIONS
EMPTY_FORM = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Way for Mailing ***************************
OBJPACK-HEAD_START = 1.
OBJBIN = ' | '. APPEND OBJBIN.
OBJPACK-HEAD_START = 1.
submit SHOWCOLO exporting list to memory and return.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
message ID '61' TYPE 'E' NUMBER '731'
with 'LIST_FROM_MEMORY'.
ENDIF.
PACKING_LIST = OBJPACK.
docdata-obj_name = 'TEST_ALI'.
docdata-obj_descr = 'Test including ALI/HTML Attachment'.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
IN = listobject
OUT = objbin
EXCEPTIONS
OTHERS = 1
if sy-subrc <> 0.
message ID '61' TYPE 'E' NUMBER '731'
with 'TABLE_COMPRESS'.
endif.
describe table objtxt lines tab_lines.
read table objtxt index tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
clear objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'OTF'.
append objpack.
att_type = 'OTF'.
describe table objbin lines tab_lines.
read table objbin index tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + strlen( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = 'Attached Document'.
append objpack.
reclist-receiver = '[email protected]'.
reclist-rec_type = 'U'.
reclist-com_type = 'INT'.
append reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
PUT_IN_OUTBOX = 'X'
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
tables
packing_list = objpack
OBJECT_HEADER = objhead
CONTENTS_BIN = objbin
CONTENTS_TXT = objtxt
receivers = reclist
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
DOCUMENT_TYPE_NOT_EXIST = 3
OPERATION_NO_AUTHORIZATION = 4
PARAMETER_ERROR = 5
X_ERROR = 6
ENQUEUE_ERROR = 7
OTHERS = 8
IF sy-subrc <> 0.
message ID 'SO' TYPE 'S' NUMBER '023'
with docdata-obj_name.
ENDIF.
I am getting the message that mail cannot be sent don't know why???
Regards,
Satya. -
Hi Gurus,
Am developing the program in which for the given subtype for the infotype 14 all the records should be deleted for that date selection. For this I write a program given below. It show that the Error 009No data stored for 0014 in the selected period Although the data is there. Please tell me where the error in my program.
*& Report ZDEL14_SUBTYPE
REPORT zdel14_subtype.
TABLES : pernr,
pa0014.
INFOTYPES : 0001,
0014.
DATA : BEGIN OF it_p0014 OCCURS 0.
INCLUDE STRUCTURE p0014.
DATA : END OF it_p0014.
DATA : zp0014 TYPE p0014.
SELECTION-SCREEN BEGIN OF BLOCK days1 WITH FRAME TITLE text-s02.
PARAMETER p_wage TYPE p0014-subty OBLIGATORY.
SELECTION-SCREEN END OF BLOCK days1.
DATA : return LIKE bapireturn1.
AT SELECTION-SCREEN.
IF pnpbegda IS INITIAL OR pnpendda IS INITIAL.
MESSAGE 'Enter Date' TYPE 'E'.
ENDIF.
START-OF-SELECTION *
START-OF-SELECTION.
GET pernr.
rp_provide_from_last p0001 space pnpbegda pnpendda.
PROVIDE * FROM p0014 BETWEEN pnpbegda AND pnpendda
WHERE p0014-subty EQ p_wage .
PERFORM delete14.
ENDPROVIDE.
END-OF-SELECTION.
*& Form delete14
text
FORM delete14.
CALL FUNCTION 'DEQUEUE_ALL' .
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
number = p0014-pernr.
IF sy-subrc NE 0.
MESSAGE 'Unable To Insert. Release Lock Keys' TYPE 'E'.
ENDIF.
p0014-BETRG = 0.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0014'
number = p0014-pernr
subtype = p_wage
objectid = p0014-objps
lockindicator = p0014-sprps
validityend = p0014-endda
validitybegin = p0014-begda
recordnumber = p0014-seqnr
record = p0014
operation = 'DEL'
tclas = 'B'
dialog_mode = '0'
nocommit = ''
IMPORTING
return = return
EXCEPTIONS
OTHERS = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
number = p0014-pernr.
IF return-number NE 0.
WRITE :/ p0014-pernr, 'IS NOT DELETED' ,return.
ENDIF.
ENDFORM. "delete14
Points will be awarded
Thanks
RaviHi Gurus,
Problem Solved by my own. i used the
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0014'
number = p0014-pernr
subtype = p_wage
objectid = p0014-objps
lockindicator = p0014-sprps
validityend = p0014-endda
validitybegin = p0014-begda
recordnumber = p0014-seqnr
record = p0014
operation = 'DEL'
tclas = 'B'
dialog_mode = '0'
nocommit = ''
IMPORTING
return = return
EXCEPTIONS
OTHERS = 0.
for the function module. ITs working.
Thanks
Ravi -
Hi Friends-
when am using PNP ldb its working fine for all other selection but for any of the radio button like current month or current date the pnpbegda and pnpendda not showing any value they are initial why so ? pls help me to understand this ..
Regards
Meeta & RadhaHello in this case dont see pnpbegda pnpendda...
see pn-begda and pn-endda..this will hold the values:)
PNPBEGDA & PNPENDDA will only be filled when you select the Other period radiobutton and fill the dates in the Data Selection Period. Whereas the PN-BEGDA & PN-ENDDA fields will always be filled & can be accessed in the Report.
hope its useful -
Restricting selection of employees
Hi all,
I would like to select all the employees who belong to a particular employee subgroup, eg: 'SE'. The problem is, if i dont specify pernr on the screen, it is fetching the subgroups of each employee for all the available date periods, and in some cases the date periods dont correspond to 'SE' but it is still being fetched.
I am using the macro "rp-provide-from-last p0001 space pn-begda pn-endda" to fetch the last record, but initially when I use "get pernr" statement, it is retrieving the employees who dont have subgroup 'SE' as well.
Is there any way to restrict the selection of employees to a specific period?
Thanks in advance,
SruthyHi Sury,
the process normally is, that the selction criteria determines the set of personnel numbers.
Second step is during the GET statement all data for this found PERNR are given to the report (after authority check was performed).
The report has to take care about the data he receives.
Now what you want is to tell the LDB only to give back a certain range of data.
This is what the macro RP_SET_DATA_INTERVAL is for.
Parameters are:
[code]
$NAME$ = &1
$BEGDA$ = &2
$ENDDA$ = &3
[/code]
Then the LDB will only deliver the data that intersects these dates.
Example for IT 0000:
[code]
START-OF-SELECTION.
RP_SET_DATA_INTERVAL 'P0000' SY-DATUM SY-DATUM.
[/code]
Example for all ITs:
[code]
START-OF-SELECTION.
RP_SET_DATA_INTERVAL 'ALL' SY-DATUM SY-DATUM.
[/code]
Normally the dates are given in the date fields PNPBEGDA and PNPENDDA so you can use them in the statement.
Regards,
Michael
Maybe you are looking for
-
Urgent help required for network configuration
sir i have a mixed scenario right now. I have only three computer on home network. 1.vista accer travelmate 4720 laptop loaded with vista sp1 ultimate 2.normal pc : Core2 duo with XFX ATI REDION graphics card and this pc is loaded with OEL 5.3.x linu
-
Virtual Leash between iPhone and iPad mini
Hello, Is there any application working like a virtual leash between an Iphone 4S and an Ipad mini? My problem is I already use bluetooth between my Iphone and Ipad for getting internet from the Iphone to the Ipad. Devices I have seen are using bluet
-
Synch BPEL Process calling PeopleSoft CI Web Service
Hello....I am trying to create a simple BPEL Process which invokes a PeopleSoft Component Interface Web Service that I created in PeopleSoft 8.9 and when I execute the BPEL Process, the following binding fault is thrown: xmlns:SOAP-ENV="http://schema
-
yesterday on a MacBook mark l; after a very long MSN typed session, MSN wouldn't close and after a while I turned off MBook turning power off with long press on on/off key. now... Flashing suitcase with ? mark flashing at start up I tried all the tri
-
Pictures are not displaying in jsp page
hi everyone, i want to display background images in my jsp page also some other images which are not background images plz tell me the way that enables me to place images in my jsp page thanx