Urgernt : ABAP Query
Dear Guru,
In Database table there are multiple rows against a Heat no. say 4 rows for different metals under one column for the same heat no., In my internal table i have taken separete coulum for separate metals and want to insert value of different metals into corresponding column in single row in the internal table.
Plz tell me the proper way.
Looking forward to your co-operation.
Thanks & Regards,
Gulrez Alam
Dear Gulrez
Here is a hint for your requirement.
I can't provide you the exact code as I am away from SAP system.
You will have to use field-symbols concept.
Select from dbtab and use sy-dbcnt to know the no of rows fetched.
Do sy-dbcnt times.
cocatenate colno heat no. into l_str no-gaps.
assign l_str to itab-<fs>.
itab-<fs> = value...
append itab.
Enddo.
Hope it helps.
Regards,
Aabhas.
Similar Messages
-
How to create an ABAP Query with OR logical expression in the select-where
Hi,
In trying to create an ABAP query with parameters. So it will select data where fields are equal to the parameters entered. The default logical expression is SELECT.. WHERE... AND.. However I want to have an OR logical expression instead of AND.. how can I attain this??
Please help me on this.. Points will be rewarded.
Thanks a lot.
Regards,
Question ManHi Bhupal, Shanthi, and Saipriya,
Thanks for your replies. But that didn't answer my question.
Bhupal,
You cannot just replace AND with OR in an ABAP QUERY. ABAP QUERY is a self generated SAP code. You'll just declare the tables, input parameters and output fields to be displayed and it will create a SAP standard code. If you'll try to change the code and replace the AND with OR in the SAP standard code, the system will require you to enter access key/object key for that particular query.
Shanthi,
Yes, that is exactly what need to have. I need to retireve DATA whenever one of the conditions was satisfied.
Saipriya,
Like what I have said, this is a standard SAP code so we can't do your suggestion.
I have already tried to insert a code in the ABAP query (there's a part there wherein you can have extra code) but that didn't work. Can anybody help me on this.
Thanks a lot.
Points will be rewarded.
Regards,
Question Man -
Logical database of ABAP query
Hi,
Can anybody please let me know what is the Logical database for ETXDCI, ETXDCH & ETXDCJ (Tax tables) with any sales document tables? I need to develop one ABAP query for the users.
I am a Functional person so I would like to know Can anybody please let me know how I can find out the Logical database?
Your time and help will be really appreciate.
Thanks & Regards,
Niki Shah.Try the BRF logical database.
I found it by searching in which programs the tables were used.
It show program SAPDBBRF which is the program for logical database BRF.
Kind regards,
Arthur Parisius -
hi.
i need to create an ABAP/sap query. when i created the InfoSet i used logical db-pnp.
if i want to get only the employees which entered my organization during the last month where should i add the ABAP code, under which section => extras -> code. i have there several options - data, initialization, at selection-screen output etc, what to choose??????????
thanks,
AmiHi
Welcome to SDN forum
query has got some limitatins compared to Reports which we write using SE38
these queries are user specific and client specific and can't be transportable and you can't write your own code as you wish like reports
see the doc
http://help.sap.com/saphelp_46c/helpdata/en/35/26b413afab52b9e10000009b38f974/content.htm
http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
Step-by-step guide for creating ABAP query
http://www.sappoint.com/abap/ab4query.pdf
ABAP query is mostly used by functional consultants.
SAP Query
Purpose
The SAP Query application is used to create lists not already contained in the SAP standard system. It has been designed for users with little or no knowledge of the SAP programming language ABAP. SAP Query offers users a broad range of ways to define reporting programs and create different types of reports such as basic lists, statistics, and ranked lists.
Features
SAP Query's range of functions corresponds to the classical reporting functions available in the system. Requirements in this area such as list, statistic, or ranked list creation can be met using queries.
All the data required by users for their lists can be selected from any SAP table created by the customer.
To define a report, you first have to enter individual texts, such as titles, and select the fields and options which determine the report layout. Then you can edit list display in WYSIWYG mode whenever you want using drag and drop and the other toolbox functions available.
ABAP Query, as far as I Believe, is the use of select statements in the ABAP Programming. This needs a knowledge of Open SQL commands like Select,UPdtae, Modify etc. This has to be done only by someone who has a little bit of ABAP experience.
To sum up, SAP queries are readymade programs given by SAP, which the user can use making slight modification like the slection texts, the tables from which the data is to be retrieved and the format in which the data is to be displayed.ABAP queries become imperative when there is no such SAP query existing and also when there is a lot of customizing involved to use a SAP Query directly
use either SQ02 ans SQ01
or SQVI tr code
for more information please go thru this url:
http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Create_The_Query.asp
http://goldenink.com/abap/sap_query.html
Please check this PDF document (starting page 352) perhaps it will help u.
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
check the below link will be helpful for u
Tutorial on SQVI
once you create query system generates a report starting with AQZZ/SAPQUERY/ABAGENCY2======= assing this report to tr code for the same
Regards
Anji -
Wrong sequence in selection screen generated by ABAP Query
Hi,
I am developing a query to display the data in the view.
My query has 8 selection fields totally.
As part of my requirement I have added selection parameter in the
selections tab of the infoset and maintained the sequence as 9.
Inspite of maintaining the sequence number as 9 in the infoset, It is
appearing first in the selection screen of the query.
I tried putting different numbers in the sequence number, but even it
is appearing first in the selection screen.
Can you please let me know how to display the selections declared in
the infoset as per the sequence required.
Thanks,
Madhuri.Actually what happen when you declare your own fields in ABAP query . you have to care about the sequence . As an example if youre selecting lets say state name , you have two variables
<b>1-state
2- land</b>
for state you have to select land first , if your state is first and land is 2nd it gave you the error of sequence .
Because you have to get data in land first in order to get state specific to the land .
it should be
1-Land
2-State
Just see the your fields , Im sure youre missing that .
<b>You can also see the NO ( field ) in Query ( Sq03 ) . where you can define the seqence on selection.</b>
hope thisll help you .
Pl...Award the points .
Thanks
Saquib<b></b>
Message was edited by: Saquib Khan -
Performance tuning for ABAP Query (created from t-cd SQ01)
Hello all,
We created ABAP Query report from transaction SQ01.
But the generated report has an appropriate SQL statement which causes performance problem.
To solve this issue, I guess the easiest way is;
0. Give up to use it.
1. Copy it to another object in the customer namespace.
2. Ajust SQL statement.
But I'm wondering if there're appropriate ways to adjust SQL statement of Query.
Could anybody give me any better idea?
Thank you
YukoYou can try this: Create 2 ranges, for objnr and cdtcode and fill like:
ra_objnr-sign = 'I'.
ra_objnr-option = 'CP'.
ra_objnr-low = 'OR*'.
append ra_objnr.
ra_code-sign = 'I'.
ra_code-option = 'CP'.
ra_code-low = 'CO*'.
append ra_code.
SELECT objnr udate utime
FROM jcds
INTO TABLE it_jcds
WHERE objnr IN ra_objnr
AND stat = l_tj02t
AND cdtcode IN ra_code
AND inact = space
Regards,
John. -
How to hide some fields in ABAP Query
Hi,
My ABAP Query has a long list of extracted fields. I wanted to set some of these output to "HIDE".
This allow User the flexibility to decide what fields to show.
How can I set the field to "HIDE" in my query?
Thanks
byeHi Tim,
You can do this by setting the Report layout variant in following steps:
1. First define the parameter on selection screent for report variant.
2. Data decelaration for variant.
3. Value request to get already present variants on report:
4. If doesn't choose the layout take out the default report layout.
5. Initialize the report variant.
6. Apply the variant to the REUSE_ALV_GRID_DISPLAY funtion module.
Here to generate report variant first to open report output and then as per according to user set the layout of report using the layout icon of ALV with summation on value fields (as required) and create layout name.
*Data Deceleration as below:
Data :g_save(1) TYPE c,
** g_default(1) TYPE c,
g_exit(1) TYPE c,
gx_variant TYPE disvariant,
g_variant TYPE disvariant.
*First Define the parameter to give layout of Report variant.
SELECTION-SCREEN BEGIN OF BLOCK 3 WITH FRAME TITLE text-003.
PARAMETERS: p_vari TYPE disvariant-variant.
SELECTION-SCREEN END OF BLOCK 3.
* Process on value request
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
PERFORM f4_for_variant.
* Selection-Screen Checking
AT SELECTION-SCREEN.
PERFORM pai_of_selection_screen.
INITIALIZATION.
w_repid = sy-repid.
PERFORM variant_init.
* Get default variant
gx_variant = g_variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
EXPORTING
i_save = g_save
CHANGING
cs_variant = gx_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 0.
p_vari = gx_variant-variant.
ENDIF.
FORM f4_for_variant .
CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
EXPORTING
is_variant = g_variant
i_save = g_save
IMPORTING
e_exit = g_exit
es_variant = gx_variant
EXCEPTIONS
not_found = 2.
IF sy-subrc = 2.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
** ELSE.
** IF g_exit = space.
** ENDIF.
ENDIF.
ENDFORM. " f4_for_variant
FORM pai_of_selection_screen .
IF NOT p_vari IS INITIAL.
MOVE g_variant TO gx_variant.
MOVE p_vari TO gx_variant-variant.
CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'
EXPORTING
i_save = g_save
CHANGING
cs_variant = gx_variant.
g_variant = gx_variant.
ELSE.
PERFORM variant_init.
ENDIF.
ENDFORM. " pai_of_selection_screen
FORM variant_init .
CLEAR g_variant.
g_variant-report = w_repid.
ENDFORM. " variant_init
**While Showing report pass the variant :::
g_save = 'A'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
i_structure_name = 'IT_MAIN'
is_layout = i_layout
is_print = i_print
it_fieldcat = i_fieldcat[]
it_events = i_events[]
i_save = g_save
is_variant = g_variant
TABLES
t_outtab = it_main
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Many Thanks / Himanshu Gupta -
Hi Guru's
I would like to ask some questions on ABAP query.
1. Can you transport abab queries? Should it only be Global or you can also transport Standard Areas?
2. Once transported, am i able to change query?
Thanks,
Jogradhi....
you can transport a quary but for that the quary should be an object itself or attached to some object
and
if once transported to production....you cannot change it there and for changing you have to get it in developement sysytem and then make any change.
regards -
How to set default value in select option for ABAP query
Hi experts,
What is the way to set up default values for select-options in ABAP query.
e.g.
I have one field 'Year' in my ABAP query selection screen.
I want value of current year to be appeared here whenever user execute report
Thanks in Advance
-HarkamalHi Harkamal,
execute your Query via SQ01. On Selection-Screen
goto save Variant. Mark your field
as selection variable an press Button election variable.
Take variable from TVARV and use it.
Than save the Variant.
Look at TVARV if the 'Year' is updated to the actualYear!
regards, Dieter -
Short Dump While selecting Variant for ABAP query
Hi,
ABAP query is going to short dump (CONNE_IMPORT_WRONG_COMP_LENG) while selecting a Variant. If i create and use variant then i am able to see Output of Variant.But not able to use Earlier created variants .
I think some mismatch between variant values and selection screen fields.Can anyone tell me how to rectify this ?
I am not able to debug the code as dump is coming in a System program(RSDBSPVD).Can anyone tell me which database table i can use to get values of the Variant.
Thanks in Advance.
Nirmala KHi nirmala,
chk the links:
http://help.sap.com/saphelp_webas620/helpdata/en/c0/980398e58611d194cc00a0c94260a5/content.htm
http://help.sap.com/saphelp_webas620/helpdata/en/c0/9803a7e58611d194cc00a0c94260a5/content.htm
regards,
keerthi. -
Getting error while assigning ABAP Query to Tr.Code
Hi Guys,
There is a problem iam facing with ABAP query while transporting which need to solved asap. It will very greatfull if u guys can resolve this problem.
My problem is, I created one ABAP Query with Name ASSETOVERVIEW. I had transported this even, now when iam going to assign it to one transaction code with se93 lets say ZAOR. I need to give its description and program name in se93 right. now my question is what is program name i need to give in se93. Bcoz in SQ01 where i created the query, there is no name as 'program name' rather there is 'Name' in that we will create the query name i.e, ASSETOVERVIEW. In se93 u give tr.code and when u see down there will be radiobuttons in 'start object',in that i had checked program and selection screen (report transaction) is this right button i had checked or any other i need to check?. I had assigned this name i.e,ASSETOVERVIEW and development class and then when i check the name for syntax check its giving "'ASSETOVERVIEW' does not exist". I don't understand what program name i need to give.
If u guys can help me out with this problem it will be very much appreciable and definetly can get the reward points.
Thanks for as usual help in advance.
Regards.Hi omer,
1. Just run the query.
2. one selection screen will come
3. then using SYSTEM---->STATUS, (from menu)
look for the program name
4. the program name will be something wired foramt.
/asdfasdf/asdfdas etc.
5. Give that name in se93.
regards,
amit m. -
Abap Query - Creation of Report
Hi guys,
I do have a question to ABAP Query:
I want to create a report that shows me all current active employees and all of their corresponding positions from Infotype 1.
I have got it to the part where the report gives me all employees (active and withdrawn).
The question is:
How can I show only active employees as of todays date?
Thanks,
SaschaThanks for your reply,
but if I enter date 31.12.9999 and status of active. it gives me for some the latest record and for some two - though I could not find out why?!
I should say, I am using logical database PNP for this query
null -
Creation of local field in ABAP Query
Hi
Please let me know how to create a local field in ABAP query. I am finding the option inactive in SQ01.
Regards
Priyadarshinihi priya,
*__Adding u201CLocal Fieldu201D (user defined field) in SAP Query_ :
There is also facility to add the user defined fields in SAP query output. Also we can provide calculation formula for calculating values for this user defined field.
Calculation formula consists of standard fields from standard SAP tables. So the values fetched for particular standard SAP fields from standard SAP tables get calculated as per the calculation formula defined for the user defined field and displays the value accordingly.
To do this first go to change mode for Query which automatically takes you to screen shown below and click on icon , as below :
Then further screen will appears. So select the Field group and again click on the same icon button .
Then switch on the Short names for the fields and give the short names to fields which we need to use in Calculation formula.
Give the short names and then created u201CLocal Fieldu201D, as shown in below screen shot. Also Short names are given to fields, which can be used further for calculation.
Defining Local Field u201CREM_QTYu201D along with its field type and Calculation formula.
In this case we have
defined field type for new
field as similar to
ORD_QTY and
Calculation formula is
defined.
Also its possible to have Conditional logic for Local field by putting Condition in u201CConditionu201D line.
Now activate this newly added Local field for coming it in output screen. To do the same again go to u201CBasic Listu201D and activate the Local Field as shown below :
i think this will help u
regards,
sindhu. -
Dear All,
This may be a technical question. I am trying to create the ABAP query by using 2 tables. Went to SQ02, entered the description of Infoset and given the first table name in the "Table join in the basis table" row. When i entered to type the second table name, the program is getting terminated. (If I want to create a query by using one table, then the system accepts)
If possible, can anybody explain me what could be the proble,?
Regards
Manivannan RYou can post u r req in Expert Forums » Application Server » SAP GUI forum
7.10 is now released, you can get it at
ftp://ftp.sap.com/pub/sapgui/win/710/compilation1/
and on
ftp://ftp.sap.com/pub/sapgui/win/710/patches
there are the newest patches available.
http://iris.tennessee.edu/sapgui_vista.htm
Message was edited by:
SHESAGIRI.G -
ABAP Query - Sorting Issue in Basic List (SQ03)
Hi,
I have developed a ABAP Query. I want to sort some of the fields, for which I need to add some output fields to the sort sequence box in the Basic List page in SQ03/SQ01. But, I am not able to drag and drop the fields directly. Please suggest how can this be done? Thanks in advance.
Best Regards,
Tejas SavlaHi Abhishek,
There are three things related to Query.
1) You have to create the USER GROUP in SQ03.
2) You have to create the Infoset in SQ02. In this infoset you can write the logic of the program/Query what ever you want to perform.So you can sort the table in the infoset in the program logic.you have to create the output table of the query.
3) you have to create the Query in SQ01 and you have to associate the User group and infoset . you have to design the layput of the output you want to have.this output fields would be same as you have defined in infoset(step 2).
hope this will help you.
thanks
Tanmaya
Maybe you are looking for
-
BI OnDemand with SAP B1 Online Database
Hi Experts, Can BI OnDemand [(bi.ondemand.com) |bi.ondemand.com] work on SAP B1 Online Database (OLTP Database) and even on multiple database? if yes then how?
-
Error when create PR from IP30
Hi All, I am executing IP30 transaction for creating maintanence order and got the error. " Formatting error in the field EBAN-AFNAM; see next message". The maintanence plan has PM02 control key (External operation) and the system try to create a PR
-
My iPhone 5 screen went pixelated, slowly dimmed and then blacked out. Not reboot-able!
-
Here's the scenario: We're working on a new DC design. Dual 6509VSS in core, dual Nexus 5k and 14 FEXs. The 2ks will be dual attached to the 5ks. Now, I read somewhere else that the 5k is limited to a maximum of 16 vPCs. So the question comes up... d
-
Visio2013 preview opens a .img file that doesn't run anything
Has anyone else tried to download the Visio2013 preview? After then entire install process I click launch and what looks like a txt file opens but nothing happens... VisioProfessional_x64_en-us Any help would be much appreciated.