10-12-2007 5:11 AM
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
10-12-2007 5:18 AM
Hi,
Check the length of the <b>fields bseg2 and bseg.</b>
Increase the length to 100.
Thanks,
10-12-2007 5:20 AM
BSEG2 is having less length as compared to BSEG.
Please increase BSEG2.
10-12-2007 5:31 AM
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
10-12-2007 5:41 AM
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.
10-12-2007 5:40 AM
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.