Application Development and Automation 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: 
Read only

replace section offset problems

Former Member
0 Likes
695

Hello all,

I have some problems with:

REPLACE SECTION OFFSET pos OF init_source WITH text.

So:

when i use it in the er5 system it works just perfectly.

but when i use it in the sc1 system, when i check the source code i get the error:

section offset pos of init_source not expected.

i checked my spelling and there's no problem.

can you, please, help me with this matter? do you know why does this error exist?

Best regards,

emilia

4 REPLIES 4
Read only

kostas_tsioubris
Contributor
0 Likes
546

Hi,

could you place here your code or a portion of it?

Kostas

Read only

Former Member
0 Likes
546
  • DATA: init_value TYPE bapicats1-network,

  • pos TYPE i,

  • source_len TYPE i.

*

  • source_len = strlen( text ).

*

  • pos = 12 - source_len.

*

  • init_value = '000000000000'.

*

                  • REPLACE section offset pos of init_value WITH text.

hello,

this is the code.:(

i hope you'll be able to help me,

thank you,

emilia

Read only

0 Likes
546

Hi Emi,

I have checked your program and I can't find any errors. You didn't gave the declaration of text in your example so I test this piece of code


DATA: INIT_VALUE TYPE BAPICATS1-NETWORK,
POS TYPE I,
SOURCE_LEN TYPE I.
DATA: TEXT(5) VALUE '12345'.  "kostas
SOURCE_LEN = STRLEN( TEXT ).

POS = 12 - SOURCE_LEN.

INIT_VALUE = '000000000000' .

REPLACE SECTION OFFSET POS OF INIT_VALUE WITH TEXT.

The program ran without problems, have you made sure that you haven't missed any fullstops in your code or any other typing error?

Kostas

Read only

0 Likes
546

hello,

in my code the text is declared the variable text.

and i checked it, deleted and wrote it again in a different form and the only error i received was with replace section offset pos of init_value with text: section offset pos of init_value not expected.

as i said above the same code works in the er5 system. i don't know what the problem could be.

i'll just try to change the method to handle things.

anyway,

thank you very much for your help ,

emilia