Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Field-symbol table assignment

Former Member
0 Kudos
151

Hi,

I am trying to modify SAP data in a user exit before it gets posted.

I need to capture the data into a field symbol, modify the data and pass it back to program.

However I guess,am unable to define the correct field-symbol type in this case as my program is DUMPING:-(

For you reference I have attached my code below .

Data:lw_lfza(15)  TYPE c VALUE '(SAPMF02K)XLFZA',
<fs_lfza> type any table.

ASSIGN (lw_lfza) TO <fs_lfza>.

As you can see I am trying to assign the SAP table XLFZA to my field symbol <FS_LFZA> where I wish to modify it.

But this code only points the header values of XLFZA into <FS_LFZA> and not the whole table as expected.

Can you please help let me know what am I doing wrong.

I only want to get all the data(table) from (SAPMF02K)XLFZA to my field symbol table <FS_LFZA>.

Regards

RK

1 ACCEPTED SOLUTION

Former Member
0 Kudos
85

Hi

If you need to transfer tha data of internal table you have to the sign [], so:

  • This definition is wrong

*----->Data:lw_lfza(15) TYPE c VALUE '(SAPMF02K)XLFZA',

  • This right definition

Data:lw_lfza(15) TYPE c VALUE '(SAPMF02K)XLFZA[]',

<fs_lfza> type any table.

ASSIGN (lw_lfza) TO <fs_lfza>.

Max

6 REPLIES 6

Former Member
0 Kudos
86

Hi

If you need to transfer tha data of internal table you have to the sign [], so:

  • This definition is wrong

*----->Data:lw_lfza(15) TYPE c VALUE '(SAPMF02K)XLFZA',

  • This right definition

Data:lw_lfza(15) TYPE c VALUE '(SAPMF02K)XLFZA[]',

<fs_lfza> type any table.

ASSIGN (lw_lfza) TO <fs_lfza>.

Max

JoseMunoz
Active Participant
0 Kudos
85

Try with []

Data:lw_lfza(15) TYPE c VALUE '(SAPMF02K)XLFZA[]',

<fs_lfza> type any table.

ASSIGN (lw_lfza) TO <fs_lfza>.

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
85

Use Brackets.



Data:lw_lfza(15)  TYPE c VALUE '<b>(SAPMF02K)XLFZA[]</b>',
     <fs_lfza> type any table.

ASSIGN (lw_lfza) TO <fs_lfza>.



Regards,

Rich Heilman

Former Member
0 Kudos
85

Hello,

U can try like this.

DATA: BEGIN OF z_type_vedavb1.

INCLUDE STRUCTURE vedavb.

DATA: END OF z_type_vedavb1.

TYPES: z_table_vedavb1 LIKE z_type_vedavb1 OCCURS 0.

FIELD-SYMBOLS: FROM wa_xveda.

ENDIF.

ENDLOOP.

ENDIF.

Hope this will be useful for u.

Dön't forget to award points.

Former Member
0 Kudos
85

Hi rajiv,

1. Do like this , and it will work.

2. I just tried now.

3. In mycase, the program name, and table name is different,

so accordingly, change your code.

4. t001 is the record 1 i want to read.

*--- IMPORTANT VARIABLES

data : t001 like t001.

field-symbols : <F> type table.

data : varname(35) type c.

BREAK-POINT.

*----


ASSIGNMENT - NOTE []

varname = '(ZAM_TEMP00)T001[]'.

assign (varname) to <F>.

*----


READ RECORD 1 - WE CAN READ ANY

read table <F> into t001 index 1.

regards,

amit m.

Former Member
0 Kudos
85

Hi,

Tried the logic but realised I still am getting the short-dump.

The short dump message is

""You attempted to assign a field to a typed field symbol,

but the field does not have the required type.""

and my modified code is

lw_lfza(15)  TYPE c VALUE '(SAPMF02K)XLFZA[]'. ASSIGN (lw_lfza) TO <fs_lfza>. <fs_lfza> type table,

Any insghts?

Thanks and regards

RK