simulation vs real load gives different masterdata
Dear BW gods
I am loading from CSV into an ODS.
I have a startroutine (in the transfer rule) in which I add masterdata (mediumtext) for a certain characteristic (ZPB_ART).
When I look at the content of the texttable after a load, this differs from the content of the same table after a simulation with all records previewed (max .
I would expect no master data to be actually written during a simulation... but that is not the case. Is there a difference between ABAP interpretation when in simulation vs real load?
My code for writing the master data is:
field-symbols: <l_requnr> type rssm_s_minfo-requnr.
data: l_requnr type fieldname.
data: l_s_minfo type rssm_s_minfo.
empty internal table
fill internal table with artikelnumber and artikeltext
data: bExists type i.
data: wa like line of DATAPAK.
data: artnr type i.
artnr = 0.
I put the existing masterdata into an internal table:
data: wa_txt TYPE /BIC/TZPB_ART.
IF VN = 0.
SELECT * FROM /BIC/TZPB_ART into wa_txt ORDER BY /BIC/ZPB_ART.
INSERT wa_txt INTO TABLE arttxt.
artnr = wa_txt-/BIC/ZPB_ART.
VN = 1.
loop at DATAPAK into wa.
I see if the article code already exists,
if not it is added to the internal table:
bExists = 0.
loop at arttxt.
if arttxt-txtmd = wa-ARTIKEL.
this artikelcode is already in the table!
bExists = 1.
if bExists = 0.
artnr = artnr + 1.
arttxt-/BIC/ZPB_ART = artnr.
arttxt-txtmd = wa-ARTIKEL.
call text transfer:
call function 'RSDMD_WRITE_ATTRIBUTES_TEXTS'
i_iobjnm = 'ZPB_ART'
i_tabclass = 'T'
i_s_minfo = l_s_minfo
i_t_table = arttxt
attribute_name_error = 1
iobj_not_found = 2
generate_program_error = 3
others = 4.
Another (related) issue is the number of records generated:
In my CSV there are 1884 different codes, so I should have 1884 records in the masterdata table.
When I do a first load, I only have 969 records in the text-table.
When I do a second load, I still have 969 records.
Only after a simulation, I get 1884 records!
when I do a load on the next day of exactly the same CSV, the number of records increases
(now it is at 2785) !?
Any help is greatly appreciated (and rewarded with points).