Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 04:09 AM

    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
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 04:11 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.