Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Deletion IDoc

mrahhaoui
Participant
0 Kudos
428

Hy everybody,

My project ask me to write a program which will be able to create an IDoc where it deletes another IDoc where his field LOGSYSTEM has been changed.

E.G.

Message Type COSMAS with LOGSYTEM A has been sent to the right system.After that the LOGSYSTEM has been changed to B so it has to go now to the B system but it has been deleted to the A system also.

I heard I have to use the FM MASTER_IDOC_DISTRIBUTE but I don't know how.

Anybody could help me please?

Regards,

Mohamed.

14 REPLIES 14

GauthamV
Active Contributor
0 Kudos
262

Use WE11 transaction.

0 Kudos
262

Use WE11 transaction and after ?

It's a transaction to check the idocs deleted not to delete a idoc with a specific field containign a specific value.

Edited by: rahhaoui mohamed on Mar 16, 2009 1:19 PM

Former Member
0 Kudos
262

Hi,

Fist try with RSEXARCA then deleted from SAP R/3 RSEXARCD(Deleted from R/3)

Thanks.

Smita

0 Kudos
262

But I have to base on the LOGSYSTEM field and see it has been changed.

E.G.: LOSGSYSTEM A -


> LOSGSYSTEM A : Do nothing

LOSGSYSTEM A -


> LOSGSYSTEM B : Delete in System A and send it to System B.

Regards,

Mohamed.

former_member222860
Active Contributor
0 Kudos
262

Hi,

Not sure, whether it works for u

data: begin of itab_edidc occurs 0.
        include structure edidc.
data: end of itab_edidc.
        
data: begin of itab_edid4 occurs 0.
        include structure edid4.
data: end of itab_edid4.
        
select * from edidc
         into corresponding fields of table itab_edidc
        where docnum = p_idocnum                       
          and status = 53
          and mestyp = 'COSMAS'.

DELETE edidc FROM TABLE itab_edidc

Also u check the field for target_client .

thanks\

Mahesh

0 Kudos
262

Thank you Manesh.

How can I delete to the target and send to the new system?

Regards,

Mohamed.

0 Kudos
262

>

>

> DELETE edidc FROM TABLE itab_edidc

>

> Also u check the field for target_client .

>

> thanks\

> Mahesh

Doing so, you will mess up all other edi related tables. What about EDIDS? And what about all other EDI tables storing information abou a partiCular IDOC?

Better not give such silly answers.

0 Kudos
262

I don't understand why you need to write a custom program to delete. there is standard custom program RSEXARCD , try this one, this works for everyone, So, for you as well. And one suggestion Do not try to delete standard database table directly This will harm your system consistency.

Kuntal

Former Member
0 Kudos
262

Hello Mohamed,

I have had this same requirement awhile back. I don't think I deleted them, but I changed them.

Here is the pseudocode:

select the idocs from edids

loop at the idocs

look for idoc issue using FM 'IDOC_READ_COMPLETELY'

edit the idoc using FM 'EDI_DOCUMENT_OPEN_FOR_EDIT'

FM 'EDI_CHANGE_DATA_SEGMENTS'

FM 'EDI_DOCUMENT_CLOSE_EDIT'

process the edited idocs by passing the parameters and submitting

SUBMIT rbdagaie WITH SELECTION-TABLE t_rspar AND RETURN

EXPORTING LIST TO MEMORY.

Good Luck!

former_member181995
Active Contributor
0 Kudos
262

I would prefer the Achieving of IDocs rather than deleting them from R/3.

Search in SCN or Google for archiving programs if you are interested to Archive them.

0 Kudos
262

Amit - That is also a good option:

RSEXARCA -


> IDoc Archive

RSEXARCB -


> IDoc Archive Background

Don't think I have copied it from SCN .

Kuntal

0 Kudos
262

Yes you right I totally am agree with you (all). So how can I use that automaticly ( in abap program)

If I understand I have to use the FM 'Change_pointers_read, in mentionning

the message and the change pointers.

After that i don't how to user those transactions in my code.

0 Kudos
262

Hi - I have provided you custom program names. So, just go to SE38 and give those name and run it.... check whether its useful to you or not. If you need some more filter to put your data, then you can write your own program, do required filtration and pass submit the program I have suggested from your program, with the filtered values.

Kuntal

mrahhaoui
Participant
0 Kudos
262

My questions is not answered, I did a mistake