cancel
Showing results for 
Search instead for 
Did you mean: 

simulation vs real load gives different masterdata

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

It appears I filled my internal table with wrong data ... I had unique key field with repeating values... that is why sometimes the datapackage was written to the texttable, and sometimes it wasn't...

"refresh arttxt." was outside of the IF VN=1

so my internal table was cleared on every package...

I deleted the statement all together.

I also added code so that the internal table is only written to the database after the last datapackage:

data: numOfPack type i.

data: wa_reqtab LIKE LINE OF reqtable.

  • read number of datapackages from table RSTSODSREQUESTPG

SELECT * FROM RSTSODSREQUESTPG into wa_reqtab

WHERE REQUEST = G_S_MINFO-REQUNR

ORDER BY DATAPAKID.

INSERT wa_reqtab INTO TABLE reqtable.

ENDSELECT.

numOfPack = wa_reqtab-DATAPAKID.

IF G_S_MINFO-DATAPAKID = numOfPack.

call function 'RSDMD_WRITE_ATTRIBUTES_TEXTS'

...

ENDIF.

Kind regards,

Edwin

Former Member
0 Kudos

Hi Edwin,

Try these three solution:

When you change anything in InfoSource, for example the code of a routine, turn back to the initial screen (log-on screen) before execute any simulation or any upload.

Everytime you make a new simulation change the number of the records to preview.

Upload in PSA before and check the result directly in PSA.

Ciao.

Riccardo.

Former Member
0 Kudos

Hi Riccardo,

thanks for your prompt reply.

I already found out about the bug that forces you to go out of the administrator workbench... it's a pain! (Do you know of any oss note about this to remedy this bug?)

The number of records to preview I always set to 2500 (my csv contains 2016 records).

I have Processing set to "PSA and then into Data Targets (Package by Package)". Do you mean to use "Only PSA" ?

("Consistency check for char. values in the transfer rules" is off.)

kind regards,

Edwin

Former Member
0 Kudos

Hi Edwin,

About OSS note I have never find out any note about this problem.

About PSA it is always better to upload first in PSA and then into DataTarget, also for tablesace performance. If you want to check the whole content of the PSA you can use table RSTSODS.

You can also use only few records for the preview from CSV to DataTarget (so try first with 10 records and then with 20, change always the number otherwise the system can show you the precedent preview), and then analyze the real content in PSA.

Ciao.

Riccardo.

Former Member
0 Kudos

Hi Riccardo,

so my setting is good... (first PSA then Datatarget).

I don't see why table RSTSODS can help me (I must admit I am new to BW and don't know what this table is used for or what I am actually seeing in there, but I will check it out)

Simulatting with only 10 or 20 records will give me different masterdata for sure... I don't see how I can test my current problem with that.

I will however keep this in mind and look into it.

kind regards,

Edwin