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

Field Symbol

Hi all

Im using the follow code in a user exit to retrieve the text typed for a certain item of the transacatio ME51N.

.

.

field-symbols <ztext> type any " or

field-symbols <ztext2> type standard table.

assign ('(SAPLMMTE)gt_control') to <ztext>.

Even If I have data stored in the gt_control, When I check sy-subrc, I get sy-subrc <> 0 .

One of the field of this gt_control is a structure type mmpur_textlines where is in fact the data I need to test.

Something like: <ztext>-textlines-tdline must be <> 0 .

Any idea how can I do this !?

Many thanks.

Cristina

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 23, 2006 at 07:46 PM

    Hi,

    field-symbol <ztext> type should be gt_control. Otherwise though it fetches data, it doesn't recognize its data definition.

    Example:

    • Data declarations

    CONSTANTS: c_ vbak (14) type c value '(SAPMV45A)VBAK'.

    FIELD-SYMBOLS: < fs_vbak> type vbak.

    • Now we assign the field symbol to point to the VBAK structure which

    • is in SAPMV45A

    ASSIGN ( c_vbak) to < fs_vbak>.

    • Now we can perform coding based on the values in vbak

    IF < fs_vbak>- vkorg = 'FR01'.

    ENDIF.

    Thanks,

    Ramakrishna

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 24, 2006 at 01:07 PM

    Christina,

    did you try uppercase?

    assign ('(SAPLMMTE)GT_CONTROL') to <ztext>.

    might do better.

    And sure, it is true: The field-symbol should be of the same table type as GT_CONTROL. As this type is declared in the program, you could either copy it or use further assigns for the field(s) you want to use:

    <pre>

    field-symbols:

    <table> type table,

    <line> type any,

    <field> type any.

    • something like

    assign ('(SAPLMMTE)GT_CONTROL') to <table>.

    loop at <table> assigning <line>.

    assign component 'OBJECT'

    of structure <line> to <field>.

    write: / <field>.

    endloop.

    </pre>

    Note: GT_CONTROL is a 'deep' table containing subtables. Handle them if required the same way: untyped field-symbols for simple fields, tab-typed field-symbols for internal tables.

    Hope you get it running!

    Regards,

    Clemens

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 23, 2006 at 07:15 PM

    Sorry, the <ztext>-textlines-tdline must be <> ''.

    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.