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

problem in string operations

Former Member
0 Likes
382

hi,

i am using module pool.in the first screen,i have two fields.in that one fielad is name field.i want to search the records with any charecter given in that field.i used contains,but it is not working,following is the code i am using,can any body help me it is urgent.'

N = strlen( ZCOMM_ULT_PARENT-Z_CUP_NAME ).

SELECT Z_CUP_NAME FROM zcomm_ult_parent INTO TABLE ITAB.

LOOP AT ITAB.

  • IF ITAB-NAME+0(N) = ZCOMM_ULT_PARENT-Z_CUP_NAME.

IF ITAB-NAME CA ZCOMM_ULT_PARENT-Z_CUP_NAME.

MOVE ITAB TO ITAB1.

APPEND ITAB1.

CLEAR ITAB1.

ENDIF.

ENDLOOP.

  • MESSAGE E002(Z_BALANCE_SCCARD).

if not itab1[] is initial .

select fz_cup_number fz_class_range_id f~z_class_type_id

fseqno fz_ind_sector f~z_cup_sub_class

p~z_cup_name from zcup_class as f

inner join zcomm_ult_parent as

p on fz_cup_number = pz_cup_number

into corresponding fields of table lt_zcupclass

for all entries in itab1 where Z_CUP_NAME = ITAB1-NAME.

ENDIF.

ENDIF.

ENDIF.

but it is not working.

2 REPLIES 2
Read only

Former Member
0 Likes
348

Hi ram,

Make the highlighted change:

LOOP AT ITAB.

<b>concatenate '' ZCOMM_ULT_PARENT-Z_CUP_NAME '' into lv_str.</b>

  • IF ITAB-NAME+0(N) = ZCOMM_ULT_PARENT-Z_CUP_NAME.

<b>IF ITAB-NAME CP lv_str.</b>

MOVE ITAB TO ITAB1.

APPEND ITAB1.

CLEAR ITAB1.

ENDIF.

ENDLOOP.

REgards,

Ravi

Read only

Former Member
0 Likes
348

Hi Ram,

Or you can directly do this at the select statement level itslef.

concatenate '%' ZCOMM_ULT_PARENT-Z_CUP_NAME '%' into v_zcupname.

SELECT Z_CUP_NAME FROM zcomm_ult_parent INTO TABLE ITAB

where Z_CUP_NAME like v_zcupname.

Regards,

Ravi