This is my code.Here iam getting the OBJCT values starting with Y but Not with Z.
Tables:TOBJ.
SELECT-OPTIONS:S_BNAME FOR TOBJ-BNAME.
RANGES:S_OBJCT FOR TOBJ-OBJCT.
DATA:BEGIN OF T_TOBJ Occurs 0,
OBJCT LIKE TOBJ-OBJCT,
BNAME LIKE TOBJ-BNAME,
END OF T_TOBJ.
INITIALIZATION.
S_OBJCT-SIGN = 'I'.
S_OBJCT-OPTION = 'BT'.
S_OBJCT-LOW = 'Y%'.
S_OBJCT-HIGH = 'Z%'.
APPEND S_OBJCT.
START-OF-SELECTION.
SELECT OBJCT BNAME FROM TOBJ INTO TABLE T_TOBJ WHERE BNAME IN S_BNAME
AND OBJCT NOT IN S_OBJCT .
LOOP AT T_TOBJ.
WRITE:/ T_TOBJ-OBJCT.
ENDLOOP.
Hi,
try changing ur code like dis,
Tables:TOBJ.
SELECT-OPTIONS:S_BNAME FOR TOBJ-BNAME.
DATA:BEGIN OF T_TOBJ Occurs 0,
OBJCT LIKE TOBJ-OBJCT,
BNAME LIKE TOBJ-BNAME,
END OF T_TOBJ.
START-OF-SELECTION.
SELECT OBJCT BNAME FROM TOBJ INTO TABLE T_TOBJ WHERE BNAME IN S_BNAME
AND ( OBJCT like 'Z%' or OBJCT like 'Y%' ).
LOOP AT T_TOBJ.
WRITE:/ T_TOBJ-OBJCT.
ENDLOOP.
Cheers,
Will.
Hi,
Please refer to the code below code :
tables: ekko. data : BEGIN OF itab occurs 0, ekgrp like ekko-ekgrp, end of itab. ranges : gr_ekgrp for ekko-ekgrp. select-OPTIONS : so_ekgrp for ekko-ekgrp. loop at so_ekgrp. gr_ekgrp-sign = 'I'. gr_ekgrp-option = 'EQ'. gr_ekgrp-low = so_ekgrp-low. append gr_ekgrp. endloop. loop at gr_ekgrp. replace '*' in gr_ekgrp-low with '%'. modify gr_ekgrp. endloop. loop at gr_ekgrp. select ekgrp from ekko APPENDING CORRESPONDING FIELDS OF TABLE itab where ekgrp like gr_ekgrp-low. * where ekgrp like so_ekgrp. endloop.
Thanks,
Sriram Ponna.
Add a comment