Hi
i need help.iam working on excelsheet.The excel sheet has 50fields,one of the field is company code.my work is check the company code.it is more than 1 we are going to reject the file.here i write the code but i dont know how it works?why b'coz the excel file will be tranfer to inbound control..check the code give me helpful solution.the company code in the wxcel sheet is coloum 6.
IF wa_datatab-col06 > 1.
MESSAGE 'Company Code Rejected because It has More than One' TYPE
's'.
endif.
plz help me helpful answers will be rewarded.
thanks
two solutions -
1) u can only check this in the excel sheet instead of the program to decide if file has to be rejected or not. add one more column to the excel name it as "correct" then in the first value under this column write -
=IF(B2 > 1,"yes","no") "here B2 is cell corresponding to column B conataining Company codes.
after writing this formula just drag it til last so tht it will be applicable for all records in the file.
2) Start-of-selection.
perform read_file "write a perform to fetch data into Internal table Itab from file
loop at itab.
if itab-cocode GT '1'.
Stop.
endif.
endloop.
End-of-selection.
message e000(000) with 'File Rejected'.
reward if helpfull
amit
Add a comment