‎2006 May 09 7:07 PM
Hi All,
I have a Select-Option: SF_KOSTL for CSKS-KOSTL.
I have a ZTable with two fields:
Username and KOSTL.
I need to determine if an entry Exists for Every SF_KOSTL (in the Select-option ) in the ZTable for username SY-UNAME.
IF there is one particular KOSTL, that doesn't have an entry in Ztable, I should ignore that from the SF_KOSTL Select-Options which is used in several other select statements.
How to overcome this.
Thanks in Advance...!
‎2006 May 09 8:35 PM
For every Cost Center in the Select-Options (It has to be a range), I need to check if entered Cost Center-SYUname pair exists in a ZAUTHtable. If it exists, I should continue with Processing. If the entry doesn't exist in the table, then i should Show them a Message saying :that cost center is ignored.
ZAUTHtable: only Contains Username and Cost Center Number. And more than one Cost Center exist for a username.
How would i check for every cost center.
Eg:
Select-Options: SF_KOSTL like CSKS-KOSTL.
How do i loop in SF_KOKSTL so that i go through each and every value that is Processed normally.
Sample Code Please.
‎2006 May 09 7:28 PM
‎2006 May 09 7:29 PM
IF you have to check all the entries of the select option against Ztable then it might give you wrong output. Becase if you enter range of KOSTL then you can't check all values in the range against Ztable.
SO better create select option with restriction.
You can eliminate the range option from the select statement and allows only low values so that you can enter as many as values without range.
After that in the
AT SELECTION-SCREEN ON SF_KOSTL-LOW.
You can write code to chec against Ztable.
Regards
Aman
‎2006 May 09 7:38 PM
Hi Raj,
You can combine the select statement so that only valid cost center and exist in ZTABLE will be selected.
select b~USERNAME
b~KOSTL
into corresponding fields of ZTABLE
from CSKS as a
inner join ZTABLE as b
on bKOSTL = aKOSTL
where a~kostl in SF_KOSTL
and b~USERNAME = SY-UNAME.
‎2006 May 09 8:35 PM
For every Cost Center in the Select-Options (It has to be a range), I need to check if entered Cost Center-SYUname pair exists in a ZAUTHtable. If it exists, I should continue with Processing. If the entry doesn't exist in the table, then i should Show them a Message saying :that cost center is ignored.
ZAUTHtable: only Contains Username and Cost Center Number. And more than one Cost Center exist for a username.
How would i check for every cost center.
Eg:
Select-Options: SF_KOSTL like CSKS-KOSTL.
How do i loop in SF_KOKSTL so that i go through each and every value that is Processed normally.
Sample Code Please.
‎2006 May 09 8:42 PM
Oh ok. I see what you need to do now. Try something like this. Here you are getting all of the kostl in your range and looping at the internal table and checking against your ztable.
report zrich_0001 .
data: icsks type table of csks with header line.
select-options: s_kostl for icsks-kostl.
at selection-screen.
clear icsks. refresh icsks.
select * into table icsks from csks
where kostl in s_kostl.
loop at icsks.
* Check against your table here
* select Single * from ztable
* where uname = sy-uname
* and kostl = icsks-kostl.
* if sy-subrc <> 0.
* message w001(00) with 'Kostl will be ignored'.
* endif.
endloop.
Regards,
Rich Heilman
‎2006 May 09 8:53 PM