Select query for fields in selection screen
SELECT * FROM hrus_d2
INTO TABLE ta_list
WHERE us_name IN subs_obj
and begdat in date_ran.
and enddat in date_ran
How can I rewrite the above query for high and low ranges of date_ran field in condition? It doesn't allow in operator with date_ran-low.Can u please help me out
Hi
rahul
SELECT *
FROM hrus_d2
INTO TABLE ta_list
WHERE us_name IN subs_obj
and begdat = date_ran-low
and enddat = date_ran -high.
u can write like this or i amnot getting why u r expliciting this date u can give directly as
SELECT *
FROM hrus_d2
INTO TABLE ta_list
WHERE us_name IN subs_obj
date in date_ran.
plzz reward if i am usefull to u in any way.. plzz dont forget to reward
Similar Messages
-
Select Query for smart form-invoice
Hi Folks,
I have to fetch the following fields as per the requirement for desiging a invoice smartform.I had copied lb_bill_invoice smartform into z format.
Can anyone here please give me the select query for the same.
fields to fetched are as follows:-
1.vbrp-arktx,
2.vbrp-fkimg,
3.konv-kbetr with respect to vbrk-knumv
4.konv-kwert.
And also what all I have to give in format interface and global definitions of the smartform.
please help me in this regard.
Points will be given.
K.Kiran.Hi,
declare the variables V_arktx(40) and v_Qty like vbrp-fkimp and other varaibles for Kbetr, kwert, knumv on the global definitions.
select single arktx fkimg into (v_arktx, v_qty) from vbrp
where vbeln = LBBIL_IT_REFPURORD-BIL_NUMBER.
select single knumv into v_knumv from vbrk where where vbeln = LBBIL_IT_REFPURORD-BIL_NUMBER.
this select has to fire in the item level and in the loop.
so have to write in the correct place.
select kbetr kwert into (v_kbetr, v_kwert) from konv
where where knumv = v_knumv and kposn = LBBIL_IT_REFPURORD-ITM_NUMBER.
regards,
anji -
Can any one send select query for this?
Hi,
can any one plese send select query for the following query.please send as early as possible.
Loop through the I_BSID internal table to fill records in I_OUTPUT.Combine data from I_BSID, I_KNKK, I_KNKK_KNKLI, I_KNA1 and I_KNVV into I_OUTPUT based on the linking conditions .Field Description Source are
I_OUTPUT-BUKRS Company code I_BSID-BUKRS
I_OUTPUT-KUNNR Customer number I_BSID-KUNNR
I_OUTPUT-NAME1 Customer Name I_KNA1-NAME1
I_OUTPUT-KNKLI Credit account I_KNKK-KNKLI
I_OUTPUT-KDGRP Customer Group I_KNKK-KDGRP
I_OUTPUT-KLIMK Credit Limit I_KNKK_KNKLI-KLIMK
I_OUTPUT-KVGR1 Business Unit I_KNVV-KVGR1
I_OUTPUT-REBZG Invoice Number I_BSID-REBZG
I_OUTPUT-BLDAT Invoice Date I_BSID-BLDAT
I_OUTPUT-WAERS Document Currency I_BSID-WAERS
I_OUTPUT-DUE_DATE Due Date Based on below
Calculation
Get the Payment terms days combining I_BSID and I_T052 based on the linking conditions mentioned above. Note : a) Baseline Date : If baseline date I_BSID-ZFBDT is blank , use the Document Date.b) Payment Term Days :If I_BSID-ZBD3T is not blank, take this as Payment Term Days for Due date calculation.
If I_BSID-ZBD3T is Blank, then get payment term days from I_T052 based on I_BSID-ZTERM. If there are more than one record in I_T052 for the given Payment term, get the day part from baseline date and select the first record where the day limit I_T052-ZTAGG is greater than the day part.If I_BSID-ZBD3T is blank and I_BSID-ZTERM is also blank, then take Y000 (Due Immediately) as Payment term and proceed with the above logic. Set the payment term field blank while printing.
Calculate Due date : For Debits, Determine Due Date = Baseline Date + Payment term Days(not discount days) For Credits Due date = Baseline date.Then, move the amount I_BSID-DMBTR to respective buckets (Not yet Due, Current Due, Past due 1-30, Past Due 31-60 etc.) Based on the due date.
Thanks&Regards,
praveen kumar.AHI,
To get Open Items you can use Function module:
data:i_items TYPE STANDARD TABLE OF rfpos.
CALL FUNCTION 'CUSTOMER_OPEN_ITEMS'
EXPORTING
bukrs = p_bukrs
kunnr = wa_customer-kunnr
TABLES
t_postab = i_items
EXCEPTIONS
no_open_items = 1
OTHERS = 2.
Table I_items will have all the open items for that Customer in the given company code.
Well for Clear Items: Try
GET_CLEARED_ITEMS or FMITPOFM_CLEARED_ITEMS_GET.
Hope it helps.
Manish -
Select query for fetching from 3 tables.
Can we have a single Select query for fetching same fields (kappl,kschl,vkorg,vtweg,spart,kunwe,datbi,knuma,datab,knumh)
from 3 tables >> KOTE707,KOTE708 and KOTE709 into an internal table for a particular KUNNR?
Regards,
Shashank.Hi,
If you have kunnr field in all the 3 tables then it is possible. use inner join as below
PARAMETERS: p_cityfr TYPE spfli-cityfrom,
p_cityto TYPE spfli-cityto.
DATA: BEGIN OF wa,
fldate TYPE sflight-fldate,
carrname TYPE scarr-carrname,
connid TYPE spfli-connid,
END OF wa.
DATA itab LIKE SORTED TABLE OF wa
WITH UNIQUE KEY fldate carrname connid.
SELECT c~carrname p~connid f~fldate
INTO CORRESPONDING FIELDS OF TABLE itab
FROM ( ( scarr AS c
INNER JOIN spfli AS p ON p~carrid = c~carrid
AND p~cityfrom = p_cityfr
AND p~cityto = p_cityto )
INNER JOIN sflight AS f ON f~carrid = p~carrid
AND f~connid = p~connid ).
LOOP AT itab INTO wa.
WRITE: / wa-fldate, wa-carrname, wa-connid.
ENDLOOP.
<b>Reward Points if this helps,</b>
Satish -
Multiple selections in a field in module screen
Hi all
Can any body tell me how to get the multiple values selection in a field in Dialog screen .
regards
dreeniEasiest way is to create a subscreen and embed this in your dynpro.
report zrich_0006 .
tables: mara.
Custom Selection Screen 1010
selection-screen begin of screen 1010 as subscreen.
selection-screen begin of block b1 with frame title text-001.
parameters: p_rad1 radiobutton group grp1 default 'X',
p_rad2 radiobutton group grp1,
p_rad3 radiobutton group grp1.
select-options: s_matnr for mara-matnr,
s_matkl for mara-matkl,
s_mtart for mara-mtart.
selection-screen end of block b1.
selection-screen end of screen 1010.
start-of-selection.
call screen 100.
*& Module STATUS_0100 OUTPUT
module status_0100 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
endmodule.
*& Module USER_COMMAND_0100 INPUT
module user_command_0100 input.
endmodule.
Screen screen 100 with a subscreen area called "subscreen_1010"
Screen Flow Logic follows
*process before output.
module status_0100.
call subscreen subscreen_1010 including sy-repid '1010'.
*process after input.
call subscreen subscreen_1010 .
module user_command_0100.
Reward if it helps..
regards,
Omkar. -
How to write selection Query for the following requirment.
Hi All,
I am new to ABAP, I need a help ,
I need to select all plants(WERKS) from MARC at Plant/Material level,
then I need to take all sales organozation(VKORG) from T001w,
then I need the company code(BUKRS) from TVKO based on VKORG,
then I need the currency key(WAERS) from T001 based on BUKRS,
Can any one help me in writing selection Query for the same?
Thanks All,
Debrup.Hi,
Its easy for you if you learn SELECT with JOIN to complete your task. So SEARCH the forum with SELECT statement and you will get a lot of examples using which you can write your own.
If you struck up anywhere revert back.
Regards
Karthik D -
ABAP Query : Obligatory fields on selection screen!
Hi Experts,
I would like to know the differrent ways through which we can define mandatory fields on selection screen.Options availabel in Infosets (SQ02) as well as Query(SQ01).
Selection Screen:
Document Date in Document: (Mandatory Select-Option)
Plant : (Mandatory Select-Option)
Thanks,
YogeshHi, Everyone .
We can do that .
At selection-screen output (code section 13), set "1" to the field REQUIED by using MODIFY SCREEN code .
(You can get Dynpro number by F1 key or T-cd SE51 )
Masao .
Edited by: MASAO NONAKA on Oct 20, 2008 9:11 AM -
F4 for field at selection screen
Hi all.
I have a field at selection screen without any standard F4 on it.
SELECT-OPTIONS: S_EXCMSG FOR T458A-AUSKT. "Exception message
How can I implement F4 for this field?
Thanks,
RebekaHi,
Try using the FM " F4IF_INT_TABLE_VALUE_REQUEST "
A Sample Examle:
REPORT Z_TEST_F4_HELP.
TABLES: ZEMPLOYEE,MARA.
DATA: BEGIN OF ITAB OCCURS 0,
ENO LIKE ZEMPLOYEE-ENO,
ENAME LIKE ZEMPLOYEE-ENAME,
EAGE LIKE ZEMPLOYEE-EAGE,
SALARY LIKE ZEMPLOYEE-SALARY,
END OF ITAB.
PARAMETERS: P_ENO LIKE ZEMPLOYEE-ENO,
P_MATNR LIKE MARA-MATNR.
TYPES: BEGIN OF ts_mara,
matnr TYPE matnr,
ersda TYPE ersda,
ernam TYPE ernam,
END OF ts_mara.
DATA : lt_mara TYPE TABLE OF ts_mara.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MATNR.
SELECT MATNR ERSDA ERNAM FROM MARA INTO TABLE LT_MARA UP TO 10 ROWS.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
RETFIELD = 'MATNR'
PVALKEY = ' '
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_MATNR '
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
VALUE_ORG = 'S'
MULTIPLE_CHOICE = ' '
DISPLAY = ' '
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
VALUE_TAB = LT_MARA
FIELD_TAB =
RETURN_TAB =
DYNPFLD_MAPPING =
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards,
Ruthra -
Selection options for field display text instead of key
Hi All,
In the selection screen in my reports, when the user clicks on the selection options for one the fields to display the possible values they can use. Instead of the key the pop up box only displays the text for that field. This is an issue because one of the fields is equipment number and the user needs to be able to see the key not the descriptions. This is occurring in multiple reports and for multiple fields. I haven't been able to find anything in the infoobject properties or the query properties to change this.
Please help!
Edited by: Anthony Loh on Sep 29, 2010 10:57 PMHi Anthony,
Cud u pls check in backend how it is created ...
RSA1>Mdeling>IO Properties>Second tab BEx properties>Display-->it shud be Key and not text...
Check this and come back ..
Rgds
SVU123 -
Performance optimization on select query for all entries
Hi All,
I want to optimize the select query in my Program.
The select query is taking lot of time to search the records for the given condition in the where clause
and more interestingly there are no records fetched from the database as the where condition does not matches.
It is taking more than 30 min to search the record and the result is no record found.
Below is my select query. I have also created the secondary Index for the same.
In My opinion FOR ALL ENTRIES is taking lot of time. Because there are more than 1200 records in internal table t_ajot
select banfn bnfpo bsart txz01 matnr Werks lgort matkl reswk menge meins flief ekorg
INTO CORRESPONDING FIELDS OF TABLE t_req
FROM eban
FOR ALL ENTRIES IN t_ajot
WHERE matkl >= t_ajot-matkl_low
AND matkl <= t_ajot-matkl_high
AND werks = t_ajot-werks
AND loekz = ' '
AND badat IN s_badat
AND bsart = 'NB'.
Please suggest.Hi,
that,
FOR ALL ENTRIES IN t_ajot
WHERE matkl >= t_ajot-matkl_low
AND matkl <= t_ajot-matkl_high
AND werks = t_ajot-werks
AND loekz = ' '
AND badat IN s_badat
AND bsart = 'NB'.
looks strange.
However:
How does your index look like?
What executoin plan do you get?
How do the statistics look like?
Whats the content of the variables t_ajot-... and s_badata?
Kind regards,
Hermann -
Issue with select query for secondary index
Hi all,
I have created a secondary index A on mara table with fields Mandt and Packaging Material Type VHART.
Now i am trying to write a report
Tables : mara.
data : begin of itab occurs 0.
include structure mara.
data : end of itab.
*select * from mara into table itab*
CLIENT SPECIFIED where
MANDT = SY-MANDT and
VHART = 'WER'.
I'm getting an error
Unable to interpret "CLIENT". Possible causes of error: Incorrect spelling or comma error.
if i change to my select query to
*select * from mara into table itab*
where
MANDT = SY-MANDT and
VHART = 'WER'.
I'm getting an error
Without the addition "CLIENT SPECIFIED", you cannot specify the client field "MANDT" in the WHERE condition.
Let me know if iam wrong and we are at 4.6c
ThanksLike I already said, even if you have added the mandt field in the secondary index, there is no need the use it in the select statement.
Let me elaborate on my reply before. If you have created a UNIQUE index, which I don't think you have, then you should include CLIENT in the index. A unique index for a client-dependent table must contain the client field.
Additional info:
The accessing speed does not depend on whether or not an index is defined as a unique index. A unique index is simply a means of defining that certain field combinations of data records in a table are unique.
Even if you have defined a secondary index, this does not automatically mean, that this index is used. This also depends on the database optimizer. The optimizer will determine which index is best and use it. So before transporting this index, you should make sure that the index is used. How to check this, have a look at the link:
[check if index is used|http://help.sap.com/saphelp_nw70/helpdata/EN/cf/21eb3a446011d189700000e8322d00/content.htm]
Edited by: Micky Oestreich on May 13, 2008 10:09 PM -
Select query for 6 different tables with vbeln as same selction criteria
Hi,
I have a query..
I am using 6 differnet tables with vbeln being the same primary key on the basis of which i have to match the data.
I have assign vbeln with different name but in the select query it gives me the error that vbeln2 is not the correct field.
Can anyone please suggest how can i use the different field name and read the data from the table.hi,
Use alias name for fields / tables in select query, problem will solve
Regards,
Praveen Savanth.N -
Select query 'for all entries'
Hello Friends,
SELECT emp_id emp_name
INTO corresponding fields of table itab_emp
FROM employee
for all entries in itab_dept
WHERE emp_id = itab_dept_emp_id.
In the above select query we are using 'for all entries' for the internal table itab_dept.What will happen if the join fails?Will we get any data in the output table?
What is the prerequisites for using 'for all entries'.
Please advice me on this.
Regards
Ashish.Hi
In this case all the records available in employee table are extracted into internal table itab_emp.
It is safe to check whether itab_dept is initial or not.
If it is initial then stop the select query.
Check the following program u will get an idea.
Also try this program by removing comment to 'REFRESH IT_LFA1'.
REPORT ZBM_PG .
TABLES: LFA1, EKKO.
DATA:
IT_LFA1 TYPE TABLE OF LFA1 WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 10,
IT_LFA1 TYPE TABLE OF LFA1 WITH HEADER LINE,
IT_EKKO TYPE TABLE OF EKKO WITH HEADER LINE.
SELECT * FROM LFA1 INTO TABLE IT_LFA1 WHERE LIFNR EQ '0000001000' OR LIFNR EQ '0000001500'.
SELECT * FROM LFA1 INTO TABLE IT_LFA1 UP TO 1 ROWS.
refresh it_lfa1.
SELECT * FROM EKKO INTO TABLE IT_EKKO FOR ALL ENTRIES IN IT_LFA1 WHERE LIFNR = IT_LFA1-LIFNR.
LOOP AT IT_EKKO.
WRITE: / IT_EKKO-LIFNR, IT_EKKO-EBELN.
ENDLOOP.
Reward me if it is useful -
Hi all,
I have a requirement to make a select options low field disable and high field editable.
Can anyone guide me on this.......!!!
Awiting u r reply.
Regards,
Rashmiyou write the code under "at-selection-screen output" event.....make one loop on screen....and make the screen enable & disable as you wish..
ELECTION-SCREEN BEGIN OF BLOCK b1 .
SELECTION-SCREEN SKIP 2.
SELECTION-SCREEN COMMENT 40(25) text-010 .
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) text-002 FOR FIELD pernr.
PARAMETERS pernr TYPE pa0001-pernr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) text-008 FOR FIELD ename.
PARAMETERS ename TYPE pa0001-ename.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) text-003 FOR FIELD persg.
PARAMETERS persg TYPE pa0001-persg.
SELECTION-SCREEN COMMENT 45(15) text-009 FOR FIELD werks.
PARAMETERS werks TYPE pa0001-werks.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) text-004 FOR FIELD persk.
PARAMETERS persk TYPE pa0001-persk.
SELECTION-SCREEN COMMENT 45(15) text-005 FOR FIELD kostl.
PARAMETERS kostl TYPE pa0001-kostl.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) text-006 FOR FIELD orgeh.
PARAMETERS orgeh TYPE pa0001-orgeh.
PARAMETERS orgehtxt TYPE person-orgeh_txt .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 20(15) text-007 FOR FIELD plans.
PARAMETERS plans TYPE pa0001-plans.
PARAMETERS planstxt TYPE person-plans_txt .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
*AT SELECTION-SCREEN OUTPUT.
AT SELECTION-SCREEN OUTPUT .
LOOP AT SCREEN.
IF screen-name = 'ENAME'
OR screen-name = 'PERSG'
OR screen-name = 'PERSK'
OR screen-name = 'KOSTL'
OR screen-name = 'WERKS'
OR screen-name = 'ORGEH'
OR screen-name = 'PLANS'
OR screen-name = 'ORGEHTXT'
OR screen-name = 'PLANSTXT'.
screen-input = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
LOOP AT SCREEN.
IF screen-name = 'ORGEHTXT'
OR screen-name = 'PLANSTXT'.
screen-output = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Edited by: Arunima Rudra on Jan 8, 2009 5:39 PM -
Drop Down Menu selection query for recordset.
I am looking to utilize a dynamic drop down menu to query a recordset...I am using Colfusion to import an MS Access database that contains the following fields: "Model Date", "Name", "Points" and "Target". Each time the database updates, the "Model Date" field contains the date and time the model was run. I have figured out how to create a dynamic drop down using SELECT DISTINCT "model date" and have also figured out how to create the dynamic recordset to be displayed showing the "Name", "Points" and "Target" data.
I want the user to select the "Model Date" from the drop down, hit a submit button and then have the appropriate "Name", "Points" and "Target" data queried and shown below.
The query should take the selection from the "model date" dropdown and then query the "name", "points" and "target" fields for that particular "model date"
I admit my knowledge of SQL and Coldfusion is not the best, but it seems like this is a somewhat simple task and I am just missing one or two pieces of the cog to put it all together.
The database basically looks like this:
Model Date...........Name..........Points........Target
8/1/2010 08:00......John Doe.....1,250.........5.55%
8/1/2010 08:00......Jane Doe.....850............2.35%
8/1/2010 08:00......Bill Smith....11,832........-123.23%
8/2/2010 09:02......John Doe.....1,323.........6.67%
8/2/2010 09:02......Jane Doe.....1,001.........3.21%
8/2/2010 09:02......Bill Smith....10,235........-110.26%
The dropdown will only show the "model dates"
8/1/2010 08:00
8/2/2010 09:02
For example, if 8/1/2010 08:00 was selected from the dropdown, I want the following displayed:
Name..................Points...................Target
John Doe.............1,250....................5.55%
Jane Doe.............850.......................2.35%
Bill Smith............11,832...................-123.23%
Any help or suggestions would be greatly appreciated!!!
Thanks,
MikeMy second paragraph talks about just displaying the filtered data, so I'm assuming that's what you're looking for, but still not quite sure based on what the other responses are.
But I head on anyway -
On your first page, make note of the instance name of your drop down menu, such as "ModelDate". Make sure it's in a Form and set the form action to the page where you want to display your data, set the form action to POST.
On the results page, create a table with cells for each of the data elements you want to display. Create a recordset which you can do in Simple mode. Leave it at select all, and set the filter drop down to the database field which contains your Model Date. In the box to the right, select "=". the next dropdown selct "Form Variable" and the variable name type in the instance name of the drop down on the first page.
I may not have the terminology right, doing it from memory.
From the data bindings tab, expand your recordset and locate each of the database fields you want to display. Drag each one to the table cell on the page where you want it displayed. The table cells have to be in a linear row.
Now, select the table row buy selecting the TR tag in the tags just above the properties panel. In the server behaviors tab, select repeat region and "All Records"
Publish your pages and test!
Maybe you are looking for
-
I got my new 80G yesterday. I've had two 30Gs in the past, so I'm not an iPod newbie, but I just want to make sure I'm not missing something. As far as I know, from the box, you just plug it into your computer via USB and it should start charging and
-
Rolling the date on in a specific format
Hello, I want to output the date in the following format yyyymmdd I then want to add a certain number of days to the above date Can anyone advise the best way to do this Cheers Mitch
-
How to get server name and port of OSB server in a proxy service ?
I need to get the server name and port of the OSB server inside a proxy service. How can I get this?
-
JDeveloper TP 2/ADF BC: jbo-26061error
I tried the 11 g JDeveloper TP 2, creating a web application based on ADF BC. The database I use is Oracle 9. I created the Application Module (as I have done already very often). Starting the Model project, gives me the Business Component Browser -
-
How to use Custom Tags for Theme and Base Map Definitions
In Mapviewer documentation I've found the following new feature: The XML definition of a theme or base map now supports application-specific attribute tags. You can use the Custom Tags option in the theme definition in Map Builder to specify tags and