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

ASSIGN statement

Former Member
0 Likes
523

Hello,

Can anybody help me to find the reason if below statement return 1 as SY-SUBRC value?

ASSIGN TABLE FIELD v_pcode TO <fs_pcode>.

Thanks for your help.

Regards,

Vidya

4 REPLIES 4
Read only

Former Member
0 Likes
496

See the example program and do compare with your program :

REPORT CHAP2402.

DATA: EXTERNAL_RECORD(4000),

POSITION TYPE I,

LENGTH TYPE N.

FIELD-SYMBOLS <ENTRY>.

EXTERNAL_RECORD = '0005Smith0007Edwards0005Young'.

DO.

LENGTH = EXTERNAL_RECORD+POSITION(4).

IF LENGTH = 0.

EXIT.

ENDIF.

ADD 4 TO POSITION.

ASSIGN EXTERNAL_RECORD+POSITION(LENGTH) TO <ENTRY>.

WRITE <ENTRY>.

ADD LENGTH TO POSITION.

IF POSITION >= 4000.

EXIT.

ENDIF.

ENDDO.

Check the below links :

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb387a358411d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3923358411d1829f0000e829fbfe/content.htm

I am not sure why you are getting sy-subrc = 1,issue would be at table field.

Thanks

Seshu

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
496

Does this work?

ASSIGN TABLE FIELD (v_pcode) TO <fs_pcode>.

Regards,

Rich Heilman

Read only

0 Likes
496

Hi Rich,

This statement working well in Development server, but in production it's returning SY-SUBRC value as 1. It's causing the issue. But in development server it's working fine.

Give me some hint, so that I can start from there.

Thanks,

vidya

Read only

0 Likes
496

Does the field exist in production server? Actually I'm not familar with this exact statement, does it point a dictioary field to the field symbol? If so, then make sure that the dictionary field exists in produciton.

Regards,

RIch Heilman