Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

DTP Selection Criteria Routine

Hi All.

I am trying to use a routine in the selection criteria of a DTP. I use the same code as per Info Package routines. However, although there are no syntax errors, the values for the selection criteria are not generated and the DTP fails with an error. It seems I am missing something. Can some one please give me some sample code. Here is the code I am using:

form compute_CALMONTH

tables l_t_range structure rssdlrange

changing p_subrc like sy-subrc.

  • Insert source code to current selection field

$$ begin of routine - insert your code only below this line -

data: l_idx like sy-tabix.

read table l_t_range with key

fieldname = ' '.

*NOTE: I have also tried to insert CALMONTH between the quotes, but it *makes no difference. ' ' is the way it is generated by default.

l_idx = sy-tabix.

*....

DATA: zdate like sy-datum,

zcalmonth(6) type n.

move sy-datum to zdate.

zcalmonth = zdate(6).

l_t_range-low = zcalmonth.

l_t_range-sign = 'I'.

l_t_range-option = 'EQ'.

if l_idx <> 0.

modify l_t_range index l_idx.

else.

append l_t_range.

endif.

p_subrc = 0.

$$ end of routine - insert your code only before this line -

endform.

Thanks.

Johan Loock

Former Member
Former Member replied

Hi

Pls try this

data: l_idx like sy-tabix.

read table l_t_range with key

fieldname = 'CALMONTH'.

l_idx = sy-tabix.

DATA: zcalmonth(6) type n.

zcalmonth = sy-datum(6).

l_t_range-iobjnm = '0CALMONTH'.

l_t_range-FIELDNAME = 'CALMONTH'.

l_t_range-low = zcalmonth.

l_t_range-sign = 'I'.

l_t_range-option = 'EQ'.

if l_idx 0.

modify l_t_range index l_idx.

else.

append l_t_range.

endif.

p_subrc = 0.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question