on 01-10-2007 4:01 AM
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
Hi,
Upload the file into itab and check the same for your condition.
if the condition is not satisfied then delete the itab and display a message
Thanks
Shiva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi amit,
once again thank u for ur reply,i have one more doubt that I have to convert the data in the internal table to a certain format XXXXXX and need to perform mapping for the same.
I got stuck at a point were in i need to follow certain rules to achieve that format like
1. left justify character fields
2. right justify numeric values
3. right justify amount decimal point and 2 decimal places not to use commas and $ symbol.
4.Null values need to be blank.
Can anyone plz send me the code for the following rules as i have never worked on this kind of requirement.
Helpfull answers will be awarded.
thanks
User | Count |
---|---|
100 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.