cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Count of total target segments in a EDI (Including MHD and MTR segment)

suchitatomar
Participant
0 Kudos
1,207

Hi,

I am developing a IDOC to EDI scenario wherein I have a requirement to count the total numbers of target segments in the ouput EDI file and place this count value in a header field D_NOSG in the EDI S_MTR segment of parent segment DELHDR

The total number of segments in the output EDI is not constant. There is mapping logic for each segment. Each segment gets created based on a condition and few segments can occur multiple times also depending on certain input field value.

Can anyone please suggest how this can be handled in mapping.

Regards

Suchita

View Entire Topic
Ryan-Crosby
Active Contributor

Hi Suchita,

Are you using the B2B add-on or some other option? We have a lot of ANSI x12 scenarios and place the value $B2B_SEG_COUNTER as a constant in the place where the dynamic segment count should be calculated. When the TransmissionNumberModule executes it does a count and replaces that constant with the proper value. I would assume it also works for the other EDI standards that are available in the add-on.

Regards,

Ryan Crosby