10-16-2008 7:58 PM
Hello Gurus,
The requirement is to combine bseg-ebeln and bseg-kblnr into one S_variable. The user will either enter ebeln or kblnr. How to do this?
SELECTION-SCREEN BEGIN OF BLOCK block_1 WITH FRAME TITLE text-t01.
SELECT-OPTIONS:
s_ebeln FOR bseg-ebeln,
or for bseg-kblnr,
s_kblnr FOR bseg-kblnr,
s_confd FOR fmtc_schno-confd.
SELECTION-SCREEN END OF BLOCK block_1.
Thank you very much,
Punita
10-16-2008 8:14 PM
Hi,
You can display the select-options with char10 dataelement...and then use OR condition in the where clause accordingly.
SELECT ..FROM bseg ..WHERE..ebeln IN so_podoc OR kblnr IN so_podoc.
Thanks
Naren
10-16-2008 8:01 PM
Hi,
I am not sure how you mean to combine it into one select-option. How can you then distinguish whether you have to check ebeln or kblnr field in the table bseg?
The best is to have two select-options and then make select like
SELECT * FROM bseg into table it_bseg where
ebeln in so_ebeln and kblnr in so_kblnr.
It will work correctly also if only one select option is filled ...
Or if you have different idea, please specify and we can discuss.
Regards,
Karol
10-16-2008 8:08 PM
Hi,
Thank you,
Business has one text box and they will enter either purchase document number (EBELN) or KBLNR (documnt # for ear marked funds). The search should happen for both the fields in BSEG table.
Punita.
10-16-2008 8:13 PM
10-16-2008 8:14 PM
Neither field is a key for BSEG, so this will not work in a production environment. You would have to search the relevant tables where there are keys, but what would you do if they are in both tables?
Rob
10-16-2008 8:03 PM
ebeln or kblnr
at selection screen.
select single ebeln
from ... into ..
if sy-subrc eq 0.
flag = 'X'.
else.
flag = 'Y'.
endif.
write two different selects and based on the flag get data.
if flag = 'X'.
select...
where..
eblen in so_value.
else.
select..
where kblnr in so_value.
10-16-2008 8:03 PM
So, how does the program tell if it's a PO or an earmarked document?
Rob
10-16-2008 8:04 PM
it is not possible, conditionally display them in selection screen if you want , with the help of some radio button or checkbox , using the event at selection-screen output you can hide them using loop at screen logic. but you cannot have a single field to hold the two variables.
10-16-2008 8:14 PM
Hi,
You can display the select-options with char10 dataelement...and then use OR condition in the where clause accordingly.
SELECT ..FROM bseg ..WHERE..ebeln IN so_podoc OR kblnr IN so_podoc.
Thanks
Naren