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

Case sensitive problem

vallamuthu_madheswaran2
Active Contributor
0 Likes
450

Hi Friends,

I'm having a ztable, In that table has value like 'John Peter' ie mixed with caps and samll letters. how i pick the values in select query.

Thanks & Regards,

Vallamuthu.M

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
406

Hi,

here is a short sample code with EXEC SQL:


report  zsget_lfa1.
                                                                                types: begin of xl,
         lifnr     type lfa1-lifnr,
         name1     type lfa1-name1,
         stras     type lfa1-stras,
       end   of xl.
                                                                                data:  xsl type xl.
                                                                                parameters: xp_name1          type  lfa1-name1 default 'In*'.
parameters: xp_stras          type  lfa1-stras default '*Se*'.
                                                                                start-of-selection.
                                                                                translate  xp_name1        to  upper case.
     translate  xp_name1     using  '*%'.
     translate  xp_stras        to  upper case.
     translate  xp_stras     using  '*%'.
                                                                                EXEC SQL                     PERFORMING  list.
       SELECT LIFNR, NAME1, STRAS
                              INTO  :xsl
                              FROM  LFA1
       WHERE  UPPER( NAME1 )  LIKE  :xp_name1
       AND    UPPER( STRAS )  LIKE  :xp_stras
     ENDEXEC.
                                                                                END-OF-SELECTION.
                                                                                FORM list.
                                                                                WRITE:                   /1  xsl-lifnr,
                                    xsl-name1,
                                    xsl-stras.
                                                                                ENDFORM.

Regards,

Klaus

2 REPLIES 2
Read only

Former Member
0 Likes
406

Hi,

Translate selection screen field value into uper case.

Fetch all data from Ztable and translate into upper case.

Using read table statement you can fetch the correct text.

TRANSLATE S_TEXT TO UPPER CASE.
           TRANSLATE ITAB-TEXT TO UPPER CASE.
           READ TABLE ITAB WITH KEY TEXT = S_TEXT

Thynaks and Regards,

Read only

Former Member
0 Likes
407

Hi,

here is a short sample code with EXEC SQL:


report  zsget_lfa1.
                                                                                types: begin of xl,
         lifnr     type lfa1-lifnr,
         name1     type lfa1-name1,
         stras     type lfa1-stras,
       end   of xl.
                                                                                data:  xsl type xl.
                                                                                parameters: xp_name1          type  lfa1-name1 default 'In*'.
parameters: xp_stras          type  lfa1-stras default '*Se*'.
                                                                                start-of-selection.
                                                                                translate  xp_name1        to  upper case.
     translate  xp_name1     using  '*%'.
     translate  xp_stras        to  upper case.
     translate  xp_stras     using  '*%'.
                                                                                EXEC SQL                     PERFORMING  list.
       SELECT LIFNR, NAME1, STRAS
                              INTO  :xsl
                              FROM  LFA1
       WHERE  UPPER( NAME1 )  LIKE  :xp_name1
       AND    UPPER( STRAS )  LIKE  :xp_stras
     ENDEXEC.
                                                                                END-OF-SELECTION.
                                                                                FORM list.
                                                                                WRITE:                   /1  xsl-lifnr,
                                    xsl-name1,
                                    xsl-stras.
                                                                                ENDFORM.

Regards,

Klaus