Skip to Content
avatar image
Former Member

Validation on company Code

Hi Experts,

I have a requirement in which I am giving a select option for the company code field,which is from t001-bukrs.Based on the validation result , i have to proceed in the program flow.

Now I have to write a code to validate the entered company code.If say user enter company code from 1 to 50 and out of this,say only 1,2,3 and 49 are valid,so i have to process only these and rest all(3-48 and 50) should be shown as invaild company code with the no.

Please give me the logic as soon as possible.

Thanks a lot.

Krishan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jun 18, 2008 at 01:10 PM

    You can fire a select query on the table T001 with the select option and get the data in an internal table. This table will only have the valid "Company Codes"...

    select bukrs

    into table t_bukrs

    from T001

    where bukrs in s_bukrs

    where s_bukrs is a select option for company code.

    Now the table t_bukrs will have the Valid Company Codes and this table can be used for Further Processing.

    Regards,

    Aj

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Abhishek Jolly

      Hi Abhishek,

      Thanks a lot for your helpful suggestion.

      But my requiement is like that only. Company code can have a range of values.

      condtion expected result

      1 Input improper company Error to be prompted as

      code Invalid Company code

      2 Input one improper company Error to be prompted for one

      code in the range company code only.The rest

      to be processed successfully.

      Please help me in this scenario.

      Regards

      Krishan