Categories: ABAP Tutorials

IDoc Reduced Segment Check

IDoc Reduced Segment Check: SAP offers some standard functions to check if a Segment can be reduced for Specific message type and even check if the Segment’s field reduction is active.

How to IDoc Reduced Segment Check

Check IDoc Segment Active BAPI

Given a message type, some time is important to check if a specific segment is reduced.
Once the check passed, data can be retrieved for the segment and the segment can be generated.

The Standard SAP BAPI IDOC_REDUCTION_SEGMENT_TEST (ALE: IDoc-Reduction / Segment-Test)

The signature of the IDOC_REDUCTION_SEGMENT_TEST is:

  • IMPORTING
    • VALUE(MESSAGE_TYPE) LIKE EDIMSG-MESTYP
    • VALUE(SEGMENT_TYPE) LIKEEDI_IAPI02-SEGTYP
  • EXPORTING
    • VALUE(ACTIVE)

SAP IDoc Segment Table

Check Most important Idocs Tcodes and Idocs Tables

Actually, the IDOC_REDUCTION_SEGMENT_TEST will check for the ALE message type and segment name in SAP Table TBD24 (ALE: IDOC reduction flagged with positive logic ).

Related Post

If an entry found, then the ACTIVE will be flagged.

Check IDoc Segment Active Sample ABAP

A sample ABAP snippet to check if a segment is active in an ALE Message Type can be as following:

  " Is Idoc segment active ?
  CALL FUNCTION 'IDOC_REDUCTION_SEGMENT_TEST'
    EXPORTING
      message_type = mestyp    " SAP IDOC Mesasge type 
      segment_type = 'E1RESBL' " IDoc's segment Name 
    IMPORTING
      active       = active_flag
    EXCEPTIONS
      OTHERS       = 1.
  
  IF sy-subrc = 0.
    " Retrieve Data 
    " Fill SAP IDoc Segment with Data
  ENDIF.

IDoc Field Reduction Active Check

IDoc Field Reduction BAPI Check

Once the check is done for IDoc’ segment, it is possible to process further check on SAP IDOC segment’s field.

For field level, use rather the SAP BAPI IDOC_REDUCTION_FIELD_REDUCE (ALE: IDoc-Reduction: Feldreduzierung ).

IDoc Field Reduction Sample ABAP Code

Check IDOC Segment Reduction Sample ABAP Code

  CALL FUNCTION 'IDOC_REDUCTION_FIELD_REDUCE'
    EXPORTING
      message_type = mestyp
      segment_type = 'E1PLAFL'
      segment_data = sdata_temp
      empty_symbol = '1'
    IMPORTING
      segment_data = sdata_temp.

Read about SAP Reduce IDoc and SAP Reduce Message Type at Reduced Message Types

Share
Published by
John

Recent Posts

The Most Important SAP ISU Tables

SAP ISU Tables for Technical master data, for Billing Master Data, Billing and invoicing Tables?…

December 22, 2020

SAP Fiori 3 UX and Design of SAP Fiori Apps for SAP S/4HANA, SAP TechEd Lecture

SAP Fiori 3 UX and Design of SAP Fiori Apps for SAP S/4HANA, SAP TechEd…

November 18, 2020

The Main SAP Dunning Transaction Codes

Dunning is the business practice of informing a customer of past due payment. Dunning letters…

November 28, 2019

SAP Accounts Payable Tcodes & Accounts Receivable Tcodes ( SAP AP Tcodes & SAP AR Tcodes)

SAP AP Tcodes & SAP AR Tcodes: House Banks Tcodes, Advance Payments or Down Payments,…

August 1, 2019

The Most Important SAP Payment Terms Tables (ZTERM, Text…)

What are the main SAP Payment Terms Tables ? What are the related Tables in…

October 21, 2018

The most Important SAP Work Center Tables in SAP PP

Work center consists of master data related to routing of products. It contains data related…

October 21, 2018