Problem in my Select query
Hi Experts,
I need a clarification in my Select query.
Have created a custom search help and my requirement is I have Request ID, Last and First Name as my search parameters. I need to fetch the values from my Ztable on search with the above said search parameters, where its workflow status = 30.
* Get Request ID
lv_pattern = <ls_query_params>-request_id.
IF lv_pattern CA '*'.
REPLACE ALL OCCURRENCES OF '*' IN lv_pattern WITH '%'.
ENDIF. " IF lv_pattern CA '*'
IF lv_pattern IS INITIAL.
lv_pattern = '%'.
ENDIF. " IF lv_pattern IS INITIAL
** Get NACHN - Lastname
lv_last_name = <ls_query_params>-nachn.
IF lv_last_name CA '*'.
REPLACE ALL OCCURRENCES OF '*' IN lv_last_name WITH '%'.
ENDIF. " IF lv_pattern CA '*'
IF lv_last_name IS INITIAL.
lv_last_name = '%'.
ENDIF. " IF lv_pattern IS INITIAL
** Get VORNA - First Name
lv_first_name = <ls_query_params>-vorna.
IF lv_first_name CA '*'.
REPLACE ALL OCCURRENCES OF '*' IN lv_first_name WITH '%'.
ENDIF. " IF lv_pattern CA '*'
IF lv_first_name IS INITIAL.
lv_first_name = '%'.
ENDIF. " IF lv_pattern IS INITIAL
*Selecting the RequestID/Last and First Name values with workflow status as 30.
SELECT zzreq_id " Internal number for appropriation request
nachn
vorna
INTO TABLE lt_select_list
FROM ZTABLE
WHERE ( ( zzreq_id LIKE lv_pattern ) and
( nachn like lv_last_name ) or
( vorna LIKE lv_first_name ) )
AND zzstatus = lv_workflow_status.
My problem is, ofcourse this query is selecting all the records where status = 30 and even it works correctly, If I searches with Request ID(* or *3*).
But am not able to select the records, if I searches with Last or First Name. Guess I did some thing wrong in select query.
Please advice me.
With Regards,
Ram.
Re: Problem in my Select query
Krishna kumar Jun 9, 2014 7:52 AM (in response to Ramakrishnan Murugan)
Hi Ramakrishnan,
Can you just try the below Select Query,
SELECT zzreq_id
nachn
vorna
INTO TABLE lt_select_list
FROM ZTABLE
WHERE ( zzreq_id LIKE lv_pattern and
nachn LIKE lv_last_name and
vorna LIKE lv_first_name ) and
zzstatus = lv_workflow_status.
Cheers,
Krishnakumar B.
I think the above suggested query is same as your solution.
Similar Messages
-
Problem in standard select query in fagll03
Good Morning frndz,
I m facing a problem while runnin fagll03. when executed it gives timeout error.
When I debug it , it gets stuck in a select query
SELECT SINGLE * FROM t800m INTO CORRESPONDING FIELDS OF ls_b
WHERE totable = ls_t800a-ntable
AND fromtable = 'ACCIT_GLX'
AND tofield = id_glflex_fieldname
AND seqnr = space.
The content in variable ls_t800a-ntable was FAGLFLEXA and in id_glflex_fieldname was USNAM.
When I cheked in table t800m, the entry could not be found. But in the report instead of setting
sy-subrc = 0 , it is stuck in the select query itself....kindly suggest y it is happening so
Regards,
VincyRe: Problem in my Select query
Krishna kumar Jun 9, 2014 7:52 AM (in response to Ramakrishnan Murugan)
Hi Ramakrishnan,
Can you just try the below Select Query,
SELECT zzreq_id
nachn
vorna
INTO TABLE lt_select_list
FROM ZTABLE
WHERE ( zzreq_id LIKE lv_pattern and
nachn LIKE lv_last_name and
vorna LIKE lv_first_name ) and
zzstatus = lv_workflow_status.
Cheers,
Krishnakumar B.
I think the above suggested query is same as your solution. -
How can i use index in select query.. facing problem with the select query.
Hi Friends,
I am facing a serious problem in one of the select query. It is taking a lot of time to fetch data in Production Scenario.
Here is the query:
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
FROM ztftelat LEFT JOIN ztfzberep
ON ztfzberep~gjahr = st_input-gjahr
AND ztfzberep~poper = st_input-poper
AND ztfzberepcntr = ztftelatrprctr
WHERE rldnr = c_telstra_accounting
AND rrcty = c_actual
AND rvers = c_ver_001
AND rbukrs = st_input-bukrs
AND racct = st_input-saknr
AND ryear = st_input-gjahr
And rzzlstar in r_lstar
AND rpmax = c_max_period.
There are 5 indices present for Table ZTFTELAT.
Indices of ZTFTELAT:
Name Description
0 Primary key( RCLNT,RLDNR,RRCTY,RVERS,RYEAR,ROBJNR,SOBJNR,RTCUR,RUNIT,DRCRK,RPMAX)
005 Profit (RCLNT,RPRCTR)
1 Ledger, company code, account (RLDNR,RBUKRS, RACCT)
2 Ledger, company code, cost center (RLDNR, RBUKRS,RCNTR)
3 Account, cost center (RACCT,RCNTR)
4 RCLNT/RLDNR/RRCTY/RVERS/RYEAR/RZZAUFNR
Z01 Activity Type, Account (RZZLSTAR,RACCT)
Z02 RYEAR-RBUKRS- RZZZBER-RLDNR
Can anyone help me out why it is taking so much time and how we can reduce it ? and also tell me if I want to use index number 1 then how can I use?
Thanks in advance.Hi Shiva,
I am using two more select queries with the same manner ....
here are the other two select query :
***************1************************
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
FROM ztftelpt LEFT JOIN ztfzberep
ON ztfzberep~gjahr = st_input-gjahr
AND ztfzberep~poper = st_input-poper
AND ztfzberepcntr = ztftelptrprctr
WHERE rldnr = c_telstra_projects
AND rrcty = c_actual
AND rvers = c_ver_001
AND rbukrs = st_input-bukrs
AND racct = st_input-saknr
AND ryear = st_input-gjahr
and rzzlstar in r_lstar
AND rpmax = c_max_period.
and the second one is
*************************2************************
SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
FROM ztftelnt LEFT JOIN ztfzberep
ON ztfzberep~gjahr = st_input-gjahr
AND ztfzberep~poper = st_input-poper
AND ztfzberepcntr = ztftelntrprctr
WHERE rldnr = c_telstra_networks
AND rrcty = c_actual
AND rvers = c_ver_001
AND rbukrs = st_input-bukrs
AND racct = st_input-saknr
AND ryear = st_input-gjahr
and rzzlstar in r_lstar
AND rpmax = c_max_period.
for both the above table program is taking very less time .... although both the table used in above queries have similar amount of data. And i can not remove the APPENDING CORRESPONDING. because i have to append the data after fetching from the tables. if i will not use it will delete all the data fetched earlier.
Thanks on advanced......
Sourabh -
Problem in the "select" query....Just check out and help me
Hi there !!
I am getting the following errors while trying to execute the "select" query from JSP page:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state
My code is :
String reg_no=(String)session.getAttribute("reg_no");
ResultSet rs=stmt.executeQuery("SELECT * FROM reg WHERE regno = "+reg_no);
(Note: the "regno" in the database is of numeric datatype)
Try to help me...
Thanx,
Ram.Just so everyone knows:
Ram Mohan joined the forum on 7-Sep-2003 and received
his 25 Dukes for joining.
Since then, he's posted three questions, each one
promising 5-10 Dukes, and never once awarded them.
His strategy seems to be to wave Dukes, ask his
hit-and-run question, and then bolt.
Answer his questions if you wish, but don't do it
expecting Dukes. - MODDuffy, you're getting just as cranky as I have. See what hanging around these forums does to oneself? :) -
Problem in Writing select * query in EJB
Hi all,
I'm writing select * from BIT_OEM in entity bean, but it is not validating the query saying this ==> EJB QL statement is invalid. See General User Output View for details.
And General User output View is not showing any error description..
pls help me with this..
regards,
AmeyHi,
Try to specify the column names instead of '*'.
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/EJBQL5.html
Regards
Ayyapparaj -
Hi.
here i have to make the code in exit_saplv56u_004 in include zxv56u11.
there are tables defined in itself.
i have written like this,but not sure about the table updation and the declaration part:
here i am writing this code in exit_sap
TABLES:VTTP,VTTK,LIKP,KNA1.
TABLES:ZOTC_SHPMNT_RTE.
DATA:x_vttp type vttpvb,
x_vttk type vttkvb,
X_LIKP TYPE LIKP,
X_KNA1 TYPE KNA1,
X_ZOTC_SHPMNT_RTE TYPE ZOTC_SHPMNT_RTE,
t_temp type vttk, feels that declaration iswrong
x_temp type vttk. this table andwork area will be used to finally update vttk table feilds
READ TABLE I_XVTTK INTO X_VTTK INDEX 1.
READ TABLE I_XVTTP INTO X_VTTP INDEX 1.
CLEAR X_LIKP.
SELECT SINGLE * FROM LIKP
INTO X_LIKP
WHERE VBELN = X_VTTP-VBELN.
IF SY-SUBRC = 0.
CLEAR X_KNA1.
SELECT SINGLE * FROM KNA1 i jus need 2-3 feilds so howcan i avoid the performance prob
INTO X_KNA1
WHERE KUNNR = X_LIKP-KUNNR.
IF SY-SUBRC = 0.
CLEAR X_TEMP.
SELECT SINGLE * FROM ZOTC_SHPMNT_RTE INTO table t_TEMP
WHERE SHTYP = X_VTTK-SHTYP
AND LAND1 = X_KNA1-LAND1
AND BLAND = X_KNA1-REGIO
AND ZONE1 = X_KNA1-LZONE.
IF SY-SUBRC = 0.
IF T_TEMP[] IS INITIAL.
READ TABLE T_TEMP INTO X_TEMP. i want to create a temp internal table
ELSE.
SELECT SINGLE * FROM ZOTC_SHPMNT_RTE INTO TABLE t_TEMP
WHERE SHTYP = X_VTTK-SHTYP
AND LAND1 = X_KNA1-LAND1
AND BLAND = X_KNA1-REGIO.
IF SY-SUBRC = 0.
READ TABLE T_TEMP INTO X_TEMP.
IF SY-SUBRC = 0.
MODIFY vttk FROM t_TEMP. here i want to modify the feilds like vttk-route and vttk-tdlnr
ENDIF.
ENDIF.
ENDIF.
endif.
endif.First declare a types structure with this 3 variables u want...
now declare a work area(X_KNA1) of this types structure.
And
SELECT SINGLE LAND1 REGIO LZONE FROM KNA1
INTO X_KNA1
WHERE KUNNR = X_LIKP-KUNNR. -
Problem with SImple Select Query
Hi
I am trying to write a simple Select SQL to a table and find out whether certain data exist or not. I have done this before but now for some reason this one is not working.
I started like this
select single * from ANLH where ANLN1 = rec-Asset
and BUKRS = Comp_Cd.
* Error Handler for non-existent empno in the database
if sy-subrc = 0 or rec-asset = ''.
rec_failed = 'T'.
concatenate 'Asset does not exist' rec-asset into asst_err.
endif.
when i debugged the code i found out that sy-subrc is returning 4 all the time. (i have passes some numbers in rec-Asset which i know doesn't exist in that table.
So i have modified the code to see if its pulling anything.
like this
select single ANLN1 into v_Asset from ANLH where ANLN1 = rec-Asset
and BUKRS = Comp_Cd.
* Error Handler for non-existent empno in the database
if sy-subrc = 0 or rec-asset = ''.
rec_failed = 'T'.
concatenate 'Asset does not exist' rec-asset into asst_err.
endif.
in debug v_asset is always empty (for real number and for the madeup number)
Please help.
Thanks
Edited by: Anwarul Kabir on Apr 3, 2008 9:27 PM
Edited by: Anwarul Kabir on Apr 3, 2008 9:29 PM
Edited by: Anwarul Kabir on Apr 3, 2008 9:30 PMThanks for the answer. But i thought i was doing the same. Anyway I replaced my code with yours but result is the same. I also did this
select single
ANLN1 into v_Asset
from ANLH where
ANLN1 = '20000544'
and BUKRS = '3000'.
I did SE11 and entered the table name and i can see that data.
but on my code i get sy-subrc=4 and v_Asset is blank
again i tried with this madeup number which i know its not in the table
select single
ANLN1 into v_Asset
from ANLH where
ANLN1 = '2056555433544'
and BUKRS = '3000'.
Get sy-subrc=4 and v_Asset is blank...
Is there anything special about the Table? -
Performance Problem in Select query
Hi,
I have performance Problem in following Select Query :
SELECT VBELN POSNR LFIMG VRKME VGBEL VGPOS
FROM LIPS INTO CORRESPONDING FIELDS OF TABLE GT_LIPS
FOR ALL ENTRIES IN GT_EKPO1
WHERE VGBEL = GT_EKPO1-EBELN
AND VGPOS = GT_EKPO1-EBELP.
as per trace i have analysed that it is fetch the complete table scan from the LIPS table and table contants almost 3 lakh records.
Kindly Suggest what we can do to optimize this query.
Regards,
Harshtypes: begin of line,
vbeln type lips-vbeln
posnr type lips-posnr
lfimg type lips-lfimg
vrkme type lips-vrkme
vgbel type lips- vgbel
vgpos type lips-vgpos
end of line.
data: itab type standard table of line,
wa type line.
IF GT_EKPO1[] IS NOT INITIAL.
SELECT VBELN POSNR LFIMG VRKME VGBEL VGPOS
FROM LIPS INTO TABLE ITAB
FOR ALL ENTRIES IN GT_EKPO1
WHERE VGBEL = GT_EKPO1-EBELN
AND VGPOS = GT_EKPO1-EBELP.
ENDIF. -
Oracle SQL Select query takes long time than expected.
Hi,
I am facing a problem in SQL select query statement. There is a long time taken in select query from the Database.
The query is as follows.
select /*+rule */ f1.id,f1.fdn,p1.attr_name,p1.attr_value from fdnmappingtable f1,parametertable p1 where p1.id = f1.id and ((f1.object_type ='ne_sub_type.780' )) and ( (f1.id in(select id from fdnmappingtable where fdn like '0=#1#/14=#S0058-3#/17=#S0058-3#/18=#1#/780=#5#%')))order by f1.id asc
This query is taking more than 4 seconds to get the results in a system where the DB is running for more than 1 month.
The same query is taking very few milliseconds (50-100ms) in a system where the DB is freshly installed and the data in the tables are same in both the systems.
Kindly advice what is going wrong??
Regards,
PurushothamSQL> @/alcatel/omc1/data/query.sql
2 ;
9 rows selected.
Execution Plan
Plan hash value: 3745571015
| Id | Operation | Name |
| 0 | SELECT STATEMENT | |
| 1 | SORT ORDER BY | |
| 2 | NESTED LOOPS | |
| 3 | NESTED LOOPS | |
| 4 | TABLE ACCESS FULL | PARAMETERTABLE |
|* 5 | TABLE ACCESS BY INDEX ROWID| FDNMAPPINGTABLE |
|* 6 | INDEX UNIQUE SCAN | PRIMARY_KY_FDNMAPPINGTABLE |
|* 7 | TABLE ACCESS BY INDEX ROWID | FDNMAPPINGTABLE |
|* 8 | INDEX UNIQUE SCAN | PRIMARY_KY_FDNMAPPINGTABLE |
Predicate Information (identified by operation id):
5 - filter("F1"."OBJECT_TYPE"='ne_sub_type.780')
6 - access("P1"."ID"="F1"."ID")
7 - filter("FDN" LIKE '0=#1#/14=#S0058-3#/17=#S0058-3#/18=#1#/780=#5#
8 - access("F1"."ID"="ID")
Note
- rule based optimizer used (consider using cbo)
Statistics
0 recursive calls
0 db block gets
0 consistent gets
0 physical reads
0 redo size
0 bytes sent via SQL*Net to client
0 bytes received via SQL*Net from client
0 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
9 rows processed
SQL> -
Select query differences between oracle 9 and oracle 8.
Hi,
I have a problem using the select query between oracle 7 and oracle 9i I don't have the same result :
ex:
With oracle7
SQL> select 'champ1','champ2' from DUAL;
'CHAMP 'CHAMP
champ1 champ2
With Oracle 9
SQL> select 'champ1','champ2' from DUAL;
'CHAMP1' 'CHAMP2'
champ1 champ2
So Can someone tell me how to solve this problem ? Is there a parameter in oracle 9 to set?
Thanx.Whenever you are posting anything over internet forums like this - you should be very careful about not just posting the details which requires to solve the problem - also should be sensible about your question.
This is not at all desired when you are posting such question. It may be because - you may not well aware of the fact.
My suggestion is -> First Go through the basics Of SQL in general.
Then go for any specific product like Oracle/ SQL Server/ Sybase etc.
And, finally learn the advanced commands of that DB.
You asked it - may be you thought the difference in output in terms of lines. But, that is not your actual output. That is the graphical display part only.
Anyway,
You can get the quite familier output by first type the following command ->
set lin 310Regards.
Satyaki De. -
Select Query issue. a% and A % both should work.
hi,
I have to selet records from database table based on local variable values.
Loal variable - Lv.
If lv = 'a*' then i have to select all records which starts with a.
I have Replaced all occurences of * with % and then i have used a select query :
select F1 from <table>
into table <internal table>
where C1 like lv.
Now problem is this select query picks values which are like a% not like A%.
I want to select all values whether it starts with a or A.
How to proceed ?hi,
Thanks for your reply.
But one problem.
You said :
Looks like your WHERE CLAUSE field C1 is a case sensitive field which means a and A* are treated differently. Build your query as WHERE C1 LIKE 'a%' OR C1 LIKE 'A%'.*
where class field C1 is Case senstive - What does it mean ? Can i change the field to make it case insensitve ?
Secondly, I may write conditon like you mentioned : like a% or like A% but the problem is value is in variable lv.
And lv can contain Ab% or aaB%. then your provided solution wont work.
Any other inputs ? -
Hi guys
i am getting problem in my select query which is creating one long string, it is working fine without order by but when i run this with order by it get hanged. this query using on function to concatenate multiple strings in one string as well
Please help me what i am doing wroing.
select
regexp_substr(pe.emp_id,'[0-9]+$') ||'|'||
p.title ||'|'||
cdt.text||'|'||
j.tit||staff_pcb.host_pub_tit ||'|'||
jou.vol ||pcb.vol||pcp.vol ||'|'||
jou.journal_number||'|'||
substr (jou.pages||pcb.pages||pcp.pages, 1, instr (jou.pages||pcb.pages||pcp.pages, '-')-1)||'|'||
substr (jou.pages||pcb.pages||pcp.pages, instr (jou.pages||pcb.pages||pcp.pages, '-')+1)||'|'||
pcb.st||jou.st||pcp.st||'|'||
concat_aut(p.id)
from pub p,journal j,caa c,person pe,class_t cdt,
(select pcj.pub_id,pcj.vol,pcj.pages,pcja.st
From pub_C_j_a pcja,pc_j pcj
where pcja.pub_c_j_id = pcj.pub_id)jou,
(select pcb.pub_id,pcb.host_pub_tit,pcb.pages,pcb.vol,pcba.st
From pub_c_b pcb,pub_c_b_a pcba
where pcba.pub_c_b_id = pcb.pub_id)pcb,
(select pcp.pub_id,pcp.vol,pcp.pages,pcpa.st
From pub_c_p pcp,pub_c_p_a pcpa
where pcpa.pub_c_p_id = pcp.pub_id)pcp,
where
p.id = c.pub_id
and c.person_id = pe.id
and p.t_c_id = cdt.c_id
and p.journal_id = j.id(+)
and p.id = jou.publication_id(+)
and p.id = pcb.publication_id(+)
and p.id = pcp.publication_id(+)
and substr(regexp_substr(pe.emp_id,'[0-9]+$'),1,2) in('77','78')
and pcb.st||jou.st||pcp.st='1' order by pe.emp_id
;Not sure about why it's only hanging on order by but looks like your query causing full table scan because of this in WHERE clause:
and pcb.st||jou.st||pcp.st='1'
I would change it to something like:
and ((pcb.st='1' and jou.st = '' and pcp.st = '') or (jou.st='1' and pcb.st = '' and pcp.st = '') or (pcp.st='1' and jou.st = '' and pcb.st = '') ) -
Wrong record reterived by select query
Hi,
I am facing crictical problem in my select query.
select distinct a.name,
b.DESC_TEXT,
max(d.START_DT),max(d.ver_num)
from Siebel.S_PROD_INT a,
S_ISS_SUB_OBJ b,
S_VOD c,
s_vod_ver d
where
c.OBJECT_NUM=a.CFG_MODEL_ID
and c.Row_id=b.VOD_ID
and d.vod_id=c.Row_id
and d.VOD_id=b.VOD_id
and a.DESC_TEXT like '%CAP%'
and d.start_dt is not null and a.name like 'TSR9010492/32000%'
group by a.LAST_UPD,b.DESC_TEXT,a.desc_text,a.name
Actual Result (wrong):
Name, desc_text, start_dt, ver_num
TSR9010492/32000, A190042010, 21-04-10, 3
TSR9010492/32000, A19042010, 21-04-10, 3
Expected Result:
Name, desc_text , start_dt, ver_num
TSR9010492/32000, A19042010, 21-04-10, 3
Above query reterived wrong version (2 version) record as mentioned Bold in actual result.
Please help me, let u know.
Thanks.
Edited by: user9522927 on Apr 21, 2010 2:10 AMHi,
Try to execute the below query and check logically (data residing in columns) makes the selections for both records
and make changes to ur query. As we can't know your DB information and we can predict..
select c.OBJECT_NUM,a.CFG_MODEL_ID,c.Row_id,b.VOD_ID,d.vod_id,b.VOD_id,d.start_dt,a.name
from Siebel.S_PROD_INT a,
S_ISS_SUB_OBJ b,
S_VOD c,
s_vod_ver d
where
c.OBJECT_NUM=a.CFG_MODEL_ID
and c.Row_id=b.VOD_ID
and d.vod_id=c.Row_id
and d.VOD_id=b.VOD_id
and a.DESC_TEXT like '%CAP%'
and d.start_dt is not null and a.name like 'TSR9010492/32000%'
and a.name in ('TSR9010492/32000','TSR9010492/32000')HTH
- Pavan Kumar N
ORACLE 9i/10g - OCP
http://www.oracleinternals.blogspot.com -
Hai,
I have problem in my select query,
My previous select query:
SELECT rrcty
ryear
rbukrs
rzzpspid
SUM( hslvt )
SUM( hsl01 )
SUM( hsl02 )
SUM( hsl03 )
SUM( hsl04 )
SUM( hsl05 )
SUM( hsl06 )
SUM( hsl07 )
SUM( hsl08 )
SUM( hsl09 )
SUM( hsl10 )
SUM( hsl11 )
SUM( hsl12 )
SUM( mslvt )
SUM( msl01 )
SUM( msl02 )
SUM( msl03 )
SUM( msl04 )
SUM( msl05 )
SUM( msl06 )
SUM( msl07 )
SUM( msl08 )
SUM( msl09 )
SUM( msl10 )
SUM( msl11 )
SUM( msl12 )
FROM zzsl5t
INTO TABLE it_erbproj
WHERE rldnr EQ c_rldnr AND
rrcty EQ c_rrcty AND
ryear EQ v_srr_fyear AND
rbukrs EQ v_srr_ccode AND
racct EQ v_racct AND
rzzpspid IN r_zzpspid
GROUP BY RRCTY ryear RBUKRS rzzpspid.
now i want change the above select query as,
If user enters input period 03 means,
i have to select
SELECT rrcty
ryear
rbukrs
rzzpspid
SUM( hslvt )
SUM( hsl01 )
SUM( hsl02 )
SUM( hsl03 )
SUM( mslvt )
SUM( msl01 )
SUM( msl02 )
SUM( msl03 )
only, not to select all the periods.
how can i give fields dynamically.
please suggest me.
ElamaranDuplicate message. Please close this one and look at my answer Doubt in Select query.
-
Issue with select query join....
Hello,
I am facing a problem with a select query. I get a message that itab_data is not long enough.
DATA: itab_data like ptrv_head occurs 0 with header line.
SELECT * from PTRV_HEAD
as a inner join PA0002 as b
on a~pernr = b~pernr
inner join PA0001 as c
on a~pernr = c~pernr
INTO TABLE itab_data
where a~PERNR in S_PERNR
and a~REINR in S_TRIP
and a~ZLAND in S_LAND
and a~DATV1 in S_BEGIN
and a~DATB1 in S_END
and b~NACHN in S_FIRST
and b~VORNA in S_LAST
and c~BUKRS in S_BUKRS
and c~KOSTL in S_KOSTL
and c~PERSG in S_EMPGP
and c~PERSK in S_SUBGP
and c~begda in ldbbegda
and c~endda in ldbendda.
Regards,
Jainam.
Edited by: Jainam Shah on Mar 27, 2009 4:13 PM
Edited by: Jainam Shah on Mar 27, 2009 4:13 PMHi,
Try this..
DATA: t_dfies TYPE STANDARD TABLE OF dfies.
DATA: t_fields TYPE STANDARD TABLE OF char40.
DATA: s_dfies TYPE dfies,
s_fields TYPE char40.
* Get the fields
CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = 'PTRV_HEAD'
TABLES
dfies_tab = t_dfies[]
EXCEPTIONS
not_found = 1
internal_error = 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.
* Build the fields to be selected.
LOOP AT t_dfies INTO s_dfies.
CONCATENATE 'A~' s_dfies-fieldname INTO s_fields.
APPEND s_fields TO t_fields.
CLEAR: s_fields.
ENDLOOP.
* Select.
SELECT (t_fields) from PTRV_HEAD
Thanks
Naren
Maybe you are looking for
-
Samsung running on 3g won't switch to 4g?
Was wondering if anyone had an issue with the samsung start on 4g, then go 3g and never go back to 4g? Doesn't it look like there is good signal for the LTE? Channel: 119 P_REV Indicator: 6 PRL ID: 15010 Band Class Type: 0 ERI Version: 5 Dorm
-
I recently installed the fonts that ship with CS5 Web Premium. These are located in Content dvd in the Goodies>Fonts folder. the Open Type fonts look fine but all True Type fonts are pixelated...like the font isn't really there? Can anyone advise?
-
My computer froze and it was necessary to use the 'apple c' while starting up with the osx install discs. Once everything was restored (the computer only used 2/5 install discs), my safari will not respond. I am unsure what to do.
-
Indesign CC doesn't find and highlight links when trying to relink!!
I was so excited to see all the customizable options in my new InDesign CC, until I tried to relink a file from the links palette and CC doesn't find and highlight the file anymore like it used to do with 4 and 5!! As a prepress operator dealing with
-
Is there a way to document File Heirchy in finder?
I need to document file locations (in text document format) and I am wondering if there is a way to do it through finder or another application so I don't have to do it manually.