Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

short dump

Former Member
0 Likes
1,490

Hi,

Please assist on this short dump.

Runtime Errors DATA_LENGTH_0

Except. CX_SY_RANGE_OUT_OF_BOUNDS

Date and Time 29.04.2008 14:29:12

-


Short text: Invalid partial field access: Length 0

Data: it_hist TYPE TABLE OF zshr014 INITIAL SIZE 0 WITH HEADER LINE.

FORM get_external_pers_name USING p_objid.

DATA : wg_full_name(40) TYPE c,

wg_diff TYPE i.

SELECT SINGLE * FROM hrp1000 WHERE plvar = '01'

AND otype = 'H'

AND objid = p_objid

AND endda = '99991231'.

IF sy-subrc = 0.

wg_full_name = hrp1000-stext.

SEARCH wg_full_name FOR hrp1000-short.

*MARSHALLL

  • IF sy-subrc = 0.

IF sy-subrc = 0 and sy-fdpos <> '0'.

*MARSHALLL

wg_diff = 40 - sy-fdpos.

it_hist-vorna = wg_full_name(sy-fdpos).

it_hist-nachn = wg_full_name+sy-fdpos(wg_diff).

ELSE.

it_hist-vorna = space.

it_hist-nachn = space.

ENDIF.

ELSE.

it_hist-vorna = space.

it_hist-nachn = space.

ENDIF.

ENDFORM.

Please assist.

Regards,

Fred.

1 ACCEPTED SOLUTION
Read only

soumya_jose3
Active Contributor
0 Likes
1,368

Hi Fred,

It seems that the variable "wg_diff" is getting some negative value in the statement

wg_diff = 40 - sy-fdpos.

as sy-fdpos value is greater than 40.

Please check it in debugging mode and let me know.

Regards,

Soumya.

Hi,

Please assist on this short dump.

Runtime Errors DATA_LENGTH_0

Except. CX_SY_RANGE_OUT_OF_BOUNDS

Date and Time 29.04.2008 14:29:12

-


Short text: Invalid partial field access: Length 0

Data: it_hist TYPE TABLE OF zshr014 INITIAL SIZE 0 WITH HEADER LINE.

FORM get_external_pers_name USING p_objid.

DATA : wg_full_name(40) TYPE c,

wg_diff TYPE i.

SELECT SINGLE * FROM hrp1000 WHERE plvar = '01'

AND otype = 'H'

AND objid = p_objid

AND endda = '99991231'.

IF sy-subrc = 0.

wg_full_name = hrp1000-stext.

SEARCH wg_full_name FOR hrp1000-short.

*MARSHALLL

  • IF sy-subrc = 0.

IF sy-subrc = 0 and sy-fdpos <> '0'.

*MARSHALLL

wg_diff = 40 - sy-fdpos.

it_hist-vorna = wg_full_name(sy-fdpos).

it_hist-nachn = wg_full_name+sy-fdpos(wg_diff).

ELSE.

it_hist-vorna = space.

it_hist-nachn = space.

ENDIF.

ELSE.

it_hist-vorna = space.

it_hist-nachn = space.

ENDIF.

ENDFORM.

Please assist.

Regards,

Fred.

9 REPLIES 9
Read only

soumya_jose3
Active Contributor
0 Likes
1,368

Hi Fred,

Can you give some information of this dump from ST22 tcode. It also shows where excatly the dump is coming with the sign

"--->".

Regards,

Soumya.

Read only

Former Member
0 Likes
1,368

Hi,

Please refer the OSS note 565565.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
1,368

Hi Soumya,

Information on where terminated

| Termination occurred in the ABAP program "ZRHRPD0004" - in

"GET_EXTERNAL_PERS_NAME".

The main program was "ZRHRPD0004 ".

In the source code you have the termination point in line 1139

