2008 Oct 21 3:58 PM
I had a sollution in an user exit for goods movement to read the memory of the screen since I had to check the changed data before saving.
it works perfectly so now I thought I could also use it in a badi but somehow it doesn't work and it can't read the programm memory .
this was my code from the user exit of IW42
data: global_field_name(100).
data: artikel type structure occurs 0 with header line .
DATA: BEGIN OF gt_comp OCCURS 0.
INCLUDE STRUCTURE cowb_comp.
DATA: END OF gt_comp.
field-symbols : <fs> type any table,
<wa> type any.
clear global_field_name.
move '(SAPLCOWB)GT_COMP[]' to global_field_name.
assign (global_field_name) to <fs>.
* functie moet alleen werken indien het element alwaar terugmelding op gemaakt wordt een serviceorder is
* en via totale terugmelding IW42 wordt ingevoerd
if caufvd_tab-aufnr is not initial and sy-tcode EQ 'IW42'.
loop at <fs> assigning <wa>.
move <wa> to gt_comp.
if gt_comp-rsnum eq '0'.
message ID 'ZCS' type 'E' number '001'.
endif.
endloop.
which works fantastic
now I tried to translate it to the badi and it doesn't work at all. the error <fs> is not assigned is raised. somehow the trick is differently in a badi or in a method to read something from memory
the purpose is that I only need to perform the check when the status is set to AFSL
so I try to read the structure CNJ_STAT from memory which is the programm SAPLCJWB
data: h_error type string.
data: global_field_name(100).
data: gt_cnj_stat type table of cnj_stat.
field-symbols : <fs> type any table,
<wa> type any.
clear global_field_name.
move '(SAPLCJWB)gt_CNJ_STAT[]' to global_field_name.
assign (global_field_name) to <fs>.
if <fs> is not initial.
loop at <fs> assigning <wa>.
move <wa> to gt_cnj_stat.
endloop.
endif.
anybody got a clue what is wrong which the assignment ?
kind regards
arthur de smidt
2008 Oct 21 4:03 PM
Give the name of the TAB in the Upper Case. Try like:
move '(SAPLCJWB)GT_CNJ_STAT[]' to global_field_name.
Regards,
Naimesh Patel
Hi,
Please do it in this way.
FIELD-SYMBOLS: <FS> TYPE ANY.
ASSIGN(')SAPLCTJDW)PSTAB') TO <FS>.
Thanks,
Chidanand
2008 Oct 21 4:03 PM
Give the name of the TAB in the Upper Case. Try like:
move '(SAPLCJWB)GT_CNJ_STAT[]' to global_field_name.
Regards,
Naimesh Patel
2008 Oct 21 4:15 PM
nop that didn't work.
but I figured it out finally since I saw in debugging the global vars and the values of CNJ_STAT I saw that the defenition was a flat structure although I would have thouught a table would be the case.
so with this coding it works now
field-symbols : <fs> type any table,
<wa> type any.
clear global_field_name.
move '(SAPLCJWB)CNJ_STAT' to global_field_name.
assign (global_field_name) to <wa>.
thanks for the input
arthur
2008 Oct 21 4:04 PM
i can see here one
'(SAPLCJWB)gt_CNJ_STAT[]'
Try this way.use all caps.
'(SAPLCJWB)GT_CNJ_STAT[]'
2008 Oct 21 4:13 PM
Hi,
Please do it in this way.
FIELD-SYMBOLS: <FS> TYPE ANY.
ASSIGN(')SAPLCTJDW)PSTAB') TO <FS>.
Thanks,
Chidanand
2008 Oct 21 4:26 PM
why is that the way to do it Chidanand Chauhan ? is there a reference somewhere where the recomended coding is described ??
kind regards
arthur de smidt
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |