Using Select options how to validate
Hi Experts,
I am using webdynpro abap component select options.In select options i am using vbeln field i want to validate the entered value.How to validate it.Can give me for this solution is there any example provide me.
Hi Chandra sekhar ,
Can you give me the clear idea for validation.I have done initially in wddoinit
method WDDOINIT .
* Reference variable used instantiate the select-options component
DATA
lr_cmp_usage TYPE REF TO if_wd_component_usage.
* Variables used to create the select-options fields and
* define its initial values
DATA:
lr_field TYPE REF TO data.
FIELD-SYMBOLS:
<fs_field> TYPE ANY,
<fs_range> TYPE INDEX TABLE.
* Instantiate the select-options component
lr_cmp_usage = wd_this->wd_cpuse_cmp_sel_opt( ).
IF lr_cmp_usage->has_active_component( ) IS INITIAL.
lr_cmp_usage->create_component( ).
ENDIF.
* Sets the helper reference
wd_this->m_sel_opt = wd_this->wd_cpifc_cmp_sel_opt( ).
wd_this->m_helper = wd_this->m_sel_opt->init_selection_screen( ).
* Hide the standard select-options components.
wd_this->m_helper->set_global_options(
i_display_btn_cancel = abap_false
i_display_btn_check = abap_false
i_display_btn_reset = abap_false ).
* Adding a block (type Tray) to the select-options
wd_this->m_helper->add_block(
i_id = `BL01`
i_block_type = if_wd_select_options=>mc_block_type_tray
i_title = `Flight Booking` ).
* Adding a parameter field to the created block
* Create a reference to the type of airline code
CREATE DATA lr_field TYPE s_carr_id.
* Sets the airline code initial value
ASSIGN lr_field->* TO <fs_field>.
<fs_field> = 'AA '.
* Add the parameter to the group
wd_this->m_helper->add_parameter_field(
i_id = `CARRID`
i_within_block = `BL01`
i_value = lr_field ).
FREE lr_field.
UNASSIGN <fs_field>.
* Adding a select-options field to the created block
* Create a reference to the connection number range table
lr_field = wd_this->m_helper->create_range_table( `S_CONN_ID` ).
* Add the select-option to the group
wd_this->m_helper->add_selection_field(
i_id = `CONNID`
i_within_block = `BL01`
it_result = lr_field ).
FREE lr_field.
endmethod.
and in button i have done as
method ONACTIONON_EXECUTE .
TYPES:
lty_r_connid TYPE RANGE OF s_conn_id.
DATA
lr_sbook TYPE REF TO if_wd_context_node.
* Variables used to retrieve the values of select-options fields
DATA
lt_sel_item TYPE if_wd_select_options=>tt_selection_screen_item.
FIELD-SYMBOLS:
<fs_sel_item> LIKE LINE OF lt_sel_item,
<fs_carrid> TYPE s_carr_id,
<fs_connid> TYPE lty_r_connid.
* Get the selection-screen items
wd_this->m_helper->get_selection_screen_items(
IMPORTING et_selection_screen_items = lt_sel_item ).
* Retrieve the values from the select-options items
LOOP AT lt_sel_item ASSIGNING <fs_sel_item>.
CASE <fs_sel_item>-m_id.
WHEN `CARRID`.
ASSIGN <fs_sel_item>-m_value->* TO <fs_carrid>.
WHEN `CONNID`.
ASSIGN <fs_sel_item>-mt_range_table->* TO <fs_connid>.
ENDCASE.
ENDLOOP.
* Retrieve the data from the database, for simplicity, the
* SELECT statement has been implemented here.
SELECT * FROM sbook
INTO TABLE wd_this->t_sbook
WHERE carrid = <fs_carrid>
AND connid IN <fs_connid>.
* Bind the data to the context
lr_sbook = wd_context->get_child_node( name = `T_SBOOK`).
lr_sbook->bind_table( wd_this->t_sbook ).
endmethod.
now can you provide me the code for carrid and connid validation how has to be done.Please give me this solution
Similar Messages
-
Date validation using select-options
i have declared date1 as select-options which is in date format.
I need to validate min of SIX months duration from LOW value to HIGH value in select-options.How to validate for min SIX monthsHi,
u can go through the following code..
data:
w_date like sy-datum.
select-options:
s_date for w_date.
initialization.
s_date-high = sy-datum.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
DATE = s_date-high
DAYS = 0
MONTHS = 6
SIGNUM = '-'
YEARS = 0
IMPORTING
CALC_DATE = w_date .
s_date-low = w_date.
append s_date.
Reward if helpful.......... -
How to use select options whitout ranges ie like parameter
how to use select options whitout ranges ie like parameter and pls send me the code on that
thanks
raja.hi,
SELECT-OPTIONS : s_kunnr for kna1-kunnr <b>no intervels.</b>
eg: code
<b>SELECT-OPTIONS : s_kunnr for kna1-kunnr <b>no intervels.</b></b>
data: itab type table of kna1 with header line.
select * from kna1 into table itab where kunnr IN s_kunnr.
rgds
Anver -
How will use Select-Options in Read table Concept.
Hi All,
How will use Select-Options in Read table. For example,
Select-Options : test for bseg-prctr.
Select * from bseg into table ITAB.
Read table ITAB with key prctr in test.
Last line is showing error. If any way to read ITAB as conditions given per select options.
Thankx Advance,,,HI,
you cannot use " IN " with read statement , read statement is used as:
READ TABLE it_collect ASSIGNING <fs_collect>
WITH KEY rbpl = <fs_wkdet>-arbpl
ufnr = <fs_wkdet>-aufnr.
anyways you can use loop at statement before read to use " into " statement as:
LOOP AT it_master INTO l_master
WHERE werks = l_werks
hope it will help you
regards
rahul
Edited by: RAHUL SHARMA on Dec 30, 2008 9:14 AM -
How to use select-options in the function module of import parameter ?
Hi ...
I have created a BAPI and tested in SWO1 tcode , by giving the single value for an company code ( BUKRS ) , it executed properly .
Same thing is working after implementing in a program .
so now it is working for fetching a single company code details .
My requirement is : I want to use select-options in program as well as in function module IN IMPORT PARAMETER.
Program :
REPORT ZTEST.
TABLES : T001 , ZBAPI_STR .
TYPES : BEGIN OF TY_ITEM .
INCLUDE STRUCTURE ZBAPI_STR .
TYPES : END OF TY_ITEM .
DATA :WA_ITEM TYPE TY_ITEM ,
ITEM LIKE STANDARD TABLE OF WA_ITEM INITIAL SIZE 0 .
PARAMETER : BUKRS TYPE ZBAPI_STR-BUKRS.
call function 'ZBAPI_FMT001'
exporting
bukrs = BUKRS
IMPORTING
RETURN =
tables
itemtab = ITEM
IF ITEM IS NOT INITIAL .
LOOP AT ITEM INTO WA_ITEM .
WRITE : / WA_ITEM-BUKRS , WA_ITEM-BUTXT , WA_ITEM-ORT01 , WA_ITEM-LAND1 .
ENDLOOP.
ENDIF.
FUNCTION MODULE :
FUNCTION ZBAPI_FMT001.
""Local Interface:
*" IMPORTING
*" VALUE(BUKRS) TYPE EFG_TAB_RANGES
*" EXPORTING
*" VALUE(RETURN) TYPE BAPIRET2
*" TABLES
*" ITEMTAB STRUCTURE ZBAPI_STR
SELECT BUKRS BUTXT ORT01 LAND1 FROM T001 INTO TABLE ITEMTAB WHERE BUKRS = BUKRS .
ENDFUNCTION.
Regards
Deepa.I have given a similiar example which i did
Declare a
Table type:Z_TT_PONUM
Short text : Select options PO Number
in SE11 tcode with row type eg: Z_ST_PONUM
create a structure (this will be the row type)
Structure Z_ST_PONUM
Short text Select Options Field PO number
Compenent Compent type
SIGN BAPISIGN Inclusion/exclusion criterion SIGN for range tables
OPTION BAPIOPTION Selection operator OPTION for range tables
LOW EBELN Purchasing Document Number
HIGH EBELN Purchasing Document Number
In the function module import
give as
I_PO_NUM TYPE Z_TT_PONUM opt pass value Select options PO Number
Hope this is exactly what you want to know.
So you create a structure simliar to mine but the low an high whould be your component
then a table type and then include that in the BAPI.
Then pass your select-option value to this BAPI when you call this BAPI in the program -
Using select-option in webdynpro for ABAP where I have two separate pages
Hi Experts,
I have a requirement where I have two pages. The first page is a selection screen that contains 2 select-options to select carrid and connid. There is also a button 'Submit'. The second page contains a ALV grid output based on the selection screen criteria.
Second page is opened on the clicking the 'Submit' button in first page.
How to design a ABAP webdynpro component for this scenario?
How to pass select-option values to the next page?
What nodes/attributes should I have to create in component controller?
Please provide me the step by step info.
I have seen the weblog by Rich Heilman at /people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application
But it has only one page. So I am not able to recreate my scenario based on this.
Thanks
GopalHi Experts,
I have a requirement where I have two pages. The first page is a selection screen that contains 2 select-options to select carrid and connid. There is also a button 'Submit'. The second page contains a ALV grid output based on the selection screen criteria.
Second page is opened on the clicking the 'Submit' button in first page.
How to design a ABAP webdynpro component for this scenario?
How to pass select-option values to the next page?
What nodes/attributes should I have to create in component controller?
Please provide me the step by step info.
I have seen the weblog by Rich Heilman at /people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application
But it has only one page. So I am not able to recreate my scenario based on this.
Thanks
Gopal -
Problem with table-indexes when using select-options in select
Hello experts,
is it right that table-indexes will not be used if you take select-options to select data from the database?
in detail:
i have build up an table-index for one of our db-tables and test it via an test-programm. The first test with '=' comparisons worked fine. Every key of the index was used; checked via ST05!
e.g.: SELECT * FROM TABLEA INTO ITAB WHERE keya = '1' AND keyb = '2' AND keyc = '3'.
Now i startet the test with select-options
e.g.: SELECT * FROM TABLEA INTO ITAB WHERE keya IN seltabA AND keyb IN seltabB AND keyc IN seltabC.
First of all i just filled the seltabs with only 1 value: eg: seltabA= SIGN = 'I' OPTION = 'EQ' LOW = '1' etc.
Everything worked fine. Every key of the index was used.
But now, I putted more than one entries in the seltabs e.g.
seltabA: SIGN = 'I' OPTION = 'EQ' LOW = '1'
SIGN = 'I' OPTION = 'EQ' LOW = '2'
SIGN = 'I' OPTION = 'EQ' LOW = '3'
From now on, the indexed was not used completely (with all keys).
Isn't that strange? How can i use select-options or sel-ranges with using the complete table-indexes?
Thanks a lot,
MarcelHi Hermann,
i hope this helps:
this is the first one, which uses the complete index:
SELECT
"KOWID" , "LIFNR" , "KLPOS" , "ORGID" , "KOART" , "MATNR" , "GLTVON" ,
"GLTBIS" , "WERT" , "ABLIF" , "FAKIV" , "AENAM" , "AEDAT" , "AFORM" ,
"HERSTELLER" , "ARTGRP" , "OE_FREITXT" , "ARTFREITEXT" , "STATUS" ,
"TERDAT"
FROM
"/dbcon/01_con"
WHERE
"MANDT" = ? AND "LIFNR" = ? AND "ORGID" = ? AND "KOART_BASIS" = ? AND
"STATUS" = ? AND "GEWAEHR_KOWID" < ? AND ( "STATUS" = ? OR "STATUS" = ? OR
"STATUS" = ? ) WITH UR
RESULT: 5 IXSCAN /dbcon/01_con05 #key columns: 4
And the second one, which does not use the complete index! The 3 ranges are filled each with 2 values. Remember; when i fill them each with only one value, the result is the same as you can see above(/dbcon/01_con05 #key columns: 4):
SELECT
"KOWID" , "LIFNR" , "KLPOS" , "ORGID" , "KOART" , "MATNR" , "GLTVON" ,
"GLTBIS" , "WERT" , "ABLIF" , "FAKIV" , "AENAM" , "AEDAT" , "AFORM" ,
"HERSTELLER" , "ARTGRP" , "OE_FREITXT" , "ARTFREITEXT" , "STATUS" ,
"TERDAT"
FROM
"/dbcon/01_con"
WHERE
"MANDT" = ? AND "LIFNR" IN ( ? , ? ) AND "ORGID" IN ( ? , ? ) AND
"KOART_BASIS" IN ( ? , ? ) AND "GEWAEHR_KOWID" < ? AND ( "STATUS" = ? OR
"STATUS" = ? OR "STATUS" = ? ) WITH UR
and here the access-plan
0 SELECT STATEMENT ( Estimated Costs = 5,139E+01 [timerons] )
5 1 RETURN
5 2 NLJOIN
5 3 [O] TBSCAN
5 4 SORT
5 TBSCAN GENROW
5 6 <i> FETCH /dbcon/01_con
7 IXSCAN /dbcon/01_con05 #key columns: 2
As you can see, only 2 keys were taken for indexed selection!
Any idea?
Kind regards,
MArcel
Edited by: Marcel Ebert on Jul 28, 2009 5:25 PM -
Hi All,
Does any one how to handel select-options in web dynpro.
thanks,Check out this weblog.
/people/rich.heilman2/blog/2005/12/20/using-select-options-in-a-web-dynproabap-application
Regards,
Rich Heilman -
Using Select option in Native SQL
Hi,
Can any one tell me, how to use select option value in native SQL.
ie.,
I want to use select option in where condition. Need to select all the records from table(non-SAP) where date in given range.
Please suggest.
Thanks,
AmalHi
No!
U need to find a way to convert a range of select-option to a range for Native SQL, probably it should be better doesn't use a select-option for the date but two parameters: one for date from and one for date to.
Max -
Can we use select options in smartform
can we use select options in smartform if so can any one send me a sample code...
Thanks
bhaskharHi ,
Can u explain why u want to use select options in smartforms . U can try it in program lines .
Its better to use select options in the driver program and fetch data accordingly in the driver program or passing the selected values from select options to the smatfrom and fdetching the data there in smartform .
Regards -
Search help is not coming while using select-options?
Hi All,
I am using select options in my selection screen, i used wdr_select_options, also i coded some parameter values also
( non select-options ). For that field i am not getting search help. If i create as normal i am getting? Suggestions pelase?
Thanks,
Venkat.HI
what kind of search help is associated with the field.
ADD_SELECTION_FIELD method has some specific parametrs for value_help
give the input there and try again.
these parameters are
I_VALUE_HELP_TYPE
I_VALUE_HELP_ID
I_VALUE_HELP_MODE
I_VALUE_HELP_STRUCTURE
thanks
sarbjeet dingh -
Error while using selection option variable in the selection screen
Hi All,
I am facing an issue while using selection option variable in the selection screen for one of my reports.
Scenario: For the field "Region From" we need to have wild card logic () in tes selection screen, for example if we put "BE" in the selection screen for the field Region From then the query should be executed only for those "Region From" values which begin from "BE".
Approach: For the above requirement I have made a selection option variable for "Region From". This allows use wild card
But when the report is executed we get the following error:
"System error in program CL_RSR_REQUEST. Invalid filter on ETVRGNFR".
(ETVRGNFR is technical name of the info object Region From)
Though the report is executed it displays all the values for the field "Region From" irrespective of the selection given in the selection screen.
Please give suggestions / alternate solutions to crack this issue.
Thanks in advance
Regards
Priyanka.Hi,
Try to use a variable of type Customer Exit and do the validation inside the exit to display according to your request.
This is just my view, i am not sure if u are already using this or Char. Variable.
Cheers.
Ranga. -
Using select option and function module in single view
Hi All,
I Have a requirment ,using service call i get a function module and bind to specified UI elements with low and high attributes to input fileds which i designed in my view . And i have to keep range for input values using select options for those input values and clicking on submit i have to display data in VC but it's going to dump
the bug is
Adapter error in INPUT_FIELD "SALEDOC_TXT" of view "ZSD_ORDERSTATUS.MAIN": Context binding of property VALUE cannot be resolved: Node COMPONENTCONTROLLER.1.ZSD_ORDER_STATUS.1.CHANGING.1.S_VBELN does not contain any elements
can any one get me out of this.
Thank U,
MadhanHi,
Call FM using CALL FUNCTION, if you want to pass selectoptions type values to FM..
Try like this...
DATA : delivery TYPE TABLE OF RVBELN,
wa_delivery TYPE RVBELN,
wa_delivery-sign = 'E'.
wa_delivery-option = 'BT'.
wa_delivery-low = lv_FROM_DELIVERYNO.
wa_delivery-high = lv_TO_DELIVERYNO.
APPEND wa_delivery to delivery.
CLEAR wa_delivery.
Pass Delivery to FM.
Cheers,
Kris. -
ABAP WD application using Select Options & Adobe form :Don't see form data
Hi,
I am trying to get multiple PDF forms by passing multiple order numbers.I was able to get one PDF form successfully and now I am enhancing this application.
For doing this I have created nested WD Context .
1) Created a Node for Selections. ND_SELECT ,
Cardinality: 1..n ,
Selection: 1..n ,
Intialization lead Selection : Checked ,
Singleton : Checked
2) Created a Node for Output Structures ADOBE_DATA
Properties same as above
3) As we need Nesting Under ADOBE_DATA node I have created a subnode for Header: HEADER
Properties same as above
4) Under HEADER node I have created a items Node : ITEM
Properties same as above
As I have used Select-options and I am getting both header and Item data in to button search method .
DATA lo_nd_adobe_data TYPE REF TO if_wd_context_node.
DATA lo_nd_header TYPE REF TO if_wd_context_node.
DATA lo_el_header TYPE REF TO if_wd_context_element.
DATA ls_header TYPE wd_this->element_header.
* navigate from <CONTEXT> to <ADOBE_DATA> via lead selection
lo_nd_adobe_data = wd_context->get_child_node( name = wd_this->wdctx_adobe_data ).
* navigate from <ADOBE_DATA> to <HEADER> via lead selection
lo_nd_header = lo_nd_adobe_data->get_child_node( name = wd_this->wdctx_header ).
lo_nd_header->bind_table( new_items = it_header set_initial_elements = abap_true ).
DATA lo_nd_item TYPE REF TO if_wd_context_node.
DATA lo_el_item TYPE REF TO if_wd_context_element.
DATA ls_item TYPE wd_this->element_item.
* navigate from <CONTEXT> to <ADOBE_DATA> via lead selection
lo_nd_adobe_data = wd_context->get_child_node( name = wd_this->wdctx_adobe_data ).
* navigate from <ADOBE_DATA> to <HEADER> via lead selection
lo_nd_header = lo_nd_adobe_data->get_child_node( name = wd_this->wdctx_header ).
* navigate from <HEADER> to <ITEM> via lead selection
lo_nd_item = lo_nd_header->get_child_node( name = wd_this->wdctx_item ).
lo_nd_item->bind_table( new_items = it_item set_initial_elements = abap_true ).
Could you please tell me where I am doing wrong?
In adobe form
Created one MainForm and its properties are
Binding : $record.HEADER.DATA[*]
Repeat subform for each data item Checked , Min Count: 1
Subform Content : Flowed ,Western Text , Allow page breaks withing Content Checked
Accessibility /Subform Role: None
Inside this Mainform I have created a small table ITEMTABLE with 3 fields and mapped it item data.
Itemtable properties
Binding : ITEM
Uncheck Repeat table for Each Data item.
I have Itemtablerow inside Itemtable and its properties are:
Binding : DATA[*]
Repeat row for each data item Checked ,Min count: 1
Accesibility:/Subform Role: Body row
Row: body row, Check Allow page breaks within content
Still donu2019t see data on form.here is what i have in Hierarchy tab.
ADOBE_DATA (no Caption)
- (Master pages)(no caption)
Page1
Untitled Content Area(no caption)
- Mainform(no Caption)
PSPID {PSPID}
-ItemTable (No caption)
- ItemtableRow (no Caption)
PSPID(no Caption)
CJTDAT(no Caption)
CPERCO(no Caption)
What could be going wrong ?
Rgds
VaraHi John,
In the WD4A view, there is a button "Show/Hide Layout Preview".
Click on that button to be able to see the Layout.
Note that this button is next to the Pretty Print button.
regards,
Reema. -
Problem using select-options?
Hi all,
I am using select-options, in this 3 are selectoptions and 1 is normal.
i am getting select-option value using..
*cust code
rt_KUNNR = wd_this->m_sel_opt->get_range_table_of_sel_field(
i_id = 'KUNNR' ).
but which method i ahve to use to get normal which is not of select-options.
i am doing like this...
*cust code
rt_YEAR = wd_this->m_sel_opt->get_range_table_of_sel_field(
i_id = 'GJAHR'
). // I think this method is wrong place i used.
assign rt_YEAR->* to <fs_GJAHR>.
move <fs_GJAHR> to F_YEAR.
*cust code
rt_KUNNR = wd_this->m_sel_opt->get_range_table_of_sel_field(
i_id = 'KUNNR' ).
assign rt_KUNNR->* to <fs_kunnr>.
clear S_KUNNR.
loop at <fs_kunnr> into S_KUNNR.
wa_kunnr-sign = S_KUNNR-sign.
wa_kunnr-option = S_KUNNR-option.
wa_kunnr-low = S_KUNNR-low.
wa_kunnr-high = S_KUNNR-high.
append wa_kunnr to it_kunnr.
endloop.
But it is giving dump.. Field symbol has not yet been assigned. at kunnr. but kunnar is select-option.
Any helps...
Thanks
venkat.Hi Lekha
thanks for your reply,
i tried this...
data : rt_YEAR TYPE REF TO data,
<fs_gjahr> TYPE table,
fs_year TYPE TABLE OF FYAC. // Fiscal year only year(4).
call method wd_this->m_sel_opt->GET_SELECTION_FIELD(
EXPORTING
i_id = 'GJAHR'
IMPORTING
ET_RESULT = rt_YEAR ).
assign rt_YEAR->* to <fs_gjahr>.
move <fs_gjahr> to fs_year.
rt_year is still initial, and getting dum field symbol is not assigned. any helps???
Thanks,
Venkat.
Maybe you are looking for
-
I cant open itunes or quicktime... i need help
i just downloaded itunes and quicktime and whenever i want to use itunes or quicktime it wont open, what should i do hp Windows XP
-
WEB.SHOW_DOCUMENT parameters trouble
Hi everyone, I'm trying to run a report from a form by a submit button in the form. It does work, I mean, I can see the report after pressing the button, but it works as if there was no parameter, it ignores it completely. I don't really know how to
-
Can you send my dashboard or corpoarte dashboard to the bo inbox?
we a running bo 3.1 and have installed the performance management product. the users would like to send dashboards to other users. we never even tested that, so now when you click on a dashboard the send to button is not active. i have been checki
-
Best way to work on timerange from FCP X project in motion?
Suppose there is a region within my FCP X that I want to add some touches (that may rely on the footage and sound i.e. tracking etc) in Motion. As I cannot export a region from FCP X, just the whole time line, for long projects this seems quite ineff
-
My dvd only plays the left speaker of my song...
Hello everyone. I recently exported onto a dvd from adobe premiere 2.0 that included a song that i had recorded in mp3 format. In the song, some of the instruments come out of the left speaker, and some come out of the right. When i play this video o