‎2007 Apr 24 6:16 PM
Hi Guys/Dolls
I have an ABAP program that works ok but I would like to make it more flexible.
The program populates a select option field on the INITILIZATION event but I need to check values entered are within valid range.
Im using
CHECK p0008-TRFGR EQ 'PROF' OR p0008-TRFGR EQ 'GRADE 09'.
But Im sure there is a way to use
CHECK p0008-TRFGR IN p_ps_grp.
Which is much more elegant but I dont know how; if I use the above the program crashes and only way to resolve is not to populate it within the initilization section and to use a variant. Is there a solution out there.
A snippet of my code is as follows:-
REPORT zh119rep LINE-SIZE 175 NO STANDARD PAGE HEADING.
* Define the Pay scale group range.
SELECT-OPTIONS p_ps_grp FOR p0008-trfgr.
* INITIALIZATION EVENT
INITIALIZATION.
* Set the Pay Scale Groups but 1st clear it.
REFRESH p_ps_grp.
p_ps_grp-low = 'PROF'.
APPEND p_ps_grp.
p_ps_grp-low = 'GRADE 09'.
APPEND p_ps_grp.
GET pernr.
* Check to see if selected wage type is in range.
CHECK p0008-TRFGR IN p_ps_grp. This crashes program
* CHECK p0008-TRFGR EQ 'PROF' OR p0008-TRFGR EQ 'GRADE 09'. This ok.
Any ideas?
Many thanks in advance.
Raj
‎2007 Apr 24 6:23 PM
the following should work fine..
REPORT zh119rep LINE-SIZE 175 NO STANDARD PAGE HEADING.
* Define the Pay scale group range.
SELECT-OPTIONS p_ps_grp FOR p0008-trfgr.
* INITIALIZATION EVENT
INITIALIZATION.
* Set the Pay Scale Groups but 1st clear it.
REFRESH p_ps_grp.
p_ps_grp-sign = 'I'.
p_ps_grp-option = 'EQ'.
p_ps_grp-low = 'PROF'.
APPEND p_ps_grp.
p_ps_grp-low = 'GRADE 09'.
APPEND p_ps_grp.
GET pernr.
* Check to see if selected wage type is in range.
CHECK p0008-TRFGR IN p_ps_grp.
~Suresh
‎2007 Apr 24 6:23 PM
the following should work fine..
REPORT zh119rep LINE-SIZE 175 NO STANDARD PAGE HEADING.
* Define the Pay scale group range.
SELECT-OPTIONS p_ps_grp FOR p0008-trfgr.
* INITIALIZATION EVENT
INITIALIZATION.
* Set the Pay Scale Groups but 1st clear it.
REFRESH p_ps_grp.
p_ps_grp-sign = 'I'.
p_ps_grp-option = 'EQ'.
p_ps_grp-low = 'PROF'.
APPEND p_ps_grp.
p_ps_grp-low = 'GRADE 09'.
APPEND p_ps_grp.
GET pernr.
* Check to see if selected wage type is in range.
CHECK p0008-TRFGR IN p_ps_grp.
~Suresh