cancel
Showing results for 
Search instead for 
Did you mean: 

doubt how to write company code condition in excel sheet..

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi amit,

thanks for ur reply.but i have doubt that does it work for inbound also?my file will be going to forward to inbound control..

plz help me

thanks

Former Member
0 Kudos

yes bhanu..it will work

amit

Former Member
0 Kudos

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