Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

LIKE operator

rnb86
Participant
0 Likes
1,520

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.

1 ACCEPTED SOLUTION
Read only

former_member194152
Contributor
0 Likes
1,020

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.

9 REPLIES 9
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
1,020

What is the value stored in lv_wbs_str2 and the value in table zwbs ?

Read only

0 Likes
1,020

Hi,

The valueof WBS in ZWBS is NS11.00128.01.01.01.

In the variable, it is without zeros.

Read only

0 Likes
1,020

you mean to say that

lv_wbs_str2 '%' = NS11%

or

lv_wbs_str2 '%' = NS11.128.1.1.1.%

??

Read only

0 Likes
1,020

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).

Read only

0 Likes
1,020

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%.

Read only

0 Likes
1,020

Gagan's suggestion is the way to do it.

Read only

former_member194152
Contributor
0 Likes
1,021

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.

Read only

Former Member
0 Likes
1,020

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.

Read only

0 Likes
1,020

Thanks for your inputs guys...appreciate it.

I have included logic for both the WBS with dots and without dots so it wont fail.