2009 May 21 9:36 AM
data: txt_sel type textpool occurs 20 with header line.
LOOP AT TXT_SEL
WHERE ID+1 EQ INP_SEL-SELNAME.
ASSIGN (TXT_SEL-ID+1) TO <PM_NAME>.
IF NOT <PM_NAME> IS INITIAL.
DSP_SEL-TEXT = TXT_SEL-TEXT+8.
somehow this part of the codes returns a serious error stating:
Offset specification "+1" is greater than or equal to field length ("1").
any advice?
Edited by: soo hing hoh on May 21, 2009 10:36 AM
Edited by: soo hing hoh on May 21, 2009 10:37 AM
Edited by: soo hing hoh on May 21, 2009 10:38 AM
2009 May 21 9:50 AM
Hi,
This problem is because of the statement
LOOP AT TXT_SEL
WHERE ID+1 EQ ...
Why are you coding as 'WHERE ID+1' ?
What does that signify? What is your objective of the where clause?
Regards,
Ankur Parab
2009 May 21 9:52 AM
Hi ,
In the Textpool first field ID is one character field (CHAR 1 ).
In the that case when you are assigning the You need to write like --
DATA: txt_sel TYPE textpool OCCURS 20 WITH HEADER LINE.
LOOP AT txt_sel
WHERE id+1 EQ inp_sel-selname.
ASSIGN (txt_sel-id+0) TO <pm_name>. " Instead +1 , use +0
IF NOT <pm_name> IS INITIAL.
dsp_sel-text = txt_sel-text+8.
Regards
Pinaki
2009 May 21 10:18 AM
*DATA: BEGIN OF TXT_SEL OCCURS 20,
ID(9),
TEXT(40),
END OF TXT_SEL.
data: txt_sel type textpool occurs 20 with header line.
LOOP AT TXT_SEL
WHERE ID+1 EQ INP_SEL-SELNAME. "HGC154389
WHERE ID EQ INP_SEL-SELNAME.
ASSIGN (TXT_SEL-ID+1) TO <PM_NAME>.
ASSIGN (TXT_SEL-ID) TO <PM_NAME>.
IF NOT <PM_NAME> IS INITIAL.
DSP_SEL-TEXT = TXT_SEL-TEXT+8.
now another error occured.
The data object "TXT_SEL" does not have a component called "TEXT".
i believe it is the declaration. the commented part of the delcaration is the initial way how i declare txt_-sel..but it has errors saying about the type doesnt match textpool type..
i posted that issue here yesterday and the solution i get from th forumers here is the delcaration im using now..
plz advice..
2009 May 21 10:23 AM
Hi,
You have declared TXT_SEL of type TEXTPOOL.
But it does not contain any component named 'TEXT'
So you are bound to get the error.
Regards,
Ankur Parab
2009 May 21 10:29 AM
Hi ,
Would you please check the following code - -
DATA: BEGIN OF txt_sel OCCURS 20,
id(9),
text(40),
END OF txt_sel.
*data: txt_sel type textpool occurs 20 with header line.
LOOP AT txt_sel
* WHERE ID+1 EQ INP_SEL-SELNAME. "HGC154389
WHERE id EQ inp_sel-text.
* ASSIGN (TXT_SEL-ID+1) TO <PM_NAME>.
ASSIGN (txt_sel-id) TO <pm_name>.
IF NOT <pm_name> IS INITIAL.
dsp_sel-text = txt_sel-text+8.
Regards
Pinaki
2009 May 21 10:36 AM
the same error occured like yesterday
The line type of "TXT_SEL" must be compatible with one of the types "TEXTPOOL".
2009 May 21 10:50 AM
Hi ,
Declare the table like - -
DATA: BEGIN OF txt_sel OCCURS 20,
ID type TEXTPOOLID ,
KEY type TEXTPOOLKY,
ENTRY type TEXTPOOLTX,
LENGTH type TEXTPOOLLN,
* id1(9),
text(40),
END OF txt_sel.
You can check the link -
[https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/howtocreateinternaltable+dynamically]
If still that issue is there you please Give me the entire code and you requirement,
I will try my level best to resole it.
Regards
Pinaki