cancel
Showing results for 
Search instead for 
Did you mean: 

End Routine Issue

Former Member
0 Kudos
789

Hi All,

I am trying to append records to the End Routine. Say we have 2 Records in a package, I wanted to append 1 more records for some specific calculation.

The records are getting appended and the result package is having 3 records, I have the counter also correctly filled from 1 to 3. But I am not able to add values to the fields SID, DATAPAKID which is populating as zero. Hence I have a problem with the manipulated key figures during activation.

Scenario during result package manipulation:

SID DATAPAKID RECORD Field 1 Key Figure 1

1 100 1 A 10 (original record)

1 100 2 AB 20 (original record)

0 0 3 X 30 (Appended record)

New Records Table:

SID DATAPAKID RECORD Field 1 Key Figure 1

1 100 1 A 10 (original record)

1 100 2 AB 20 (original record)

0 0 3 X 30 (Appended record)

Active Table: (Records get added but the key figure value becomes 0)

SID DATAPAKID RECORD Field 1 Key Figure 1

1 100 1 A 10 (original record)

1 100 2 AB 20 (original record)

0 0 3 X 0 (Appended record) - Hence my calculation is getting useless.

Please let me know how to amed the result package with SID & DATAPAKID.

Declarations used:

DATA : IT_RESULT TYPE tyt_tg_1.

DATA : WA_RESULT TYPE tys_tg_1.

After Append this is done.

CLEAR RESULT_PACKAGE[].

MOVE IT_RESULT[] TO RESULT_PACKAGE[].

Best Regards

Srinivas.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Srinivas,

Map the KeyFigures / Characteristic in the transformation.

If you cannot use Direct Mapping, use a constant value. But ensure that none of the fields are left unmapped.

Then you can modify this value in end-routine.

Hope this helps!

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Implement the OSS Note that Walter has suggested.

OSS note : 1223532.

This should solve your problem.

Include this statement in your end_routine before you append the record to the result_package:

CALL METHOD me->new_record__end_routine

If you are on Support Package 19, the implementation is visible in the generated program.

Regards,

Pankaj

former_member223744
Active Participant
0 Kudos

Hello Srinivas.

Did you check note 1223532 which instructs how we can add records in the end routines?

[1223532-Desgin rules: Adding records to end routine|https://service.sap.com/sap/support/notes/1223532]

I hope I could be helpful.

Thanks,

Walter Oliveira