on ‎2010 Aug 17 5:16 AM
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!!
Request clarification before answering.
Please ignore the above posts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 29 | |
| 14 | |
| 7 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.