Skip to Content

Not able to select a field by query

Hi All,

I'm trying to fetch data from USR02 table with the input as BNAME and should get UFLAG(Locked/Not) and CLASS(Usergroup of the user) as output.

I'm able to get UFLAG value. But for CLASS, I'm not getting any output.

Is SE16, if you see, the field has a yellow background.

Could anyone help whats the problem?

Thanks a lot in advance.

Pradeep

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 24, 2008 at 05:33 AM

    Hi,

    I am getting both the fields data.

    Just check this code by giving the BNAME field value.

    TABLES: USR02.

    DATA: BEGIN OF ITAB OCCURS 0.

    INCLUDE STRUCTURE USR02.

    DATA: END OF ITAB.

    SELECT BNAME CLASS UFLAG INTO

    CORRESPONDING FIELDS OF

    TABLE ITAB

    FROM USR02

    WHERE BNAME = 'ABDULS'.

    LOOP AT ITAB.

    WRITE:/ ITAB-BNAME, ITAB-CLASS, ITAB-UFLAG.

    ENDLOOP.

    Reward,if it is useful.

    Thanks,

    Chandu

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Pradeep Mathew Cherian

      Hi,

      Can u tell me the meaning of the this code.

      loop at userlist into users.

      *select * from usr02 into corresponding fields of table user_info_tab where bname = users.*

      loop at user_info_tab into g_user_info.

      endloop.

      write :/ users, g_user_info-ACCNT, g_user_info-class, g_user_info-uflag.

      clear: users.

      endloop.

      It is little bit confusing,Just tell me ur requirement in detail

      (tables,fields). what u want the final output.

      So that i can help you.

      Regards,

      Chandu

  • author's profile photo Former Member
    Former Member
    Posted on Mar 24, 2008 at 05:17 AM

    Hi,

    Can you give your select query here ?

    Regards.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 24, 2008 at 05:21 AM

    data: begin of g_user_info,

    locked type usr02-UFLAG,

    usrgrp type usr02-CLASS,

    end of g_user_info.

    *

    data: user_info_tab like table of g_user_info.

    *

    *loop at it_mandt into wa_mandt.

    select * from usr02 into corresponding fields of table user_info_tab where bname eq pa_bname.

    loop at user_info_tab into g_user_info.

    endloop.

    write :/ pa_bname, g_user_info-usrgrp, g_user_info-locked.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      Check this code..

      types: begin of g_user_info,
      locked type usr02-UFLAG,
      usrgrp type usr02-CLASS,
      end of g_user_info.
      
      data: t_g_user_info type standard table of g_user_info.
      data: wa_g_user_info type g_user_info.
      
      select single class uflag  from usr02 into wa_g_user_info where bname eq pa_bname.
      append wa_g_user_info to t_g_user_info.
      
      write: / t_g_user_info-locked, t_g_user_info-usrgrp.
      
      

      Reward if helpful.

      Regards.

  • author's profile photo Former Member
    Former Member
    Posted on Mar 24, 2008 at 05:26 AM

    Hi,

    No data is there for class in table : USR02.

    Means table itself doe't have any data that is the reason you are getting like that.

    Pls. reward if useful...

    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.