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: 

How to delete segment from inboud idoc

former_member186783
Participant
3,179

Hi everyone,

I have to delete a segment from an incoming idoc. (I can't use filters, because there is a special precondition for that)

I implemented the HRALE00INBOUND_IDOC BAdI  (PROCESS_IDOC method), and I delete the records from the idoc_data, but when I check it after the processing in BD84 everything is there.

Can you please tell me, how to delete segments from an inbound idoc? I did a search but every topic is about the outbound idoc processing.

Thanks

N.

1 ACCEPTED SOLUTION

former_member186783
Participant
729

Hi everyone,

The iDoc can be filtered in the inboud plug. The mentioned badi is perfect for this: HRALE00INBOUND_IDOC~PROCESS_IDOC method. My solution was perfect for the first time, the only mistake I made, was that in BD87 the full idoc is visible (even if I deleted the idoc_data) But when it was processed the actual data is correctly filtered.(in this case, If I deleted one pernr's data from the idoc, the data was not inserted to the HR masterdata, even if it was in BD87)

Bye

N.

8 REPLIES 8

Former Member
0 Kudos
729

Hi Nandor,

it is not the sense of this BAdI to change the IDoc structures with DB commit on Inbound processing. The only reason to allow changes on idoc_data itab in the BAdI is to modify the Idoc data at runtime for inbound processing.

You can check the program behaviour in the FM IDOC_INPUT_HRMD. After the BAdI you"ll find only reading acess to idoc_data.

Generally: If an IDoc comes into SAP system via port, the idoc data will be write to database (EDIDD) If you want to change the IDoc (Segments or fields) it should take place always before inbound. Eighter at outbound procesing or due to EDI Converter.

Kind Regards

Robert

0 Kudos
729

Hi Robert,

Thanks for the answer. the full requirement is: If an HRMD_A type iDoc comes into our system, the system should not process some personnel numbers, and completely skip the segments related to a specific personnel number.

Can you tell me where to remove that unwanted segments? Is there a BAdI, or anything where I can remove the unnecessary segments? Or the only way is to delete it from the database?

Thanks

Nandor

0 Kudos
729

Hi Nandor,

I suppose that you can avoid to process some personal no. if you just make the affected segments empty in the BAdI. This seems to be a possibillity but it will not looks very konsistant if you still have data in incoming idoc they are not been posted.

An other option, who are more transparent could be to take all relevant idoc segments in the BAdI to create a new valid IDoc at inbound processing and set the proper idoc to the status 68 (not relevant, but can be archived).

Kind Regards

Robert

Former Member
0 Kudos
729

which message type you are using?

0 Kudos
729

HRMD_A

former_member186783
Participant
730

Hi everyone,

The iDoc can be filtered in the inboud plug. The mentioned badi is perfect for this: HRALE00INBOUND_IDOC~PROCESS_IDOC method. My solution was perfect for the first time, the only mistake I made, was that in BD87 the full idoc is visible (even if I deleted the idoc_data) But when it was processed the actual data is correctly filtered.(in this case, If I deleted one pernr's data from the idoc, the data was not inserted to the HR masterdata, even if it was in BD87)

Bye

N.

0 Kudos
729

Hi Nandor,

Is there a specific function module or method you can use to delete a whole segment?

Kind Regards

Deon