cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ABAP code for determining User Status?

Former Member
0 Likes
2,691

Hello, I have found this code in an existing ABAP program that I am trying to modify. It's used for determing if an active User Status 'E0002' exist on a particular order.

select single jest~objnr into st_jest-objnr
     from jest join jsto  on ( jest~objnr = jsto~objnr )
                  join tj30t  on ( tj30t~stsma = jsto~stsma )
     where   ( jest~objnr = s_order_no-objnr and
                   jest~inact = ' ' and tj30t~estat = 'E0002' and tj30t~spras = sy-langu ) .

Does it look correct to you? For some reason, the above code is ignoring what's in jest~inact.. I am not sure why. May be the join is setup incorrectly??

Thanks for your help!!

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Likes

Please ignore the above posts.

former_member206439
Contributor
0 Likes

Hi Sam,

The select query is to Join JEST , JSTO and TJ30T.

THE field value JEST-INACT if it is space means the status is active.

Some times you will not find a record in JEST table if the status is not set at all.

What i mean is you set and deactivate any status for any order.

If you didn't set any user status for a order then that status record will not exist in the JEST table.

If you are not understood this just let me know.

The select query is good.

You can manually go into the JEST table and put the OBJNR value which you will get from AUFK table for that otrder and check wheather that record exist or not.

Thanks

Naresh

Edited by: Naresh Nelapatla on Aug 17, 2010 6:33 AM

Former Member
0 Likes

Naresh, I already checked the JEST table. It has many entries for this object#. The entry for "E0002" has the INACT field value of "X". I think the above ABAP code is wrong for determing the User Status value. Does anyone know what the correct code should be?

I got it to work just by doing this select :

select single objnr into st_jest-objnr
    from jest
    where objnr = s_order_no-objnr and inact = ' '  and
         stat = 'E0002'.
  if ( sy-subrc = 0 ).
    clear s_order_no-objnr.
  endif.

I am not sure if this code could cause other issues later. Is it necessary to include JSTO and TJ30T in the select?

Thanks.

Former Member
0 Likes

Hi,

In your code , wat is s_order_no-objnr . if it is select-option then modify your code accordingly.

select single jest~objnr into st_jest-objnr

from jest join jsto on ( jestobjnr = jstoobjnr )

join tj30t on ( tj30tstsma = jstostsma )

where ( jest~objnr in s_order_no-objnr and

jestinact = ' ' and tj30testat = 'E0002' and tj30t~spras = sy-langu ) .

BR,

Lokeswari.

Former Member
0 Likes

Lokeswari, it's not a selection-option field. It only contains a single value. I know the naming convention made you think it's selection-option.