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
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
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