of the (Include) program "ZRHRPD0004". The termination is caused because exception "CX_SY_RANGE_OUT_OF_BOUNDS"occurred in procedure "GET_EXTERNAL_PERS_NAME" "(FORM)", but it was neither handled locally nor declared in the RAISING clause of its signature. The procedure is in program "ZRHRPD0004 "; its source code begins in line 1121 of the (Include program "ZRHRPD0004 ".

Read only

0 Likes
1,368

Guess you need to send this message to people who have access to your server

We will not be able to see your Z reports. Sorry

Read only

Former Member
0 Likes
1,368

Hi Fred,


IF sy-subrc = 0 and sy-fdpos '0'.
*MARSHALLL

wg_diff = 40 - sy-fdpos.
it_hist-vorna = wg_full_name(sy-fdpos).
it_hist-nachn = wg_full_name+sy-fdpos(wg_diff).

ELSE.
it_hist-vorna = space.
it_hist-nachn = space.

in the above piece of code, you are trying to send the full name. then i dont think u require to fight tough with all variables.


IF sy-subrc = 0 and sy-fdpos '0'.
*MARSHALLL

*wg_diff = 40 - sy-fdpos.
it_hist-vorna = wg_full_name.
it_hist-nachn = wg_full_name.

ELSE.
it_hist-vorna = space.
it_hist-nachn = space.

coz both do the same thing.

now try executing and lemme know if u r getting short dump.

Reward points if this helps,

Kiran

Read only

soumya_jose3
Active Contributor
0 Likes
1,369

Hi Fred,

It seems that the variable "wg_diff" is getting some negative value in the statement

wg_diff = 40 - sy-fdpos.

as sy-fdpos value is greater than 40.

Please check it in debugging mode and let me know.

Regards,

Soumya.

Read only

Former Member
0 Likes
1,368

change the coding as ...

IF sy-subrc = 0 and sy-fdpos = '0'.

it_hist-vorna = wg_full_name(0).

it_hist-nachn = wg_full_name+0(40).

ELSE.

Read only

Former Member
0 Likes
1,368

Hi,

Please check these values in debugging mode,

it_hist-vorna = wg_full_name(sy-fdpos).

it_hist-nachn = wg_full_name+sy-fdpos(wg_diff).

might be going negative out of range.

Bye.

Read only

0 Likes
1,368

Hi All,

I have tried all your suggestion (now i am back to my original code) but they never worked i think its best if you can have a look at my coding:

REPORT zrhrpd0004 NO STANDARD PAGE HEADING

LINE-SIZE 132.

----


  • Author: Shobna Devchand *

  • Date: 12/06/2006 *

  • Change request number: DECK905984 *

  • Trouble ticket number: *

  • Description: Training and Event Management Report : *

  • Attendees' History *

  • Version: ECC 5.0 *

  • Technical Design Specification(s): SAP-TDS-FHR-RPT-T009-V1.0 *

----


  • Change History: *

  • --------------- *

*Ver Date UserID TransportNo Description *

----


--


[TABLES]-

TABLES:

pernr,

p0001,

hrp1000,

hrp1001,

hrpad34,

hrpad25,

pa0008.

--


[INFOTYPES]-

*INFOTYPES:

--


[TYPES]-

DATA : wg_objid TYPE pchdy,

wg_otype LIKE pchdy-otype VALUE 'O',

wg_dtype LIKE pchdy-otype VALUE 'D',

wg_ptype LIKE pchdy-otype VALUE 'P',

wg_htype LIKE pchdy-otype VALUE 'H',

wg_etype LIKE pchdy-otype VALUE 'E'.

INCLUDE : ziclassdef_gen.

DATA : event_receiver TYPE REF TO lcl_event_receiver.

INCLUDE zilonalv.

--


[CONSTANTS]-

*CONSTANTS:

  • (C_?????)

--


[INCLUDES]-

INCLUDE rhxmacro. "PD Objects

rhx-f4-objid-data.

DATA: subrc TYPE sy-subrc.

--


[PARAMETERS]-

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text-t01.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS : p_pernr AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN COMMENT 3(15) text-t05.

SELECTION-SCREEN POSITION 30.

SELECT-OPTIONS : s_pernr FOR wg_objid-objid_str NO INTERVALS.

SELECTION-SCREEN POSITION 58.

PARAMETERS : p_epern AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN COMMENT 60(15) text-t06.

SELECT-OPTIONS : s_epern FOR wg_objid-objid_str NO INTERVALS.

SELECTION-SCREEN END OF LINE.

SELECT-OPTIONS :

s_org FOR wg_objid-objid_str NO INTERVALS.

SELECTION-SCREEN SKIP.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS p_evtyp AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN COMMENT 3(19) text-t07.

SELECTION-SCREEN POSITION 30.

SELECT-OPTIONS : s_evtyp FOR wg_objid-objid_str NO INTERVALS.

SELECTION-SCREEN POSITION 58.

PARAMETERS : p_event AS CHECKBOX DEFAULT 'X'.

SELECTION-SCREEN COMMENT 60(15) text-t08.

SELECT-OPTIONS : s_event FOR wg_objid-objid_str NO INTERVALS.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK block1.

SELECTION-SCREEN BEGIN OF BLOCK block2 WITH FRAME TITLE text-t09.

SELECT-OPTIONS : s_level FOR pa0008-trfst NO INTERVALS.

SELECTION-SCREEN END OF BLOCK block2.

SELECTION-SCREEN BEGIN OF BLOCK block3 WITH FRAME TITLE text-t02.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS :

p_begda LIKE sy-datum DEFAULT '19000101'.

SELECTION-SCREEN COMMENT 17(2) text-t03.

SELECTION-SCREEN POSITION 25.

PARAMETERS :

p_endda LIKE sy-datum DEFAULT '99991231'.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK block3.

--


[SELECT OPTIONS]-

*SELECT-OPTIONS:

  • (S_?????)

--


[FIELD GROUPS]-

*FIELD-GROUPS:

--


[INCLUDES]-

*INCLUDE: bdcrecx1. "for BDC's

*INCLUDE: ZIALBCDT0010 "if us any user standard functions

"like page headings

==============================================================[DATA]==

  • Work fields

DATA : wg_plvar LIKE hrhcp_s_plan-plvar VALUE '01',

wg_orgeh LIKE p0001-orgeh,

wg_pos LIKE p0001-plans,

wg_pernr TYPE prelp-pernr,

wg_lines TYPE i,

wg_index TYPE i,

wg_begda TYPE prelp-begda,

wg_endda TYPE prelp-endda,

wg_trfst LIKE p0008-trfst.

  • Totals

  • (TOT_?????)

  • or

  • (SUM_?????)

  • Flags

  • (FL_?????)

  • Indexes

  • (IDX_?????)

  • Ranges

  • (R_?????)

--


[STRUCTURES]-

DATA : it_stations TYPE TABLE OF hrsobid INITIAL SIZE 0 WITH HEADER LINE,

it_people TYPE TABLE OF hrpe_ind_dev_plan INITIAL SIZE 0 WITH HEADER LINE,

it_p0001 TYPE TABLE OF p0001 INITIAL SIZE 0 WITH HEADER LINE,

it_p0002 TYPE TABLE OF p0002 INITIAL SIZE 0 WITH HEADER LINE,

it_hrp1001 TYPE TABLE OF hrp1001 INITIAL SIZE 0 WITH HEADER LINE,

it_hist TYPE TABLE OF zshr014 INITIAL SIZE 0 WITH HEADER LINE.

DATA : BEGIN OF it_dev OCCURS 0,

orgeh LIKE p0001-orgeh,

orgtxt LIKE hrp1000-stext,

sobid LIKE hrpe_ind_dev_plan-sobid,

stext LIKE hrpe_ind_dev_plan-stext,

tobid LIKE hrpe_ind_dev_plan-tobid,

ttext LIKE hrpe_ind_dev_plan-ttext,

statetxt LIKE hrpe_ind_dev_plan-statetxt,

vbegd LIKE hrpe_ind_dev_plan-vbegd,

vendd LIKE hrpe_ind_dev_plan-vendd,

END OF it_dev.

--


[INITIALIZATION]-

INITIALIZATION.

--


[AT SELECTION SCREEN]-

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_pernr-low.

rhx-f4-objid-low wg_plvar wg_ptype s_pernr 'PLVAR' space.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_epern-low.

rhx-f4-objid-low wg_plvar wg_htype s_epern 'PLVAR' space.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_org-low.

rhx-f4-objid-low wg_plvar wg_otype s_org 'PLVAR' space.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_evtyp-low.

rhx-f4-objid-low wg_plvar wg_dtype s_evtyp 'PLVAR' space.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_event-low.

rhx-f4-objid-low wg_plvar wg_etype s_event 'PLVAR' space.

AT SELECTION-SCREEN.

IF p_evtyp NE 'X' AND p_event NE 'X'.

MESSAGE e022(zhr).

ENDIF.

--


[START OF SELECTION]-

START-OF-SELECTION.

IF p_evtyp = 'X'.

PERFORM get_attendee_to_evtyp.

ENDIF.

IF p_event = 'X'.

PERFORM get_attendee_to_event.

ENDIF.

--


[END OF SELECTION]-

END-OF-SELECTION.

SORT it_hist BY pernr.

PERFORM display_alv.

--


[TOP OF PAGE]-

TOP-OF-PAGE.

*PERFORM f_page_headings. (if use headings make sure to include

  • ZIALBCDT0010)

--


[END OF PAGE]-

END-OF-PAGE.

--


[AT USER COMMAND]-

AT USER-COMMAND.

--


[AT LINE SELECTION]-

AT LINE-SELECTION.

============================================================[FORMS]===

*----


*FORMS.

&----


*& Form fill_stations_table

&----


FORM fill_stations_table .

REFRESH : it_stations.

CLEAR : it_stations.

LOOP AT s_evtyp.

it_stations-plvar = '01'.

it_stations-otype = 'D'. "Business Event Type

it_stations-sobid = s_evtyp-low.

APPEND it_stations.

ENDLOOP.

ENDFORM. " fill_stations_table

&----


*& Form get_developed_people

&----


FORM get_developed_people .

REFRESH : it_people, it_dev.

CLEAR : it_people, it_dev.

CALL FUNCTION 'RHPQ_GET_DEVELOPED_PEOPLE'

EXPORTING

plvar = '01'

begda = p_begda

endda = p_endda

TABLES

stations = it_stations

people = it_people

EXCEPTIONS

no_authority = 1

nothing_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

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

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

ENDIF.

LOOP AT it_people.

MOVE-CORRESPONDING it_people TO it_dev.

IF it_dev-stext IS INITIAL.

*--- Get Business Event Type Text

PERFORM get_object_text USING it_dev-sobid

CHANGING it_dev-stext.

ENDIF.

APPEND it_dev.

ENDLOOP.

ENDFORM. " get_developed_people

&----


*& Form check_org

&----


FORM check_org .

*--- Check if people obtained with Business Event Types are in Org Units selected

IF NOT s_org IS INITIAL.

wg_index = 1.

LOOP AT it_dev.

CLEAR : wg_orgeh.

*--- Get Org Unit of Attendee

PERFORM get_org_unit_of_employee USING it_dev-tobid

wg_orgeh.

IF wg_orgeh IN s_org.

it_dev-orgeh = wg_orgeh.

MODIFY it_dev INDEX wg_index.

wg_index = wg_index + 1.

*--- Get Org Unit Text

PERFORM get_orgeh_text USING wg_orgeh

CHANGING it_dev-orgtxt.

ELSE.

*--- If Org Unit of Developed person is not in selection Org

*--- then remove

DELETE it_dev INDEX wg_index.

ENDIF.

ENDLOOP.

ELSE.

*--- For all Org Units --- Get Org Unit of Employee

wg_index = 1.

LOOP AT it_dev.

CLEAR : wg_orgeh.

*--- Get Org Unit of Attendee

PERFORM get_org_unit_of_employee USING it_dev-tobid

wg_orgeh.

*--- Get Org Unit Text

PERFORM get_orgeh_text USING wg_orgeh

CHANGING it_dev-orgtxt.

it_dev-orgeh = wg_orgeh.

MODIFY it_dev INDEX wg_index.

wg_index = wg_index + 1.

ENDLOOP.

ENDIF.

ENDFORM. " check_org

&----


*& Form get_org_unit_of_employee

&----


FORM get_org_unit_of_employee USING p_tobid

p_orgeh.

CLEAR : wg_pernr, wg_orgeh, it_p0001, wg_lines.

REFRESH : it_p0001.

wg_pernr = p_tobid.

CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING

tclas = 'A'

pernr = wg_pernr

infty = '0001'

begda = p_begda

endda = p_endda

TABLES

infty_tab = it_p0001

EXCEPTIONS

infty_not_found = 1

OTHERS = 2.

IF sy-subrc = 0.

DESCRIBE TABLE it_p0001 LINES wg_lines.

READ TABLE it_p0001 INDEX wg_lines.

IF sy-subrc = 0.

p_orgeh = it_p0001-orgeh.

ELSE.

p_orgeh = space.

ENDIF.

ENDIF.

ENDFORM. " get_org_unit_of_employee

&----


*& Form check_pernr

&----


FORM check_pernr .

CLEAR : wg_pernr.

IF NOT s_pernr IS INITIAL.

wg_index = 1.

LOOP AT it_dev.

wg_pernr = it_dev-tobid.

IF NOT wg_pernr IN s_pernr.

DELETE it_dev INDEX wg_index.

ELSE.

wg_index = wg_index + 1.

ENDIF.

ENDLOOP.

ENDIF.

ENDFORM. " check_pernr

&----


*& Form get_all_business_event_types

&----


FORM get_all_business_event_types .

REFRESH : it_stations.

CLEAR : it_stations.

SELECT * FROM hrp1000 WHERE plvar = '01'

AND otype = 'D'.

it_stations-plvar = '01'.

it_stations-otype = 'D'. "Business Event Type

it_stations-sobid = hrp1000-objid.

APPEND it_stations.

ENDSELECT.

ENDFORM. " get_all_business_event_types

&----


*& Form display_alv

&----


FORM display_alv .

wg_repid = sy-repid.

wg_struc = 'ZSHR014'.

wg_header = text-t04.

PERFORM alv_create_layout USING wg_layout.

PERFORM fill_field_catalogue USING wg_struc

CHANGING wg_fldcat.

PERFORM fill_add_fieldcat USING wg_struc

CHANGING wg_fldcat.

PERFORM alv_eventtab_build USING wg_event[].

PERFORM alv_comment_build USING wg_list_top[]

wg_header.

PERFORM additional_comment USING wg_list_top[]

wg_header.

  • PERFORM alv_sort_build USING 'IT_HIST'

  • CHANGING wg_sort[].

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = wg_repid

i_callback_top_of_page = c_top_of_page

is_layout = wg_layout

it_fieldcat = wg_fldcat[]

i_save = 'A'

  • it_events = wg_event[]

  • it_sort = wg_sort[]

TABLES

t_outtab = it_hist.

ENDFORM. " display_alv

&----


*& Form additional_comment

&----


FORM additional_comment USING p_wg_list_top TYPE slis_t_listheader

p_header.

  • REFRESH : p_wg_list_top.

DATA : wg_begda(10) TYPE c,

wg_endda(10) TYPE c.

DATA: wc_line TYPE slis_listheader,

wc_dat1(10) TYPE c,

wc_dat2(10) TYPE c.

CONCATENATE p_begda(4) '.' p_begda4(2) '.' p_begda6(2) INTO wg_begda.

CONCATENATE p_endda(4) '.' p_endda4(2) '.' p_endda6(2) INTO wg_endda.

CLEAR wc_line.

wc_line-typ = 'S'.

wc_line-key = 'Evaluation Period : '.

CONCATENATE wg_begda 'to' wg_endda INTO wc_line-info SEPARATED BY space.

APPEND wc_line TO p_wg_list_top.

ENDFORM. " additional_comment

&----


*& Form get_object_text

&----


FORM get_object_text USING p_sobid

CHANGING p_stext.

SELECT SINGLE * FROM hrp1000 WHERE plvar = '01'

AND otype = 'D'

AND objid = p_sobid.

IF sy-subrc = 0.

p_stext = hrp1000-stext.

ELSE.

p_stext = space.

ENDIF.

ENDFORM. " get_object_text

&----


*& Form alv_sort_build

&----


FORM alv_sort_build USING p_tabname

CHANGING p_wg_sort TYPE slis_t_sortinfo_alv.

DATA: wc_sort TYPE slis_sortinfo_alv.

DATA: wc_num TYPE i.

wc_num = 1.

CLEAR wc_sort.

wc_sort-fieldname = 'ORGEH'.

wc_sort-spos = wc_num.

wc_sort-up = 'X'.

wc_sort-obligatory = 'X'.

wc_sort-subtot = 'X'.

  • wa_sort-expa = ''.

  • wa_sort-comp = 'X'.

wc_sort-group = '* '.

wc_sort-tabname = p_tabname.

APPEND wc_sort TO p_wg_sort.

CLEAR wc_sort.

  • wc_num = wc_num + 1.

*

  • CLEAR wc_sort.

  • wc_sort-fieldname = 'SOBID'.

  • wc_sort-spos = wc_num.

  • wc_sort-up = 'X'.

  • wc_sort-obligatory = 'X'.

  • wc_sort-subtot = 'X'.

    • wa_sort-expa = ''.

    • wa_sort-comp = 'X'.

    • wc_sort-group = '* '.

  • wc_sort-tabname = p_tabname.

*

  • APPEND wc_sort TO p_wg_sort.

  • CLEAR wc_sort.

*

  • wc_num = wc_num + 1.

*

  • CLEAR wc_sort.

  • wc_sort-fieldname = 'STEXT'.

  • wc_sort-spos = wc_num.

  • wc_sort-up = 'X'.

  • wc_sort-obligatory = 'X'.

  • wc_sort-subtot = 'X'.

    • wa_sort-expa = ''.

    • wa_sort-comp = 'X'.

    • wc_sort-group = '* '.

  • wc_sort-tabname = p_tabname.

*

  • APPEND wc_sort TO p_wg_sort.

  • CLEAR wc_sort.

*

ENDFORM. " alv_sort_build

&----


*& Form get_orgeh_text

&----


FORM get_orgeh_text USING p_orgeh

CHANGING p_orgtxt.

CLEAR : p_orgtxt.

SELECT SINGLE * FROM hrp1000 WHERE plvar = '01'

AND otype = 'O'

AND objid = p_orgeh.

IF sy-subrc = 0.

p_orgtxt = hrp1000-stext.

ELSE.

p_orgtxt = space.

ENDIF.

ENDFORM. " get_orgeh_text

&----


*& Form get_attendee_to_evtyp

&----


FORM get_attendee_to_evtyp .

REFRESH : it_hrp1001.

CLEAR : it_hrp1001.

*--- Get Attendees to Business Event Type Relationship for Selected Period.

PERFORM get_empl_evtyp.

PERFORM get_ext_pers_evtyp.

LOOP AT it_hrp1001.

CLEAR : wg_orgeh, wg_pos, wg_begda, wg_endda, wg_trfst.

wg_begda = it_hrp1001-begda.

wg_endda = it_hrp1001-endda.

*--- Determine if attendee in Org Unit Selected.

PERFORM get_employee_org USING it_hrp1001-objid wg_orgeh wg_pos

wg_begda wg_endda.

*--- Determine if attendee in Payscale Level selected

PERFORM get_trfst USING it_hrp1001-objid wg_trfst wg_begda wg_endda.

IF wg_orgeh IN s_org AND wg_trfst IN s_level.

PERFORM fill_it_hist.

it_hist-evtyp = 'X'.

PERFORM fill_add_info_pad34 USING it_hrp1001-adatanr.

APPEND it_hist.

ENDIF.

ENDLOOP.

ENDFORM. " get_attendee_to_evtyp

&----


*& Form get_employee_org

&----


FORM get_employee_org USING p_objid

p_org

p_pos

p_hbegda TYPE prelp-begda

p_hendda TYPE prelp-endda.

REFRESH : it_p0001.

CLEAR : it_p0001.

CLEAR : wg_lines.

DATA : wg_pernr LIKE pernr-pernr.

wg_pernr = p_objid.

CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING

tclas = 'A'

pernr = wg_pernr

infty = '0001'

begda = p_hbegda

endda = p_hendda

TABLES

infty_tab = it_p0001

EXCEPTIONS

infty_not_found = 1

OTHERS = 2.

IF sy-subrc = 0.

DESCRIBE TABLE it_p0001 LINES wg_lines.

READ TABLE it_p0001 INDEX wg_lines.

IF sy-subrc = 0.

p_org = it_p0001-orgeh.

p_pos = it_p0001-plans.

ELSE.

p_org = space.

p_pos = space.

ENDIF.

ELSE.

p_org = space.

p_pos = space.

ENDIF.

ENDFORM. " get_employee_org

&----


*& Form fill_it_hist

&----


FORM fill_it_hist .

CLEAR : it_hist.

it_hist-pernr = it_hrp1001-objid.

it_hist-ttype = it_hrp1001-otype.

IF it_hrp1001-otype = 'P'.

PERFORM get_employee_name USING it_hist-pernr.

ELSEIF it_hrp1001-otype = 'H'.

PERFORM get_external_pers_name USING it_hrp1001-objid.

ENDIF.

it_hist-orgeh = wg_orgeh.

it_hist-posid = wg_pos.

it_hist-trfst = wg_trfst.

PERFORM get_org_text USING wg_orgeh.

PERFORM get_pos_text USING wg_pos.

it_hist-begda = it_hrp1001-begda.

it_hist-endda = it_hrp1001-endda.

it_hist-eventid = it_hrp1001-sobid.

it_hist-priox = it_hrp1001-priox.

PERFORM get_description USING it_hrp1001-sclas it_hrp1001-sobid

it_hist-descr.

ENDFORM. " fill_it_hist

&----


*& Form get_employee_name

&----


FORM get_employee_name USING p_pernr.

CLEAR : wg_lines.

CALL FUNCTION 'HR_READ_INFOTYPE'

EXPORTING

tclas = 'A'

pernr = p_pernr

infty = '0002'

begda = sy-datum

endda = sy-datum

TABLES

infty_tab = it_p0002

EXCEPTIONS

infty_not_found = 1

OTHERS = 2.

IF sy-subrc = 0.

DESCRIBE TABLE it_p0002 LINES wg_lines.

READ TABLE it_p0002 INDEX wg_lines.

IF sy-subrc = 0.

it_hist-vorna = it_p0002-vorna.

it_hist-nachn = it_p0002-nachn.

ELSE.

it_hist-vorna = space.

it_hist-nachn = space.

ENDIF.

ELSE.

it_hist-vorna = space.

it_hist-nachn = space.

ENDIF.

ENDFORM. " get_employee_name

&----


*& Form get_org_text

&----


FORM get_org_text USING p_orgeh.

SELECT SINGLE * FROM hrp1000 WHERE plvar = '01'

AND otype = 'O'

AND objid = p_orgeh.

IF sy-subrc = 0.

it_hist-orgtxt = hrp1000-stext.

ELSE.

it_hist-orgtxt = space.

ENDIF.

ENDFORM. " get_org_text

&----


*& Form get_pos_text

&----


FORM get_pos_text USING p_pos.

SELECT SINGLE * FROM hrp1000 WHERE plvar = '01'

AND otype = 'S'

AND objid = p_pos.

IF sy-subrc = 0.

it_hist-postxt = hrp1000-stext.

ELSE.

it_hist-postxt = space.

ENDIF.

ENDFORM. " get_pos_text

&----


*& Form get_description

&----


FORM get_description USING p_sclas

p_sobid

p_descr.

SELECT SINGLE * FROM hrp1000 WHERE plvar = '01'

AND otype = p_sclas

AND objid = p_sobid.

IF sy-subrc = 0.

p_descr = hrp1000-stext.

ELSE.

p_descr = space.

ENDIF.

ENDFORM. " get_description

&----


*& Form fill_add_fieldcat

&----


FORM fill_add_fieldcat USING p_wg_struc

CHANGING p_wg_fldcat TYPE slis_t_fieldcat_alv.

DATA : wa_catalog1 TYPE LINE OF slis_t_fieldcat_alv.

LOOP AT p_wg_fldcat INTO wa_catalog1 WHERE fieldname = 'PRIOX'

OR fieldname = 'ZFEE'

OR fieldname = 'KWAER'

OR fieldname = 'POSID'.

wa_catalog1-no_out = 'X'.

MODIFY p_wg_fldcat FROM wa_catalog1.

ENDLOOP.

LOOP AT p_wg_fldcat INTO wa_catalog1 WHERE fieldname = 'ZHOURS'

OR fieldname = 'ZDAYS'

OR fieldname = 'ZBOOK'

OR fieldname = 'ZFEE'.

wa_catalog1-do_sum = 'X'.

MODIFY p_wg_fldcat FROM wa_catalog1.

ENDLOOP.

ENDFORM. " fill_add_fieldcat

&----


*& Form fill_add_info_pad34

&----


FORM fill_add_info_pad34 USING p_adatanr.

SELECT SINGLE * FROM hrpad34 WHERE adatanr = p_adatanr.

IF sy-subrc = 0.

it_hist-zdays = hrpad34-ndays.

it_hist-zhours = hrpad34-nhours.

it_hist-zbook = hrpad34-manzl.

ENDIF.

ENDFORM. " fill_add_info_pad34

&----


*& Form get_attendee_to_event

&----


FORM get_attendee_to_event .

REFRESH : it_hrp1001.

CLEAR : it_hrp1001.

*--- Get Attendees to Business Event Relationship for Selected Period.

PERFORM get_emp_event.

PERFORM get_ext_person_event.

LOOP AT it_hrp1001.

CLEAR : wg_orgeh, wg_pos, wg_begda, wg_endda.

wg_begda = it_hrp1001-begda.

wg_endda = it_hrp1001-endda.

*--- Determine of attendee in Org Unit Selected.

PERFORM get_employee_org USING it_hrp1001-objid wg_orgeh wg_pos

wg_begda wg_endda.

*--- Determine if attendee in Payscale Level selected

PERFORM get_trfst USING it_hrp1001-objid wg_trfst wg_begda wg_endda.

IF wg_orgeh IN s_org AND wg_trfst IN s_level.

PERFORM fill_it_hist.

it_hist-event = 'X'.

PERFORM fill_add_info_pad25 USING it_hrp1001-adatanr

it_hrp1001-sclas

it_hrp1001-sobid.

APPEND it_hist.

ENDIF.

ENDLOOP.

ENDFORM. " get_attendee_to_event

&----


*& Form fill_add_info_pad25

&----


FORM fill_add_info_pad25 USING p_adatanr

p_sclas

p_sobid.

DATA : it_sched TYPE TABLE OF hrvsched INITIAL SIZE 0 WITH HEADER LINE.

DATA : wg_objid TYPE hrobjid.

REFRESH : it_sched.

CLEAR : it_sched, wg_objid.

wg_objid = p_sobid.

SELECT SINGLE * FROM hrpad25 WHERE adatanr = p_adatanr.

IF sy-subrc = 0.

it_hist-zbook = hrpad25-manzl.

it_hist-zfee = hrpad25-kkost.

it_hist-kwaer = hrpad25-kwaer.

ENDIF.

CALL FUNCTION 'RH_READ_EVENT_SCHEDULE'

EXPORTING

plvar = '01'

otype = p_sclas

objid = wg_objid

TABLES

schedule_tab = it_sched

EXCEPTIONS

nothing_found = 1

OTHERS = 2.

IF sy-subrc = 0.

READ TABLE it_sched INDEX 1.

IF sy-subrc = 0.

it_hist-zdays = it_sched-ndays.

it_hist-zhours = it_sched-nhours.

ENDIF.

ENDIF.

ENDFORM. " fill_add_info_pad25

&----


*& Form get_empl_evtyp

&----


FORM get_empl_evtyp .

IF p_pernr = 'X'.

SELECT * FROM hrp1001 INTO it_hrp1001

WHERE plvar = '01'

  • AND ( otype = 'P' OR otype = 'H' )

  • AND ( objid IN s_pernr and objid IN s_epern )

AND otype = 'P' AND objid IN s_pernr

AND rsign = 'B'

AND relat = '034'

AND sclas = 'D'

AND sobid IN s_evtyp

AND ( begda BETWEEN p_begda AND p_endda OR

endda BETWEEN p_begda AND p_endda ).

APPEND it_hrp1001.

ENDSELECT.

ENDIF.

ENDFORM. " get_empl_evtyp

&----


*& Form get_ext_pers_evtyp

&----


FORM get_ext_pers_evtyp .

IF p_epern = 'X'.

SELECT * FROM hrp1001 INTO it_hrp1001

WHERE plvar = '01'

  • AND ( otype = 'P' OR otype = 'H' )

  • AND ( objid IN s_pernr and objid IN s_epern )

AND otype = 'H' AND objid IN s_epern

AND rsign = 'B'

AND relat = '034'

AND sclas = 'D'

AND sobid IN s_evtyp

AND ( begda BETWEEN p_begda AND p_endda OR

endda BETWEEN p_begda AND p_endda ).

APPEND it_hrp1001.

ENDSELECT.

ENDIF.

ENDFORM. " get_ext_pers_evtyp

&----


*& Form get_emp_event

&----


FORM get_emp_event .

IF p_pernr = 'X'.

SELECT * FROM hrp1001 INTO it_hrp1001

WHERE plvar = '01'

AND otype = 'P' AND objid IN s_pernr

AND rsign = 'B'

AND relat = '025'

AND sclas = 'E'

AND sobid IN s_event

AND ( begda BETWEEN p_begda AND p_endda OR

endda BETWEEN p_begda AND p_endda ).

APPEND it_hrp1001.

ENDSELECT.

ENDIF.

ENDFORM. " get_emp_event

&----


*& Form get_ext_person_event

&----


FORM get_ext_person_event .

IF p_epern = 'X'.

SELECT * FROM hrp1001 INTO it_hrp1001

WHERE plvar = '01'

AND otype = 'H' AND objid IN s_epern

AND rsign = 'B'

AND relat = '025'

AND sclas = 'E'

AND sobid IN s_event

AND ( begda BETWEEN p_begda AND p_endda OR

endda BETWEEN p_begda AND p_endda ).

APPEND it_hrp1001.

ENDSELECT.

ENDIF.

ENDFORM. " get_ext_person_event

&----


*& Form get_trfst

&----


FORM get_trfst USING p_objid

p_trfst

p_begda

p_endda.

DATA : wg_emp TYPE prelp-pernr,

wg_lines TYPE i,

it_0008 TYPE TABLE OF p0008 INITIAL SIZE 0 WITH HEADER LINE.

REFRESH : it_0008.

wg_emp = p_objid.

CALL FUNCTION 'HR_READ_SUBTYPE'

EXPORTING

  • TCLAS = 'A'

pernr = wg_emp

infty = '0008'

begda = p_begda

endda = p_endda

no_auth_check = 'X'

TABLES

infty_tab = it_0008

EXCEPTIONS

infty_not_found = 1

invalid_input = 2

OTHERS = 3.

IF sy-subrc = 0.

DESCRIBE TABLE it_0008 LINES wg_lines.

READ TABLE it_0008 INDEX wg_lines.

p_trfst = it_0008-trfst.

ENDIF.

ENDFORM. " get_trfst

&----


*& Form get_external_pers_name

&----


FORM get_external_pers_name USING p_objid.

DATA : wg_full_name(40) TYPE c,

wg_diff TYPE i.

SELECT SINGLE * FROM hrp1000 WHERE plvar = '01'

AND otype = 'H'

AND objid = p_objid

AND endda = '99991231'.

IF sy-subrc = 0.

wg_full_name = hrp1000-stext.

SEARCH wg_full_name FOR hrp1000-short.

*MARSHALLL

  • IF sy-subrc = 0.

IF sy-subrc = 0 and sy-fdpos <> '0'.

*MARSHALLL

wg_diff = 40 - sy-fdpos.

it_hist-vorna = wg_full_name(sy-fdpos).

it_hist-nachn = wg_full_name+sy-fdpos(wg_diff).

ELSE.

it_hist-vorna = space.

it_hist-nachn = space.

ENDIF.

ELSE.

it_hist-vorna = space.

it_hist-nachn = space.

ENDIF.

ENDFORM. " get_external_pers_name

Regards,

Fred.