‎2009 Mar 19 7:11 AM
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.
‎2009 Mar 19 7:17 AM
Hi,
Before passing the value in selct query use conversion routine :
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = wa_src_prps
IMPORTING
OUTPUT = wa_src_prps.
Then pass this value. Hopefully ur problem should get resolved.
Regards,
Lalit
‎2009 Mar 19 7:14 AM
you will have to take the conversion routine for this field into account, are you doing so?
1. CONVERSION_EXIT_ABPSN_INPUT Format > Without Edition (Project Number / WBS Element Number)
2. CONVERSION_EXIT_ABPSN_OUTPUT Format > With Edition (Project Number / WBS Element Number)
Edited by: Micky Oestreich on Mar 19, 2009 8:14 AM
‎2009 Mar 19 7:16 AM
‎2009 Mar 19 7:15 AM
Hi,
Use:
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.
Check the suitable data in database table PRPS for data in where clause (for POSID).
Regards,
Tarun
‎2009 Mar 19 7:15 AM
Hi Deepthi,
The field posid is of length 24.
But ur passing value of shorter length to the work area
.Dont ignore any zeroes.Please add them if they are present.
Regards,
Lakshman
‎2009 Mar 19 7:15 AM
Hi,
If you check the domain of posid you'll see it has a conversion routine attached to it.
There is a chance that while you select query is being executed the format is different from the one entered. Try running the program in debugging mode ane check the value at runtime. If there is a difference then you will have to conert it using the function modules
CONVERSION_EXIT_ABPSN_INPUT or
CONVERSION_EXIT_ABPSN_OUTPUT
Hope this helps.
Regards,
Sachin.
‎2009 Mar 19 7:16 AM
hi,
fm: CONVERSION_EXIT_ABPSN_INPUT
CONVERSION_EXIT_ABPSN_OUTPUT
write PSPNR also in the where condition as it is the primary key and u are using select single
wa_src_prps sholud be of length 24.
SELECT SINGLE pbukr INTO lv_pbukr
FROM prps
WHERE
pspnr = '1252525' and "some value of pspnr
posid EQ wa_src_prps.
thanks
‎2009 Mar 19 7:16 AM
Hi,
For '3-3310-02-01-01-10-20' wbs-element ,there is no record ,so sy-subrc is 4.
‎2009 Mar 19 7:16 AM
Use conversion routine: CONVERSION_EXIT_ABPSN_INPUT for wa_src_prps.
pass wa_src_prps as input and get wa_src_prps as ouput.
Pass this wa_src_prps to the select query. u can fetch data.
Reg,
Sachin
‎2009 Mar 19 7:17 AM
Hi,
Before passing the value in selct query use conversion routine :
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = wa_src_prps
IMPORTING
OUTPUT = wa_src_prps.
Then pass this value. Hopefully ur problem should get resolved.
Regards,
Lalit
‎2009 Mar 19 7:20 AM
‎2009 Mar 19 7:22 AM
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.