2014 Jul 01 5:08 AM
Hello Experts,
While I try to create a record in IT0081 using FM HR_INFOTYPE_OPERATION, all data flows correctly to IT0081 screen except Unit (P0081-WDEIN) and rank (P0081-WDGRD).
Here is the sample code I created:
report zmtest.
data: ls_p0081 type p0081,
ls_return type bapireturn1.
ls_p0081-pernr = '12345'. " Hardcode PERNR vale here
ls_p0081-subty = '01'.
ls_p0081-objps = '01'.
ls_p0081-begda = '20140701'.
ls_p0081-endda = '99991231'.
ls_p0081-wdgrd = '003'.
ls_p0081-wdart = '01'.
ls_p0081-wderd = '20140515'.
ls_p0081-wdein = 'Test'.
ls_p0081-wdpfl = 'X'.
clear: ls_return.
call function 'BAPI_EMPLOYEET_ENQUEUE'
exporting
number = '12345'
validitybegin = '20140701'
importing
return = ls_return.
call function 'HR_INFOTYPE_OPERATION'
exporting
infty = '0081'
number = '12345'
subtype = '01'
* OBJECTID =
* LOCKINDICATOR =
validityend = '99991231'
validitybegin = '20140701'
* RECORDNUMBER =
record = ls_p0081
operation = 'INS'
tclas = 'A'
dialog_mode = '2'
* NOCOMMIT =
* VIEW_IDENTIFIER =
* SECONDARY_RECORD =
importing
return = ls_return
* KEY =
.
write: ls_return.
Please suggest !!
2014 Jul 02 10:22 AM
Hi All,
I found the cause. This is how the infotype behaves. In the Infotype modulepool, the following piece of code is clearing Unit (P0081-WDEIN) and Rank (P0081-WDGRD) for all actions other than COPY.
if psyst-ioper ne copy and psyst-massn is initial. "note 708768
clear: p0081-wdein, p0081-wdgrd.
endif.
Hi All,
I found the cause. This is how the infotype behaves. In the Infotype modulepool, the following piece of code is clearing Unit (P0081-WDEIN) and Rank (P0081-WDGRD) for all actions other than COPY.
if psyst-ioper ne copy and psyst-massn is initial. "note 708768
clear: p0081-wdein, p0081-wdgrd.
endif.
2014 Jul 01 6:22 AM
Hi Meenakshi,
The record type is mismatched.
Please go through the FM definition you get some information.
Actually the record type is like PSHDR , in this structure there is no what you mentioned variables so ,please cross check once and verify.
Regards,
Krishna
2014 Jul 01 7:19 AM
Thanks for the reply Krishna but I don't think there is a type mismatch. I am using P structure and all P structures have PSHDR included. I have updated many other infotypes in the same program using the same approach and it works fine. For 0081 also I am not getting any error. Just that data for 2 mentioned fields is not flowing from program to Infotype.
2014 Jul 02 10:22 AM
Hi All,
I found the cause. This is how the infotype behaves. In the Infotype modulepool, the following piece of code is clearing Unit (P0081-WDEIN) and Rank (P0081-WDGRD) for all actions other than COPY.
if psyst-ioper ne copy and psyst-massn is initial. "note 708768
clear: p0081-wdein, p0081-wdgrd.
endif.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |