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 Segment Hierarchy Problem.

Former Member
0 Likes
8,501

Hi,

I am using Idoc type FIDCCP02 and segments E1FIKPF, E1FISEG, E1FISE2 and E1FISET. But when I am creating Idoc then these segments are not appearing in hierarchical manner as shown in definition of Idoc. I am using function module MASTER_IDOC_DISTRIBUTE to create the Idoc.

Please let me know how I can modify my program so that segments will come in hierarchy?

Thanks.


17 REPLIES 17
Read only

PeterJonker
Active Contributor
0 Likes
5,113

Is there a custom program to fill the IDoc ? Then you should check this to find the error.

How does the segment hierarchy looks now ?

Read only

0 Likes
5,113

Hi,

I am using custom program to fill the Idoc. There is not hierarchy it is showing at this moment. Segments are appearing just one after another.

What I need to do so that segments will appear in Hierarchical manner?

Thanks.

Read only

0 Likes
5,113

Did you use Function Module: FI_IDOC_CREATE_FIDCC2 ? It should take care of this for you.

Otherwise you need to use the fields in structure EDIDD to define the level in the hierarchy.

PSGNUM  Number of the hierarchically higher SAP segment

HLEVEL    Hierarchy level

Read only

0 Likes
5,113

Hi,

As suggested by you I have written code as below but still hierarchy is not coming. Below code is in the loop and it will be creating at the most 999 segments for E1FIKPF. Could you please suggest how I should proceed?.  Thanks

    t_edidd-segnam = 'E1FIKPF'.

    t_edidd-sdata = t_e1fikpf.

    t_edidd-psgnum =
'000001'.

    t_edidd-hlevel =
'01'.

   
APPEND t_edidd.



    t_edidd-segnam =
'E1FISEG'.

    t_edidd-sdata = t_e1fiseg.

    t_edidd-psgnum =
'000002'.

    t_edidd-hlevel =
'02'.

   
APPEND t_edidd.



    t_edidd-segnam =
'E1FISE2'.

    t_edidd-sdata = t_e1fise2.

    t_edidd-psgnum =
'000003'.

    t_edidd-hlevel =
'03'.

   
APPEND t_edidd.



    t_edidd-segnam =
'E1FISET'.

    t_edidd-sdata = t_e1fiset.

    t_edidd-psgnum =
'000004'.

    t_edidd-hlevel =
'04'.

   
APPEND t_edidd.

Read only

engswee
Active Contributor
0 Likes
5,113

Hi

You mentioned that it will have at most 999 segments of E1FIKPF. However, the IDoc definition only allows 1.

You would probably get an error in the IDoc stating that it exceeds the number or the definition does not match.

Read only

0 Likes
5,113

Hi,

So here I can create one idoc for one document, am I correct ?  By any chance can we able increase the limit of maximum idocs for segment F1FIKPF?

Thanks.

Read only

0 Likes
5,113

Hi

In PSGNUM you shall actually pass the number of parent.  for example for segment 'E1FISEG parent is 'E1FIKPF'. So in SEG segment pass PSGNUM as 00001 and hierarchy level is 02 for segment under E1FIKPF. and it become 03 and so on as you drill.

Please check some sample idocs in your system in We02. Then use FM IDOC_READ_COMPLETELY to see how the idoc data is filled

Nabheet

Read only

engswee
Active Contributor
0 Likes
5,113

Hi

Because it is an SAP standard definition, there is no direct way to modify the segment occurences.

However, if you check OSS note 370021, SAP provides an ABAP program that can be used to update the occurrences by directly updating the SAP table. The sample program is for ORDERS0x IDoc but you can choose different values for the parameters to update the IDoc definition you are using.

Please note the warning in the OSS note that using the program to update the values are considered SAP modification. You would need to transport the program to each environment (Test, Production) and run it there manually. Also, if an SAP support pack/upgrade changes the definition, you would need to rerun the program in each environment again.

Rgds

Eng Swee

Read only

0 Likes
5,113

Hi Nabheet,

Many thanks.

Can I incorporate more than one segment E1FIKPF in one Idoc ? ....If yes then how I need to modify my code which I have in my ealrlier conversation?


Read only

0 Likes
5,113

nopes it is at header level only one is allowed as shown in the screen shot by OP it shall have 1 segment maximum 1 segment

Nabehet

Read only

0 Likes
5,113

One more thing to confirm please. If I have upto 999 items in one document then I can incorporate all those items in one idoc under segment  E1FIKPF, right ?

Read only

0 Likes
5,113

Yes

Read only

0 Likes
5,113

Hi,

I have seen ur code . This segmant 'E1FISET' is not in hlevel 4. It is in level 2. Please correct it. Also, check you have entered the PSGNUM correctly also.

  t_edidd-segnam = 'E1FISET'.

    t_edidd-sdata = t_e1fiset.

    t_edidd-psgnum =
'000004'.

    t_edidd-hlevel =
'04'.

   
APPEND t_edidd.

Regards,

Peri

Read only

Former Member
0 Likes
5,113

Hi,

Did you use append statement in segment internal table. If so then it will surely miss the hierarchy. You need to update the data in the given segment sequence.

Could you please post the code for more accurate solution.

Regards,

K.Srikanth Reddy.

Read only

0 Likes
5,113

Hi,

Code is as below. Could you please suggest better way of doing it. Below code is in the loop.

    t_edidd-segnam = 'E1FIKPF'.

    t_edidd-sdata = t_e1fikpf.

    APPEND t_edidd.



    t_edidd-segnam = 'E1FISEG'.

    t_edidd-sdata = t_e1fiseg.

    APPEND t_edidd.



    t_edidd-segnam = 'E1FISE2'.

    t_edidd-sdata = t_e1fise2.

    APPEND t_edidd.



    t_edidd-segnam = 'E1FISET'.

    t_edidd-sdata = t_e1fiset.

    APPEND t_edidd.

Thanks.

Read only

0 Likes
5,113

Hi,

Did u find any solution?

I am also using master_idoc_distribute FM..even though I pass the hierarchy inside the FM I can see that it clears the HLEVEL and PSGNUM.

Thanks

Read only

Former Member
0 Likes
5,113

As suggested by Peter pass the HLEVEL and PSGNUM along with segnam and sdata to t_edidd.

Regards,

K.Srikanth Reddy.