Select options in Objects
Hi ,
I am trying to pass select-options values from my ABAP editor to Class metod.
its giving error like *The IN operator with "S_KUNNR" is followed neither by an internal table *.
I am not getting how to pass ranges values to method.
Get_data is my method. Importing s_kunnr type SELOPT.
SELECT kunnr
name1
ort01
adrnr FROM kna1
INTO TABLE it_kna1
WHERE kunnr in s_kunnr.
can you let me know how to pass range values .
Regards,
sarath.
HI ,
what ever u r importing that value we need to give.
ex.
methods:
getmara IMPORTING matgr TYPE C
EXPORTING l_tab TYPE ANY TABLE.
in
Method: getmara.
select matnr (some fileds ) from mara
where matkl = matgr.
endmethod.
Regards,
Bharani
Similar Messages
-
F4 help for select options based on parameter value
hi all,
I need a help to create an F4 help for select options for object id based on parameter value of object type, I mean once an object type is given the f4 help should contain object id's only of that type for each option.
Regard's,
Girija
Moderator Message : Duplicate post locked. Continue with [f4 help for select options based on parameter value |f4 help for select options based on parameter value;.
Edited by: Vinod Kumar on May 17, 2011 1:36 PMhi all,
I need a help to create an F4 help for select options for object id based on parameter value of object type, I mean once an object type is given the f4 help should contain object id's only of that type for each option.
Regard's,
Girija
Moderator Message : Duplicate post locked. Continue with [f4 help for select options based on parameter value |f4 help for select options based on parameter value;.
Edited by: Vinod Kumar on May 17, 2011 1:36 PM -
Hi!
How can I put a select-option like "object" into a dynpro which is not a selection screen.
Is there any possibility to do this?
THX:
PeterHi,
select options in screen check this code..
REPORT ZTEST_SCREEN .
DATA : BEGIN OF IT_DYNPFIELDS OCCURS 3.
INCLUDE STRUCTURE DYNPREAD.
DATA : END OF IT_DYNPFIELDS.
DATA: TEST(10) TYPE C.
RANGES: R_UNAME FOR SY-UNAME.
DATA: V_USERNAME LIKE SY-UNAME.
DATA : V_PROG LIKE D020S-PROG VALUE 'ZTEST_SCREEN',
V_DNUM LIKE D020S-DNUM VALUE '0100'.
CALL SCREEN 100.
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'TEST'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Module GET_CURSOR_USERNAME INPUT
* text
MODULE GET_CURSOR_USERNAME INPUT.
REFRESH IT_DYNPFIELDS.
CLEAR IT_DYNPFIELDS.
MOVE 'V_USERNAME' TO IT_DYNPFIELDS-FIELDNAME.
APPEND IT_DYNPFIELDS.
CLEAR IT_DYNPFIELDS.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
DYNAME = V_PROG
DYNUMB = V_DNUM
TRANSLATE_TO_UPPER = 'X'
TABLES
DYNPFIELDS = IT_DYNPFIELDS
EXCEPTIONS
INVALID_ABAPWORKAREA = 1
INVALID_DYNPROFIELD = 2
INVALID_DYNPRONAME = 3
INVALID_DYNPRONUMMER = 4
INVALID_REQUEST = 5
NO_FIELDDESCRIPTION = 6
INVALID_PARAMETER = 7
UNDEFIND_ERROR = 8
DOUBLE_CONVERSION = 9
STEPL_NOT_FOUND = 10
OTHERS = 11.
IF SY-SUBRC = 0.
READ TABLE IT_DYNPFIELDS WITH KEY FIELDNAME = 'V_USERNAME'.
IF SY-SUBRC = 0.
V_USERNAME = IT_DYNPFIELDS-FIELDVALUE.
ENDIF.
ENDIF.
PERFORM GET_MULTIPLE.
ENDMODULE. " GET_CURSOR_USERNAME INPUT
*& Form GET_MULTIPLE
* text
* --> p1 text
* <-- p2 text
FORM GET_MULTIPLE .
* Dynamically holding Field name
FIELD-SYMBOLS: <FST> TYPE STANDARD TABLE.
IF R_UNAME[] IS INITIAL.
IF NOT V_USERNAME IS INITIAL.
R_UNAME-SIGN = 'I'.
R_UNAME-OPTION = 'EQ'.
R_UNAME-LOW = V_USERNAME.
APPEND R_UNAME.
CLEAR R_UNAME.
ENDIF.
ENDIF.
ASSIGN R_UNAME[] TO <FST>.
CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
EXPORTING
TITLE = 'Select Multiple Value'(059)
TEXT = 'Finish Group'(058)
SIGNED = 'X'
LOWER_CASE = ' '
NO_INTERVAL_CHECK = 'X'
JUST_DISPLAY = ' '
JUST_INCL = 'X'
TABLES
RANGE = <FST>
EXCEPTIONS
NO_RANGE_TAB = 1
CANCELLED = 2
INTERNAL_ERROR = 3
OTHERS = 4.
IF SY-SUBRC = 0.
READ TABLE R_UNAME INDEX 1.
IF SY-SUBRC = 0.
V_USERNAME = R_UNAME-LOW.
ENDIF.
ENDIF.
ENDFORM. " GET_MULTIPLE
Check this thread...
Select option in Dialog program screen
Regards
Vijay -
Re : select-options in abap-objects program
Dear friends,
I want to give select-options in abap-objects program. How to give that.
Thanking You
with regards,
ManiIn the transaction SE24, enter your class name, click modify.
in the tab named "Types" you have to declare two types. By example, if you want to receive one select-options that in your program that uses this class is declared like:
" P_SAKNR FOR SKAT-SAKNR".
you've got to declare two types in the class:
a- TYPES: begin of E_S_SAKNR,
sign(1),
option(2),
low(10),
high(10),
end of E_S_SAKNR.
b - TYPES E_T_SAKNR type standard table of E_S_SAKNR.
so, in the class method that you want to receive P_SAKNR as importing parameter. You got to do this:
method TEST importing ET_SAKNR type E_T_SAKNR.
now, in the implementation of this method you should be able to use ET_SAKNR as the same way as you usually use a parameter or a select-option. You could use it in a select with the operator IN by example.. -
Re : select-options in abap objects
Dear friends,
I want to give select-options in abap-objects program. How to give that.
Thanking You
with regards,
ManiHI Mani,
It's common mix ABAP Procedural with ABAP Objects in the same program.
You should use the same way used in ABAP procedural program as Marco Cerdelli sad.
But inside ABAP OBJECTS classes you can't use is these statement type.
Don't forget to close this thread and all yours previous when your question be answered ! In case of doubt read the [rules of engagement|https://forums.sdn.sap.com/].
Best Regards.
Marcelo Ramos -
Hi Guys,
I need a small help from you. I want to know how to populate the value from select-option to abap object. Please help me, it is very importantcheck this code
REPORT ZSELOPT_TO_CLASS .
TABLES: VBRK.
SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN.
DATA: IT_VBELN TYPE RSELOPTION.
DATA: X_VBELN TYPE RSDSSELOPT.
CLASS C1 DEFINITION.
PUBLIC SECTION.
DATA: IT_VBRP TYPE VBRP_TAB,
X_VBRP LIKE LINE OF IT_VBRP.
METHODS: GET_DATA IMPORTING S_VBELN TYPE RSELOPTION.
METHODS: DISP_DATA.
ENDCLASS.
CLASS C1 IMPLEMENTATION.
METHOD GET_DATA.
*SELECT * FROM VBRP*
INTO TABLE IT_VBRP
WHERE VBELN IN S_VBELN.
ENDMETHOD.
METHOD DISP_DATA.
LOOP AT IT_VBRP INTO X_VBRP.
WRITE:/ X_VBRP-VBELN,
X_VBRP-POSNR.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
DATA OBJ TYPE REF TO ZCL_SELOPT.
CREATE OBJECT OBJ.
LOOP AT S_VBELN.
MOVE S_VBELN-LOW TO X_VBELN-LOW.
MOVE S_VBELN-HIGH TO X_VBELN-HIGH.
MOVE S_VBELN-SIGN TO X_VBELN-SIGN.
MOVE S_VBELN-OPTION TO X_VBELN-OPTION.
APPEND X_VBELN TO IT_VBELN.
ENDLOOP.
CALL METHOD OBJ->GET_DATA
EXPORTING
S_VBELN = IT_VBELN.
CALL METHOD OBJ->DISP_DATA.
Edited by: moazam hai on May 17, 2008 6:17 AM
Edited by: moazam hai on May 17, 2008 6:19 AM -
How to set BDCDATA table for a SELECT-OPTIONS object?
Dear experts,
I have a transaction with PARAMETERS and SELECT-OPTIONS objects. This transaction will be called by another program by using CALL TRANSACTION 'mytransaction' USING mybdcdata statement. Below is some of the called transaction's source code:
DATA:
date TYPE sflight-fldate.
PARAMETERS:
p_carid TYPE sflight-carrid,
p_conid TYPE sflight-connid.
SELECT-OPTIONS:
so_date FOR date.
This is what I wrote in the calling program to define the values of the called transaction PARAMETERS fields:
DATA:
wa_bdcdata TYPE bdcdata,
it_bdcdata TYPE TABLE OF bdcdata.
wa_bdcdata-program = 'MYPROGRAM'.
wa_bdcdata-dynpro = '1000'.
wa_bdcdata-dynbegin = 'X'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'P_CARID'.
wa_bdcdata-fval = 'AA'.
APPEND wa_bdcdata TO it_bdcdata.
CLEAR wa_bdcdata.
wa_bdcdata-fnam = 'P_CONID'.
wa_bdcdata-fval = '017'.
APPEND wa_bdcdata TO it_bdcdata.
CALL TRANSACTION 'MYTRANSACTION' USING it_bdcdata.
Unfortunately, I don't know how to set the values for the SELECT-OPTIONS screen fields. How to do this?
I've Googled this and tried several guesses but none was found or successful. Thanks in advance.
Regards,
HarisHi ,
Better go for SUBMIT report instead of CALL transaction ...
find the name of report being called on that transaction which you will be calling . Use that report name in SUBMIT
Just take help from below code .
Before using do please read by pressing f1 on SUBMIT syntax .
data:seltab type table of rsparams,
seltab_wa like line of seltab.
move: 'LANGU' to seltab_wa-selname,
'S' to seltab_wa-kind,
'I' to seltab_wa-sign,
'BT' to seltab_wa-option,
'D' to seltab_wa-low,
'I' to seltab_wa-high.
append seltab_wa to seltab.
clear seltab_wa.
move: 'E' to seltab_wa-sign,
'EQ' to seltab_wa-option,
'F' to seltab_wa-low,
space to seltab_wa-high.
append seltab_wa to seltab.
clear seltab_wa.
move: 'AUFNR' to seltab_wa-selname,
p_aufnr to seltab_wa-low.
append seltab_wa to seltab.
clear seltab_wa.
submit rkaep000 using selection-set 'VARIANT1'
with aufnr = p_aufnr
with selection-table seltab
exporting list to memory
and return .
regards
Deepak. -
Two selection option-variables for the same object
Hi,
I'm using two selection-option variables for the same characteristic in my query:
One is authorization variable and the other is used for restrictions (filter) in a selection screen.
I get an error: SELOPT/Query variable .... does not allow any further selections.
If a selection option-variable is used, no additional selections can be specified for this characteristic in this element.
Is there a way to overcome this problem?
Thanks,
HagitHi,
I have solved the problem by changing the authorization object (in RSECADMIN) from range to single value and also the variable in BEx from selection single value.
To be more clear:
object in RSECADMIN was: infoobject BT var1 - var5
I have changed it to:
infoobject EQ var1
infoobject EQ var2
infoobject EQ var3
infoobject EQ var4
infoobject EQ var5
Hope this helps.
Hagit -
List Box - Object How do you get "allow multiple item selection" option to work?
developing a fillable PDF form using livecycle. I have several list boxes that contain multiple text items. I have entered all items directly into the item list and I have selected "allow multiple selection". The object is committed on exit, All the binding options have been left on default settings. BUT when the form is tested it will not allow multiple selections. I cannot find anything in help to resolve this. CAN Someone help me. This is urgent!!!!!
Dear Deb
Thank you for your suggestion, but it does not appear to work. I used the alt key then my mouse to select, but it still only allows for 1 selection. I do not see the sample you said you included, so I cannot check to see if I have a setting incorrect. If you have any other suggestions I would really appreciate it or if there is a way for you to look at the form, at this point I am open to any suggestions. -
Hi,
I have a requirement where i have to use to separate select options but the value of the 2nd Select option is dependant of the value chosen in the first select option.
For eg:First Select option is for SWCV and 2nd option is for Data Object.
If you choose S1 as SWCV in first select option then the values in select options for Data object should be populated for Data objects belonging to SWCV "S1" only an not for any other SWCV.
PS:Points will be awardedHi Sacha,
Is there any other way in abap web dynpro where i can achieve the above mentioned requirement.The catch here is that the user can enter multiple values.
Earlier user was allowed to have only one entry in inputfield so OVS used to solve my problem.But with multiple entries i can't do the same thing. -
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 -
How to restrict more than one 1 range in select option on selection screen.
Hi all,
I have a requirement where I need to restrict user from giving more than 1 range for a date selct option ..other all features of multiple selection will be as usual...
for eg we can do this if we disable / hide other cells if the user clicks on multiple ranges tab.. If only 1 cell is available to give the range user will not be able to give more than 1 range....
I was thinking if I could use select_options_restrict but how do i fill its parameters...
Can anyone send me the sample code or the same to achieve this functionality...I have used select_options_restrict to hide multiple ranges itself ... But here user will be able to give range but only 1....
Thanks and Regards
SwetaHI,
Please try the below logic.
SELECT-OPTIONS: so_addr FOR ADR6-SMTP_ADDR NO INTERVALS.
***********remove_range_for_select_option******************* .
DATA: ls_restrict TYPE SSCR_RESTRICT, "The type for SELECT_OPTIONS_RESTRICT
ls_opt_list TYPE SSCR_OPT_LIST, "One list of options
ls_asn TYPE SSCR_***. "One line of table associating selection screen
"object with opt. list
CLEAR: ls_restrict,
ls_opt_list,
ls_asn.
*Only EQ valid, discrete values, Include & Exclude
ls_opt_list-name = 'EQ'.
ls_opt_list-options-eq = 'X'.
APPEND ls_opt_list TO ls_RESTRICT-OPT_LIST_TAB.
LS_ASN-KIND = 'S'.
LS_ASN-NAME = 'SO_ADDR'. "Select Option
LS_ASN-SG_MAIN = 'I'.
LS_ASN-SG_ADDY = '*'.
LS_ASN-OP_MAIN = 'EQ'.
LS_ASN-OP_ADDY = ' '.
APPEND LS_ASN TO LS_RESTRICT-***_TAB.
*Make use of SELECT-OPTIONS easier on the selection screen
CALL FUNCTION 'SELECT_OPTIONS_RESTRICT'
EXPORTING
RESTRICTION = LS_RESTRICT
EXCEPTIONS
TOO_LATE = 1
REPEATED = 2
SELOPT_WITHOUT_OPTIONS = 3
SELOPT_WITHOUT_SIGNS = 4
INVALID_SIGN = 5
EMPTY_OPTION_LIST = 6
INVALID_KIND = 7
REPEATED_KIND_A = 8
OTHERS = 9.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Edited by: Rajasekhar Reddy P on Mar 16, 2009 2:03 PM -
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. -
Select option greyed out for fields of custom DataSource (rso2, rsa6)
Hi
Why are several fields, in my custom DataSource (created in rso2) not available for select?
I do not think this is a permission issue, since several fields are selectable, but not all fields.
It is not the data type, since I see other custom DataSources that have the same data type, and it is selectable as a select option.
This is not a DataSource that was provided by SAP, it is completely custom, and uses a custom data definition (defined as a structure via se11), and a custom function.
I have read the responses to similar questions, but have not found an answer that explains how to make the field selectable for select.
What determines which fields can be selected for selection, and which fields have this option greyed out (not selectable)?
I have come across multiple answers, for similar questions, that suggest an abap program to directly update table roosfield.
Is this safe?
IF I choose this route will I need to run the update program on production, or will the change it makes to my dataSource transport with my transport?
(I can test this).
What I most need to know is If this suggestion is safe, or if it has side effects?
Thank youHi Eileen,
In Least case to enable the selection for the fields with the below program:
Below code is for your reference which will use to unhide objects in RSO2 or RSA6 for Data source( in code for BELNR, KUNNR, VBELN, BUDAT fields are unhiding for 0fi_ar_4 data source selection option) . Still need any clarifications let me know.
SE38: Create a program for ref below code.
REPORT ZNP_SELE_DS.
tables: ROOSFIELD.
UPDATE ROOSFIELD SET SELECTION = 'P'
WHERE OLTPSOURCE = '0FI_AR_4' AND OBJVERS = 'A' AND FIELD = 'BELNR'.
UPDATE ROOSFIELD SET SELECTION = 'P'
WHERE OLTPSOURCE = '0FI_AR_4' AND OBJVERS = 'A' AND FIELD = 'KUNNR'.
UPDATE ROOSFIELD SET SELECTION = 'P'
WHERE OLTPSOURCE = '0FI_AR_4' AND OBJVERS = 'A' AND FIELD = 'VBELN'.
UPDATE ROOSFIELD SET SELECTION = 'P'
WHERE OLTPSOURCE = '0FI_AR_4' AND OBJVERS = 'A' AND FIELD = 'BUDAT'.
Thanks & Regards,
Srinu.Rapolu -
Result of the query is not filtered as value given in Select Option variabl
Hello ,
A Select option Variable is created on Navigational Attribute( ZINV_PROG) of 0WBS_ELEMT.
The Compound Key for object ZINV_PROG(Investment program) is APPR_YEAR( Approval Year)
This ZINV_PROG object does not bear Master data.
The values in the field get populated as you load Master data of 0WBS_ELEMT.
The values for this objects is as shown below:
APPR_YEAR ZINVPROG
2005 ESCCCAPS
2007 ESCCCAPS
2008 FIRE
2006 CAPITAL
A select option variable is craeted on this Navigational attribute.
When you execute the query , On the selection screen of the query..
If you provide i/p for Investment programm field as 2007 ESCCCAPS, the data should ideally be filtered for this values only.
But the result of the query shows data for both values 2005 ESCCCAPS and as well as for 2007ESCCCAPS.
Let me know how to sort this issue.
Points will be assigned for the correct and helpfull answere.
Thanks,Thanks Srini for your prompt explanation.
My Question is if Approval year is a compounded key of ZINV_PROG object why data would not get filter out directly.
I mean on the screen for this particualr variable i take help - F4 to see values there you are able to see all the values of Investment programm along with the apprroval year.
If i select value as 2005 ESCCCAPS from the help F4 screen then ideally data should be fileterd out for this particular value. But it is not happening so.
Is that so in Query desgining that if you creating a variable on Nav Attribute, and that particular Nav attribute has a compound key then if you want to filter out the data for this Nav attribute correctly you would also require to create a variable for Compound key also.
Please let me know
Thanks
Maybe you are looking for
-
I have an ipod classic 120gb. The other day it just quit working after I downloaded an ebook to it. I have tried 3 different computers with 3 different operating systems (Windows 7, Vista and XP) and I have received the same response from all
-
Please help with reading fixed-length file
I am reading a fixed-length file from a batch program and I need to read through each line, parsing out records in each, and replacing the first character in each line after I finish processing. I am using a RandomAccessFile, but I am not sure if thi
-
Wrong Name Attached to Correct Email Address in Mail
I use Apple's Mail program to receive email from a couple of gmail accounts. I also use iCal to coordinate those same gmail accounts, plus a few work calendars. One of the work calendars is one called "Holidays in Canada," (just a calendar showing fe
-
Thumbnails appear in iPhoto, but photos cannot be opened on its own
Hello- I had an older camera that I have since replaced. When I uploaded the photos to iPhoto initially, they were uploaded fine. However, now when I go to open them in iPhoto, I can see them only as a small thumbnail. When I double click on the imag
-
Approved requisition still in IN PROCESS status.
HI, I have a requisition which is approved by last approver but still its in IN Process status and I am not able to get PO for that.I tried with Auto Create option but its giving requisition not yet approved. Please suggest if any work around is ther