‎2007 May 15 9:28 AM
I found a record in the lips table with the parameters given below. Why this query is not fetching any value from the table. Please help me to resolver this issue.
SELECT vbeln
posnr
vgbel
vgpos
FROM lips
INTO TABLE lt_lips
WHERE VGBEL = '170000122'
AND VGPOS = '100'.
‎2007 May 15 9:41 AM
Hi,
Try with this
SELECT vbeln
posnr
vgbel
vgpos
FROM lips
INTO TABLE lt_lips
<b>WHERE VGBEL = '0170000122'
AND VGPOS = '000100'.</b>
-
Patil
‎2007 May 15 9:37 AM
could anyone tellme what is the problem to retrieve. I am not using select single and also i am not refering to the primary keys of the table. Please help me to resolve this issue.
Relevant answers will be highly rewarded...
______________________________________________________
Ramineni
‎2007 May 15 9:37 AM
Hai,
i also faced the same problem like this,then i changed the query to
select * from table into table it_table of table where condition.
try this.
‎2007 May 15 9:41 AM
Hi,
Try with this
SELECT vbeln
posnr
vgbel
vgpos
FROM lips
INTO TABLE lt_lips
<b>WHERE VGBEL = '0170000122'
AND VGPOS = '000100'.</b>
-
Patil
‎2007 May 15 9:47 AM
‎2007 May 15 9:47 AM
OMG you always will get an error like this.
EIther do
SELECT vbeln
posnr
vgbel
vgpos
FROM lips
INTO
**START INSERT**
Corresponding fields of
**END INSERT**
TABLE lt_lips
WHERE VGBEL = '170000122'
AND VGPOS = '100'.
or do it like this:
Data: lv_vbeln type vbak-vbeln,
lv_posnr type vbap-posnr,
lv_vbgel type vbak-vbeln,
lv_vgpos type vbap-posnr.
SELECT
**START INSERT**
SINGLE
**END INSERT**
vbeln
posnr
vgbel
vgpos
FROM lips
**START INSERT**
INTO (lv_vbeln, lv_posnr, lv_vgbel, lv_vgpos )
**END INSERT**
WHERE VGBEL = '170000122'
AND VGPOS = '100'.
if you are selecting Single fields out of a database table you HAVE to use INTO CORRESPONDING FIELDS OF, when you want to move them ot a structure or an internal table.
there´s no way round it, besides declaring yourself a structure containing just THOSE fields.
Message was edited by:
Florian Kemmer
‎2007 May 15 10:04 AM
the query which i had posted above is working fine if i pad 0's . But i want to replace this charecter set with a work area variable. i mean to say like the following query:-
SELECT vbeln
posnr
vgbel
vgpos
FROM lips
INTO TABLE lt_lips
WHERE VGBEL = wa_disp-vbeln
AND VGPOS = wa_disp-posnr.
‎2007 May 15 10:09 AM
‎2007 May 15 10:19 AM
thanks Santhosh...i had rewarded you and waiting for one more issue (what i had mentioned above)to be resolved.
‎2007 May 15 10:22 AM
try this..
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_disp-vbeln
IMPORTING
OUTPUT = wa_disp-vbeln.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_disp-posnr
IMPORTING
OUTPUT = wa_disp-posnr.
SELECT vbeln
posnr
vgbel
vgpos
FROM lips
INTO TABLE lt_lips
WHERE VGBEL = wa_disp-vbeln
AND VGPOS = wa_disp-posnr.
‎2007 May 15 10:25 AM
you can use the FM :for Conversion Exits which will add the necessary paddings that are required.
FM like CONVERSION_EXIT_ALPHA_INPUT may be useful.
Pass wa_disp-vbeln and wa_disp-posnr to the FM and save the output in a variable.
Then use these in your select query.
regards,
‎2007 May 15 10:28 AM