Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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:

  • TABLES: ...

TABLES: /BIC/TZPB_ART.

FORM STARTROUTINE

...

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

refresh arttxt.

  • 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.

ENDSELECT.

VN = 1.

ENDIF.

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.

EXIT.

endif.

endloop.

if bExists = 0.

artnr = artnr + 1.

arttxt-/BIC/ZPB_ART = artnr.

arttxt-txtmd = wa-ARTIKEL.

collect arttxt.

endif.

endloop.

  • call text transfer:

call function 'RSDMD_WRITE_ATTRIBUTES_TEXTS'

exporting

i_iobjnm = 'ZPB_ART'

i_tabclass = 'T'

i_s_minfo = l_s_minfo

tables

i_t_table = arttxt

exceptions

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).

Kind regards,

Edwin Jacobs

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question