on 05-05-2006 8:25 AM
Hi There,
I am new to HR-ABAP.
I have a requirement to fill infotype 0019 from a custom program. Do I need to write a BDC program for transaction PA30? Please advice.
Thanks in advance,
Raj.
Hi Rajesh,
If the data to be uploaded is in bulk, then u can go for BDC else you can use function module HR_INFOTYPE_OPERATION.
Rgds,
Balaji. D
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your replies.
I think it's not possible to maintain texts with this Function module. I also need to maintain text in infotype 0019. 'EXPORT' is one option to populate text for cluster PCL1. Are there any alternatives?
regards,
Rajesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Suresh,
I have used EXPORT statement and can see an entry in PCL1 whenever I create an entry in infotype 0019. But i am not able see this text from PA30 as comments.
Below find the statement.
pcl1-aedtm = sy-datum.
pcl1-uname = sy-uname.
EXPORT text FROM text TO DATABASE pcl1(tx)
FROM pcl1 ID g_key.
Here key is the key I got from FM HR_INFOTYPE_OPERATION.
Any suggestions will be appreciated.
Thanks in advance,
Rajesh.
Hi Rajesh,
The following code worked perfect for me..
report zp_pa_0019_save_notes .
tables:
pernr.
infotypes:
0019.
data: key like pskey.
data: begin of ptext occurs 200.
data: line(72).
data: end of ptext.
selection-screen begin of block abc with frame title text-001.
parameters:
p_pernr like pernr-pernr.
selection-screen end of block abc.
ptext-line = 'Test Text1'.
append ptext.
ptext-line = 'Test Text2'.
append ptext.
ptext-line = 'Test Text3'.
append ptext.
rp-read-infotype p_pernr 0019 p0019 '18000101' '99991231'.
sort p0019 descending.
read table p0019 index 1.
move-corresponding p0019 to key.
p0019-itxex = 'X'.
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = '0019'
number = p_pernr
validityend = p0019-endda
validitybegin = p0019-begda
record = p0019
operation = 'MOD'.
export ptext to database pcl1(tx) id key.
Regards,
Suresh Datti
Hi Suresh,
Thanks a lot for your answers.
I have implemented my solution using BDC and its working as expected. I have tried your solution also and it worked.
Before BDC I was trying for creation not for change and it didn't work for me. Now I made some changes to your code and tried for creation it didn't work :-(.
Below I have given my test code. (Here 10 is a custom subtype).
TABLES: pernr.
*INFOTYPES: 0019.
tables p0019.
DATA: key LIKE pskey.
DATA: BEGIN OF ptext OCCURS 200.
DATA: line(72).DATA: END OF ptext.
SELECTION-SCREEN BEGIN OF BLOCK abc
WITH FRAME TITLE text-001.
PARAMETERS:
p_pernr LIKE pernr-pernr,
subty like p0019-subty,
endda like p0019-endda,
begda like p0019-begda.
SELECTION-SCREEN END OF BLOCK abc.ptext-line = 'Test Text1'.
APPEND ptext.
ptext-line = 'Test Text2'.
APPEND ptext.
ptext-line = 'Test Text5'.
APPEND ptext.
data: rec_return type bapiret1.
DATA L_PERNR LIKE BAPIP0001-PERNR.
move '0019' to p0019-infty.
MOVE p_PERNR TO P0019-PERNR.
MOVE '10' TO P0019-SUBTY.
MOVE ENDDA TO P0019-ENDDA.
MOVE BEGDA TO P0019-BEGDA.
MOVE '000' TO P0019-SEQNR.
MOVE-CORRESPONDING p0019 TO key.p0019-itxex = 'X'.
move pernr to l_pernr.
call function 'BAPI_EMPLOYEE_ENQUEUE'
exporting
number = l_pernr
importing
return = rec_return.
move subty to p0019-TMART.
move begda to p0019-TERMN.
CALL FUNCTION
'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0019'
number = p_pernr
validityend = p0019-endda
validitybegin = p0019-begda
record = p0019
operation = 'INS'.
EXPORT ptext from ptext TO DATABASE
pcl1(tx) ID key.
call function 'BAPI_EMPLOYEE_DEQUEUE'
exporting
number = l_pernr
importing
return = rec_return.
As I have already implemented my solution using BDC, Just wanted to know why its not working during creation.
Thanks for your valuable replies,
Rajesh.
You can use the function HR_INFOTYPE_OPERATION for infotype 0019.
Following is an example program from a
Use PNP logical database to start .
You can use operation 'MOD' or 'INS'.
infotypes : 0002.
tables :pernr.
return structure
data: rec_return type bapiret1. "return code
start-of-selection.
get pernr.
rp-provide-from-last p0002 space sy-datum sy-datum.
p0002-nachn = 'test'.
call function 'BAPI_EMPLOYEE_ENQUEUE'
exporting
number = p0002-pernr
importing
return = rec_return.
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = '0002'
number = p0002-pernr
subtype = p0002-subty
objectid = p0002-objps
recordnumber = p0002-seqnr
validityend = p0002-endda
validitybegin = p0002-begda
record = p0002
operation = 'MOD'
*tclas = ''
*lockindicator = p0002-sprps
*nocommit = ' '
importing
return = rec_return.
call function 'BAPI_EMPLOYEE_DEQUEUE'
exporting
number = p0002-pernr
importing
return = rec_return.
end-of-selection.
Message was edited by: Ahmad Quraishi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.