IS ITCOMPULSARY TO USE SELECT ENDSELETC IN LDB
Hello All,
Am freshaer in ABAP . In a code we use a LDB named PNM . in that LDB there is a table named PLPOD from this table we get the workcentre number then from it we will be going to database table crhd and crtx to get the description of that particular work centre . While selecting the data it is asking for endselect statement though i use the target as a interanl table .
Hi,
if u want multiple entries of description ,U can use
Select with into table it statement. then it do not ask u for endselect.
for eg.
SELECT
matnr mtart mbrsh matkl
FROM mara
INTO CORRESPONDING FIELDS OF TABLE it
WHERE matnr IN p_matnr.
if u want single entries of description , u can use
select single statement.
For eg.
select single KWERT
from KONV
into IT-ZADM
where KNUMV = IT-KNUMV
and KPOSN = IT-POSNR
and KSCHL = 'ZADM'.
Regards,
Digesh Panchal
Similar Messages
-
Can i use select statements in LDB
Hai All,
Can i use select statements and internal table in a LDB program.
my requirement is that if i enter company code , fiscal year and reporting periods.
generally fiscal year will be jan to dec.but in my requirement the fiscal year is apr of previous year to march of currentyear.
so as i require the last years data can iuse select statement in that ldb program or is there any solution for this.
Thanks in Advance
kiranHi Kiran,
To retrive records from ldb you have to use the
GET <node> statement. This will invoke the selection screen of the node. An alternate solution is to use the function module LDB_PROCESS.
Please see the following link for help and example
http://help.sap.com/saphelp_nw04/helpdata/en/64/237f8cd43711d1950b0000e8353423/content.htm
Thanks
Vinod -
Program with Dynamic selection but no LDB is used
Hello Friends,
Can any one tell me the any standard program name, In which Dynamic selection (Free Selection) is used but LDB(Logical Data Base) is not used.
Lalit SoniNot possoble with out LDB, it uses selection-screen dynamic selections for table <tabname> in ldb, one alternative is using the screen table to hide selection.
E,.g
loop at screen.
if screen-group1 = 'FS1' .
screen-active = 1.
modify screen.
endif.
endloop. -
How to Add a new fields in the selection screen of LDB.
Hi All,
I want to add a new fields in the selection screen of LDB & then i need to select the data for that fields.
So could you please tell me for that where i need to add the code for selecting the data.
Thanks
RoliHi
welcome to SDN forum
If you are designing your own LDB with your own tables you can define tree structure and then the selection screen for the tables
if you wants to modify the std LDB of SAp means take the access key and to modify that code
if you add the extra field you have to modify the where conditions in the code also
see the doc
A logical database is a special ABAP/4 program which combines the contents of certain database tables. You can link a logical database to an ABAP/4 report program as an attribute. The logical database then supplies the report program with a set of hierarchically structured table lines which can be taken from different database tables.
LDB offers an easy-to-use selection screens. You can modify the pre-generated selection screen to your needs. It offers check functions to check whether user input is complete, correct, and plausible. It offers reasonable data selections. It contains central authorization checks for data base accesses. Enhancements such as improved performance immediately apply to all report programs that use the logical database.
Less coding s required to retrieve data compared to normal internel tables.
Tables used LDB are in hierarchial structure.
Mainly we used LDBs in HR Abap Programming.
Where all tables are highly inter related so LDBs can optimize the performance there.
Check this Document. All abt LDB's
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=%2flibrary%2fabap%2fabap-code-samples%2fldb+browser.doc
GO THROUGH LINKS -
http://www.sap-basis-abap.com/saptab.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9bfa35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.htm
/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases
Re: **LDB**
www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_Logical_Database_FAQ.html
www.sap-img.com/abap/abap-interview-question.htm
www.sap-img.com/abap/quick-note-on-design-of-secondary-database-indexes-and-logical-databases.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9bb935c111d1829f0000e829fbfe/content.htm
Gothru the blog which provides info on LDB's:
/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases
Sample code
TABLES: SPFLI,
SFLIGHT,
SBOOK,
SCARR.
START-OF-SELECTION.
GET SPFLI.
WRITE:/ SPFLI: , SPFLI-CARRID, SPFLI-CONNID,
SPFLI-AIRPFROM, SPFLI-AIRPTO.
GET SFLIGHT.
WRITE:/ SFLIGHT: , SFLIGHT-CARRID, SFLIGHT-CONNID, SFLIGHT-FLDATE.
GET SBOOK.
WRITE:/ SBOOK: , SBOOK-CARRID, SBOOK-CONNID,
SBOOK-FLDATE, SBOOK-BOOKID.
GET SFLIGHT LATE.
WRITE:/ GET SFLIGHT LATE: , SFLIGHT-FLDATE.
Regards
anji -
Reg : Selection-Screen in LDB's
hi,
Iam working on a report which uses Logical DataBase : PSJ.
Iam getting output based on the standard selection screen of LDB PSJ.
Now my requirement is :
I need to add a new field(select option) to the Selection screen and the output should be displayed based on new field select option values
how to do this?
Plz answer
Regards
vajaHi,
You simply add the check in the relevant GET event of the LDB.
For example, you may have an event for DOCUMENT as follows.
GET DOCUMENT.
check document-ref in s_ref.
S_REF being your new select option.
Hope this helps.
Darren -
Is it worth using select query on infotype tables
Hi Experts,
I might be posting in the wrong column, but i just need to know is it worth using a select query on Infotype tables (PAxxxx)?? or should we prefer using the function modules for data fetching?
If select is not suggested, what is the reason for that?
Rgds
PrateekHi ,
Its not said that u cant write select on PAXXXX tables . Yes of couse LDB are there to fetch the data but it depends on
the requirement when to write a select and when to consider using in LDB .
Generally when you are looking at say 8 to 10 tables of infotypes with free selection , then LDB is suggested to fetch the data .
if you are looking to fetch the data for say some tables for a restricted selection (where clause) then select is used .
If i want to write a program using select only then fetching data from infotypes tables for large no of records will lead to
more time consumption which becomes easier in LDB as they are fetched in hierarchy level based on keys .
Normally it will be a combination of LDB and select querys in the development scenario
Br,
Vijay. -
How to disable the Selection screens of LDB's ?
Hi,
How to disable the Selection screens of LDB's when we r using the predefined LDB for our executable pgm ? and how to include the predefined LDB can u write the Code for including LDb or if possible give an example of a Pgm using a Predefined LDB?
Thanks & Regards,
Gopi.Hi Gopi,
Go through the link,
http://www.sapdevelopment.co.uk/hr/hrhome.htm
Regards,
Azaz Ali. -
Regarding Selection views in LDB
Hi Experts,
What is use of Selection Views in LDB ??
and how can we generate different Selection Views in LDB because i am getting only two Options either SAP or CUS for every LDB ??
I want to declare 4-5 and how to use Those Selection Views ( as by default it takes SAP one or newly generated one)
Thanks,
Regards,
Anil SonesarHi Suny,
When I run the T-code FBL1N at my place and click on Dynamic selections button,what I see that there are all the three options--Vendor Master,Company Code and Documents available.
You need to observe that against Vendor number there is no input box available but all the fields available under it till Company Code belong to Vendor Master.Similarly,all the fields mentioned under Comaony Code belong to Company Code and likewise all the fields mentioned under Documents like Special G/L Indicator,Assignment,Document number etc. belong to Document.
In case you have any further clarifications,do let me know.
Regards,
Puneet Jhari. -
Hi All, difference btwen data selection and person selection period in ldb
Hi All, difference btwen data selection and person selection period in ldb -pnp
If possible provide with an example .Its Urgent pls.Hi,
Difference:--
Data Selection Period
The data selection period enables you to specify the period in which employee data records are read. Only records which overlap with the specified period by at least one day are selected. To define an interval, enter the start date in the left column and the end date in the right column
Person Selection Period
When you enter a person selection period, the system selects only those employees who are members of the enterprise on at least one day in the specified period. These are persons with a valid Organizational Assignment (0001) record. Entries in the standard selection options fields limit the personnel numbers that are selected. You can specify an interval by entering the start and end dates in the left and right columns respectively.
Selection criteria in PNP are just used to determine the pernrs which meet them. For these pernrs then all wanted data is selected. This data then is not checked against this criterias.
An Example:
Pernr 4711 has benn assigned to costcenter 10 from 01.01.2004 until 31.12.2004. On 01.01.2005 costcenter changes to 20.
If you now select all employees with costcenter 10 and list their costcenters, you will get both costcenters 10 and 20.
Most reports which use PNP have to sets of date-ranges:
- Person selection period that controls selection of pernr.
- Other period that controls selection of data.
If you set person selection period in above example to 01.01.2004 and other period to 01.01.2005 and select costcenter 10 you will in fact get employee 4711 with costcenter 20 shown.
Same effect with org-unit or any other selection criteria.
Regards
Vasu -
How to get all values from an interval using select statement
Hi,
Is it possible to write a select statement that returns all values from an interval? Interval boundaries are variable.
something like this:
select (for x in 1,1024 loop x end loop) from dual
(this, of course, doesn't work)
The result in this example should be 1024 rows of numbers from 1 to 1024. These numbers are parameters, so it is not possible to create a table with predefined values.
Thanks in advance for your help,
Mia.For your simple case, with a lower boundary of 1, you can use:
SELECT rownum
FROM all_objects
WHERE rownum <= 1024For a set of number between say 50 - 100, you can use something like:
SELECT rownum + (50 - 1)
FROM all_objects
WHERE rownum <= (100 - 50 + 1)Note, that all_objects was used only because it generally has a lot of rows. Any table with at least the number of rows in your range will work.
TTFN
John -
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 -
Using Select statement in IF condition?
hi all,
Can i use select statement in IF COndition in pl sql ?
eg like- if( select 1 from ASD) then
end if;There is no way to do any kind of select statement inside if conditions.
Why don't test simple cases like this first?
An example to show it.
SQL> begin
2 if exists (select 1 from dual) then
3 dbms_output.put_line('ok');
4 end if;
5 end;
6 /
if exists (select 1 from dual) then
ERRORE alla riga 2:
ORA-06550: line 2, column 5:
PLS-00204: function or pseudo-column 'EXISTS' may be used inside a SQL
statement only
ORA-06550: line 2, column 2:
PL/SQL: Statement ignored
SQL> begin
2 if ( (select count(*) from dual) > 0 ) then
3 dbms_output.put_line('ok');
4 end if;
5 end;
6 /
if ( (select count(*) from dual) > 0 ) then
ERRORE alla riga 2:
ORA-06550: line 2, column 8:
PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
( - + case mod new not null others <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall merge time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set specification>
<an alternativ
ORA-06550: line 2, column 33:
PLS-00103: Encountered the symbol ")" when expecting one of the following:
. , @ ; for <an identifier>
<a double-quoted delimited-identifier> group having intersect
minus order partition start subpartition union where connect
SQL> begin
2 if ( 0 in (select count(*) from dual) ) then
3 dbms_output.put_line('ok');
4 end if;
5 end;
6 /
if ( 0 in (select count(*) from dual) ) then
ERRORE alla riga 2:
ORA-06550: line 2, column 12:
PLS-00405: subquery not allowed in this context
ORA-06550: line 2, column 2:
PL/SQL: Statement ignoredBye Alessandro -
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 -
I have a scenario in which our enterprise activation servers exist in a domain that is in a separate forest than our offices. Currently all our domain controllers are 2008 R2 with domain and forest functional levels at 2008 R2. We have set
up two-way forest trusts with our office domains using selective authentication. We then give the domain controllers from our licensing domain the "Allowed to Authenticate" right to the domain controllers in the office domain. On the
server 2008 R2 domain controllers in the office domain, we can browse to the appropriate objects in the licensing domain after being presented with an authentication window that allows us to enter credentials for the licensing domain. However, after
installing a 2012 R2 domain controller in an office domain, we can not use the 2012 domain controller to browse to the objects in the licensing domain. It never asks for credentials for the licensing domain when we specify the objects we want to add
from the licensing domain. I simply states that the object can not be found. When I look at the domain controller in the licensing domain, I see that the domain controller in the office domain is attempting to pass the credentials of the user that
is logged on and this is failing since this user has no rights in the licensing domain. I can still use a 2008 R2 domain controller in the office domain to add the rights and it works like it always has. Can somebody tell me why this is happening
and how to correct it?Hi,
Based on my research, this is a known issue in Windows Server 2012 R2.
According to the article below: “The Selective Authentication feature of selective trusts is
not functional. Access to resources enabled by “Allowed to Authenticate” will fail. There is no workaround at this time”.
Release Notes: Important Issues in Windows Server 2012 R2
http://technet.microsoft.com/en-us/library/dn387077.aspx
Best Regards,
Amy Wang -
Hi Friends,
I am using Oracle 8.1.6 Server, & facing problems while retrieving data from a PL/SQL Table:
CREATE or REPLACE PROCEDURE test_proc IS
TYPE tP2 is TABLE of varchar2(10); --declared a collection
dt2 tP2 := tP2('a','b','c');
i NUMBER(8);
begin
SELECT COUNT(*) INTO i FROM TABLE(CAST(dt2 as tP2));
DBMS_OUTPUT.PUT_LINE('**'||i);
end;
While executing the above procedure, I encountered foll. error:
ERROR at line 1:
ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL execution], [], [],
ORA-06544: PL/SQL: internal error, arguments: [pfrrun.c:pfrbnd1()], [], [], [], [], [], [], []
ORA-06553: PLS-801: internal error [0]
Can anyone please help me, where the problem is??
Is it Possible to retrieve data from PL/SQL TABLE using SELECT statement? & How ?
Thanks in advance.
Best Regards,
Jay Raval.Thanks Roger for the Update.
It means that have to first CREATE TYPE .. TABLE in database then only I can fire a Select statement on that TYPE.
Actually I wanted to fire a Select statement on the TABLE TYPE, defined & declared in PLSQL stored procedure using DECLARE TYPE .. TABLE & not using CREATE TYPE .. TABLE.
I was eager to know this, because my organization is reluctant in using CREATE TYPE .. TABLE defined in the database, so I was looking out for another alternative to access PL/SQL TABLE using Select statement without defining it database. It would have been good if I could access a PLSQL TABLE using Select statement Declared locally in the stored procedure.
Can I summarize that to access a PL/SQL TABLE using SELECT statement, I have to first CREATE TYPE .. TABLE?
If someone have any other idea on this, please do let me know.
Thanks a lot for all help.
Best Regards,
Jay Raval.
You have to define a database type...
create type tP2 is table of varchar2(10)
CREATE OR REPLACE PROCEDURE TEST_PROC
IS
dt2 tP2 := tP2('a','b','c');
i NUMBER(8);
begin
SELECT COUNT(*) INTO i FROM TABLE(CAST (dt2 AS tP2));
DBMS_OUTPUT.PUT_LINE('**'||i);
end;
This will work.
Roger
Maybe you are looking for
-
How do i remove a credit card from my account?
I dont have any money in my account and it wont let me update my apps. Please help me.
-
Usage Report and Audit Log report showing different totals
I am trying to understand the differences displayed in two similar reports. The first report is an 'Audit Log' Report and it is displaying the number of Resource Account creations over a time period. The second report is a Usage Report using the exac
-
Hi frnds i developed a ALV report with GRID display with 12 columns .Iam getting the proper o/p for the same. Now wen i try to take the print or see the print preview of it it gives me only 6 columns . can any1 tell me wht can be the problem.
-
Changing JdbcDriver at runtime
I need, in my Jclient app, to change the Jdbcdriver to connect to different databases of differebt vendors. How can I do this at runtime ? Any suggestion ? TIA Tullio
-
HT5567 Update failed IOS 6.0.1 for my IPhone, what can I do?
I cannot download the new update for my iPhone 4s, it's the IOS 6.0.1, what do I do?