‎2007 Jul 28 4:31 AM
Hi sirs,
I have extract the WBS element for certain ASSET numbers, sample sql below. since objnr is not a primary key my sql is very slow, is there a way to convert an internal wbs number (anla-posnr) to a WBS element? because prps-pspnr is displayed differently from what is stored i cannot use it in my select statement
SELECT SINGLE * FROM anla.
IF sy-subrc = 0.
CONCATENATE 'PR' anla-posnr INTO objnr.
SELECT SINGLE * FROM prps WHERE objnr = objnr.
WBSelem = PRPS-POSID.
endif.
thanks in advance
‎2007 Jul 28 5:25 AM
Hi,
You can convert ANLA-POSNR to external WBS .
please check the conv routine CONVERSION_EXIT_ABPSP_OUTPUT
http://www.erpgenie.com/abaptips/content/view/363/62/
please check ANLA-POSNR domain its have conv,exit associated with it.
aRs
Points are always welcome
‎2007 Jul 28 4:58 AM
please aviod select *
select field1 field2 ...fieldn single into correspoing fields of table itab from dbtable.
‎2007 Jul 28 5:25 AM
Hi,
You can convert ANLA-POSNR to external WBS .
please check the conv routine CONVERSION_EXIT_ABPSP_OUTPUT
http://www.erpgenie.com/abaptips/content/view/363/62/
please check ANLA-POSNR domain its have conv,exit associated with it.
aRs
Points are always welcome
‎2007 Jul 28 8:25 AM
Please check at the domain of the WBS element. There will be conversion exita.
Double click on the conversion ext and you will see two FMs _INPUT & _OUTPUT.
This are for internal & external format conversion of WBS element.
Now you use according to the your requirement, example to convert from External to Internal for format use the FM ending with ---INPUT. The export parameter of this FM will be internal format.
Now regarding SQL optimization. Avoid select * <----use the specific field needed.
Also avoid using repeated SELECT statement from the same table. In such case, first option should always if possible --select the whole required records in a internal table.
SELECT <F1> <F2> INTO TABLE itab
FROM []
FOR ALL ENTRIES IN <>
WHERE <> = <>.
Regards,
A.Singh