cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Segment & Higher Segment details

Former Member
0 Kudos

Hi Experts,

I have a requirement in my scenario where I want to store IDOC segments number & it's higher segment number.

For example these are the segment's and it's number.

<b>.</b>E1COGH -


> segment1

E1COGHT -


> segment2

E1COGHR -


> segment3

<b>.</b>E1COGS----


> segment4

<b>.</b>E1COGSR----


> segment5

here E1COGHT number is 2 and it's higher segment is E1COGH so obviously it's E1COGHT higher segment number is 1,

similarly E1COGS number is 2 and it's higher segment is E1COGH so m E1COGHT higher segment number is 1.

I want these details for mapping.

Now when I do mapping through graphical mapping I want to map segment number it's corresponding higher segment needs to map with target message type.

Can any body suggest me how to get these details

Thanks,

Murthy.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Murthy,

I am not sure whether we can view segment number in IR.

Just refer the documentation in we63 and map it in IR.

Answers (6)

Answers (6)

Former Member
0 Kudos

Murthy,

You need to use ABAP maping & need to call FM 'EDI_SEGMENTS_GET_ALL in it which will connect to sender R/3 system with doc no & will give the IDOC detail. You can also use table IDXIDOCSYN but I doubt that it will contail all the info required.

Regards

Sushil

Former Member
0 Kudos

Hi

Hope I understand u'r requirements correctly.

Try the following function:


  CALL FUNCTION 'EDI_SEGMENTS_GET_ALL'
       EXPORTING
            DOCUMENT_NUMBER         = I_EDIDC-DOCNUM
       TABLES
            IDOC_CONTAINERS         = I_EDIDD
       EXCEPTIONS
            DOCUMENT_NUMBER_INVALID = 1
            END_OF_DOCUMENT         = 2
            OTHERS                  = 3.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ELSE.

This comes from the template funciton OWN_FUNCTION which is used for ABAP-PI Ports in handling IDocs.

Given an IDoc number, it returns all segments within this IDoc,

Check the fields in the returned structure I_EDIDD:

- SEGNUM (Segment Number)

- PSGNUM (Number of superior parent segment)

former_member214364
Active Contributor
0 Kudos

hi Narasimha,

you can use index standard node function to get required output.but becareful with node context when you are using this node function.

Cheers,

Jag

former_member214364
Active Contributor
0 Kudos

Hi narasimha,

could you please tell me which IDOC type you are using. and also target message structure,in that you want to map segment occurrence to which element in target.

Cheers,

Jag

Former Member
0 Kudos
Source Message                                    Target Message
&#61656;COGRP01                                           indsp_mt
       IDOC                                                Statement
         BEGIN                                                COGRP_TMP_PROC_1
      &#61656;  EDI_DC40                                               action
             SEGMENT                                            IDOCNUMBER   
             TABNAME                                             -------
              -------
             &#61656;	E1COGH                                           E1COGH_NUMBER
                  SEGMENT                                       E1COGH_HIGHERNUMBER
                   MSGFN          --------------------            E1COGH_MSGFN
                   ------                                                --------
             &#61656;	E1COGHT                                          E1COGHT_NUMBER
                   SEGMENT                                      E1COGHT_HIGHERNUMBER
                   LANGU             ------------------            E1COGHT_LANGU

As shown in above target structure I want to store E1COGH segment number in E1COGH_NUMBER & it's Parent Segment number in E1COGH_HIGHERNUMBER.

Similarly i want to store E1COGHT segment number in E1COGHT_NUMBER & it's parent segment number (E1COGH in this case) in E1COGHT_HIGHERNUMBER.

Can you tell me how to do this.....

Thanks

Murthy

former_member214364
Active Contributor
0 Kudos

Hi Narasimha,

i am not clear with your requirement,could you please tell me what is the meaning of segment number?

is it segment occurrence?

Cheers,

Jag

Former Member
0 Kudos

Hi Jagadish,

please refer this link, I have the same requirement as in this thread.

But the replies for this thread is not clear to me.

Thanks,

Murthy.

Former Member
0 Kudos

Hi

U can check the details of your IDoc using the transaction WE63.

There u give your IDoc type in basic type and press F8 to see the documentation of the IDoc.

Former Member
0 Kudos

Hi Praasath,

Thanks for the response.

I want those details in XI Integration Repository, so that I will use those elements to map to the target messge type.

Thanks

Murthy