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: 

Syntax Error with Offset assignments

Former Member
0 Kudos

Hi Experts,

Now i am doing upgrade project from 4.6C to ECC6.0.

I have one syntax error with offset assignment

Error description:

The length declaration "97" exceeds the length of the character-type

start(=70) of the structure. This is not allowed in Unicode programs.

syntax error with this line *bseg20(97) = *bseg0(97).

Small piece of code:

IF v_tax_amount <> 0.

*bseg20(97) = *bseg0(97).

*bseg2-kostl = *bseg-kostl.

*bseg2-prctr = *bseg-prctr.

*bseg2-mwskz = *bseg-mwskz.

*bseg2-saknr = t030k-konts.

*bseg2-hkont = t030k-konts.

*bseg2-buzei = '999'.

Kindly help me its bit urgent to me.

Thanks,

Vikram

5 REPLIES 5

Former Member
0 Kudos

Hi,

Check the length of the <b>fields bseg2 and bseg.</b>

Increase the length to 100.

Thanks,

former_member223537
Active Contributor
0 Kudos

BSEG2 is having less length as compared to BSEG.

Please increase BSEG2.

0 Kudos

Hi Prashant,

Thanks for your sugession

But i declared bith *BSEG and *BSEG2 are same structure of BSEG.

pls check the bellow code

DATA: BEGIN OF *bseg OCCURS 100.

INCLUDE STRUCTURE bseg.

DATA: BEGIN OF *bseg2 OCCURS 100.

INCLUDE STRUCTURE bseg.

DATA: END OF *bseg2.

Is this declration way is correct or not.

Thanks,

Vikram

0 Kudos

Hi,

Its possible to use Offset value to the Structure.

<b>*bseg20(97) = *bseg0(97).</b>

Declre the above syntax with any field from the structure.

<b>*bseg2-field10(97) = *bseg-field10(97).</b>

Thanks.

varma_narayana
Active Contributor
0 Kudos

Hi Chanikya..

The problem is not with the Declaration of workarea.

But in Unicode we cannot access the Workarea using the OFFSET specification once if there is any Numeric field (CURR, DEC, QUAN).

In BSEG the First 70 characters can be accessed with OFFSET bcoz they are Non-Numeric fields.

but when you give

*bseg20(97) = *bseg0(97). "It is referrring to filed KZBTR. This will give syntax error

So you can directly give:

<b>*bseg2-KZBTR = *bseg-KZBTR. </b> "This will work

Hope u got it.

REWARD IF HELPFUL.