Help in select single
hallow
i have erorr when i do this select what i miss
DATA: l_ennda TYPE endda,
emp_status TYPE stat2.
SELECT single endda stat2
FROM pa0000
INTO (l_endda , emp_status)
WHERE stat2 = 0
AND begda LE so_date-high
AND endda GE so_date-low.
the erorr is :
The list "(L_ENDDA" after "INTO" is not of the the form (f1, ...,fn),
or contains an undefined field. the form (f1, ...,fn), or contains an
undefined field. the form (f1, ...,fn), or contains an undefined field.
efined field. the form (f1,
reagrds
Hi Ricardo,
The error is coming because you have done one spelling mistake. In the declaration you have decalred 'l_ennda' but in the select statement you are using 'l_endda'.
Kindly copy the below select statement:
SELECT single endda stat2
FROM pa0000
INTO (l_ennda, emp_status)
WHERE stat2 = 0
AND begda LE so_date-high
AND endda GE so_date-low.
<b>Reward the point if reply is useful.</b>
Regards,
Gopal.
Similar Messages
-
Graphical mess-mapping help needed: select single segment from many
Hi All,
I am sending a standard PO IDOC from R/3 and converting it into a file before sending to 3rd party.
The IDOC used is ORDERS.
In this IDOC segment E1EDK14 gets repeated in R/3 and I want to use the value of 009th occurance (E1EDK14 009) to map my values.
When I look at XML, it looks as follows
<E1EDK14 SEGMENT="1">
<QUALF>014</QUALF>
<ORGID>AB1</ORGID>
</E1EDK14>
<E1EDK14 SEGMENT="1">
<QUALF>009</QUALF>
<ORGID>CD1</ORGID>
</E1EDK14>
<E1EDK14 SEGMENT="1">
<QUALF>013</QUALF>
<ORGID>AA</ORGID>
</E1EDK14>
<E1EDK14 SEGMENT="1">
<QUALF>011</QUALF>
<ORGID>GDE</ORGID>
</E1EDK14>
I need to get the ORGID value of 009th segment( i.e when QUALF (above) has value '009'.
I tried to put a simple if condition in mapping (if qualf = 009-->then get ORGID), but it does not work.
Can you help.
Many thanks
ShirinThanks Prakasu,
I tried it again, but it is picking the first segment value and not the 009th one.
Many thanks
Shirin
Edited by: Shirin K on Oct 24, 2008 10:56 AM
Edited by: Shirin K on Oct 24, 2008 11:00 AM -
Visual Composer 7.0.1 (EHP1) - Value Help only shows "Single Selection"
I tried to add a value help to a field that allows multiple selections. However, when I used the wizard through "Add Value Help" drop-down menu, I can only see one proposed selection - "Single selection". However this SAP help document (http://help.sap.com/saphelp_nw70/helpdata/en/b5/036d391f074f769e00602634ee9960/content.htm) mentioned about the "Multiple selection" option. What I can do to make this selection available?
I am using VC 7.0.1 (EHP1). Thanks for any helps in advance.
KellyHi
Are you using 'BI Query' as 'data Service'? & are you creating value help for variable? If Yes -
Create necessary variable as 'Multiple Single Options' in your BEx query & then create value help in VC. Then it will allow multiple options or interval values.
Regards
Sandeep -
Simple Select Single statment doubt : please help
Dear SAP,
One simple question !!
What happens, If I dont pass all the key values in select single statement.
which data would it bring, the first occurence in DB table ?????
Cont..
And what happens if, I use select single without passing all keys (missing POSNR) but using it in a loop and giving condition as posnr > 900000. does this always bring same values.
Please let me know. Thank you.
Regards
venkatHi
If you don't pass all key fields in SELECT SINGLE there will be multiple records for those condition and it fetches the first record
If you won't pass POSNR in a loop, then for a single doc there will be multiple items and always the first item only selected
if a value exists greater than 900000, then it may consider that value
<b>Reward points for useful Answers</b>
Regards
Anji -
ABAPer's ,
Does anyone can guide me to select single row only in ALV grid , without OO.Hello,
I did not get u.
But check the below code it may help u.
tables: mara.
TYPE-POOLS: SLIS.
data:repid like sy-repid.
data: itb type mara occurs 0 with header line,
IT_FIELDCAT TYPE STANDARD TABLE OF SLIS_FIELDCAT_ALV WITH HEADER LINE,
IT_LAYOUT TYPE SLIS_LAYOUT_ALV,
ITB1 TYPE MAKT OCCURS 0 WITH HEADER LINE.
selection-screen begin of block b.
parameters: p_matnr type matnr.
selection-screen end of block b.
select * from mara into table itb where matnr = p_matnr.
SELECT * FROM MAKT INTO TABLE ITB1 WHERE MATNR = P_MATNR.
repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'HANDLE_USER_COMMAND'
I_STRUCTURE_NAME = 'MARA'
IS_LAYOUT = IT_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = itb
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.
FORM HANDLE_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE
SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'.
CLEAR IT_FIELDCAT[].
IF RS_SELFIELD-FIELDNAME = 'MATNR'.
READ TABLE ITB1 INDEX RS_SELFIELD-TABINDEX.
WRITE: / ITB1-MAKTX.
ENDIF.
ENDCASE.
ENDFORM. "HANDLE_USER_COMMAND
Regards -
Error in Select single statement
Hi All,
Following is the statement and error message im getting:
Can anyone help me with this. I am not able to figure out whats wrong with this.
<b>select SINGLE *
from vbrk where vbeln eq iv_billno.</b>
<u>Error:</u>
The INTO clause is missing at SELECT, or the FROM addition at either DELETE, INSERT, MODIFY, or UPDATE is missing.
Thanks & Regards,
MeghaProgram always needs a work area to store the values retrived from your select statement. Either you declare that work area as TABLES: VBRK or DATA: wa_vbrk LIKE VBRK.
If you use the first option, then you don't need to do anything but it is an obsolete statement.
If you use the second option, then you should change your select statement as follows
SELECT SINGLE * FROM vbrk
INTO wa_vbrk
WHERE vbeln EQ iv_billno. -
Select Single * is not fetching all Data
Hi,
I have a peculiar problem, when i am extending the customer to a new company code, we are getting Dump saying 'ASSERTION_FAILED'
when i debugg i am geeting issue with following Code of a FM 'KNA1_SINGLE_READER'
IF NOT i_bypassing_buffer IS INITIAL.
*SELECT SINGLE * FROM kna1*
INTO o_kna1
WHERE kunnr = i_kunnr.
IF sy-subrc <> 0.
MESSAGE e300(vs) WITH 'KNA1' RAISING not_found.
ENDIF.
i am passing customer number (i_kunnr), this code is executed 2 times first time it is fetching all columns but second time it is only fetching customer number and no other information regarding customer. But in data base all information is present. Can any one help me in this.
Thanks a lot...
Reddy
Edited by: JAGAN MOHAN REDDY on Jun 2, 2010 11:30 AMHi Jagan,
It'll be helpful to others if you can please post how and what was done to resolve the issue.
Thanks!
Sandeep -
Problem in select single statement : its urgent
Dear ,
i written one select single stmt i.e
tables : ser03 .
SELECT SINGLE * FROM ser03
WHERE obknr = objk-obknr
AND bwart = '101'
AND shkzg = 'S'.
based on this select stmt their are 5 records in database table satisfying the select stmt where clause and this select stmt is picking the fourth record . why this record is picking forth record only even this 4th record is not most recently created record and nor old record this record is middle one if any one plz tell me . points must be given . to access most recently recreated record how to write select stmt. plz tell me .Hi,
hope this code will help you.
just added the mandt in the where condition.
SELECT SINGLE * FROM ser03
WHERE mandt = sy-mandt
AND obknr = objk-obknr
AND bwart = '101'
AND shkzg = 'S'.
reward if helpful,
teja. -
"SELECT SINGLE" is not working.
Hi all,
here i have one report. And in this i want just one row when my input material number match with my table material number this time if movement type is 131 then program will be terminated otherwise it's working but this coding is not working properly so can you please help me out.
My code is below .
data : matnr1 LIKE mseg-matnr,
bwart1 LIKE mseg-bwart.
loop at mseg.
SELECT SINGLE matnr bwart from mseg into (matnr1,bwart1) where matnr = matnr.
endloop.
if bwart1 = '131'.
MESSAGE 'DATA NOT FOUND FOR THIS SELECTION1' type 'I'.
SUBMIT ZPP_DAYWISE_MY_OWN VIA SELECTION-SCREEN AND RETURN .
LEAVE PROGRAM.
endif.
CLEAR matnr1.
CLEAR bwart1.there should be all key fields in where condition of SELECT SINGLE
here in select which matnr you are passing? selection screen of mseg-matnr?
loop at mseg.
SELECTmatnr bwart from mseg upto 1 rows into (matnr1,bwart1) where matnr = matnr. endselect.
endloop.
if bwart1 = '131'.
MESSAGE 'DATA NOT FOUND FOR THIS SELECTION1' type 'I'.
SUBMIT ZPP_DAYWISE_MY_OWN VIA SELECTION-SCREEN AND RETURN .
LEAVE PROGRAM.
CLEAR matnr1.
CLEAR bwart1.
endif.
Edited by: Sachin Bidkar on Feb 23, 2010 7:12 AM -
Hi experts,i have a query,plz help me.
can i use select single in the below condition.
crmd_link---table(key fields: guid_hi,guid_set)
crmd_cancel---table(key fields:guid)
SELECT SINGLE a~cancparty
a~canc_reason
INTO (l_canc_party,l_canc_reason)
FROM crmd_cancel AS a INNER JOIN crmd_link AS b
ON aguid = bguid_set
WHERE b~guid_hi = '32134241324'.
on the above statement can i use select single????????Hi Sravan,
You can use either of the following:
a) TRANSLATE : This command will change your 'T' to 'A' if its ZZXG1T. If its not, it will leave it as it is.
SELECT SINGLE * FROM T881 WHERE RLDNR = P_RLDNR.
DATA: WA_CHANGE(2) VALUE 'TA'.
TRANSLATE T881-TAB USING WA_CHANGE.
b) RELPACE : This too will perform the same function.
REPLACE 'T' WITH 'A' INTO T881-TAB.
The only difference between the two is that TRANSALTE replaces all occurances of a character with the one succeeding it in WA_CHANGE, while REPLACE will replace only the 1st occurance of the character.
Hope this helps,
Regards,
Madhur
NB: Please do award points if found helpful.
Message was edited by: Madhur Chopra -
Problem in SELECT SINGLE Query
Hi,
I am writing a small quesry in PS, Though the entry exist in database table PRPS, The sy-subrc is 4 for this query.Can u help me.
data : wa_src_prps like prps-posid.
start-of-selection.
wa_src_prps = '3-3310-02-01-01-10-20'.
DATA: lv_pbukr LIKE prps-pbukr.
CLEAR: lv_pbukr.
SELECT SINGLE pbukr INTO lv_pbukr
FROM prps
WHERE posid EQ wa_src_prps.
if sy-subrc = 0.
write:/5 wa_src_prps, lv_pbukr.
endif.hi,
DATA : wa_src_prps LIKE prps-posid.
START-OF-SELECTION.
wa_src_prps = '0-1000-0'.
" Conversion Routine for domain PS_POSID
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_INPUT'
EXPORTING
input = wa_src_prps
IMPORTING
output = wa_src_prps.
DATA: lv_pbukr LIKE prps-pbukr.
CLEAR: lv_pbukr.
SELECT SINGLE pbukr INTO lv_pbukr
FROM prps
WHERE posid EQ wa_src_prps.
IF sy-subrc = 0.
WRITE:/5 wa_src_prps, lv_pbukr.
ENDIF. -
Dear gurus
Below is my select statement. Im having problem with statement.
the problem is that the table vbfa have some entries like this
800 1400004654 10 3900012235 10 M 424,672.68
800 1400004654 10 3900012257 10 M 137,093.36
800 1400004654 20 3900012311 20 M 214,257.36
800 1400004654 30 3900012412 30 M 81,248.44
800 1400004654 30 3900012901 30 M 166,920.68
When the select statement is run it does not fetch the data of LINE number 2 and Line number 5
LOOP AT itab1.
SELECT SINGLE * INTO CORRESPONDING FIELDS OF wa_vbfa
FROM vbfa
WHERE vbelv = itab1-vgbel
AND posnn = itab1-vgpos
AND vbtyp_n = 'M'.
SELECT SINGLE * INTO CORRESPONDING FIELDS OF wa_vbrk
FROM vbrk
WHERE vbeln = wa_vbfa-vbeln
AND vbtyp = 'M'.
IF sy-subrc = 0.
itab1-lfimg = wa_vbfa-rfmng.
itab1-old_price = wa_vbfa-rfwrt.
MODIFY itab1.
ELSE.
ENDIF.
ENDLOOP.
Please Help
Regards
Saad NisarHello Saad,
The reason why you are not getting the 2nd and 5th entries is that, the where conditions vbelv, posnn and vbtyp_n matches for both the 1st and 2nd record where select will pick only the 1st record. The same way for 4th and 5th record. so its picking only 4th.
So to avoid this add even vbeln in the where condition of the select query
LOOP AT itab1.
SELECT SINGLE * INTO CORRESPONDING FIELDS OF wa_vbfa
FROM vbfa
WHERE vbelv = itab1-vgbel
AND posnn = itab1-vgpos
AND vbeln = itab1-field " Add the corresponding field here
AND vbtyp_n = 'M'.
SELECT SINGLE * INTO CORRESPONDING FIELDS OF wa_vbrk
FROM vbrk
WHERE vbeln = wa_vbfa-vbeln
AND vbtyp = 'M'.
IF sy-subrc = 0.
itab1-lfimg = wa_vbfa-rfmng.
itab1-old_price = wa_vbfa-rfwrt.
MODIFY itab1.
ELSE.
ENDIF.
ENDLOOP.
Vikranth -
Search help on select optionbased on other select ooption entered
hi,
I need to know search help for selection screen based on value entered in another select options
SELECT-OPTIONS : s_bukrs FOR bkpf-bukrs OBLIGATORY,
s_belnr FOR bkpf-belnr,
s_gjahr FOR bkpf-gjahr OBLIGATORY,
s_budat FOR bkpf-budat OBLIGATORY,
s_akont FOR lfb1-akont,
s_saknr FOR bseg-saknr. """"""""""
*PARAMETERS : p_akont type lfb1-akont.
here i need to get the vaues of s_akont based on values entered in s_bukrs,
In event at selection screeen for s_akont i am writing
SELECT a~bukrs
a~saknr
a~mitkz
b~txt50
FROM skb1 AS a
INNER JOIN skat AS b
ON asaknr = bsaknr
INTO CORRESPONDING FIELDS OF TABLE lt_skb1
WHERE bukrs IN s_bukrs
AND mitkz = 'K'
AND b~spras = 'EN'.
but not getting value of s_bukrs at this point of execution. I requir the fiels in select statement in F4 of s_akont.
what are the function modules to call and what is the way to do??
thanks..Check the below solution for your issue - The FM "'RS_SELECTIONSCREEN_READ" is used to get the S_BUKRS values. Even though the FM returns single values of the Select options ( Low & High ) it fits the requirement.As the trick part is...If user enters multiple values or even enters sign for select options, S_BUKRS itself will have the value. That's why we have If else S_BUKRS[] is initial and R_BUKRS. Let me know if you have any issues with the solution provided.
TABLES: bkpf, lfb1.
DATA lt_fieldvalues TYPE STANDARD TABLE OF rsselread.
DATA ls_fieldvalue TYPE rsselread.
DATA r_bukrs TYPE RANGE OF bkpf-bukrs.
DATA ls_bukrs LIKE LINE OF r_bukrs.
SELECT-OPTIONS: s_bukrs FOR bkpf-bukrs,
s_akont FOR lfb1-akont.
INITIALIZATION.
ls_fieldvalue-name = 'S_BUKRS'.
ls_fieldvalue-kind = 'S'.
ls_fieldvalue-position = 'LOW'.
APPEND ls_fieldvalue TO lt_fieldvalues.
ls_fieldvalue-name = 'S_BUKRS'.
ls_fieldvalue-kind = 'S'.
ls_fieldvalue-position = 'HIGH'.
APPEND ls_fieldvalue TO lt_fieldvalues.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_akont-low.
refresh r_bukrs.
clear ls_bukrs.
IF s_bukrs[] IS INITIAL.
CALL FUNCTION 'RS_SELECTIONSCREEN_READ'
EXPORTING
program = sy-repid
dynnr = '1000'
TABLES
fieldvalues = lt_fieldvalues.
IF NOT lt_fieldvalues[] IS INITIAL.
ls_bukrs-sign = 'I'.
READ TABLE lt_fieldvalues INTO ls_fieldvalue WITH KEY position = 'LOW'.
IF sy-subrc EQ 0.
ls_bukrs-low = ls_fieldvalue-fieldvalue.
ENDIF.
READ TABLE lt_fieldvalues INTO ls_fieldvalue WITH KEY position = 'HIGH'.
IF sy-subrc EQ 0.
ls_bukrs-high = ls_fieldvalue-fieldvalue.
ENDIF.
IF ls_bukrs-high IS NOT INITIAL.
ls_bukrs-option = 'BT'.
ELSE.
ls_bukrs-option = 'EQ'.
ENDIF.
if ls_bukrs-low is not initial or ls_bukrs-high is not initial.
APPEND ls_bukrs TO r_bukrs.
endif.
ENDIF.
ELSE.
r_bukrs[] = s_bukrs[].
ENDIF.
SELECT a~bukrs a~saknr a~mitkz b~txt50 FROM skb1 AS a
INNER JOIN skat AS b
ON a~saknr = b~saknr
INTO CORRESPONDING FIELDS OF TABLE lt_skb1
WHERE bukrs IN r_bukrs " Changed to r_burks
AND mitkz = 'K'
AND b~spras = 'EN'. -
Search help for selection screen field
Hi ,
steps for creating search help for a key field in selection screen..
tables is a userdefined from which the field is taken..
thxs,
vindhi,
c this.
REPORT ZXYZ_0002 .
data: dynfields type table of dynpread with header line.
data: return type table of ddshretval with header line.
selection-screen begin of block b1 with frame title text-001 .
selection-screen begin of line.
PARAMETERS: P_BUKRS type T001-BUKRS.
selection-screen comment 30(20) BUTXT for field p_bukrs.
selection-screen end of line.
selection-screen end of block b1.
at selection-screen output.
if butxt is initial.
select single butxt into butxt
from t001
where bukrs = p_bukrs.
endif.
at selection-screen on value-request for p_bukrs.
call function 'F4IF_FIELD_VALUE_REQUEST'
exporting
tabname = 'T001'
fieldname = 'BUKRS'
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P_BUKRS'
tables
return_tab = return
exceptions
field_not_found = 1
no_help_for_field = 2
inconsistent_help = 3
no_values_found = 4
others = 5.
read table return with key fieldname = 'P_BUKRS'.
Add it back to the dynpro.
dynfields-fieldname = return-retfield.
dynfields-fieldvalue = return-fieldval.
append dynfields.
Get the company code from db and add to dynpro
data: xt001 type t001.
clear xt001.
select single * into xt001
from t001
where bukrs = return-fieldval.
dynfields-fieldname = 'BUTXT'.
dynfields-fieldvalue = xt001-butxt.
append dynfields.
Update the dynpro values.
call function 'DYNP_VALUES_UPDATE'
exporting
dyname = sy-cprog
dynumb = sy-dynnr
tables
dynpfields = dynfields
exceptions
others = 8.
start-of-selection.
rgsds
anver
if hlped mark points -
Hi everyone,
I have the follwing two codes .The first one works fine but the second one gives me an error.
Please let me know what is the error.
1)The below code works fine
loop at itab.
select single * from zxyz
where zorder = itab-zorder.
if zxyz-id is initial.
endif.
endloop.
2)This one doesn't work
select single * from zac
where userid = sy-uname.
if sy-subrc eq 0.
endif.
Iam getting this error please let me know
The INTO clause is missing at select, or the from addition at either DELETE,INSERT,MODIFY OR UPDATE IS MISSING.
Thanks in advance.
DeepthiHi Deepthi,
You must declare either the table or an work area in your program.
You can do that with either of the below methods:
1. Tables: ZAC. (or)
2. Data: w_zac like ZAC.
Change your select statement to the following when you use the option 2:
select single *
from zac
into w_zac
where userid = sy-uname.
Hope this helps.
Regards,
Sumant.
Message was edited by: Sumant Sura
Maybe you are looking for
-
Partner bank field in Credit memo thru MIRO
Hi I am trying to post credit memo related to MM invoice in transaction MIRO. I am getting error select partner bank out of multiple partner bank but the field is not available for selection. The same is avaialable for input in invoice though. Not co
-
Doubt in Table Function?
Hi, I created a Table funtion. Its working fine. After processing every record, I am piping the record. Can we pipe bulk records (for ex: 50 records) ? Is there any advantange in pefromance? Thanks in advance. Thank you, Regards, Gowtham Sen
-
My Microsoft WSUS Update Services Issues/Event Viewer Service Issues
Hello, So yesterday I began investigating why my PC's that were pointed to the WSUS weren't recieveing patches for their particular group. I checked to make sure it was approved and the client was in my client group. When I went to continue my troubl
-
hi... I've installed flash CS4 without any problem. When I try to enter it, the program does'nt launch. I have an Acer Aspire with Windows Vista. Thank you. Sorry for my english.
-
Problems going into coverflow in ipod
my phone will also not go into landscape mode in safari or photos. this started to happen after i downloaded the latest version of itunes today. is this related somehow? is anyone else having trouble?