Application Development and Automation 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: 
Read only

IDOC Filtering

Former Member
0 Likes
6,418

Hi,

I have to filter IDOCs based on segment field value. Could you please provide me information on the IDOC filteration.

Thanks in advance.

Hi,

I have to filter IDOCs based on segment field value. Could you please provide me information on the IDOC filteration.

Thanks in advance.

3 REPLIES 3
Read only

Former Member
0 Likes
3,891

Hi Naren,

There are two filtering in IDoc.

<b>Segment Filtering</b>:

Segment filtering can be achieved using T/Code BD56. Here you can suppress a whole segment irrespective of data inside it . You have to give Message Type / Sender Prrtner / Receiver Partner.

<b>Data Filtering</b>:

Data filtering can be done in dustribution model where you can restrict whole IDOCS or partials IDOCS to be send based on data in fields inside IDOC depending on whether the segment in which you filter is at the highest level or at a lower level. For example in MATMAS if you put a filter of E1MARCM for a particular plant , only data for this plant will go and other plants will be ignored.

Please check this link for detail information.

http://help.sap.com//saphelp_470/helpdata/EN/0b/2a611c507d11d18ee90000e8366fc2/frameset.htm

Hope this will help.

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
3,891

Hi,

U will not be able to fill the data of idoc directly based on the segment data because value is stored as string :- structure of idoc

MANDT -


Client

DOCNUM -


IDoc number

COUNTER----


Counter in cluster table

SEGNUM -


Number of SAP segment

SEGNAM----


Name of SAP segment

PSGNUM----


Number of the hierarchically higher SAP segment

HLEVEL -


Hierarchy level

SDATA -


Application data

Structure is self explanatory.

Segnam----


stores the name of the segment

SDATA----


Contains the value for the segment

U need the data SDATA to be moved in corressponding segment structure to get appropriate shape to the data.

when u move the data into segment structure. corresponding field of the segment get filled with the data.

Still if u want to filter data based on the segment data

go ahead

To get idoc u can use direct select based on date, idoc type etc.

SELECT idoctp docnum

FROM edidc

INTO TABLE lit_idoc_nos

WHERE credat EQ p_credat

AND docnum IN p_docnum

AND idoctp IN p_idoctp.

u can use this function module.

F.M-------> IDOC_READ_COMPLETELY

im -->document_number

ta -->int_edidd............structure mention above

Now rest i clear i suppose.

int_edidd------> this will contain data with segment name and idoc type which enough to help u.

Please mark the helpfull answers and close the thread.

Regards

Manoj

Read only

Former Member
0 Likes
3,891

hi

good

Definition

Filter objects are attributes of a message in the distribution model. A filter objects consists of a filter object type (for example, material type) and an assigned object value (for example PROD).

Use

ALE uses filter objects in outbound processing. You can use the filter objects to specify the content of a message and its receivers.

Filter objects function differently for message types and for BAPIs.

When message types are filtered, all the IDoc segments containing a field with an object type name whose value does not match the object value are suppressed. The subsegments of these IDoc segments are also suppressed.

If the suppressed segment was a mandatory segment and provided that there are no other mandatory segments of the same name on the same IDoc hierarchy level, the higher-level IDoc segment is also suppressed. This process is repeated and the final result depends on the specific IDoc structure, mandatory segments and the segments that have been repeatedly processed.

If the uppermost mandatory segment of an IDoc still exists after this process, the rest of the IDoc is distributed.

With BAPIs the filter object type corresponds to a parameter name. BAPI filter objects check whether a parameter contains the specified object value. An IDoc is created and distributed via the BAPI, only if this is the case.

The following distinction is made:

Receiver determination

When the receiver is determined, the filter objects are checked against the specified conditions and the valid receivers are reported back.

For further information see Determining the Receivers of a BAPI in the ALE Programming Guide.

Parameter filtering

The dataset of the BAPI tables is determined by filtering the BAPI table parameters, similar to filtering IDoc segments.

For further information see BAPI Parameter Filters in the ALE Programming Guide.

=======================

Segment filtering

Individual segments can be deleted from the IDoc before dispatch by selecting Functions for the IDoc processing -> Settings for filtering in ALE Customizing. The appropriate setting depends on the sending and receiving logical R/3 System.

Field conversion

Receiver-specific field conversions are defined under Functions for the IDoc processing -> Conversions.

General rules can be specified for field conversions; these are important for converting data fields to exchange information between R/2 and R/3 Systems. For example, the field "plant" can be converted from a 2-character field to a 4-character field.

The conversion is done using general EIS conversion tools (Executive Information System).

thanks

mrutyun