cancel
Showing results for 
Search instead for 
Did you mean: 

Append Datapak - transfer start routine

Former Member
0 Kudos

Hello BW Experts,

We can modify the records in the datapak of transfer structure in transfer start routine. Can we append extra records to the datapak.

should this statement work in transfer start routine?

APPEND ITAB_DATAPAK TO DATAPAK

suggestions appreciated.

Thanks,

BWer

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Sure (better, you can completely copy all the content from DATAPAK to DATAPAK_COPY, then add to DATAPAK_COPY what you want, delete the actual content of DATAPAK and insert into it all DATAPAK_COPY !!!

Hope it helps!

Bye,

Roberto

Former Member
0 Kudos

1) Clear: DATAPAK. will work to delete the contents ?

2) say intially the DATAPAK contains 100 records, can i delete the intial 100 records and add 200 records in the transfer start routine ?

Thanks,

BWer

edwin_harpino
Active Contributor
0 Kudos

hi,

sample

DATA: l_s_datapak_line type TRANSFER_STRUCTURE,

l_s_errorlog TYPE rssm_s_errorlog_int.

tables : table1.

data : l_field1 liek table1-field1,

l_tabix like sy-tabix.

loop at datapak into l_s_datapak_line.

l_tabix = sy-tabix.

  • fill field1 with data

select single field1 into l_field1

from table1 where fieldintable1 = l_s_datapak_line-[fieldname]

if sy-subrc = 0.

l_s_datapak_line-field1 = l_field1.

modify datapak from l_s_datapak_line index l_tabix.

endif.

endloop.

or

if sy-subrc = 0.

l_s_datapak_line-field1 = l_field1.

append l_s_datapak_line.

endif.

edwin_harpino
Active Contributor
0 Kudos

hi,

try

after add 200 records with append l_s_datapak_line.

refresh datapak.

datapak[] = l_s_datapak_line.

hope this helps.

Former Member
0 Kudos

okay i see here is the problem

step1) making a copy of 100 records from datapak „³ datapak_copy

step2) making modifications to some fields and making it 200 records in datapak_copy

step3) clearing datapak

step4) copy datapak_copy „³ datapak

observation: for the first set of 100 records and for the second set of 100 records in the datapak_copy the keys request id , package number and record number are the same. So while copying from datapak_copy „³ datapak. Only the 2nd set of 100 records can be seen in the datapak. That explains the reason.

How to fix this :

1) Now to fix this which one those fields could be better to modify, can I increment the record number leaving the datapackage and request id the same.

2) Or shall I increment the datapackage number and without changing the request id , record number.

If I consider the option 1, datapage simply doubles, what are the disadvantages to that. Is this doable?

If I consider the option 2, I need to know the what is the next datapackage number that I give it. How to know the next available datapackage number. Is it possible to know the next available package number ?

Suggestions appreciated.

Thanks,

BWer

Former Member
0 Kudos

Hi,

you should not change the data package number as you are in the same package all the time. You are only increasing the number of records in the data package.

Siggi