Skip to Content
author's profile photo Former Member
Former Member

Not Getting Proper output in simple Report

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 01:03 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 01:02 PM

    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
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 31, 2008 at 01:14 PM

    change ur query to the below one;

    SELECT objct bname FROM tobj INTO TABLE t_tobj WHERE

    bname IN s_bname

    AND

    objct LIKE S_OBJCT-high and objct LIKE S_OBJCT-low .

    It works.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.