SAP for Utilities Discussions
Connect with fellow SAP users to share best practices, troubleshoot challenges, and collaborate on building a sustainable energy future. Join the discussion.
cancel
Showing results for 
Search instead for 
Did you mean: 

EMIGALL - Migrate multiple lines form a Z_TABLE

miguel_silva3
Explorer
0 Kudos

Hi,

I have to migrate a ztable with multiple lines to one object.

I read the Guideline Document of the EMIGALL, and i did all the process:

MARK the checkbox's GENERATION, CUSTOMER and MULTIPLE but when i try to migrate the data object the modifications don't appear on the Ztable

Can anyone help me.

Thank you

1 ACCEPTED SOLUTION

miguel_silva3
Explorer
0 Kudos

Hi Fritz,

Yes, fritz now i realize that and i make some tricky

Best Regards

View solution in original post

13 REPLIES 13

friedrich_keller
Contributor
0 Kudos

Miguel,

Do you mind providing some more details of the problem? ;o)

- Is the TEMKSV table updated?

- Do you receive error messages?

- Have you tested your own developed service function module w/ transaction SE37?

- Is your own function module called at all in the load program when executing the data migrtion?

- Have you set a breakpoint in your service function module and checked what's happening there?

- ...

Cheers,

Fritz

miguel_silva3
Explorer
0 Kudos

Hi Fritz thank you for the aswer,

I insert the table structure Z on the object and mark the checkboxes for generation, client and multiple link the guideline show.

Then i go the object events and on the CALL02, i make an INSERT to the table Z. but on the generation program only insert one line.

I look to the ZRE3TR_EDPG_SIS and i see the others structs with multiple lines have this code:

describe table auto-ADRSTRTCCS lines h_lines.

if sy-index le h_lines.

refresh auto-ADRSTRTCCS.

endif.

insert h_ADRSTRTCCS01

into auto-ADRSTRTCCS index sy-index.

And my z_table don't have.

Best Regards

0 Kudos

Hi Miguel,

> Then i go the object events and on the CALL02, i make an INSERT to the table Z. but on the generation program only insert one line.

This is not a big surprise if you copied the example from the guidelines one by one. It is indeed an example to inset only one single line into a z-table.

> I look to the ZRE3TR_EDPG_SIS and i see the others structs with multiple lines have this code:

> describe table auto-ADRSTRTCCS lines h_lines.

> if sy-index le h_lines.

> refresh auto-ADRSTRTCCS.

> endif.

> insert h_ADRSTRTCCS01

> into auto-ADRSTRTCCS index sy-index.

> And my z_table don't have.

Such a coding is not generated your customer-specific table because your table is not part of the (standard) auto structure.

What to do next? Well, you need to be creative and develop an own coding that does the trick. Maybe somebody from the forum has done it already and wants to share?

Cheers,

Fritz

0 Kudos

Hi

miguel_silva3
Explorer
0 Kudos

Hi Fritz,

Yes, fritz now i realize that and i make some tricky

Best Regards

0 Kudos

Hi Miguel,

Out of curiosity: why do you need to write multiple lines into a custom table when migration ADRSTRTISU?

Kind regards,

Fritz

0 Kudos

Hi,

First check the service module you are using. In my case, I developed a Z service Module and the import parameter X_AUTO refers to a structure ZMG_ZABC_ZAB_AUTO(which is also the Auto Struct. Type), which in turn contains a component X_AUTO of a table type, if you want muliptle values in your Z Table.

Then, I have written an event in fill02

insert zmg_zabc_zab_imp

into auto-x_auto

index sy-index.

The above approach works perfectly fine for me. You should try the same and let me know if you face any problem.

Regards,

Sachin

0 Kudos

Sachin,

Please allow my following comments:

(1) I understand you have created a new BAPI migration object. If you had been using the TABLE parameter in the interface of your function module the event would not have been necessary (see also chapters 5.3 and 9.3 of the guidlines ISMW.

(2) The initial question was how to setup exn already existing standard migration object to transfer multiple lines to a custom table and all this within the load report.

Please correct me if I am wrong.

Cheers,

Fritz

0 Kudos

Hi Fritz,

I agree with the points you have made above. I thought that a Z FM is being used in the object.

Now, If I want to post multiple entries to a custom table using A Standard Object, I have done the following:

1) Create a custom structure in EMIGALL object and mark the GENERATION, CUSTOMER and MULTIPLE options (as done correctly by Miguel).

2) I declare an Internal Table and Work Area of type Z table in which the data is to be inserted.

3) In FILL02 event, I write the following code:

if imp-ddtyp = Customer Import Struct.Rec Data Type( like ZADR in you case)

append MaxInputStruct Name to internal table delcared in step 1.

clear MaxInputStruct Name.

endif.

4) Then in EVENT SERVI03, after COMMIT_WORK, I write the following code:

if not new-par-partner (or The newkey value returned by Service Module) is inital.

insert Ztable from table (internal table)

endif.

then clear the workarea and internal table.

Please correct me if I have missed something.

Regards,

Sachin.

0 Kudos

Where to declare the internal table i mean in which event

miguel_silva3
Explorer
0 Kudos

Hi,

I solve the problem, i copy all the program of the object ADRSTRTISU and edit the new struct to insert more than a line.

Thank you very much for the help.

0 Kudos

Can you tell me please where to declare the tables? i tried in event after include and it gives me eror.

0 Kudos

Yes, I also faced the same problem; do not know where to declare the internal table for processing as the program generated by EMIGALL is non-modifiable. I was wondering whether the declaration has to be done in the Pre-processing tab of the custom sub-structure.