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

Please help with data type declaration

Hi All,

I have declared a field as data type P, but only inside my ELSE condition i want to change it to data type C with a length of 20. Outside of this ELSE loop it should remain as P only.

Is it possible? & if yes how should i do it?

Await inputs.

Vivek

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 10:29 AM

    Hi Vivek

    Please use the syntax CREATE DATA which will help you to create the data varaibles dynamically. You can find more info. in SAP HELP.

    ~ Ranganath

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Ranganath,

      I have entered the code as mentioned by you in ELSE condition, the syntax check is ok, but the query on execution throws a dump & the error analysis reads

      Error Analysis:

      The first operand entered at CREATE DATA is not a data reference

      How to resolve this error?

      Vivek

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

    Declare another variable with type C and size 20.

    In ur Else condition copy ur value into another variable which is of type C and size 20.

    Perform ur operations on that Character variable in ur Else block.

    awrd points if helpful

    Bhupal

    Add a comment
    10|10000 characters needed characters exceeded

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

    Hi

    Vivek

    no it is not at all possible to declare one with variable with one type in one place and as anothre type in another place where as this type of declaration is only possible wih field string

    Add a comment
    10|10000 characters needed characters exceeded

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

    Hi Vivek,

    you can try defining two variables and use field-symbol to change pointer as you desired..

    Of course, you will not be able to use same variable, but data will be stored in 2 different variables,

    Regards,

    Mohaiyuddin

    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.