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

APPEND Error

former_member426550
Participant
0 Likes
894

hi experts...

i just want to ask if is it possible that append command will not be successfully executed?

data:begin og it_detail occurs 100.

pernr like pa0001-pernr,

name like pa0001-ename,

data: end of it_Detail.

data it_pernr like pa0001-pernr occurs 100.

data it_name like pa0001-ename occurs 100.

table contents:

10000001 name1

10000002 name2

10000004 name3

loop at it_Detail

append it_detail-pernr to it_pernr.

append it_detail-name to it_name.

endoop.

i am expecting it_pernr table has same

number of records with it_name.

but to my surprise..it_pernr has 3 contents

and it_name has 2.

this was the result at the production system..

i was not able to simulate again but based on the workflow container(SWI2_FREQ)...

they have diffent number of contents..

maybe upon executing the command

append it_detail-name to it_name.

it was not stored successfully to the internal table..

any idea why 1 of the record was not stored at it_name talble..?

thanks,,,

7 REPLIES 7
Read only

Sm1tje
Active Contributor
0 Likes
847

Are you sure that name only has 2 entries, or does it have ONE empty line as well.

The only thing I can think of is that field name is empty, but is appended to internal table anyway with an empty line.

Read only

0 Likes
847

thanks micky for your reply...

it_name has only 2 records.

no empty line was appended to it_name since

all of the entries at table it_detail has a value.

i am expecting 3 records since it_Detail-ename has 3..

any idea why it was not appended?

Edited by: jr_sap_developer on Apr 15, 2008 4:12 PM

Read only

Former Member
0 Likes
847

is that the real code?

Doesn't work for me

Is that the real entries?

Read only

0 Likes
847

nope...

i did not paste all the source code..

actually it_detail has 10+ fields...

i only declared 2 field for me two show the problem..

Read only

Former Member
0 Likes
847

Hi,

check this one.

it is working.

data:begin of it_detail occurs 100,

pernr like pa0001-pernr,

name like pa0001-ename.

data: end of it_Detail.

data it_pernr like pa0001-pernr occurs 100.

data it_name like pa0001-ename occurs 100.

it_detail-pernr = 10000001.

it_detail-name = 'name1'.

append it_detail.

it_detail-pernr = 10000002 .

it_detail-name = 'name2'.

append it_detail.

it_detail-pernr = 10000004.

it_detail-name = 'name3'.

append it_detail.

loop at it_Detail.

append it_detail-pernr to it_pernr.

append it_detail-name to it_name.

endloop.

<REMOVED BY MODERATOR>

raam

Edited by: Alvaro Tejada Galindo on Apr 15, 2008 10:48 AM

Read only

0 Likes
847

thank you for your reply...

i was not able to re run the workflow at the production system but i was able to simulate it at qas server..

my codes are working fine at qas..

the result was the same number of records both it_pernr and it_name,,,

i have no idea why it_pernr and it_name has diff number od records at PROD system..this happen only once..

as of today, all are working fine..i just cant explain to our functional what happen why 2 tables have diiferent number of contents...

is it possible that system slowdows causes the append command not succesfull?

Read only

0 Likes
847

maybe you do something afterwards that affects the tables?