cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Function Parameters

Former Member
0 Likes
785

Hi,

I want to retrieve data from PCL4 table for all Person Numbers and Infotypes and Users for a specific date range. I am looking for code example on how to do that using Function HR_INFOTYPE_LOG_GET_LIST. My code is as given below. I am not sure what I am missing since I don't get any result.

I would really appreciate if someone can help me out.

Thanks.

Regards,

bw_newbie

REPORT ZTEST11 .

DATA: BEGDA TYPE BEGDA.

DATA: ENDDA TYPE ENDDA.

DATA: doc_key_tab TYPE PLDOC_KEY_TAB.

DATA: SUBRC like SY-SUBRC.

*

data: pernr_tab type persno_range_tab with header line,

infty_tab type infty_range_tab with header line.

data: date_tab type DATUM_RANGE_TAB with header line.

*

  • Select ranges

RANGES: L_R_PERNR FOR PA0000-PERNR,

L_R_OBJID FOR PLOGI-OBJID.

  • fetch data to be transfered in 2nd call

  • 1. Fill range tables

clear pernr_tab.

pernr_tab-sign = 'I'.

pernr_tab-option = 'BT'.

pernr_tab-low = 00000000.

pernr_tab-high = 99999999.

append pernr_tab.

*

clear infty_tab.

infty_tab-sign = 'I'.

infty_tab-option = 'BT'.

infty_tab-low = '0000'.

infty_tab-high = '3000'.

BEGDA = '20060101'.

ENDDA = '20060110'.

clear date_tab.

date_tab-sign = 'I'.

date_tab-option = 'BT'.

date_tab-low = begda.

date_tab-high = endda.

call function 'HR_INFOTYPE_LOG_GET_LIST'

exporting

begda = begda

endda = endda

importing

subrc = subrc

tables

pernr_tab = pernr_tab

infty_tab = infty_tab

infty_logg_key_tab = doc_key_tab

DATUM_RANGE_TAB = date_tab.

WRITE 'DONE'.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Likes

Hi,

When u create a variant for the program in the output options put select New pages per doc, I do not know about other options. U get all the data in an internal table but in a single field, u can split it depending upon ur requirement.

data: begin of downtab occurs 0,

line(255),

end of downtab.

DATA: BEGIN OF L_T_LISTOBJECT1 OCCURS 0.

INCLUDE STRUCTURE ABAPLIST.

DATA: END OF L_T_LISTOBJECT1.

SUBMIT RPUAUD00

USING SELECTION-SET 'ZVAR1'

AND RETURN

EXPORTING LIST TO MEMORY.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = L_T_LISTOBJECT1

EXCEPTIONS

NOT_FOUND = 1.

CALL FUNCTION 'WRITE_LIST'

EXPORTING

WRITE_ONLY = 'X'

TABLES

LISTOBJECT = L_T_LISTOBJECT1

  • EXCEPTIONS

  • EMPTY_LIST = 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.

call function 'LIST_TO_ASCI'

  • EXPORTING

  • list_index = list_index

TABLES

listasci = downtab

listobject = L_T_LISTOBJECT1

EXCEPTIONS

list_index_invalid = 1

others = 2.

if sy-subrc <> 0.

raise list_index_invalid.

endif.

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Regarding long docs/short docs u have the options in RPUAUD00

Regards

Vick

Message was edited by: vick vennav

Answers (6)

Answers (6)

Former Member
0 Likes

Hi Vick,

Thanks a lot for your help. I ran the code you provided. I see the output. Before I mark this topic as solved and award you points Can you Please let me know your thoughts on my previous post regarding Function HR_INFOTYPE_LOG_GET_LIST on how to retrieve short term docs.

Thanks.

Regards,

bw_newbie

Former Member
0 Likes

Hi,

I need to debug the standard program and check it out how it works you could do the same, will take some time but my knowledge is limited to this.How does the long term and short term documents affect your program.

Regards

Vick

Message was edited by: vick vennav

Former Member
0 Likes

Hi Vick,

Please correct me If I am wrong. I guess I cannot use Program RPUAUD00 since I cannot get the output to the calling Program/Function. I think I have no choice but to invoke Function HR_INFOTYPE_LOG_GET_LIST. But, I see that this function is only returning long term docs. I am interested in Short term docs(SA). Where can I specify when invoking this function that I am interested in Short term docs?

Thanks.

Regards,

bw_newbie

Former Member
0 Likes

Hi Vick,

Per your suggestion. I have changed my approach. Here's the code I have using program RPUAUD00. However, I see the output on display. I need to get the result in a table or structure. The Functions 'LIST_FROM_MEMORY' and 'DISPLAY_LIST' do not return anything. What am I missing. Please help.

