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

How to access to work area fields with a variable

Hi,

I need to access to work area fields but I dont know all the name of the fields in advance, cause I'm offering the possibility to the user to add fields in the application in the future.

wa_my-VARIABLE will definitely not work

I would like to know if its possible ?

Thanks !

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jul 18, 2011 at 01:42 PM

    ls_struc_fld should be an existing structure....

    ls_fieldname is of type string....

    i am just wondering that the user should add his filed in the exisitng structure at the dictionary level...

    <fs_STR> will be type any....

    and then you can use the below code.

    MOVE ls_struc_fld-fieldname TO ls_fieldname.

    ASSIGN COMPONENT ls_fieldname OF STRUCTURE <fs_STR> TO <fs_val>.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      I retrieve the fieldnames

      with a SELECT

      SELECT * FROM ZEXCELFIELDS INTO wa_excelfields WHERE optional = 'X' AND contract = 'C' ORDER BY fieldname.

      ENDSELECT.

      wa_excelfields-fieldname will content the fieldname.

      Thanks

      BA

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.