‎2008 May 02 9:05 AM
hi all,
i have a seletion screen in my report with two different blocks
begin of block b1.
select-options: s_date like sy-datum.
end of block b1.
and the date is in the format like 200801
and i have another block
begin of block b2.
parameters : p_date as checkbox default no.
select-options: o_print like pbed-perxx.
end of block b2.
and the requirement is like when i enter the date in s_date in 200801 format then the last two values should be automatically
filled in o_print.
like as follows
s_date 200801 to 200812
o_print 01 to 12please help me in this regard i have tried with at selection-screen output but its not relevent.
thanks in advance.
anupama
‎2008 May 02 9:09 AM
You can populate these values in 'at selection-screen output' event.
Refer the following code:
REPORT ZTESTAB11.
TABLES: PBED.
SELECTION-SCREEN BEGIN OF BLOCK B1.
SELECT-OPTIONS: S_DATE FOR SY-DATUM.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2.
*parameters : p_date as checkbox default no.
SELECT-OPTIONS: O_PRINT FOR PBED-PERXX.
SELECTION-SCREEN END OF BLOCK B2.
AT SELECTION-SCREEN OUTPUT.
IF NOT S_DATE[] IS INITIAL.
READ TABLE S_DATE INDEX 1.
O_PRINT-SIGN = 'I'.
O_PRINT-OPTION = 'EQ'.
O_PRINT-LOW = S_DATE-LOW+4(2).
O_PRINT-HIGH = S_DATE-HIGH+4(2).
APPEND O_PRINT.
CLEAR O_PRINT.
ENDIF.
After executing the program, when you enter s_date and press enter O_PRINT will be autometically filled,
‎2008 May 02 9:37 AM
hi,
try this code.
after you entered date in s_date press enter
then you have the other select-options o_print automatically filled with your required values
Tables : PBED.
data : var(6) type c.
selection-screen begin of block b1.
select-options: s_date for var.
selection-screen end of block b1.
selection-screen begin of block b2.
parameters : p_date as checkbox default 'X'.
select-options: o_print for PBED-PERXX.
selection-screen end of block b2.
at selection-screen .
o_print-low = s_date-low+4(2).
o_print-high = s_date-high+4(2).
append o_print.
DONT FORGET TO REWARD IF HELPFUL.
PRASANTH
‎2008 May 02 10:46 AM
Hi,
Use the below code.
data: v_date(6) type n.
SELECTION-SCREEN BEGIN OF BLOCK B1 with frame.
SELECT-OPTIONS: S_DATE FOR v_date.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 with frame.
parameters : p_date as checkbox user-command rusr.
SELECT-OPTIONS: O_PRINT FOR PBED-PERXX.
SELECTION-SCREEN END OF BLOCK B2.
AT SELECTION-SCREEN OUTPUT.
if p_date = 'X'.
IF NOT S_DATE[] IS INITIAL.
O_PRINT-SIGN = 'I'.
O_PRINT-OPTION = 'BT'.
O_PRINT-LOW = S_DATE-LOW+4(2).
O_PRINT-HIGH = S_DATE-HIGH+4(2).
APPEND O_PRINT.
CLEAR O_PRINT.
ENDIF.
else.
refresh o_print.
endif.
Note: After entering the dates in S_DATE, select the check box
then only you can see the values in o_print. if you deselect the check box then the values in o_print will be deleted
‎2008 May 02 11:01 AM
HI deep,
as u r scenario
At selection-screen on s_data
o_print-low = s_data-low+4(2)
o_print-high = s_data-high+4(2)
Check This Code