REPORT ZTEST12 .

DATA: BEGIN OF L_T_LISTOBJECT1 OCCURS 0.

INCLUDE STRUCTURE ABAPLIST.

DATA: END OF L_T_LISTOBJECT1.

SUBMIT RPUAUD00

USING SELECTION-SET 'ZVAR1'

AND RETURN

EXPORTING LIST TO MEMORY.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

LISTOBJECT = L_T_LISTOBJECT1

EXCEPTIONS

NOT_FOUND = 1.

CALL FUNCTION 'DISPLAY_LIST'

exporting fullscreen = 'X'

tables listobject = L_T_LISTOBJECT1.

WRITE 'DONE'.

Former Member
0 Likes

Hi,

Use Submit statement to call the program and you can use return to come back to the original program but I do not know of any way to to get the data from the other program into yours.

Regards

Vick

Former Member
0 Likes

Hi Vick,

My requirement is to retrieve changed records from PCL4 table. I was wondering if I could invoke RPUAUD00 in my program or Function and pass the required parameters and get output in a structure or a table. Please let me know.

Thanks.

Regards,

bw_newbie

Former Member
0 Likes

Hi,

Why do u wnat to write a custom program when you have standard program, check out the program RPUAUD00 if you do not get any output it means that you need to make sure that these fields are maintained in the views - Infotypes to be Logged (V_T585A), Field Group Definition (V_T585B) and Field Group Characteristics (V_T585C).

Regards

Vick

I was looking into your code, you are missing append statement after the infty_tab and date_tab. The following is the sample code.

FORM read_documents

TABLES doc_key_tab STRUCTURE pldoc_key

error_tab STRUCTURE rpbenerr

USING pernr TYPE pernr_d

begda TYPE begda

endda TYPE endda

idoc_categ TYPE rpbenidoc_categ

reaction LIKE sy-msgty

CHANGING subrc LIKE sy-subrc.

*

DATA: pernr_tab TYPE persno_range_tab WITH HEADER LINE,

infty_tab TYPE infty_range_tab WITH HEADER LINE.

*

  • 1. Fill range tables

CLEAR pernr_tab.

pernr_tab-sign = 'I'.

pernr_tab-option = 'EQ'.

pernr_tab-low = pernr.

APPEND pernr_tab.

*

CLEAR infty_tab.

infty_tab-sign = 'I'.

infty_tab-option = 'EQ'.

IF idoc_categ-healt = true.

IF parameter_cobra = false.

infty_tab-low = '0167'. APPEND infty_tab.

ELSE.

infty_tab-low = '0212'. APPEND infty_tab.

ENDIF.

ENDIF.

IF idoc_categ-insur = true.

infty_tab-low = '0168'. APPEND infty_tab.

ENDIF.

IF idoc_categ-savin = true.

infty_tab-low = '0169'. APPEND infty_tab.

ENDIF.

IF idoc_categ-spend = true.

IF parameter_cobra = false.

infty_tab-low = '0170'. APPEND infty_tab.

ELSE.

infty_tab-low = '0671'. APPEND infty_tab.

ENDIF.

ENDIF.

IF idoc_categ-misce = true.

infty_tab-low = '0377'. APPEND infty_tab.

ENDIF.

IF idoc_categ-stock = true.

infty_tab-low = '0379'. APPEND infty_tab.

ENDIF.

infty_tab-low = '0000'. APPEND infty_tab.

infty_tab-low = '0002'. APPEND infty_tab.

infty_tab-low = '0006'. APPEND infty_tab.

infty_tab-low = '0077'. APPEND infty_tab.

infty_tab-low = '0376'. APPEND infty_tab.

infty_tab-low = '0021'. APPEND infty_tab.

infty_tab-low = '0106'. APPEND infty_tab. " USA / Canada

infty_tab-low = '0148'. APPEND infty_tab. " Japan

infty_tab-low = '0397'. APPEND infty_tab. " Brasil

IF g_idoc_type = idoctype_participation2 OR

g_idoc_type = idoctype_participation3.

infty_tab-low = '0001'. APPEND infty_tab.

infty_tab-low = '0008'. APPEND infty_tab.

infty_tab-low = '0375'. APPEND infty_tab.

ENDIF.

*

  • 2. Read documents

CALL FUNCTION 'HR_INFOTYPE_LOG_GET_LIST'

EXPORTING

begda = begda

endda = endda

IMPORTING

subrc = subrc

TABLES

pernr_tab = pernr_tab

infty_tab = infty_tab

infty_logg_key_tab = doc_key_tab.

Message was edited by: vick vennav