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

IDOC segment fields prefixing blank space with values

Former Member
0 Likes
1,204

Hi Experts,

I am sending data through custom IDOC from SAP to XML which generates successfully but getting 2 problems in the data.

its having 3 level idoc segments:

SEGMENT1 with 1 field (field_name(20))

SEGMENT2 with 3 fields, (code_g(20), field_name(20), value(20))

SEGMENT3 with 4 fields, (code(20), field_name(20), Language(2) & text(20))

When i check the idoc in WE02,

1. i found that segment2-value field is prefixing some space along with the values.

Eg: if the output is "0111" whihc is plant, in the output (WE02) it is giving " 0111"

2. Segment3-language is no where in the output and text which should come as "011" is coming like " EN011" means it is concatinating language field value and displaying it with the text field value with prefixing space.

This is happening in PRD not in QA & DEV. I also checked the transport req and everything, Its same everywhere.

Can anyone please help me on this.

Regards,

Nik

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
622

Hi,

This issue happnes when u are moving the data to iDOC segement with offset.

to aviod this improper move instead of using offset statement use below mentioned code.

decalare a structure as

Data SEG1 type SEGMENT1 ,

SEG2 type SEGMENT2,

SEG3 type SEGMENT3.

then while moving

SEG2-code_g = 'XXXX'

SEG2-field_name = 'YYYY'

SEG3-value = 'ZZZZ'

here u are moving the segment values to idoc data (SDATA) and then append it.

move seg3 to idoc-sdata.

then append it to idoc.

hope this helps

Hi Experts,

I am sending data through custom IDOC from SAP to XML which generates successfully but getting 2 problems in the data.

its having 3 level idoc segments:

SEGMENT1 with 1 field (field_name(20))

SEGMENT2 with 3 fields, (code_g(20), field_name(20), value(20))

SEGMENT3 with 4 fields, (code(20), field_name(20), Language(2) & text(20))

When i check the idoc in WE02,

1. i found that segment2-value field is prefixing some space along with the values.

Eg: if the output is "0111" whihc is plant, in the output (WE02) it is giving " 0111"

2. Segment3-language is no where in the output and text which should come as "011" is coming like " EN011" means it is concatinating language field value and displaying it with the text field value with prefixing space.

This is happening in PRD not in QA & DEV. I also checked the transport req and everything, Its same everywhere.

Can anyone please help me on this.

Regards,

Nik

2 REPLIES 2
Read only

Former Member
0 Likes
623

Hi,

This issue happnes when u are moving the data to iDOC segement with offset.

to aviod this improper move instead of using offset statement use below mentioned code.

decalare a structure as

Data SEG1 type SEGMENT1 ,

SEG2 type SEGMENT2,

SEG3 type SEGMENT3.

then while moving

SEG2-code_g = 'XXXX'

SEG2-field_name = 'YYYY'

SEG3-value = 'ZZZZ'

here u are moving the segment values to idoc data (SDATA) and then append it.

move seg3 to idoc-sdata.

then append it to idoc.

hope this helps

Read only

Former Member
0 Likes
622

soled my self