‎2012 Feb 29 11:21 AM
Hi Experts,
i have written a select on a table to fetch 4th level WBS elements. In the where clause, im passing the 3rd level WBS number. The query below:
data lv_wbs_str2 TYPE string.
lv_wbs_str2 = wa_znam_mrf-wbse+0(13).
CONCATENATE lv_wbs_str2 '%' INTO lv_wbs_str2.
SELECT wbse est_rfs_dt FROM zwbs
INTO TABLE it_check
WHERE wbse LIKE lv_wbs_str2
AND new_process = 'X'.This works fine in development. When i run this code in Quality, the select fails. In debugging, when i manually enter dots in the lv_wbs_str2 WBS variable, the select fetches values.
Any idea about the settings i need to do to automatically fetch the WBS from the table??
Thanks.
‎2012 Feb 29 11:37 AM
Hi,
WBS Element internally stored in numberic 8 value, its data element is "PS_POSNR" and it is using conversion routine ABPSP to convert this numeric value to charcter output of WBS element.
So like statement will not werks in this case because internally it is searching numeric value with character value so you have to follow some other approach like first get data of all WBS element into internal table then apply conversion routine changes and prepare final internal table and then work on it.
‎2012 Feb 29 11:27 AM
What is the value stored in lv_wbs_str2 and the value in table zwbs ?
‎2012 Feb 29 11:35 AM
Hi,
The valueof WBS in ZWBS is NS11.00128.01.01.01.
In the variable, it is without zeros.
‎2012 Feb 29 11:38 AM
you mean to say that
lv_wbs_str2 '%' = NS11%
or
lv_wbs_str2 '%' = NS11.128.1.1.1.%
??
‎2012 Feb 29 11:44 AM
Thanks Gagan for the reply.
Hi Keshav,
in the table the WBS is stored with dots. ex NS11.00128.01.01.01.
When i select this into itab, the dots dont come. it is stored in itab without dots. (itab name it_znam_mrf).
The variable lv_wbs_str2 is filled from the itab like this.
lv_wbs_str2 = wa_znam_mrf-wbse+0(13).
‎2012 Feb 29 11:46 AM
Thanks Gagan for the reply.
Hi Keshav,
in the table the WBS is stored with dots. ex NS11.00128.01.01.01.
When i select this into itab, the dots dont come. it is stored in itab without dots. (itab name it_znam_mrf).
The variable lv_wbs_str2 is filled from the itab like this.
lv_wbs_str2 = wa_znam_mrf-wbse+0(13).
original 4th level WBS in database table is NS11.00128.01.01.01
The third level WBS for the above WBS is --> lv_wbs_str2 = NS11001280101%.
‎2012 Feb 29 12:12 PM
‎2012 Feb 29 11:37 AM
Hi,
WBS Element internally stored in numberic 8 value, its data element is "PS_POSNR" and it is using conversion routine ABPSP to convert this numeric value to charcter output of WBS element.
So like statement will not werks in this case because internally it is searching numeric value with character value so you have to follow some other approach like first get data of all WBS element into internal table then apply conversion routine changes and prepare final internal table and then work on it.
‎2012 Feb 29 12:49 PM
Hi,
After fetching the data
Loop the itab.
inside the loop you have to use conversion routine
CONVERSION_EXIT_ABPSN_INPUT----Conversion routine for WBS element
append final internal table
endloop.
‎2012 Feb 29 12:51 PM
Thanks for your inputs guys...appreciate it.
I have included logic for both the WBS with dots and without dots so it wont fail.