‎2007 Sep 05 6:20 PM
Hi all Experts,
I am reading the infotype by using fm hr_read_infotype from infotype 0170. When I am trying to display i0170-endda, it is displaying wrong format.
i0170- enda for a pernr is 99991231
when trying to display from the structure which is retrived from the function module hr_read_infotype. is 91/23/ 999.
Please help me how to solve this issue.
‎2007 Sep 05 7:11 PM
declare ur internal table as :
data: itab type table of p0170 initial size 0 with header line.
Regards
Prax
‎2007 Sep 05 6:32 PM
check the date format settings in su01, defaults tab.
or may be..
The parameter name INFTY_TAB is not structure type but a string. So while displaying the date, make sure you are extracting complete date
Goto su01, enter your userid, click on defaults tabe and you will seee the date format
Thanks,
SKJ
Message was edited by:
SKJ
null
‎2007 Sep 05 6:36 PM
hi,
HOw to do date settings in the su01. I went there it is asking my userid. Can you please let me know how to do this?
‎2007 Sep 05 6:45 PM
Hi SJk
I tried in changing the date format but still it didnt work.
‎2007 Sep 05 6:53 PM
Hi all,
I wrote the code as below.
TABLES: pa0000.
DATA: i0170 TYPE TABLE OF pa0170 WITH HEADER LINE.
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
TCLAS = 'A'
pernr = ls_pernr-pernr
infty = '0170'
BEGDA = '20070101'
endda = '99991231'
BYPASS_BUFFER = ' '
IMPORTING
subrc = l_subrc
TABLES
infty_tab = i0170
EXCEPTIONS
INFTY_NOT_FOUND = 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.
IF l_subrc = 0.
write / i0170.
write / i0170-endda.
endif.
Please help me why the date format is wrong.
‎2007 Sep 05 6:59 PM
Try declaring :
Data: i0170 like pa0170 occurs 0 with header line.
Thanks,
SKJ
‎2007 Sep 05 7:10 PM
‎2007 Sep 05 7:20 PM
ok try making these changes to your code:
declare your infotype as:
<b>INFOTYPES: 0170</b>
TABLES: pa0000.
<b>*DATA: i0170 TYPE TABLE OF pa0170 WITH HEADER LINE.</b>
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
TCLAS = 'A'
pernr = ls_pernr-pernr
infty = '0170'
BEGDA = '20070101'
endda = '99991231'
BYPASS_BUFFER = ' '
IMPORTING
subrc = l_subrc
TABLES
infty_tab =<b>P0170</b>
EXCEPTIONS
INFTY_NOT_FOUND = 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.
IF l_subrc = 0.
write /P0170
write / P0170-endda.
endif.
Thanks,
SKJ
‎2007 Sep 05 7:52 PM
‎2007 Sep 05 6:54 PM
Try:
REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.
DATA: dt TYPE sy-datum VALUE '99991231'.
WRITE: /001 dt MM/DD/YYYY.Rob
‎2007 Sep 05 7:07 PM
Rob,
its working fine as you coded. But my scienerio is I read the complete record from infotype 0170 into i0170. Then how can i retrive i0170-endda.
Ravi
‎2007 Sep 05 7:18 PM
Can you:
REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.
TABLES: pa0107.
DATA: dt TYPE sy-datum.
SELECT endda FROM pa0107 INTO dt UP TO 1 ROWS.
WRITE: /001 dt MM/DD/YYYY.
ENDSELECT.Rob
‎2007 Sep 05 7:11 PM
declare ur internal table as :
data: itab type table of p0170 initial size 0 with header line.
Regards
Prax
‎2007 Sep 05 7:16 PM
Thanks Pradeep a lot. it is working fine with your suggested code.
Thanks
Ravi
‎2007 Sep 06 3:53 AM
Thanks a lot this forum is helping a lot. Thanks for the forum administrator