Date interval check on selection-screen
Hello, How can I check on the selection-screen if the s_date (high part) is filled out or not? s_date is an interval. If the high field is not filled, the program don't allowed to run. So I have to check it is a single date or an interval.
if u r referring to a field of date in select options just dont ignore the case that if u r not entering any field in the high interval its value will be '00000000'.
u need to check this .
execute the code .
select-options : s_date for sy-datum.
initialization.
at selection-screen .
if s_date-high eq '00000000'.
message e999(zd) with 'Cannot Run'.
endif.
regards,
vijay
Similar Messages
-
Checking the Selection Screen Parameters
Dear All,
We are uploading data from various excel sheets into SAP tables. Now at selection screen I just want to check if the location specified exists or not ie. if I have created one variant on one system & then if I am running that report from other system using the variants, since the files does not exists it should throw the error and should return to the selection screen to enter the new parameters.
Please help me in the code, I am attaching my code herewith.
Waiting for ur responses,
Nishu
*********************CODE***************************
tables: bseg, zfi_tbl_qty, t001, tgsb.
data:
t_excel like alsmex_tabline occurs 0 with header line,
l_excelfile(128) type c,
l_excelfile1(128) type c,
l_excelfile2(128) type c,
l_excelfile3(128) type c.
data: begin of t_bukrs_tmp occurs 0,
bukrs like t001-bukrs,
end of t_bukrs_tmp.
data: begin of t_gsber_tmp occurs 0,
gsber like tgsb-gsber,
end of t_gsber_tmp.
ranges: r_bukrs_tmp for t001-bukrs,
r_gsber_tmp for tgsb-gsber.
data: begin of t_type,
bukrs like bseg-bukrs,
gsber like bseg-gsber,
count type i,
end of t_type.
data: l_charlen1 type i,
l_charlen2 type i.
data: t_type2 like t_type occurs 0 with header line,
t_type2_tmp like t_type occurs 0 with header line.
data: l_end_row type i,
l_endrow1 type i,
l_count type i,
v_bukrs like bseg-bukrs.
data : q_count type i value 1,
v_flag type i value 0,
v_gsber like t_type2-gsber.
data: l_var type c.
selection-screen begin of block b1 with frame title text-001.
parameter : p_file1 type rlgrap-filename obligatory,
p_file2 type rlgrap-filename obligatory,
p_file3 type rlgrap-filename obligatory,
p_file4 type rlgrap-filename obligatory.
selection-screen end of block b1.
*perform updation_tbl.
*clearing the contents of database table before uploading a new file everytime
delete from zfi_tbl_qty.
*selection-screen
at selection-screen on value-request for p_file1.
call function 'KD_GET_FILENAME_ON_F4'
exporting
field_name = p_file1
changing
file_name = p_file1.
at selection-screen on value-request for p_file2.
call function 'KD_GET_FILENAME_ON_F4'
exporting
field_name = p_file2
changing
file_name = p_file2.
at selection-screen on value-request for p_file3.
call function 'KD_GET_FILENAME_ON_F4'
exporting
field_name = p_file3
changing
file_name = p_file3.
at selection-screen on value-request for p_file4.
call function 'KD_GET_FILENAME_ON_F4'
exporting
field_name = p_file4
changing
file_name = p_file4.
at selection-screen.
l_excelfile = p_file1.
l_excelfile1 = p_file2.
l_excelfile2 = p_file3.
l_excelfile3 = p_file4.
if l_excelfile = l_excelfile1 or l_excelfile = l_excelfile2 or l_excelfile = l_excelfile3
or l_excelfile1 = l_excelfile2 or l_excelfile1 = l_excelfile3 or l_excelfile2 = l_excelfile3.
message e010(zn) with 'Files with the same name found Please enter again. '.
endif.
start-of-selection.
select bukrs
from t001
into corresponding fields of table t_bukrs_tmp.
loop at t_bukrs_tmp.
r_bukrs_tmp-sign = 'I'.
r_bukrs_tmp-option = 'EQ'.
r_bukrs_tmp-low = t_bukrs_tmp-bukrs.
append r_bukrs_tmp.
endloop.
select gsber
from tgsb
into corresponding fields of table t_gsber_tmp.
loop at t_gsber_tmp.
r_gsber_tmp-sign = 'I'.
r_gsber_tmp-option = 'EQ'.
r_gsber_tmp-low = t_gsber_tmp-gsber.
append r_gsber_tmp.
endloop.
perform upload_table using l_excelfile 5 2 6 4000.
perform upload_table using l_excelfile1 5 2 6 4000.
perform upload_table using l_excelfile2 5 2 6 4000.
perform upload_table using l_excelfile3 5 2 6 4000.
if sy-subrc = 0.
message i010(zn) with 'Files Uploaded Successfully.'.
if sy-subrc <> 0.
message e398(00) with 'Files Not Found'.
leave to screen 0.
endif.
************Calling the other program
SUBMIT ZFI_REP_IS_CHARGES_POST1.
*and return.
*******************Calling the subroutine.
form upload_table using filename
i_begin_col type i
i_begin_row type i
i_end_col type i
i_end_row type i.
clear : t_excel.
refresh : t_excel.
v_flag = v_flag + 1.
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = filename
i_begin_col = 5
i_begin_row = 2
i_end_col = 6
i_end_row = 4000
tables
intern = t_excel
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
case v_flag.
when '1'.
perform fill_int_tab.
when '2'.
perform fill_int_tab.
when '3'.
perform fill_int_tab.
when '4'.
perform fill_int_tab.
endcase.
endform. "upload_table
*uploading data from internal table into database table
*& Form fill_int_tab
text
--> p1 text
<-- p2 text
form fill_int_tab .
clear : t_type2, q_count.
refresh : t_type2.
describe table t_excel lines l_endrow1.
l_endrow1 = l_endrow1 / 2.
do.
loop at t_excel where row = q_count.
if t_excel-col = 1.
t_type2-gsber = t_excel-value.
elseif t_excel-col = 2.
t_type2-bukrs = t_excel-value.
endif.
endloop.
l_charlen1 = strlen( t_type2-bukrs ).
l_charlen2 = strlen( t_type2-gsber ).
if ( t_type2-bukrs <> ' ' and t_type2-gsber <> ' ' ).
if ( l_charlen1 = 4 and l_charlen2 = 4 ).
append t_type2. clear t_type2.
endif.
endif.
q_count = q_count + 1.
if q_count > l_endrow1.
exit.
endif.
enddo.
t_type2_tmp[] = t_type2[].
clear t_type2.
refresh t_type2.
loop at t_type2_tmp where bukrs in r_bukrs_tmp
and gsber in r_gsber_tmp.
move-corresponding t_type2_tmp to t_type2.
append t_type2.
endloop.
sort t_type2 by bukrs gsber.
loop at t_type2.
clear v_gsber.
l_count = l_count + 1 .
v_gsber = t_type2-gsber.
at end of gsber.
at end of bukrs.
zfi_tbl_qty-company_code = t_type2-bukrs.
zfi_tbl_qty-barea = v_gsber.
zfi_tbl_qty-comb = l_count.
if v_flag = 1.
zfi_tbl_qty-type = 'A'. " Item 1
endif.
if v_flag = 2.
zfi_tbl_qty-type = 'B'. " Item 2
endif.
if v_flag = 3.
zfi_tbl_qty-type = 'C'. " Item 3
endif.
if v_flag = 4.
zfi_tbl_qty-type = 'D'. " Item 4
endif.
insert zfi_tbl_qty from zfi_tbl_qty.
clear l_count.
endat.
endat.
endloop.
endform. " fill_int_tabHi,
After calling this FM:
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = filename
i_begin_col = 5
i_begin_row = 2
i_end_col = 6
i_end_row = 4000
tables
intern = t_excel
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
*-> try following code:
if sy-subrc = '2'.
message 'File not Found' type 'I'.
leave list-processing.
endif.
Regards,
Kalyan -
Get Months for the given date ranges on the Selection Screen
Hello All,
If I give Begin Date (Begda) and End Date (Endda) on the Selection Screen, I need to get all the months given in the selection screen ranges.
Could any one please suggest me how to proceed further on this.
Thanks in Advance
Regards
YathishHI,
Check this FM
HR_99S_INTERVAL_BETWEEN_DATES ---> this can help you it will return the month in this table MONTH_TAB
HR_99S_MONTHS_BETWEEN_DATES -
Validation check in selection screen
Hi experts,
I have a selection screen in which there are 2 radio buttons S1 n S2, and a text field (Parameter) namely P_PATH.
I am using a method (CALL METHOD cl_gui_frontend_services=>file_save_dialog) for selecting a file to save some
data in the XLS format.
Once the user selects S2, and presses the F4 help in the parameter P_PATH, this method is called.
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = p_title
default_file_name = p_filename
file_filter = l_file_filter
initial_directory = p_download_path
CHANGING
filename = p_filename
path = p_download_path
fullpath = p_full_path
user_action = g_user_action "save or cancel
EXCEPTIONS
OTHERS = 1.
The g_user_action given here has a value of 9 in case the user selects the CANCEL button in the pop up that asks for the file name to be given for saving the file.
My req. is that when g_user_action = 9. then the selection screen should be displayed back, with the S1 being selected (instead of the earlier S2).
I have done the below coding, but its not working. Is there something that I am doing incorrect?
SELECTION-SCREEN: BEGIN OF BLOCK b4 WITH FRAME TITLE text-004.
PARAMETERS: s1 RADIOBUTTON GROUP rad2 DEFAULT 'X' USER-COMMAND ac,
s2 RADIOBUTTON GROUP rad2.
SELECTION-SCREEN: END OF BLOCK b4.
DATA: g_s1 type c.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path.
PERFORM get_download_path
AT SELECTION-SCREEN OUTPUT.
if g_s1 = 'X'.
s1 = 'X'.
s2 = ''.
endif.
FORM get_download_path
the above method is called**
IF g_user_action = 9.
g_s1 = 'X'.
exit.
endif.
ENDFORM.Hello Ajay,
As Advait has pointed out already AT SELECTION_SCREEN OUTPUT event (or the PBO) does not trigger after the ON VALUE-REQUEST (or the POV) event.
You have to use the FM: DYNP_VALUES_UPDATE to update the selection-screen value.
FORM get_download_path
** the above method is called**
data: dyname like d020s-prog,
dynumb like d020s-dnum.
data: it_dyfields type standard table of dynpread,
st_dyfields type dynpread.
IF g_user_action = 9.
dyname = sy-repid.
dynumb = sy-dynnr.
CLEAR s2.
s1 = 'X'.
move 'S1' to st_dyfields-fieldname.
move 'X' to st_dyfields-fieldvalue.
append st_dyfields to it_dyfields.
move 'S2' to st_dyfields-fieldname.
CLEAR st_dyfields-fieldvalue.
append st_dyfields to it_dyfields.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = dyname
dynumb = dynumb
tables
dynpfields = it_dyfields
exceptions
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
others = 8.
check sy-subrc eq 0.
endif.
ENDFORM.
Check this out.
BR,
Suhas -
Uploading selection data to an ABAP selection screen
Not sure this is the best place for this question but here goes.
When a user is presented with a selection screen from an ABAP they have the option to upload data from a text file. This works fine for single value lists but I cannot get this to work for ranges.
I have tried tab & comma delimited files, xls and plain fixed width text and am always presented with the message 'lower limit is greater than upper limit'.
Regards
Paul.Hi Paul,
You are thanking a poster for his answer.
Please next time also give him points.
See: /people/mark.finnern/blog/2004/08/10/spread-the-love
This time I did it for you.
Remember: When you ask a question you also assume the responsibility to assign points.
Please check your other questions and if the answers were good.
Spread the love and give some points.
Thanks in advance, Mark. -
Date validation in the selection screen
Hi
I am new to all this..so pls help me with this...
I need to validate my input field in the selection screen to have the format as YYYYMMDD i.e user is allowed to enter the date in this format only!!
Now how to validate this kind of a format??Hi
That's INPUT format just one used to save a date, so u need to check it only.
It's the same if you used a DATS format, because its INPUT FORMAT is the same, for example, output format of SY-DATUM is DD.MM.YYYY, but input format is YYYYMMDD, so:
PARAMATERS: P_DATE LIKE SY-DATUM.
AT SELECTION-SCREEN.
IF P_DATE < SY-DATUM.
MESSAGE E208(00) 'Error'.
ENDIF.
In your case the INPUT and OUTPUT format are the same so:
PARAMATERS: P_DATE(8) TYPE N.
AT SELECTION-SCREEN.
IF P_DATE < SY-DATUM.
MESSAGE E208(00) 'Error'.
ENDIF.
Max -
Initialization for Date Fields on PNP Selection screen
Hi All,
I need to initialize the date on the LDB PNP selection screen to today.
I gave the following code in the Initialization
Set the Key Date to Today
pnptimr1 = 'X'.
but this doesn't get reflected on the selection screen.
Please suggest.
Thanks,
Suryakiran D.Hi Suryakiran,
1. Only as Default.
2. Use this.
DATA : firstover TYPE c.
AT SELECTION-SCREEN OUTPUT.
IF firstover = ''.
firstover ='X'.
pnptimr6 = ''.
pnptimr1 = 'X'.
ENDIF.
regards,
amit m. -
How to Make Field "Creation Date" Mandatory (in EP Selection Screen)
Dear experts,
I am on SRM 7.0.
In Shopping Cart, i'd like to set Field "Creation Date" as Mandatory Field in EP Selection Screen / Criteria Maintenance.
Is there BADI or SPRO need to be maintained?
Thanks & regards,
Jack
Edited by: Jack4ever on Aug 9, 2011 7:42 AM
Edited by: Jack4ever on Aug 9, 2011 7:43 AMHi Jack,
Not sure if it possible in standard with any customizing but it might be able to achieve this through webdynpro enhancements.
Regards,
Prasanna -
Wrong date format when using selection screen query
Hi all,
I have a problem in a report when usign the selection screen of the query.
the system has been upgraded recently from a 3.5 to 7.0. when a query is run in the bex web the user can put in the selection date needer to run the query.
currently if u select a month using the selection screen next to the input form, the month will show up in the input field
as 006 09 (006space09) instead of 06.2009 for the selection of june.
does anyone know how to fix this? it was working good using the 3.5 version of the bex web.
Any help apriciatedUsing the list cube transaction and using the selection sceen and selecting the month it does put the right selection in the input field. ive also just tested it using de bx excel plugin and using the selection screen the correct value is set in the input field. so i think it more of a bex we b problem but i dont know where to start the search for the solution.
-
Splitting the date based on the selection screen input
Hi all,
In the Selection screen of my report i had maintained two fields
SELECT-OPTIONS : S_DATE FOR TPCDATE-FROM_DATE.
PARAMETERS : P_NUMBER TYPE ZMMAREA-NUMBER.
I need to code such that
S_DATE should be splitted into P_NUMBER times
for example if P_NUMBER is 4 i need S_DATE should be splitted into 4 equal parts or near by equal parts
IF P_NUMBER is 2 i need S_DATE should be splitted into 2 equal parts or near by equal parts
Please suggest me the code of if any Function module exists fot this date splitting
Thanks in advance
Ajay.Dthough date question are not allowed, this requirement sounds little different.
you can take a difference between those days by: S_date-high - S_date-low.
then divide the difference by p_number. now you get the split positions.
now in a do enddo you can negate the dates by the split amount you got from the divisions.
like...
PARAMETERS: num type i.
select-OPTIONS: s_date for sy-datum.
data : gv_split type i, gv_temp type sy-datum.
gv_split = s_date-high - s_date-low.
gv_split = gv_split / num.
gv_temp = s_date-high.
do num times.
gv_temp = gv_temp - gv_split.
WRITE / gv_temp.
enddo. -
Cursor on a error-data field in the Selection-Screen
Hi all,
I have a normal selection-screen in which I have 4 select-options.
I require that when user enters a wrong data in the 3rd field, the cursor should blink in that field.
I tried to use AT SELECTION-SCREEN ON fld event, but through this, the other's field input is disabled which I don't want.
What should I do?
Can I do it using SCREEN table?
Regards,
Saurabh A. BukshHi Saurabd,
you could use the general event
AT SELECTION-SCREEN.
with no restriction on the fields. Then
SET CURSOR FIELD error_field.
MESSAGE Exxx...
Best regards,
Florin -
How to fetch data based on this selection screen
Hi Friends:
I've a selection screen which contains these 3 fields:
company code (t001-bukrs)
material division (mara-spart)
posting date (bkpf-budat)
based on the above fields, I've to fetch the following:
ekpo-bukrs
mara-spart
mseg-werks
mseg-lgort
bseg-hkont
bseg-kostl
bseg-hkont
skat-txt50
mseg-mblnr
mseg-zeile
bseg-belnr
bkpf-bktxt
mseg-insmk
bkpf-monat
bkpf-budat
mseg-bwart
mbew-matnr
makt-maktx
mseg-menge
mseg-meins
mbew-stprs
mseg-dmbtr
bseg-pswsl
ausp-atwrt
mara-matkl
mara-mtart
mbew-bklas
mbew-bwtar
mkpf-vgart
mcha-charg
mseg-ebeln
aufk-aufnr
mseg-ummat
vbak-vbeln
likp-vbeln
bkpf-usnam
Please help me with the logic . I want to ask that in which order I should start fetching data.How to relate it from selection screen. Which table I should fetch first based on the selection screen.how to relate mseg/bseg/mara/mbew/vbak/bkpf etc.
Please help.
Thanks for your time.Hi,
I dont think you need EKPO to fetch your bukrs. It is available in BKPF too.
Use inner join to join MKPF, BKPF, MAKT, fetch all the related entreis.
Use Inner join on MBEW, MCHA for all entries from above query.
use inner join on AUSP for all entries from above query.
Use may use separate queries or inner joins for LIKP and VBAK with for all entries.
Use separate for all entries for BSEG and MSEG. Do not use any JOIN on BSEG as it is a pooled table.
As per the need you may change the queries..
Regards,
Subramanian -
AUTHORITY-CHECK before Selection-screen?
Hi,
i want to check the authority before the selection-screen. I do it in this way:
AT SELECTION-SCREEN OUTPUT.
AUTHORITY-CHECK OBJECT 'Z_REPORT'
ID 'PROGRAM' FIELD SY-REPID
ID 'ACTVT' FIELD '16'. "Ausführen
IF SY-SUBRC <> 0.
MESSAGE E010 WITH 'Keine Berechtigung für Programm: '
SY-REPID.
ENDIF.
But the selection appears without any parameters.
Is there a way to check without the selection-screen?
thanks.
regards, DieterHi Dieter,
Please check the below code for at selection screen authorization check.
Handling selection screen events
AT SELECTION-SCREEN ON p_carrid.
IF p_carrid IS INITIAL.
MESSAGE 'Please enter a value' TYPE 'E'.
ENDIF.
AUTHORITY-CHECK OBJECT 'S_CARRID'
ID 'CARRID' FIELD p_carrid
ID 'ACTVT' FIELD '03'.
IF sy-subrc = 4.
MESSAGE 'No authorization for carrier' TYPE 'E'.
ELSEIF sy-subrc <> 0.
MESSAGE 'Error in authority check' TYPE 'A'.
ELSE.
IF sy-ucomm = 'ONLI'.
CALL SELECTION-SCREEN '0500'.
ENDIF.
ENDIF.
Regards,
Md Ziauddin -
Filtering of the data based upon the selection screen data using ldb
Hi Experts ,
I am using ldb pnpce, for my report ,and i created my own report category with selection paramaters
action type and payroll area
now the problem is when i am giving the action type as Z0 ,the data to be extracted is not getting filtered
based upon the action type ,the data consists the records having different action types other than Z0
Please give me some solution for thisThanks Durga ,but the link wat ever u was for hiding the selection screen fields
but my question is when am using get pernr event my data is not getting filtered with the selection screen paramater value
i,e m giving action type as only hiring ,but m getting the data for all the action types ,its not filtering based upon my selection -
F4 ( Search Help ) for date field on the selection screen
Hi Freinds,
i have used WDR_SELECT_OPTIONS In my component, i have one date field on selection screen(BUDAT), for this date field i want seach help
this is my code
create a range table for Posting Date
lt_range_table = wd_this->m_handler->create_range_table(
i_typename = 'BUDAT' ).
add Posting Date to the selection
wd_this->m_handler->add_selection_field( i_id = 'BUDAT'
i_value_help_type = if_wd_value_help_handler=>CO_PREFIX_SEARCHHELP
I_VALUE_HELP_ID = '??????'
I_DESCRIPTION = 'Posting Date'
it_result = lt_range_table ).
can any one help me
Thanks
Srinihi sarbjeet
i created search help in dictionary and i used that search help in my program, but still its now working , any other ideas
Thnx
srini
Maybe you are looking for
-
Color graded sequence won't export back into fcp as an xml or send to
Hi, I've finished a film and graded it. when everything is rendered, I export using either send to or as an xml. Both stop at around 50%. on the xml I get the following report. I started out at a 20 min sequence then a ten minute sequence now I'm dow
-
IPhoto using wrong email to "share" photos
Hi there, I'm using my new macbook, and love it! BUT, when using iPhoto for the very first time, I wanted to "share" a photo and clicked to email the photo. I then had options to setup whatever email I had. I opted for the Windows Live Account, but
-
Delete old Iweb published site not saved
Hi Team, My compter crashed and I have a published website, but I dont have a backup of the files that created it. I have heard you cant download all of it and I have to start again. How do I delete it and start again??????? I have read how to get th
-
Main and alternative account.
Hi everyone, i have this issue. There are two companies, and each one of them has its own chart of accounts. Company A follows the A chart of accounts and company B follows the B chart of accounts. Company A wants to be a connection between the two c
-
I picked up the Extreme base station when I got the Air. I was previously using a Linksys 54G with 2 Airport Express. I used the Linksys as the main router wired and on wireless G and the 2 express in the dead zones of my house. The 2 express were co