Today, I had to debug a function module IDOC_OUTPUT_ORDERS to determine why certain segments and its fields are not appearing especially when it is sending out for its Cross Stocks. In contrast to Y/C stocks, those segments are appearing normally. So I had to make a comparison on the flow of its coding during debugging.
As an initial start of debugging, I need to know what are the missing fields and segments. So I took 2 PO numbers and sent out Y/C and Cross Stock IDOCS. After sent out, execute WE02 to get the two comparison output of the following 2 IDOCS as below:
Figure 1.0 Missing Segments
The Figure 1.0 showed two screens of WE02 of 2 IDOCS of same basic type but sending out Y/C and Cross Stocks. On your right, the IDOC sent out Y/C and the left is Cross Stock. As you see, the Cross Stock (Left Screen) has several missing segments that is in Y/C type IDOC. These are those difference in segments missing. Following figure showed the missing fields in a segment.
Figure 2.0 Missing fields
Similar as above description in Figure 1.0 Missing Segments, Y/C had extra fields that Cross Stock type in IDOC_OUTPUT_ORDERS that is not appearing. These missing fields and segments are due to the following reasons: (The following segments are filled in subroutine fuellen_idoc_inttab)
1.0 E1EDK01 (General Data)
Debug 1.0 General Data
E1EDK01 segments that is supposed to be filled in Cross Stock is not filled due to FLAG_PSTYP_STR not fullfilled. As a result, E1EDP-VSART and E1EDPK01-KZAZU are not filled in Cross Stock for IDOC (Orders).
2.0 E1EDKT1 (Document Text, Third Party)
Debug 2.0 3rd Party Document Text
Segment E1EDKT1 that is supposed to be filled in IDOC for Cross Stock not appearing is due to the coding above which FLAG_PSTYP_STR and SO_COUNTER is not fulfilled as in IDOC for Y/C. However, VBAK had to be fulfilled to in order to get the segment for Cross Stock.
3.0 E1EDP02 (3rd Party Order)
Debug 3.0 (A)
Segment E1EDP02 that is supposed to appear in IDOC for Cross Stock had been skipped because EKPO-PSTYP does not equal PSTYP-STRE. This is the first checking that initiates the rest of filling of segment E1EDP02.
Debug 3.0 (B)
After the Debug 3.0 (A) had initiate, this is the portion Debug 3.0 (B) that will fill E1EDP02 in Cross Stock. However, this only occur in IDOC for Y/C.
4.0 E1EDPT1 (Text for 3rd Party Order)
Debug 4.0 Text for 3rd Party Order
This is the last segment that is supposed to be filled in IDOC for Cross Stock but not appear at all. Similar to previous filling of segment's condition, SO_COUNTER and EKPO-PSTYP must also matched PSTYP-STRE before this segment be fill into IDOC for Cross Stock.
This is the analysis as the reason IDOC (IDOC_OUTPUT_ORDERS) not appearing for Cross Stocks. Functional should be make understand this findings and hopefully they will do the necessary adjustment or configurations to enable Cross Stock have those missing fields and segments be filled up during publication from ME21N or ME22N. Another options, there might be a possible enhancement to this IDOC. Each segments has a BADI or USER EXIT that allow you to make the necessary enhancement to fulfill your business requirement.
williamwilstroth... IDOC_OUTPUT_ORDERS, missing segments...