Relative date as selection option
Hi Experts,
could any of You pls help me to define a relative date as selection options?
I have a program about production order selection with a start date as selection option (AKFO-GSTRP). I would like to run this program daily as a background job with dynamic selection: ex. always select orders start date: -5 days form today up till +5 days from now.
So,I want to define a selection options, which will give possibilit to user define only the number of days, and based on this and sy-datum can calculate the actual value for the selection. But in so_xxx definition up till now I only referred to a real value, and I can not do it this time with FOR string. ( My selection field has data element CO_DAT_REL).
Could any of You pls help me - as being beginner at programming-, how to define this relative date selection option?
Thanks in advance
Some solutions (if I understood)
- define a variant for the report, use this variant in the transaction definition (define this variant as a [system variant|http://help.sap.com/saphelp_nw70/helpdata/en/c0/980389e58611d194cc00a0c94260a5/frameset.htm] (start with CUS& or SAP&) so it will be transported automatically, in this variant define the range of date as a selection variant of type D: Dynamic date calculation and select one of the available variable by F4
- define a parameter field of type integer, and build yourself the range by subtracting or adding this field to current date, you can define the result range as a select-options, just protect it in the PBO (AT SELECTION-SCREEN OUTPUT with a classical LOOP AT SCREEN/MODIFY SCREEN/ENDLOOP)
Regards,
Raymond
Similar Messages
-
PS:Copy of MBBS report with Date(GR) selection option in selection screen.
Hi,
We are developing a report, which is Copy of MBBS report, addition as Date(GR) selection option in selection screen to view historical data {i.e.Project Stock(Q) on back dates}.
MBBS is showing Project Stock w.r.t. WBS. So pls suggest Table, which can fulfill the requirement to show the Project Stock from GR w.r.t. Purchase and Production order in back date w.r.t. that WBS.
Pls do the needful.
Thanks,
Amit Jain.Hi Amit ,
The Project Stock Table is MSPR , and the Project stock history table is MSPRH .
Though not through with your actual requirement , There is a standard Report MB5B -- Stock on Posting Date . In the selection screen , we can have the Special Stock Q (Project Stock ) .
If you can develop copying this report instead of MBBS , it would take care of receipts as well as issues ,and from the material Document you can build a relation to the account assignment WBS/Network Activity through MSEG Table .
Hope it helps .
thanks and regards
Kish -
How to read data from select Options in another view without using context
I have 2 views, one for selection screen and another for displaying result.
In selection screen view I have define a select options with the help of webdynpro component.
Now my object is display result in result view based on entry of selection screen.
I don't want to do binding in context node, without that how I can read data of select option
in result view?
Regards,
Rasmi Ranjan MishraSolve by own.
If I define the Select options in component controller, then it will be global in nature. so i can get the value of select options
in another view also.
Regards,
Rasmi Ranjan Mishra -
F4 help for date in select options..
Hi Gurus,
I want a search help for date field which belongs to select options.
I know if it is a parameter we directly map the attribute value to that data element.
Can some help me with this..
Best Regards,
Navin Fernandes.Hi Gurus,
The select options works for date.. I got the solution.
It directly relates to the default data dcitionary help.
Got it from this example: WDR_TEST_SELECT_OPTIONS
Best Regards,
Navin Fernandes. -
How to set a dynamic variant for date in select-options in the upper field
Hi Variant experts Good Evening!
I have the following problem while setting up a dynamic varinat .
Ex: select-options: dat for sy-datum.
I am able to save the lower limit as a dynamic value but not able to save the upper values as dynamic in the select-options. Could any of you please help me in this.
Regards
Ravi.i hope dynamic variant concept is not there,
but u can use the fn module DYPRO_GET_VALUES and
DYNPRO_SET_VALUES
DYNPRO_GET_VALUES gets the values in the screen,
DYNPRO_SET VALUES sets the values.
first get the values, compare and set the values as u want -
Move the data in select options to internal table
I have the code as in the fillowing
SELECT-OPTION:S_MATNR FOR MARA-MATNR.
DATA:BEGIN OF IT_MATNTR OCCURS 0,
MATNR LIKE MARA-MATNR,
END OF IT-MATNR.
NOW HOW CAN I ADD THE MATNER VALUES IN THE SELECT-OPTIONS IN INTERNAL TABLEHi Vamsikrishna,
Yes. You can move the values from S_MATNR to IT_MATNR.
you can try either it_matnr[] = s_matnr[].
if not then you can loop in to the select-options as follows.
Define LS_MATNR as a structure type of s_matnr.
Define LS_IT_MATNR as a structure type of it_matnr.
LOOP S_MATNR INTO LS_MATNR.
MOVE LS_MATNR to LS_IT_MATNR.
APPEND LS_IT_MATNR to IT_MATNR.
CLEAR: LS_MATNR, LS_IT_MATNR.
ENDLOOP.
<b>Reward points for helpful answers.</b>
Best Regards,
Ram. -
Reg: Date in Select-options
Hello All,
I have a date field in the SSCRN as select-options.
Now I want to give a default value to the date-low and date-high.
Those default values must be :
1. For s_date-low the value must be the START DATE of the current Week ( MONDAY )
2. For S_date_high the value must be the END DATE of the Week ( SUNDAY )
Eg: today is 07.11.2007 then my s_date-low must be 05.11.2007 (Monday) and my s_date-high must be 11.11.2007 (Sunday).
Can anyone know how to pass these as default values ?
Regards,
Deepu.KHi Deepu,
Try the following code.
SELECT-OPTIONS : s_date FOR sy-datum.
DATA : l_date LIKE sy-datum.
DATA : h_date LIKE sy-datum.
INITIALIZATION.
CALL FUNCTION 'GET_WEEK_INFO_BASED_ON_DATE'
EXPORTING
DATE = SY-DATUM
IMPORTING
WEEK =
MONDAY = l_date
SUNDAY = h_date.
s_date-low = l_date.
s_date-high = h_date.
append s_date.
If it is usefull pls reward it.
Regards
Srimanta -
Assigning Data-Type Select-Option from Report to Method
Hi Specialists,
How can I solve the following task smart? Its a quiet simple task. In my Report Ive some Select-Option-Data-Types and I want to assign this data-type an Abpab-Object-Method. Is it possible to do this in a smart fashion. Ive fight with the Abap-Syntax und at the end Ive found a tricky way of assigning the Select-Option parameter to the Abap-Object-Method.
If somebody have a smart idea for this problem, pleas let me know.
Thankx.
Hallo Spezialisten,
ich hätte da eine Frage wie man folgende Aufgabe elegant lösen kann.
Es ist ganz einfach, ich möchte von einen Report einen Select-Option-Datentyp an eine Abapobject Methode übergeben. Ich hatte sehr lange gekämpft bis ich ein umständlichen weg gefunden habe die parameter vom reprot an die mehtode zu übergen.
Falls jemand da eine gut Idee hätte wäre mir das nächste mach sehr geholfen.
DankeHi
Here is the Program with Selection screen and the Class & Methods.
REPORT demo_abap_objects_methods NO STANDARD PAGE HEADING.
* Global Selection Screens
SELECTION-SCREEN BEGIN OF: SCREEN 100 TITLE tit1, LINE.
PARAMETERS members TYPE i DEFAULT 10.
SELECTION-SCREEN END OF: LINE, SCREEN 100.
SELECTION-SCREEN BEGIN OF: SCREEN 200 TITLE tit2.
PARAMETERS: drive RADIOBUTTON GROUP actn,
stop RADIOBUTTON GROUP actn,
gearup RADIOBUTTON GROUP actn,
geardown RADIOBUTTON GROUP actn.
SELECTION-SCREEN END OF: SCREEN 200.
* Class Definitions
CLASS: c_biker DEFINITION DEFERRED,
c_bicycle DEFINITION DEFERRED.
CLASS c_team DEFINITION.
PUBLIC SECTION.
TYPES: biker_ref TYPE REF TO c_biker,
biker_ref_tab TYPE STANDARD TABLE OF biker_ref
WITH DEFAULT KEY,
BEGIN OF status_line_type,
flag(1) TYPE c,
text1(5) TYPE c,
id TYPE i,
text2(7) TYPE c,
text3(6) TYPE c,
gear TYPE i,
text4(7) TYPE c,
speed TYPE i,
END OF status_line_type.
CLASS-METHODS: class_constructor.
METHODS: constructor,
create_team,
selection,
execution.
PRIVATE SECTION.
CLASS-DATA: team_members TYPE i,
counter TYPE i.
DATA: id TYPE i,
status_line TYPE status_line_type,
status_list TYPE SORTED TABLE OF status_line_type
WITH UNIQUE KEY id,
biker_tab TYPE biker_ref_tab,
biker_selection LIKE biker_tab,
biker LIKE LINE OF biker_tab.
METHODS: write_list.
ENDCLASS.
CLASS c_biker DEFINITION.
PUBLIC SECTION.
METHODS: constructor IMPORTING team_id TYPE i members TYPE i,
select_action,
status_line EXPORTING line TYPE c_team=>status_line_type.
PRIVATE SECTION.
CLASS-DATA counter TYPE i.
DATA: id TYPE i,
bike TYPE REF TO c_bicycle,
gear_status TYPE i VALUE 1,
speed_status TYPE i VALUE 0.
METHODS biker_action IMPORTING action TYPE i.
ENDCLASS.
CLASS c_bicycle DEFINITION.
PUBLIC SECTION.
METHODS: drive EXPORTING velocity TYPE i,
stop EXPORTING velocity TYPE i,
change_gear IMPORTING change TYPE i
RETURNING value(gear) TYPE i
EXCEPTIONS gear_min gear_max.
PRIVATE SECTION.
DATA: speed TYPE i,
gear TYPE i VALUE 1.
CONSTANTS: max_gear TYPE i VALUE 18,
min_gear TYPE i VALUE 1.
ENDCLASS.
* Class Implementations
CLASS c_team IMPLEMENTATION.
METHOD class_constructor.
tit1 = 'Team members ?'.
CALL SELECTION-SCREEN 100 STARTING AT 5 3.
IF sy-subrc NE 0.
LEAVE PROGRAM.
ELSE.
team_members = members.
ENDIF.
ENDMETHOD.
METHOD constructor.
counter = counter + 1.
id = counter.
ENDMETHOD.
METHOD create_team.
DO team_members TIMES.
CREATE OBJECT biker EXPORTING team_id = id members = team_members.
APPEND biker TO biker_tab.
CALL METHOD biker->status_line IMPORTING line = status_line.
APPEND status_line TO status_list.
ENDDO.
ENDMETHOD.
METHOD selection.
CLEAR biker_selection.
DO.
READ LINE sy-index.
IF sy-subrc <> 0. EXIT. ENDIF.
IF sy-lisel+0(1) = 'X'.
READ TABLE biker_tab INTO biker INDEX sy-index.
APPEND biker TO biker_selection.
ENDIF.
ENDDO.
CALL METHOD write_list.
ENDMETHOD.
METHOD execution.
CHECK NOT biker_selection IS INITIAL.
LOOP AT biker_selection INTO biker.
CALL METHOD biker->select_action.
CALL METHOD biker->status_line IMPORTING line = status_line.
MODIFY TABLE status_list FROM status_line.
ENDLOOP.
CALL METHOD write_list.
ENDMETHOD.
METHOD write_list.
SET TITLEBAR 'TIT'.
sy-lsind = 0.
SKIP TO LINE 1.
POSITION 1.
LOOP AT status_list INTO status_line.
WRITE: / status_line-flag AS CHECKBOX,
status_line-text1,
status_line-id,
status_line-text2,
status_line-text3,
status_line-gear,
status_line-text4,
status_line-speed.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
CLASS c_biker IMPLEMENTATION.
METHOD constructor.
counter = counter + 1.
id = counter - members * ( team_id - 1 ).
CREATE OBJECT bike.
ENDMETHOD.
METHOD select_action.
DATA activity TYPE i.
tit2 = 'Select action for BIKE'.
tit2+24(3) = id.
CALL SELECTION-SCREEN 200 STARTING AT 5 15.
CHECK NOT sy-subrc GT 0.
IF gearup = 'X' OR geardown = 'X'.
IF gearup = 'X'.
activity = 1.
ELSEIF geardown = 'X'.
activity = -1.
ENDIF.
ELSEIF drive = 'X'.
activity = 2.
ELSEIF stop = 'X'.
activity = 3.
ENDIF.
CALL METHOD biker_action( activity ).
ENDMETHOD.
METHOD biker_action.
CASE action.
WHEN -1 OR 1.
CALL METHOD bike->change_gear
EXPORTING change = action
RECEIVING gear = gear_status
EXCEPTIONS gear_max = 1
gear_min = 2.
CASE sy-subrc.
WHEN 1.
MESSAGE i315(at) WITH 'BIKE' id
' is already at maximal gear!'.
WHEN 2.
MESSAGE i315(at) WITH 'BIKE' id
' is already at minimal gear!'.
ENDCASE.
WHEN 2.
CALL METHOD bike->drive IMPORTING velocity = speed_status.
WHEN 3.
CALL METHOD bike->stop IMPORTING velocity = speed_status.
ENDCASE.
ENDMETHOD.
METHOD status_line.
line-flag = space.
line-text1 = 'Biker'.
line-id = id.
line-text2 = 'Status:'.
line-text3 = 'Gear = '.
line-gear = gear_status.
line-text4 = 'Speed = '.
line-speed = speed_status.
ENDMETHOD.
ENDCLASS.
CLASS c_bicycle IMPLEMENTATION.
METHOD drive.
speed = speed + gear * 10.
velocity = speed.
ENDMETHOD.
METHOD stop.
speed = 0.
velocity = speed.
ENDMETHOD.
METHOD change_gear.
gear = me->gear.
gear = gear + change.
IF gear GT max_gear.
gear = max_gear.
RAISE gear_max.
ELSEIF gear LT min_gear.
gear = min_gear.
RAISE gear_min.
ENDIF.
me->gear = gear.
ENDMETHOD.
ENDCLASS.
* Global Program Data
TYPES team TYPE REF TO c_team.
DATA: team_blue TYPE team,
team_green TYPE team,
team_red TYPE team.
DATA color(5) TYPE c.
* Program events
START-OF-SELECTION.
CREATE OBJECT: team_blue,
team_green,
team_red.
CALL METHOD: team_blue->create_team,
team_green->create_team,
team_red->create_team.
SET PF-STATUS 'TEAMLIST'.
WRITE ' Select a team! ' COLOR = 2.
AT USER-COMMAND.
CASE sy-ucomm.
WHEN 'TEAM_BLUE'.
color = 'BLUE '.
FORMAT COLOR = 1 INTENSIFIED ON INVERSE ON.
CALL METHOD team_blue->selection.
WHEN 'TEAM_GREEN'.
color = 'GREEN'.
FORMAT COLOR = 5 INTENSIFIED ON INVERSE ON.
CALL METHOD team_green->selection.
WHEN 'TEAM_RED'.
color = 'RED '.
FORMAT COLOR = 6 INTENSIFIED ON INVERSE ON.
CALL METHOD team_red->selection.
WHEN 'EXECUTION'.
CASE color.
WHEN 'BLUE '.
FORMAT COLOR = 1 INTENSIFIED ON INVERSE ON.
CALL METHOD team_blue->selection.
CALL METHOD team_blue->execution.
WHEN 'GREEN'.
FORMAT COLOR = 5 INTENSIFIED ON INVERSE ON.
CALL METHOD team_green->selection.
CALL METHOD team_green->execution.
WHEN 'RED '.
FORMAT COLOR = 6 INTENSIFIED ON INVERSE ON.
CALL METHOD team_red->selection.
CALL METHOD team_red->execution.
ENDCASE.
ENDCASE.
Reward points if it is usefull ....
Girish -
How to get the data into select options if we have 10 select options
Hi Experts,
I facing problem to get the data from diffrent tables and different select options.
I have to pass different parameter ranges.
SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: rb1 RADIOBUTTON GROUP g1. "Existing Key Accounts
PARAMETERS: rb2 RADIOBUTTON GROUP g1. "Potential Key Accounts
SELECT-OPTIONS: s_part FOR but000-partner."Business Partner Number
PARAMETERS: p_bpkind LIKE but000-bpkind. "Business Partner Type
PARAMETERS: p_but000 LIKE but000-partner. "Key Account Manager
SELECT-OPTIONS : s_vkont FOR fkkvkp-vkont. "Contract Account
SELECT-OPTIONS : s_ktokl FOR fkkvkp-ktokl. "Debtor Type
SELECT-OPTIONS : s_sparte FOR ever-sparte. "Division
SELECT-OPTIONS : s_vertra FOR ever-vertrag. "Contract
SELECT-OPTIONS : s_budat FOR erdk-budat. "Invoice Date
SELECT-OPTIONS : s_netto FOR dberchv-nettobtr."Billing Amount
SELECT-OPTIONS : s_abrm FOR abc. "Consumption Value
SELECTION-SCREEN: END OF BLOCK b1.
need response asap.
Thanking you.
Regards Surya RamireddyHI,
You can use as many Select-options in the select statment,
Select XXXX yyyy from TABLE where FIELD In S_FIELD1 and
FIELD2 In S_FIELD2.
Regards
Sudheer -
Cant't get the data through SELECTION-OPTION
hi all,
i have created a REPORT in which i have two SELECTION-OPTION i-e one is ANLKL from TABLE ANLA and other is GJAHR from table ANLC.Problem which i m facing is that when i execute without giving my SELECTION-OPTION GJAHR.it gives me all data for example(2005,2007,2008),but when im defining it with by 2005 it gives blank fields even though there is data with GJAHR by 2005.
This is the coding of my report:
include zalsd_alv_incl.
TABLES:ANEP,ANLA,ANLC.
SELECT-OPTIONS:
S_ANLKL FOR ANLA-ANLKL DEFAULT '1100' to '2790',
S_GJAHR FOR ANLC-GJAHR.
DATA:BEGIN OF gi_anla OCCURS 0,
bukrs LIKE anla-bukrs,
ANLN1 LIKE anla-ANLN1,
ANLN2 LIKE anla-ANLN2,
AKTIV LIKE ANLA-AKTIV,"Asset capitalization date
ANLKL LIKE ANLA-ANLKL,"Asset Class
END OF gi_anla,
BEGIN OF GI_ANLC OCCURS 0,
bukrs LIKE anlc-bukrs,
NAFAP LIKE anlc-nafag,"Posted Depreciation
kansw LIKE anlc-kansw,"Asset Acquisation Value
ANLN2 LIKE anlc-anln2,"Asset Subnumber
ANLN1 LIKE anlc-ANLN1,"Main Asset Number
GJAHR LIKE ANLC-GJAHR,"Fiscal Year
AFABE LIKE ANLC-AFABE,"Real depreciation area
ANSWL LIKE ANLC-ANSWL,"Transactions for the year
END OF GI_ANLC,
BEGIN OF gi_main OCCURS 0,
sno type i, "S.No
bukrs LIKE anla-bukrs,"Company code
ANLN1 LIKE anlc-ANLN1,"Main Asset Number
anln2 LIKE anlc-anln2,"Asset Subnumber
AKTIV LIKE ANLA-AKTIV,"Asset capitalization date
ANLKL LIKE ANLA-ANLKL,"Asset Class
NAFAG LIKE anlc-nafag,"Ordinary Depreciation Posted
kansw LIKE anlc-kansw,"Asset Acquisation Value
GJAHR LIKE ANLC-GJAHR,"Fiscal Year
PSTEND LIKE anlc-PSTEND,"Posting depreciation up to period
AFABE LIKE ANLC-AFABE,"Real depreciation area
ANSWL LIKE ANLC-ANSWL,"Transactions for the year
END OF gi_main.
START-OF-SELECTION.
PERFORM get_data.
PERFORM organize_data.
PERFORM f_display_report.
END-OF-SELECTION.
form get_data.
SELECT anlc~bukrs anlc~anln1 ANLC~ANLN2 kansw nafaG PSTEND ANSWL ANLKL AKTIV
INTO CORRESPONDING FIELDS OF TABLE gi_main
FROM
ANLC
INNER JOIN ANLA ON
anlc~bukrs = anla~bukrs AND
anlc~anln1 = anla~anln1 AND
ANLC~ANLN2 = ANLA~ANLN2
WHERE AFABE eq '1'
AND GJAHR IN S_GJAHR
AND ANLA~ANLKL in S_ANLKL.
ENDFORM.
FORM organize_data.
data: lv_index type sy-tabix.
LOOP at gi_anla.
move sy-tabix to gi_main-sno.
READ TABLE gi_anla WITH KEY bukrs = gi_anla-bukrs
anln1 = gi_anla-anln1
anln2 = gi_anla-anln2.
MOVE-CORRESPONDING gi_anla to gi_main.
READ TABLE gi_anlc WITH KEY bukrs = gi_anlc-bukrs
anln1 = gi_anlc-anln1
anln2 = gi_anlc-anln2.
IF sy-subrc = 0.
MOVE-CORRESPONDING gi_anlc to gi_main.
ENDIF.
APPEND gi_main.
CLEAR gi_main.
ENDLOOP.
ENDFORM.
form f_display_report.
perform fill_fieldcat using 'SNO' 5 'S.No.' 'gi_main'.
perform fill_fieldcat using 'ANLKL' 20 'Asset Class' 'gi_main'.
perform fill_fieldcat using 'ANLN1' 20 'Asset Number' 'gi_main'.
perform fill_fieldcat using 'ANLN2' 20 'Asset Subnumber' 'gi_main'.
perform fill_fieldcat using 'AKTIV' 20 'Asset Capitalization Date' 'gi_main'.
perform fill_fieldcat using 'KANSW' 20 'Asset Acquisation Value' 'gi_main'.
perform fill_fieldcat using 'NAFAG' 20 'Posted Depreciation' 'gi_main'.
perform fill_fieldcat using 'PSTEND' 20 'Posting depreciation up to period' 'gi_main'.
perform fill_fieldcat using 'ANSWL' 20 'Transactions for the year' 'gi_main'.
perform add_heading_alv using c_alv_head_header '' 'Ghulam Farooq Group'.
perform display_alv using gi_main[].
endform.
Thankks,
abapfkHi,
I created a program with the 2 select-option and a structure for storage and a select statement.
REPORT Z_ANLA_ANLC_TEST.
TABLES:ANEP,ANLA,ANLC.
SELECT-OPTIONS:
S_ANLKL FOR ANLA-ANLKL DEFAULT '1100' to '2790',
S_GJAHR FOR ANLC-GJAHR.
DATA :
BEGIN OF gi_main OCCURS 0,
sno type i, "S.No
bukrs LIKE anla-bukrs,"Company code
ANLN1 LIKE anlc-ANLN1,"Main Asset Number
anln2 LIKE anlc-anln2,"Asset Subnumber
AKTIV LIKE ANLA-AKTIV,"Asset capitalization date
ANLKL LIKE ANLA-ANLKL,"Asset Class
NAFAG LIKE anlc-nafag,"Ordinary Depreciation Posted
kansw LIKE anlc-kansw,"Asset Acquisation Value
GJAHR LIKE ANLC-GJAHR,"Fiscal Year
PSTEND LIKE anlc-PSTEND,"Posting depreciation up to period
AFABE LIKE ANLC-AFABE,"Real depreciation area
ANSWL LIKE ANLC-ANSWL,"Transactions for the year
END OF gi_main.
START-OF-SELECTION.
SELECT anlcbukrs anlcanln1 ANLC~ANLN2 kansw nafaG PSTEND ANSWL ANLKL AKTIV
INTO CORRESPONDING FIELDS OF TABLE gi_main
FROM
ANLC
INNER JOIN ANLA ON
anlcbukrs = anlabukrs AND
anlcanln1 = anlaanln1 AND
ANLCANLN2 = ANLAANLN2
WHERE AFABE eq '1'
AND GJAHR IN S_GJAHR
AND ANLA~ANLKL in S_ANLKL.
BREAK-POINT.
Here is the result at the break point
GI_MAIN[] Standard Table[831x12(116)]
S_ANLKL[] Standard Table[0x4(38)]
S_GJAHR[] Standard Table[1x4(22)]
S_GJAHR-LOW 2009
S_GJAHR-HIGH 0000
I entered value only in GJAHR.
I see there is no problem with the JOIN and the selection, i assume there is a problem with the data.
Try creating a simple query using sqvi and check it.
Regards,
George. -
How to select multiple data without select options?
Dear experts,
I have a rquirement that i have a one selection screen and in that selection screen on date field is there which is parameter type. we using this parameter date field in the program for selecting data..after that i am using the logic to multiple value..now my requirement is how to select the data for multiple value..
PARAMETERS : SO_DATE TYPE SY-DATUM OBLIGATORY.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
DATE = so_date
DAYS = 1
MONTHS = 0
SIGNUM = '-'
YEARS = 0
IMPORTING
CALC_DATE = so_date
l_cm_first+0(6) = so_date+0(6). " month & year
l_cm_first+6(2) = '01'. " date
l_cm_end = so_date.
my requirement is that how to use l_cm_first and l_cm_end multiple selection in select query ??
eg- i want to fetch the data from 1/8/2014 to 11/08/2014 using this field l_cm_first and l_cm_endl_cm_first+0(6) = so_date+0(6). " month & year
l_cm_first+6(2) = '01'. " date
l_cm_end = so_date.
after executing this line l_cm_first = 1/8/2014 and l_cm_end = 11/08/2014
now i have to select in this range how to do it? -
Select-options for date field.
Hi all,
i need to give select options for Date field.How can i give that.
Thanks & Regards
Ravi.Hi Ravi,
Use the Component WDR_SELECT_OPTIONS to include select options in Web Dynpro ABAP. Follow these steps:
1. In your Component , "Used Componet" tab add Component WDR_SELECT_OPTIONS . Component Use can be any name that you want to give, eg SELECT_OPTIONS
2. Go to the View where you want to include the Date Select Options. I am assuming that you already have an Attribute of Type DATS in your context.
3. View: Properties Tab:Create Controller Usage and select
SELECT_OPTIONS WDR_SELECT_OPTIONS
SELECT_OPTIONS WDR_SELECT_OPTIONS INTERFACECONTROLLER
4. View Layout Tab:Include a View Container. In this view container we will show the Date Select Options.
5. View Attributes Tab: Create Following two attributes:
M_HANDLER type IF_WD_SELECT_OPTIONS
M_WD_SELECT_OPTIONS type IWCI_WDR_SELECT_OPTIONS
6: View Methods Tab: Create a method eg CREATE_SELECTION_SCREEN. Call this method in the WDDOINIT of the view.
7:CREATE_SELECTION_SCREEN: Write following Code:
* Data Declaration
data:
lt_range_table TYPE REF TO DATA.
data:
lr_componentcontroller TYPE REF TO IG_COMPONENTCONTROLLER,
lr_componentusage TYPE REF TO IF_WD_COMPONENT_USAGE.
* Execution
* Create Used Component
lr_componentusage = wd_this->wd_cpuse_select_options( ).
if LR_COMPONENTUSAGE->HAS_ACTIVE_COMPONENT( ) is initial.
lr_componentusage->create_component( ).
endif.
* Get pointer to interface controller of select options
wd_this->M_WD_SELECT_OPTIONS = wd_this->wd_cpifc_select_options( ).
* initialize selction screen
wd_this->M_HANDLER = wd_this->M_WD_SELECT_OPTIONS->init_selection_screen( ).
* Create Range Table for: Date
CALL METHOD WD_THIS->M_HANDLER->CREATE_RANGE_TABLE
EXPORTING
I_TYPENAME = 'DATS'
RECEIVING
RT_RANGE_TABLE = lt_range_table.
* Add Selection Field for: Date
CALL METHOD WD_THIS->M_HANDLER->ADD_SELECTION_FIELD
EXPORTING
I_ID = '<name of date attribute in the context>'
* I_WITHIN_BLOCK = MC_ID_MAIN_BLOCK
* I_DESCRIPTION =
* I_IS_AUTO_DESCRIPTION = ABAP_TRUE
IT_RESULT = lt_range_table
* I_OBLIGATORY = ABAP_FALSE
* I_COMPLEX_RESTRICTIONS =
* I_USE_COMPLEX_RESTRICTION = ABAP_FALSE
* I_NO_COMPLEX_RESTRICTIONS = ABAP_FALSE
* I_VALUE_HELP_TYPE = IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_NONE
* I_VALUE_HELP_ID =
* I_VALUE_HELP_MODE =
* I_VALUE_HELP_STRUCTURE =
* I_VALUE_HELP_STRUCTURE_FIELD =
* I_HELP_REQUEST_HANDLER =
* I_LOWER_CASE =
* I_MEMORY_ID =
* I_NO_EXTENSION = ABAP_FALSE
* I_NO_INTERVALS = ABAP_FALSE
* I_AS_CHECKBOX = ABAP_FALSE
* I_AS_DROPDOWN = ABAP_FALSE
* IT_VALUE_SET =
* I_READ_ONLY = ABAP_FALSE
* I_DONT_CARE_VALUE =
* I_EXPLANATION =
I_TOOLTIP = 'Select Date'.
8: To Fetch Data entered in the selection field, write following code on action of button click:
data:
lt_date type REF TO DATA.
FIELD-SYMBOLS:
<fs_date> TYPE table.
* retrieve Date from Select Options
CALL METHOD WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD
EXPORTING
I_ID = '<attrib_name>'
RECEIVING
RT_RANGE_TABLE = lt_date.
* assign Date Field Symbol
ASSIGN lt_date->* to <fs_date>.
9: Windows Window Tab: In the View Conatiner, embed the WND_SELECTION_SCREEN view from SELECT_OPTIONS component Usage of WDR_SELECT_OPTIONS component.
Regards,
Reema. -
Selection OPTION: Date input problem in Module POOL through Subscreen
Dear ALL,
Being new to ABAP, I am struck in a Problem.
Requirement:
I want an option on the Screen( My Screen 9000) for Date Range. Through this Date-Range I want to filter and pull some data from
Database.
As Date Range Selection option is possible only through Sub-Screen integration. Hence I integrated a Sub-Screen 400 (as below) and named the Sub-Screen area as SEL on my screen.
Problem: As soon as I enter the dates on the screen, then those dates are not taken up by the code.
During debugging I saw the the S_datum-low and S_datum-high are empty (in fact 00000000)
The code follows:
PROCESS BEFORE OUTPUT.
MODULE STATUS_9000.
Call SUBSCREEN SEL INCLUDING sy-repid '400'.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9000.
DATA: gv_datum Type dats,
SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
SELECT-OPTIONS: s_datum FOR gv_datum.
SELECTION-SCREEN END OF SCREEN 400 .
Plz help where I am missing something.
Regards
ChandanCall the subscreen during the AT SELECTION-SCREEN event.
SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
SELECT-OPTIONS: s_datum FOR gv_datum.
SELECTION-SCREEN END OF SCREEN 400 .
AT SELECTION-SCREEN.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS '0100'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE sy-ucomm.
WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT -
How to change date format in select-option (mm.yyyy).
Hi,
Plz, How to change date format in select-option (mm.yyyy).
in my selection screen date type selection-option is there ,when i am enter date it's taken dd.mm.yyyy format,but i want mm.yyyy format.
how to set that .
Regards,
Kk.sorry
parameters : pmonyr type spmon or
select-options : sspmon for PGPL-spmon .
or what table ccontains spmon.
regards
shiba dutta -
Date as a select option in sales order report.....
hello guys i want to add sales doc date from as a lower field and date to as a higher field on a selection screen.....so please help me out......i also want to add error message for it.....
Simply add the date field as select-options error msg on choosing wrong date format will be automatically triggred.
For example for order creation date.
select-options: audat for vbak-audat.
anya
Maybe you are looking for
-
External Hyperlink behavior in iBooks ePub created with iWork Pages
I am new at ePup publishing. I'm using iWork pages and exporting to ePub. Things were going great until........ I started playing with the hyperlinks in my ePub book in iBooks. I am doing this with an iPad and an iPod Touch. I'm in iBooks, I click
-
Unable to move or rename files on WebDAV shares
I have not been able to get WebDAV shares to work properly on Lion. Let's say I have a "User" that has given ownership to a WebDAV folder named "Share". I can connect to my WebDAV share using Finder at "https://website.com/webdav" and I can successfu
-
How to conversion .wmf files for Mac use?
We have Broderbund's ClickArt package from the days when the user used Windows. Now, on the Mac, the .wmf files won't open in Preview, Pages, etc. (We don't have MS Office.) How can we either use these .wmf files with Mac or find a good conversion
-
Lost calender data with sync - aaagh! Where can I find backup data??
Hi. I synced my iphone (ios4) with my imac yesterday and lots of random calender data has been lost on my iphone. I haven't synced for a long time so no use me trying to restore to a recent sync. A friend told me that prior to syncing, itunes takes a
-
Hi, I want to show top 3 salary records from emp table and I am using below query in oracle * plus. However I am getting an error saying, "FROM keyword not found where expected". I am not getting what mistake I am doing while writing this query. Can