Skip to Content
avatar image
Former Member

In fox formula, how to define a variable which is Character String length 4

Hi Expert,

I want to define a variable in fox formula. This variable not the type of any characteristic or key figure in Agg Level. But a Character which length 4.

I tried below:

DATA XXX  TYPE STRING.

While that length is 2.

Is there any way to define the string length is 4?

Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Dec 31, 2014 at 08:04 AM

    Hi,

    As I know type STRING doesn't have a lenght (only maximum 255, or more in the latest BW versions).

    So you can't say STRING(4) in FOX.

    Do you need exactly 4 characters lenght ?

    For which purpose ? May be there is a workaround for it ...

    BR,

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      I think that there is a limitation in calling function modules in fox, you can't export string directly so change your logic and manage the string inside the FM and export in integer.

      Hope it helps

  • avatar image
    Former Member
    Jan 04, 2015 at 10:12 PM

    I just realize that when I use:

    DATA AST  TYPE STRING.


    Some time the length of AST is 2, some time the length is 3 because I saw another error message when I check another program, which use same type STRING, while the error message say:

    Length of Parameter ASTYP(000004) and variable AST(000003) are inconsistent.


    So I guess the type STRING is dynamic. I do not know which factor cause it think it should be 2 or 3...


    Can anyone advice?


    Thanks!


    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 12, 2015 at 12:28 PM

    Hi,


    DATA XXX  TYPE STRING.

    where XXX is string variable any length.


    but if you want to restrict a string to 4 characters, you can create an InfoObject (YYYY)  in BW with CHAR of length 4.Then use it accordingly


    DATA XXX TYPE YYYY.


    Wish that helps..


    Regards,

    Bishwajit


    Add comment
    10|10000 characters needed characters exceeded