2007 May 19 8:18 AM
Hi all I want to do a check calculation in a badi - on an internal table of dates. In normal abap I was able to do it easily. but in oo abap, its not allowing me to do the arethmatic calculation on date fields.Below is the code:
method IF_EX_PT_ABS_REQ~GET_WORKFLOW_ATTRIBS.
begda type pa2001-begda,
end of date1.
data: zbegda type table of date1,
zbegdah type table of date1,
line1 like line of zbegdah.
*data zbegda like pa2001-begda occurs 0 with header line.
*data zbegdah like pa2001-begda occurs 0 with header line.
select begda from pa2001 into table zbegda
where pernr = pernr1.
zbegdah[] = zbegda[].
clear zbegda[].
loop at zbegdah into line1.
add 1 to zbegdah. "<------ THIS LINE IS GIVING ME ERROR
*line1-begda = zbegdah + 1.
append line1 to zbegda.
endloop.
loop at zbegda into line1.
if line1-begda eq bdate.
MESSAGE i074(hrtim_abs_req).
endif.
endloop.
endmethod.
Actually, in my EP leave request workflow I want to give an error message, if the user applies for a leave of say 5th april, and he already has an approved leave of 6th of april - which is stored in infotype 21.
There is a badi - SE18 -> Enhancement Spots PT_ABS_REQ. In this, I am creating implimentation and I am writing the code in the method - IF_EX_PT_ABS_REQ~GET_WORKFLOW_ATTRIBS.
I also want to know that if i declare 2 fields - PERNR1 and bdate ( begin date of leave) in attributes, which I did, would they be passed from EP at runtime? if not, what should I do to get them in my method?
Please suggest.
Thanks
Ribhu
2007 May 19 8:25 AM
put like this.
<b>loop at zbegdah into line1.
add 1 to zbegdah-begda. "<------ THIS LINE IS GIVING ME ERROR
*line1-begda = zbegdah-begda + 1.
append line1 to zbegda.
endloop.</b>
Regards
Peram