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

uploading case problems

Former Member
0 Likes
639

Hi all,

I am uploading an excel file .Before uploading i need to check with another ztable ,if value of one field of excel sheet exist in ztable then i have to upload.

I am having a value in excel sheet which exists in ztable that means i have to upload. I have everything in ztable in upper case and in excel i have in lower case because of this the sy-subrc is not equal to zero and its not uploading.

can you suggest anything regarding this

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
520

Hi Kajol,

After uploading to the internal table, translate all the fields of the ITAB to UPPERCASE Using the Translate to uppercase syntax.

Then check with ur z table.

If helps reward.

Vasanth

4 REPLIES 4
Read only

Former Member
0 Likes
521

Hi Kajol,

After uploading to the internal table, translate all the fields of the ITAB to UPPERCASE Using the Translate to uppercase syntax.

Then check with ur z table.

If helps reward.

Vasanth

Read only

0 Likes
520

Hi,

The problem is that i have some records in upper and some in lower case.

Is there any way that i can make the selection i.e checking with ztable independent of case.

I have everything in z table in upper case.

No matter what the case of alphabets in excel sheet if it finds that value in ztable then it should upload.

Is there any solution for this.Pls do let me know

Read only

0 Likes
520

Just before you do your select statement, translate the field value to uppercase.

loop at itab.

transalate itab-field1 to upper case.

Select Single * from ztable
             where field1 = itab-field1.
if sy-subrc = 0.


endif.




endloop.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
520

Hi Kajol,

Consider you have uploaded the Excel file into an internal table <b>it_mara</b>.

And <b>matnr</b> is the field with which you want to check the DB Table

Then proceed this way.


LOOP AT it_mara.

  TRANSLATE  <b>it_mara-matnr</b> TO UPPER CASE.
  MODIFY     it_mara INDEX sy-tabix.
  
ENDLOOP.

Now the Internal table contains matnr in upper cases <i>irrespective of whether initially it was in lower case or upper case</i> . Then you can proceed with checking.

Regards,

AS.