Query and selection fields
Hi,
I'm creating a query with trx SQ01.
I want to modify the name of a field in the selection screen of the query.
How can I do this ?
Regards
Hi,
In SQ01 select query and choose icon "change".
In the change query screen choose from top menu "goto", followed by "field selection" and "selections". In column "No" you can set sequence, in columns "selection text" you can amend the descriptions.
Hope it will solve ur problem
Similar Messages
-
SAP Query and selection screen fields
Hi,
I am currently modifying a Query. I have added a new selection field. The fieldname for this selection field has been autogenerated within the query and I have pasted a bit in here:
SELECT-OPTIONS SP$00015 FOR ZERROR_FLG LOWER CASE.
SELECT-OPTIONS SP$00022 FOR KNA1-ERDAT.
SELECT-OPTIONS SP$00023 FOR KNA1-ERNAM.
SELECT-OPTIONS SP$00027 FOR ZLOEVM LOWER CASE.
SELECT-OPTIONS SP$00030 FOR ZPARTNERNO
NO INTERVALS NO-EXTENSION.
I relation to this select -option, I want to execute a few lines of code that only is executed if the user has filled in a value in teh ZPARTNERNO field. However, no matter if I use the field name ZPARTNERNO or SP$00030 it has no effect.
Any good ideas ?HI,
In the AT SELECTIOn-SCREEN event, you can write the code
IF not <b>SP$00030[]</b> is initial.
write the code which you want to execute before the output
ENDIF.
if you want in START-OF-SELECTION>
IF not <b>SP$00030[]</b> is initial.
write the code which you want to execute before the output
ENDIF
Regards
Sudheer -
Sap query and additional fields.
Hello guys.
ABAP it's not my strong skill, but i need to develop some report.
What i need:
input: material, SLED, plant
output: material, SLED, plant, values from characteristic field.
I have created sap query with additional field type c.
Below my code:
TYPES: BEGIN OF charast,
ATNAM(50) TYPE c,
ATWTB(8) TYPE n,
X(50) TYPE n,
C(50) TYPE n,
ATINN(50) TYPE n,
END OF charast.
DATA: char TYPE TABLE OF charast WITH HEADER LINE.
CALL FUNCTION 'VB_BATCH_GET_DETAIL'
EXPORTING
MATNR = MCH1-MATNR
CHARG = MCH1-CHARG
GET_CLASSIFICATION = 'X'
TABLES
CHAR_OF_BATCH = char.
LOOP AT char into TEST (This is an additional field type C.
ENDLOOP.
Questions:
1. How i can return internal table into standard abap type, because i can create additional field only with standart types.
2. Need i fetch exporting parameters before calling FM? Or sap query do it automatically, based on given values on selection screen of the report?
3. How i can return only needed field from FM output? Now, when i'm executing FM via SE37 it's show desired result, but when i'm getting it from code i see strange values.
4. If i don't know exactly return by an FM values, how i can fill structure dynamically?
5. How i can return result of a program not only to additional field but to layout?
Sorry for noob questions and thank you in advance guys!Well, seems like it work fine for me.
Below my crappy, but working code:
DATA: material TYPE MCHB-MATNR,
batch TYPE MCHB-CHARG,
plant TYPE MCHB-WERKS,
sloc TYPE MCHB-LGORT,
gtdt TYPE STANDARD TABLE OF clbatch,
gtdit TYPE clbatch.
SELECT MATNR INTO material FROM MCHB
WHERE MATNR = MCHB-MATNR.
ENDSELECT.
SELECT CHARG INTO batch FROM MCHB
WHERE CHARG = MCHB-CHARG.
ENDSELECT.
SELECT WERKS INTO plant FROM MCHB
WHERE WERKS = MCHB-WERKS.
ENDSELECT.
SELECT LGORT INTO sloc FROM MCHB
WHERE LGORT = MCHB-LGORT.
ENDSELECT.
CALL FUNCTION 'VB_BATCH_GET_DETAIL'
EXPORTING
MATNR = material
CHARG = batch
WERKS = plant
GET_CLASSIFICATION = 'X'
TABLES
CHAR_OF_BATCH = gtdt.
READ TABLE gtdt INTO gtdit
WITH KEY atnam = 'BATCH_SHELF_LIFE_EXPIRY_DATE'.
GTD = gtdit-ATWTB. -
SAP Query: Display Selection Fields in the header page of Basic list
Hello,
I have to display the selection fields in the header page of the basic list and statistics
in a SAP Query.
I know the usage of short names for fields in the header page, but this doesn't work
for the selection fields.
How can I display the selection fields in header pages?
Kind regards
ThomasTry using:
DATA: wa_lstab TYPE line
READ LINE sy-index line value INTO wa_lstab
Thanks,
SKJ -
ABAP QUERY: Obligatory selection fields
Hello,
I have created an ABAP QUERY and i can't find a way to make any of the selection fields obligatory.
Is this possible?
RegardsHi, 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:12 AM -
Cfoutput query and form field names
I have a form that have two field inputs. I would like to repeat the form fields as part of a cfoutput query. The first field of the form automatically populates the different person's name (via cfoutput query) and this form field is called "tenant". The next field of the form is called "sales". The sales field is left open for user imput. The entire form is in between the cfoutput query tags. When the cfoutput query is executed, Both form fields of the form is displayed with each tenant name listed in each of the first form fields of each row. The problem I'm running into is that even though the form elements appear to display correctly, I would like the name of each of my form elements in the cfoutput query, of each row to have a different form field name like, tenant2, sales2, tenant3, sales3 etc. is that possible?
Here's what my code look like.
<cfform action= "addsales.cfm" method="post">
<cfoutput query="tenantsales"><Input name="tenant" type="text" value="#office.tenant#" size="32" />
<select name="sales"><option>$5</option><option>$10</option><option>$12</option></br></cfoutput>
<input name="submit" type="submit" />
</cfform>I cannot imagine why you would want to show a list of pre-populated input fields. What makes sense to me is a select-box. If that is indeed what you want, then you could do something like this:
<cfform action= "addsales.cfm" method="post">
<cfselect name="tenant">
<option value="">Tenant</option>
<cfoutput query="tenantsales">
<option value="#tenantsales.tenantID#">#tenantsales.tenantName#</option>
</cfoutput>
</cfselect></br>
<cfselect name="sales">
<option value="">Sales</option>
<option value="5">$5</option>
<option value="10">$10</option>
<option value="12">$12</option>
</cfselect></br>
<cfinput name="submit" type="submit" value="Submit" />
</cfform>
Like Dan, I have assumed your database table has a column for tenant ID. -
SAPbouiCOM.DBDataSource.Query and Date fields
When I try to add a Condition that uses an Alias for a database field of type datetime, the Query method crashes.
Is there a specific Date format that I am supposed to use?
I am currently using the SAP date format and I also tried the database date format. Both crashed the Query method.My customer's date format is mm/dd/yy and that is the format I was using. Here is what my code looks like for debugging this problem which is still crashing on the Query method:
conditions = new SAPbouiCOM.Conditions();
condition = conditions.Add();
condition.Alias = "U_PLS_PkgD";
condition.Operation = SAPbouiCOM.BoConditionOperation.co_GRATER_EQUAL;
condition.CondVal = "03/11/2004";
dbDataSource.Query(conditions);
I have also tried the following date formats:
condition.CondVal = "11/03/2004";
condition.CondVal = "03-11-2004";
condition.CondVal = "2004-11-01";
"U_PLS_PkgD" is a field in my user table that is of type datetime in the database. I can Query with varchar and int database fields. Just not datetime fields.
Please advise. Thank-you. -
Difference in count(*) query and select * query results
i am using Oracle9i Enterprise Edition Release 9.2.0.8.0.
in a table select count(*) returns 34, but when i run select * statement it returns only 6 rows. Results are pasted below. Can any one knows the reason of this mismatch
SQL> select * from pay_at;
EMP_CODE STA IN_OUT_DA TIME
100341 IN 07-MAR-04 09:32
100341 OUT 07-MAR-04 10:24
103165 IN 31-MAR-03 14:41
103165 OUT 31-MAR-03 20:00
101204 IN 19-APR-04 13:00
101204 OUT 19-APR-04 23:59
6 rows selected.
SQL> select count(*) from pay_at;
COUNT(*)
34
------------------------------------------------------Maybe you pressed CTRL-c during the fetch phase of "select * from" ?
If this is not the case, try to build a very small test case we can run that shows this behaviour and post it here.
Regards,
Rob. -
ABAP Query (SQ01) Compare bewteen 2 selected fields
Hello, In ABAP Query has selected fields (say) Fld1 Fld2 Fld3... I need to output / show only those records where Fld1 not equal to Fld3. Any ideas ?? Both the fields are from the same table in a functional area.
Thank You,
DebHi,
Welcome to SDN.
This is not possible exactly with ABAP Query but can be easily done by ADHOC query. Using Set operation A-B.
Check the links for ADHOC Query -
<a href="http://www.sap.cmich.edu/fihr/hr/adhoc-query.doc">http://www.sap.cmich.edu/fihr/hr/adhoc-query.doc</a>
Regards,
Amit
Reward all helpful replies. -
SAP Query DB - Selection screen
Hi!
I am workin with a DB for SAP Query. I tried it and there is just one problem: In the report selection screen there is a field (from the DB) that is mandatory. I wanted to exclude that field or at least to make it not mandatory. Is it possible? How?
Thank youHi,
Go to SQ01. Input your Query. Press change button. Press Basic list. In the left side you will see check box for list fields and selection fields. Remove the check box for whatever field you dont wan in the selection screen.
Thanks,
Senthil -
hai sap gurus..
what is difference the query and reporting
in an interview i have been asked.
how many queries and how many reporting did you created.Hi Naren,
SAP Query
An ABAP Workbench tool that enables users without knowledge of the ABAP programming language to define and execute their own reports.
In ABAP Query, you enter texts and select fields and options to determine the structure of the reports. Fields are selected from functional areas and can be assigned a sequence by numbering.
ABAP Query offers the following types of reports:
Basic lists
Statistics
Ranked lists
Query used for short run based i.e the format of the report output you can change frequently.
Report (CA)
A compilation of data for a company or group of companies in the form of a table or list.
An evaluation is the result of executing a report. It can be either displayed on the screen or sent to a printer.
Here ABAP programing language will be used to execute the report.
Report used for long run it is standard output we can,t change frequently.
I hope it will clear for you,
Regards,
Murali. -
Not able to select Field only option
Dear All,
I created a generic datasource based on a infoset query and enhanced the extract structure with a component zzvalov (amount). The idea is to fetch the amount from a different table writinga n user exit.
Now, the filed ZZVALOV is by default in Hide mode in the extractor field selections. When I try to uncheck the Hidel field and select Field only option and save , I get an error message that OLTP has still some errors.
Can anyone help to overcome this error. Is it mandatory to have the exit in place before I uncheck the Hide filed and select Field only ioption ? I did not get any warnings while activating the extract structure as well.
Thanks in advance
Regards,
SrinivasHi Srinivas,
Please check:
['The OLTP Source still has errors|'The OLTP Source still has errors]
[Re: OLTP error when appending a data source .|Re: OLTP error when appending a data source .]
[Generic Datasource Error: The OLTP source still has errors|Generic Datasource Error: The OLTP source still has errors]
[Re: The OLTP source still has errors Message no. R8417|Re: The OLTP source still has errors Message no. R8417]
[Re: OLTP Contains still has errors.|Re: OLTP Contains still has errors.] -
Hi Abapers,
What is the diff b/w Select single * from.... and select * ...up to 1 row.
Thanks in advance.
Subbu.Select SINGLE...
SINGLE
The result of the selection should be a single entry. If it is not possible to identify a unique entry, the system uses the first line of the selection. If you use the FOR UPDATE addition, the selected entry is protected against parallel updates from other transactions until the next database commit (see LUW and database lock mechanism). If the database system identifies a deadlock, a runtime error occurs.
... UP TO n ROWS
Effect
The set of results is restricted to a maximum of nrows.
Example
To output a list of the 3 business customers with the greatest discount:
DATA WA_SCUSTOM TYPE SCUSTOM.
SELECT * FROM SCUSTOM INTO WA_SCUSTOM UP TO 3 ROWS
WHERE CUSTTYPE = 'B'
ORDER BY DISCOUNT DESCENDING.
WRITE: / WA_SCUSTOM-ID, WA_SCUSTOM-NAME, WA_SCUSTOM-DISCOUNT.
ENDSELECT.
Notes
If you use an UP TO n ROWS addition in an ORDER-BY clause , the lines read are sorted into the correct order. The first n lines are then displayed. The system may need to read more than n lines from the database to be able to do this.
If n = 0, all selected lines are displayed.
n < 0 results in a runtime error.
<b>Knowing when to use SELECT SINGLE or SELECT ... UP TO 1 ROWS</b>
A lot of people use the SELECT SINGLE statement to check for the existence of a value in a database. Other people prefer to use the 'UP TO 1 ROWS' variant of the SELECT statement.
<b>So what's the difference between using 'SELECT SINGLE' statement as against a 'SELECT .... UP TO 1 ROWS' statement ?</b>
If you're considering the statements
SELECT SINGLE field INTO w_field FROM table.
and
SELECT field INTO w_field FROM table UP TO 1 ROWS. ENDSELECT.
then looking at the result, not much apart from the extra ENDSELECT statement. Look at the run time and memory usage and they may be worlds apart.
Why is this ?? The answer is simple.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
Get the difference ??
If not, here is a good example, credit for this example goes to Richard Harper, a friend of mine on sapfans.com :
Create a Ztable called ZDifference with 2 fields in it, MANDT of type MANDT and POSNR of type POSNR. Make sure both of these are keys. Also create a table maintenance dialog for it (SE11->Utilities->Table Maintenance Generator). Fill the table with ten rows 000001-000010.
Then run the program shown below:
Report Z_Difference
Message-id 38
Line-Size 80
Line-Count 0
No Standard Page Heading.
Start-Of-Selection.
Data: w_Single type Posnr,
t_Rows type standard table of Posnr
initial size 0
with header line.
Select single Posnr
from zDifference
into w_Single.
Select Posnr
into table t_Rows
from zDifference
up to 1 rows
order by Posnr descending.
Write :/ 'Select single:', w_Single.
Skip 1.
Write :/ 'Up to 1 rows :'.
Loop at t_Rows.
Write t_Rows.
EndLoop.
You should see the output:
Select single: 000001
Up to 1 rows : 000010
The first 'SELECT' statement selected the first record in the database according to any selection criterion in the 'WHERE' clause. This is what a 'SELECT SINGLE' does. The second 'SELECT' has asked the database to reverse the order of the records before returning the first row of the result.
In order to be able to do this the database has read the entire table, sort it and then return the first record. If there was no ORDER BY clause then the results would have been identical (ie both '000001') but the second select if given a big enough table to look at would be far slower.
Note that this causes a problem in the Extended Program Check if the full key is not specified in a 'SELECT SINGLE'. Replacing the 'SELECT SINGLE' by an "UP TO 1 ROWS" will give the same exact results without any warning but the program will run slower and consume more memory. This is a good example of a warning that we should ignore... considering you are sure of what you are doing !!
Message was edited by:
Judith Jessie Selvi -
Diff between select single and select upto 1 rows.
Hello aLL,
PL tell what is technical diff between select single and select upto 1 rows and how it is affecting the performance.
RushikeshHi
Knowing when to use SELECT SINGLE or SELECT ... UP TO 1 ROWS
A lot of people use the SELECT SINGLE statement to check for the existence of a value in a database. Other people prefer to use the 'UP TO 1 ROWS' variant of the SELECT statement.
So what's the difference between using 'SELECT SINGLE' statement as against a 'SELECT .... UP TO 1 ROWS' statement ?
If you're considering the statements
SELECT SINGLE field INTO w_field FROM table.
and
SELECT field INTO w_field FROM table UP TO 1 ROWS. ENDSELECT.
then looking at the result, not much apart from the extra ENDSELECT statement. Look at the run time and memory usage and they may be worlds apart.
Why is this ?? The answer is simple.
The 'SELECT SINGLE' statement selects the first row in the database that it finds that fulfils the 'WHERE' clause If this results in multiple records then only the first one will be returned and therefore may not be unique.
The 'SELECT .... UP TO 1 ROWS' statement is subtly different. The database selects all of the relevant records that are defined by the WHERE clause, applies any aggregate, ordering or grouping functions to them and then returns the first record of the result set.
Get the difference ??
If not, here is a good example, credit for this example goes to Richard Harper, a friend of mine on sapfans.com :
Create a Ztable called ZDifference with 2 fields in it, MANDT of type MANDT and POSNR of type POSNR. Make sure both of these are keys. Also create a table maintenance dialog for it (SE11->Utilities->Table Maintenance Generator). Fill the table with ten rows 000001-000010.
Then run the program shown below:
Code:
Program: Z_Difference
Purpose: A program that demonstrates the difference
between SELECT SINGLE and SELECT UP TO n ROWS.
This program requires the data table Z_DIFFERENCE
to have been created according to the structure
outlined in the text above and populated with
at least 10 records.
Creation Date: 21/04/2004
Requested By:
Reference Doc:
Author: R Harper
Modification History:
Date Reason Transport Who
Report Z_Difference
Message-id 38
Line-Size 80
Line-Count 0
No Standard Page Heading.
Start-Of-Selection.
Data: w_Single type Posnr,
t_Rows type standard table of Posnr
initial size 0
with header line.
Select single Posnr
from zDifference
into w_Single.
Select Posnr
into table t_Rows
from zDifference
up to 1 rows
order by Posnr descending.
Write :/ 'Select single:', w_Single.
Skip 1.
Write :/ 'Up to 1 rows :'.
Loop at t_Rows.
Write t_Rows.
EndLoop.
You should see the output:
Select single: 000001
Up to 1 rows : 000010
The first 'SELECT' statement selected the first record in the database according to any selection criterion in the 'WHERE' clause. This is what a 'SELECT SINGLE' does. The second 'SELECT' has asked the database to reverse the order of the records before returning the first row of the result.
In order to be able to do this the database has read the entire table, sort it and then return the first record. If there was no ORDER BY clause then the results would have been identical (ie both '000001') but the second select if given a big enough table to look at would be far slower.
Note that this causes a problem in the Extended Program Check if the full key is not specified in a 'SELECT SINGLE'. Replacing the 'SELECT SINGLE' by an "UP TO 1 ROWS" will give the same exact results without any warning but the program will run slower and consume more memory. This is a good example of a warning that we should ignore... considering you are sure of what you are doing !! -
Addition of checkbox and 2 fields in ABap query selection screen
Hi
I need to add chack boxes and 2 fields in ABAP query which is using LDB QMI. can u pls let me know how to do that.Hi Tarun,
I am still not clear with the problem..I guess you require plant in your selection screen which you have.
i guess if you go to sq01tcode there is a option infoset query from where you can give your selection options and value.
have you selected all the fields in infoset and made a selection screen?
When you have done with your infoset you just need to diplay the fields and there is a automatic program generated.
Let me know...
Regards,
Nihkil.
Maybe you are looking for
-
GTK3 apps ugly since yesterday (either upgrade or package removal!)
I have an issue where GTK3 apps (spacefm & file-roller as examples) are looking messed up since yesterday. It is not GTK theme related, as it looks the same for root. I use openbox, and trimmed some unused packages from my system yesterday. Hopefully
-
Is posible execute script PLSQL in Visual Basic 2008?
Hi, i'm a beginner in PL/SQL. And i have a question: How is the procedure for execute script PL/SQL on clic a button in a visual basic 2008 form. Coud you help me please. I'm sorry for my english but i only speak spanish. Thanks Edited by: Edgar Moli
-
Connecting directly to Macbook Air
I just purchased a Time Capsule, and successully did a backup using my router. But is there a way to connect the Time Capsule directly to my Macbook Air? There isn't a Ethernet slot on the laptop.
-
Can't add a goods receipt using 8.8 DP API.
Hi, I'm having a problem adding a goods receipt using the 8.8 DI API. It's not based on any document like a PO or production order. It needs one line. Here is my code: If ItemExists(ItemCode) Then If TotalTime > 0 Then
-
Hallo, My version 7.2.3 quit when I open it. I've tried many things: zapping the PRAM zapping the VRAM Reinstall twice Throw the preferences The receipts Disk Warrior Conclusion nothing!!! I need that soft working professionally, it's quite urgent. I