04-19-2006 11:09 AM - last edited on 02-04-2024 3:26 AM by postmig_api_4
Dear Friend,
I want to upload fields like Compny Code & Business Area of length 4 characters into SAP Tables. But in the excel sheet at some places Co Code & Business Area of length less than 4 characters is maintained which I want to ignore ie. those items should not be updated into the tables.
Plz guide me how this can b done, what code I shuld write for this.
Thanks,
Nishu
04-19-2006 11:12 AM
Hi,
You can condense the value after populating to table-field by
CONDENSE ITAB-FIELDNAME.
Later you can find out the field length using STRLEN.
if it is less than 4 then dont populate.
04-19-2006 11:12 AM
Hi,
You can condense the value after populating to table-field by
CONDENSE ITAB-FIELDNAME.
Later you can find out the field length using STRLEN.
if it is less than 4 then dont populate.
04-19-2006 11:15 AM
Hi Nishu,
There is no way you can validate the fields and their lengths before you ipload them into internal tables.
First you should upload them and then loop the intrenal table to delete such records.
loop at itab.
if strlen(itab-comp_code) < 4.
delete itab index sy-tabix.
endif.
endloop.
Regards,
Ravi