‎2014 Mar 20 11:58 AM
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.
‎2014 Mar 20 12:23 PM
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 ?
‎2014 Mar 20 12:30 PM
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.
‎2014 Mar 20 12:56 PM
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
‎2014 Mar 21 8:12 AM
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.
‎2014 Mar 21 8:36 AM
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.
‎2014 Mar 21 9:08 AM
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.
‎2014 Mar 21 9:14 AM
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
‎2014 Mar 21 9:26 AM
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
‎2014 Mar 21 9:49 AM
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?
‎2014 Mar 21 9:57 AM
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
‎2014 Mar 21 10:12 AM
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 ?
‎2014 Mar 21 11:52 AM
‎2014 Mar 21 1:11 PM
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
‎2014 Mar 20 1:47 PM
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.
‎2014 Mar 20 2:08 PM
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.
‎2015 May 27 4:39 AM
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
‎2014 Mar 20 3:08 PM
As suggested by Peter pass the HLEVEL and PSGNUM along with segnam and sdata to t_edidd.
Regards,
K.Srikanth Reddy.