04-25-2006 10:14 PM
hi folks,
I have this piece of code and trying to delimit the records on the infotype 0050. The code is executing fine and I am getting no errors when I run the code but the record is not getting delimited.
Can anyone tell me what am I missing here?
SELECT SINGLE * INTO CORRESPONDING FIELDS OF WA_0050 FROM PA0050 WHERE PERNR = REC-PERNR.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = WA_0050-PERNR
IMPORTING
RETURN = return.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0050'
number = wa_0050-pernr
subtype = subty
validityend = ztermin (delimit date -YYYYMMDD)
validitybegin = wa_0050-begda
recordnumber = seqnr
record = wa_0050
operation = 'LIS9'
tclas = 'A'
dialog_mode = '0'
IMPORTING
return = return
key = key
EXCEPTIONS
OTHERS = 0.
IF NOT return IS INITIAL.
CLEAR key.
EXIT.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = WA_0050-PERNR
IMPORTING
return = return.
Any insight into this is greatly appreciated.
Thanks
Vinu
04-25-2006 10:28 PM
1. if you haven't already trie dit..put an explicit COMMIT WORK.
2. Change the parameter to dialog_mode = '2' & verify if all the delimit is actually done.
regards,
Suresh Datti
04-25-2006 10:57 PM
THANKS suresh,
I did put explicit COMMIT WORK soon after the HR_infotype_operation FM , and changed the dialog_mode to '2'.
I did not see any difference except the sy-subrc was '0' at that point.
Am I missing something?
Thanks
Vinu
04-26-2006 12:11 AM
Once again !!! I asked you to check out thread .. but !!!
<b>FYI</b>
I notice after debugging the program if you pass LIS instead of LIS9 , it gave you an error that entry not maintained in table T589A . I went there and copy the LIS9 entry for LIS . After that when I pass Actio = LIS in my Fm , it giving error Status LIS of the user interface MP018500 missing. It is because it doesnt have LIS in SE41. if I pass LIS , its not doing some thing . I also debug the program (FP50MF10 ) at line # 1659. it called the perform ( perform message(sapfp50g). From here youre getting message No data stored for & in the selected period
Main program = SAPFP50M
Source code = FP50MF10
perform message(sapfp50g). ( 1605 )
if pspar-actio(3) eq 'LIS'.
pspar-rcode = rc_not_found.
perform message(sapfp50g).
leave.
else.
pspar-rcode = rc_not_found.
perform message(sapfp50g).
psyst-ioper = old_ioper.
endif.
Every time if youre passing MOD or LIS its going there .
Hope thisll give you some guide line as I am still investigating that .
I think you need to create seprate programs to perform this task , as I am also fade up with this FM.
I also found class (IF_EX_HR_LA_TRM_ACTION :Adjust/delimit infotypes for a given action ) . You can try this out
Thanks
04-26-2006 1:01 AM
Saquib is right.. you are better off going for a normal BDC for the delimits.. the only way I could make the function module work was with dialog_mode = '2'
& validityend = wa_0050-endda (not the delimit date). and then you will have to manually enter the delimit date, when the screen comes up in dialog mode..
Regards,
Suresh Datti
04-26-2006 6:20 PM
Thanks fo your response guys,
Infact I am getting the message ' No data stored for 0050 in the selection period' as you mentioned, and I reverted to this FM because in the normal BDC the delimit action is not taking, and I cannot be using manually to enter because there will be about 2000 records in one roll out.
Let me try the other FM given by saquib, and if you have any leads or breakthrough from here let me know.
Vinu
04-26-2006 9:53 PM
04-26-2006 10:57 PM
04-27-2006 4:46 PM
hi folks!!!
Solved it using the FM HR_INFOTYPE_OPERATION.
Here is the code....
I had not used the FM 'HR_INFOTYPE_GETDETAIL' earlier, when I used it and with the action 'MOD' it worked, the records are getting delimited.
The problem with BDC was, it was not recognizing the Delimit action (when the button for delimit is pressed)
as a result the records were not getting updated.
The problem is each infotype has some uniques actions that they respond to like in my system updating infotypes 0035 and 0041 have dynamic actions which do not show up when you are recording the data using SHDB in a sequence.
But this worked finally!!!!
SELECT SINGLE * INTO CORRESPONDING FIELDS OF WA_0050 FROM PA0050 WHERE
PERNR = REC-PERNR.
BEGIN = wa_0050-begda.
END = wa_0050-endda.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = WA_0050-PERNR
IMPORTING
RETURN = return.
CALL FUNCTION 'HR_INFOTYPE_GETDETAIL'
EXPORTING
infty = '0050'
number = WA_0050-pernr
subtype = subty
validityend = END
validitybegin = BEGIN
tclas = 'A'
IMPORTING
return = return
record = WA_0050
EXCEPTIONS
OTHERS = 0.
IF NOT return IS INITIAL.
EXIT.
ENDIF.
Move ztermin to wa_0050-endda.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0050'
number = wa_0050-pernr
subtype = subty
validityend = '99991231'
validitybegin = BEGIN
recordnumber = seqnr
record = wa_0050
operation = 'MOD'
tclas = 'A'
dialog_mode = '0'
IMPORTING
return = return
key = key
EXCEPTIONS
OTHERS = 0.
IF NOT return IS INITIAL.
CLEAR key.
EXIT.
ENDIF.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = WA_0050-PERNR
IMPORTING
return = return.
IF NOT return IS INITIAL.
EXIT.
ENDIF.
<b>I HOPE IT HELPS TO EVERYONE.
THANKS GUYS FOR YOUR INPUT I SHALL AWARD POINTS HERE.
VINU</b>