02-20-2012 1:51 PM
Hi experts,
in the below code at modify statement went to dump.
parameters : p_table LIKE dd02l-tabname.
DATA: va_ligne(2000) TYPE c.
DATA: BEGIN OF t_ligne OCCURS 0,
ligne(100),
ligne(30),
END OF t_ligne.
DATA: x031l_tab LIKE x031l OCCURS 0 WITH HEADER LINE.
LOOP AT x031l_tab.
CLEAR t_ligne.
READ TABLE t_ligne INDEX sy-tabix.
CHECK sy-subrc EQ 0.
va_ligne+x031l_tab-offset(x031l_tab-dblength) = t_ligne-ligne.
ENDLOOP.
MODIFY (p_table) CLIENT SPECIFIED FROM va_ligne.
va_ligne have the below values in the debugging,so went to dump
020 1002 09.05.2006 09.05.2006 IMP 14 RE01 Mr. GILARDIN FRANCOIS
help me out.
02-20-2012 2:15 PM
Have you considered reading and acting upon the information in the dump? SAP provides those and they're remarkably useful for figuring out where you code is bad.
In the meaning, you didn't assign a value to P_TABLE, and that client specified is useless since you haven't specified a client, so far as I can see.
02-20-2012 2:27 PM
P_TABLE is a selection-screen value.so what ever the table you are given there,that is the value of P-TABLE.
02-20-2012 5:17 PM
Hi,
at least you should assign a temporary working-area with compatible line-type.
like:
parameters : p_table LIKE dd02l-tabname.
DATA: va_ligne(2000) TYPE c.
DATA: BEGIN OF t_ligne OCCURS 0,
ligne(100),
* ligne(30),
END OF t_ligne.
DATA: x031l_tab LIKE x031l OCCURS 0 WITH HEADER LINE.
****----****----****----****----****
data: lo_tabl type ref to data.
field-symbols: <t_line>.
create data lo_tabl type (P_TABLE).
assign lo_tabl->* to <t_line>.
****----****-----****----****----****
LOOP AT x031l_tab.
CLEAR t_ligne.
READ TABLE t_ligne INDEX sy-tabix.
CHECK sy-subrc EQ 0.
va_ligne+x031l_tab-offset(x031l_tab-dblength) = t_ligne-ligne.
ENDLOOP.
* and then:
<t_line> = va_ligne.
MODIFY (p_table) from <t_line>.
That should do the trick. The worst to happe now, is a new entry created from trash.
Regards
Jörg