01-16-2013 9:51 AM
Hello all,
in the selection screen I am having two fields as select options, for eg date and vendor number. When date is filled, I would like to get the vendors automatically into the vendors field based on the date range.
I have created an internal table and retreived the values but unable to copy those into the select options field before executing the report.
can someone share their views on how to achive this.
thanks.
01-16-2013 11:00 AM
Hi Chakravarthy,
One option to do that is u can use AT SELECTION-SCREEN OUTPUT event...enter the dates and click enter... if u r getting the dates by F4 help then use the event AT SELECTION-SCREEN ON VALUE REQUEST... i hope it works...do let me know if this works..
good question anyway
01-16-2013 9:59 AM
Hi Chakravarthy ,
select options work same as range table ,
insert your data in select options as per as range table .
it will work
For help , View this :
TABLES SBOOK.
SELECT-OPTIONS FL_DATE FOR SBOOK-FLDATE.
INITIALIZATION.
MOVE: 'BT' TO FL_DATE-OPTION,
'19960101' TO FL_DATE-LOW,
'19960630' TO FL_DATE-HIGH.
APPEND FL_DATE.
MOVE: 'I' TO FL_DATE-SIGN,
'EQ' TO FL_DATE-OPTION,
SY-DATUM TO FL_DATE-LOW.
APPEND FL_DATE.
01-16-2013 10:07 AM
(FAQ) Just loop at your internal table of vendors, and append records into the select-options parameter which is also an internal table, First read the select-options statement documentation.
Regards,
Raymond
PS: Spoiler (select to display) : If you cannot find it yourself , use SIGN = 'I', OPTION = 'EQ' and LOW = LIFNR.
01-16-2013 10:44 AM
Hi,
thanks for the replies, I am able to retreive the records, but my question is how can i populate them in the select options field before executing the report.
regards.
Chakravarthy
01-16-2013 11:01 AM
Hi kumar ,
I am not getting exactly , what you want ?
You want to display the records on selection screen ?
or
you want to populate the records in select option ?
01-16-2013 11:22 AM
Hi Yogendra,
I would like to populate the records.
scenario is we need to do some pre-work in excel and then copy them to the select option vendor field and then execute the report.
so I am able to retreive the records as needed but dont know how to populate them in the field, as there would be no user action other than keying in the required fields.
01-16-2013 12:16 PM
hi Chakravarthy ,
First of all write the code at selection screen output.
If you are getting the data from excel to any internal table e.g. it_tab
you have to write such code :
loop at it_tab into wa_itab.
MOVE: 'I' TO S_VENDOR-SIGN,
'EQ' TO S_VENDOR-OPTION,
wa_itab-kunnr to s_vendor-low.
append s_vendor.
endloop.
01-16-2013 10:44 AM
Hi Kumar,
When date is filled, I would like to get the vendors automatically into the vendors field based on the date range.
From the above statement I assume you want to populate vendors within the selected date range. If so, then try the below code:
Suppose V_TAB is your vendor table.
DATA : wa_vendor LIKE LINE OF s_vendor.
DELETE V_TAB WHERE date > s_date-high and date < s_date-low.
SORT V_TAB ASCENDING BY vendor.
LOOP AT v_tab INTO wa_vtab.
wa_vendor-low = wa_vtab-vendor.
APPEND wa_vendor TO s_vendor.
ENDLOOP.
Hpoe this helps
01-16-2013 10:52 AM
Hi Chakravarthy,
do u mean to tell that as soon as u type or input the date in input field, ur select option for vendor should get populated...means without executing? I think that will not be possible in core abap..u can do that in webdynpro etc..
01-16-2013 11:00 AM
Hi Chakravarthy,
One option to do that is u can use AT SELECTION-SCREEN OUTPUT event...enter the dates and click enter... if u r getting the dates by F4 help then use the event AT SELECTION-SCREEN ON VALUE REQUEST... i hope it works...do let me know if this works..
good question anyway
01-16-2013 11:32 AM
Hi Shahir,
i have tried at selection screen, but the issue is we cannot get the date values, anyways thanks a lot for all the inputs, maybe I should give some user event and use at user command.
01-16-2013 1:02 PM
Hi Chakravarthy,
Maybe you can use function key in you selection screen. It allows you to add a button on the application toolbar of the screen. After you enter date on the screen, you can click the button and get the vendor values in the select-options.
Here You have to use the ucomm of the table SSCRFIELDS(for selection screen fields).
You have to right the code in AT SELECTION SCREEN event for the button.
Hope this helps
Do revert back if you nedd anything
10-14-2019 11:41 AM
Is it possible to move the select statement output(structure) to the parameter value?
when I select the value from the search help of another parameter?
PARAMETERS:p1 TYPE zd_studentno MATCHCODE OBJECT z1132_sh,
p2 TYPE zd_studentname.
AT SELECTION-SCREEN OUTPUT .
SELECT SINGLE studentname FROM ztt_sd WHERE studentno = @p1 INTO @p2.
01-16-2013 11:26 AM
Hi chakravarthy kumar,
you need a selection-screen event.
You may use AT SELECTION SCREEN and put the code as mentioned here.
Check SAP help on report selection screen events.
Regards
Clemens
01-16-2013 7:02 PM
thanks all, with at selection screen output was able to achive it.
so-vendor-sign = i
so-vendor-option = eq
loop at itab
so-vendor-low = itab-vendor1.
append so-vendor.
endloop