2008 Jul 16 12:46 PM
Hello!
I have the following problem.
I built a function with the INFOTYP and PERNR as Import parameters.
regarding to the infotyp i define my structure
DATA:
wa_line TYPE REF TO data,
FIELD-SYMBOLS:
<wa> TYPE ANY.
CREATE DATA wa_line TYPE infotyp '' which is e.g p0001
ASSIGN wa_line->* TO <wa>.So if i Import the infotyp "p0001" i have a structure now <wa> with type of p0001.
Now i want to fill this structure with data.
Of course its not possible to say <wa>-pernr, because during compile time <wa> is no structure.
I tried to use
move-corresponding pernr to <wa>but this is not working as well because you can't move a single data into a structure
move pernr to <wa>didn't work as well
Is there a way to add data into an dynamic created structure?
greets thomas
2008 Jul 16 12:49 PM
hi,
use this code.
ASSIGN COMPONENT 'PERNR' OF STRUCTURE <wa> TO <fs_field>.
now, assign values to <fs_field> and it will reflect on <wa>-pernr.
regards,
Peter
hi,
use this code.
ASSIGN COMPONENT 'PERNR' OF STRUCTURE <wa> TO <fs_field>.
now, assign values to <fs_field> and it will reflect on <wa>-pernr.
regards,
Peter
2008 Jul 16 12:49 PM
hi,
use this code.
ASSIGN COMPONENT 'PERNR' OF STRUCTURE <wa> TO <fs_field>.
now, assign values to <fs_field> and it will reflect on <wa>-pernr.
regards,
Peter
2008 Jul 16 12:50 PM
hi Thomas,
it only works like this:
FIELD-SYMBOLS : <field> TYPE ANY.
ASSIGN COMPONENT 'PERNR' OF structure <wa> TO <field>.
<field> = '00000001'.you have to repeat the ASSIGN for each field you want to give value.
hope this helps
ec
2008 Jul 16 1:16 PM
ok, one things is now not clear for me...
to be sure, lets say i have a import variable of the function named gc_pernr
this variable i want to assign to my structure <wa> to the field 'PERNR'
how can i handle this?
<wa> is my dynamic structure with no values so far.
now i want to assign the variable gc_pernr to <wa>-pernr?
(something like assign gc-pernr to component 'PERNR' of structure <wa> i know thats not an valid code but i think it shows what i want to do)
2008 Jul 16 1:23 PM
do you mean in gc_pernr you have a value (an employee number) and you want <wa>-pernr to have this value? If yes, just follow my code in my first comment, but replace the last line:
<field> = gc_pernr.
2008 Jul 16 1:26 PM
As Eric said in the previous reply
FIELD-SYMBOLS : <field> TYPE ANY.
ASSIGN COMPONENT 'PERNR' OF structure <wa> TO <field>.
<field> = gc_pernr. "<<<<
a®
2008 Jul 16 1:29 PM
ah ok, now i understand
the field symbol reflects the value back, that was the hint i missed
thanks!
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |