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: 

a serious problem with read textpool

Former Member
0 Kudos
254

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

7 REPLIES 7

former_member555112
Active Contributor
0 Kudos
147

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

Former Member
0 Kudos
147

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

0 Kudos
147

*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..

0 Kudos
147

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

0 Kudos
147

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

0 Kudos
147

the same error occured like yesterday

The line type of "TXT_SEL" must be compatible with one of the types "TEXTPOOL".

0 Kudos
147

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