2009 Apr 16 10:58 AM
Hello experts!
I am using the standard BAPI BAP1_PO_CREATE1 (via LSMW with IDOC) to create pruchase orders with services. The order is created but the services are not created. I think I did everything OK with the package numbers of the father- and underlying services (see data below). I don't get any error message, the services are just not there and I can see in SE16N that no entries are generated for table ESLL. The header and items are created and seem OK. I think I don't need to enter account assignment as my category is "U", but I put some data in to see if it helps, which does not.
The data I currently put in:
POHEADER
COMP_CODE Company Code 2824
DOC_TYPE Purchasing Document Type ZPM
VENDOR Vendor's account number 9900013086
PURCH_ORG Purchasing Organization ACZ1
PUR_GROUP Purchasing group ZMR
DOC_DATE Purchasing Document Date 20090219
VPER_START Start of validity period 20090101
VPER_END End of validity period 20091231
POHEADERX
COMP_CODE Updated information in related user data field X
DOC_TYPE Updated information in related user data field X
VENDOR Updated information in related user data field X
PURCH_ORG Updated information in related user data field X
PUR_GROUP Updated information in related user data field X
DOC_DATE Updated information in related user data field X
VPER_START Updated information in related user data field X
VPER_END Updated information in related user data field X
POITEM
PO_ITEM Item Number of Purchasing Document 0010
SHORT_TEXT Short text Order 1, Item 1
PLANT Plant AD58
MATL_GROUP Material group MR011-10
QUANTITY Purchase order quantity 1
PO_UNIT Order unit LE
ITEM_CAT Item category in purchasing document D
ACCTASSCAT Account assignment category U
PCKG_NO Package number 0000003808
POITEMX
PO_ITEM Item Number of Purchasing Document 0010
PO_ITEMX Updated information in related user data field X
SHORT_TEXT Updated information in related user data field X
PLANT Updated information in related user data field X
MATL_GROUP Updated information in related user data field X
QUANTITY Updated information in related user data field X
PO_UNIT Updated information in related user data field X
ITEM_CAT Updated information in related user data field X
ACCTASSCAT Updated information in related user data field X
POACCOUNT
PO_ITEM Item Number of Purchasing Document 0010
SERIAL_NO Sequential number of account assignment 01
POACCOUNTX
PO_ITEM Item Number of Purchasing Document 0010
SERIAL_NO Sequential number of account assignment 01
POSERVICES (father service line)
PCKG_NO Package number 0000003808
LINE_NO Internal line number 0000000001
EXT_LINE Line number 0000000000
OUTL_LEVEL Hierarchy level of group 0
SUBPCKG_NO Subpackage number 0000003809
QUANTITY Quantity with or without plus/minus sign 0000000000
POSERVICES ("real" service line)
PCKG_NO Package number 0000003809
LINE_NO Internal line number 0000000002
EXT_LINE Line number 0000000010
OUTL_LEVEL Hierarchy level of group 0
SUBPCKG_NO Subpackage number 0000000000
SERVICE Activity Number 5000001
QUANTITY Quantity with or without plus/minus sign 0000000001
BASE_UOM Base Unit of Measure AU
GR_PRICE Gross price 1
ESKLC (father service line)
PCKG_NO Package number 0000003808
LINE_NO Line number 0000000001
SERNO_LINE Serial number of acc. 00
PERCENTAGE Percentage for acc. 100
SERIAL_NO Sequential number of account assignment 01
ESKLC ("real" service line)
PCKG_NO Package number 0000003809
LINE_NO Line number 0000000002
SERNO_LINE Serial number of acc. 00
PERCENTAGE Percentage for acc. 100
SERIAL_NO Sequential number of account assignment 01
Does anyone have an idea why the service are not created? Is there a way to analyze what is happening? Pain in the butt that there is no error message!
Thanks...
Did you try and debugg where it is getting stuck.
Regards,
Lalit Mohan Gupta.
2009 Apr 16 6:45 PM
Did you try and debugg where it is getting stuck.
Regards,
Lalit Mohan Gupta.
2009 Apr 17 9:19 AM
Well, I tried to debug.
I debugged just the BAPI and everything seems OK. The problem with executing the BAPI from SE37, that the commit work is not executed, so I cannot see if the BAPI would have worked correctly when I execute it directly. The "temporary" tables seem to fill correctly.
When I call the BAPI from the IDOC, it is done in the background and I cannot arrive in the debugging of the bapi. It might be that the IDOC to BAPI transfer is not working properly.
I will try to do some more debugging but maybe someone would see a problem with my data or had the same problem before (and hopefully solved it...).
CU,
Frank
2009 Apr 17 1:22 PM
OK, I found the error. For someone who might have the same problem:
In POITEM we defined:
PCKG_NO Package number 0000003808
But in POITEMX we did not mark the X for the same field. So missing is the following:
POITEMX
PCKG_NO Updated information in related user data field X
With the missing entry, for some reason the system then creates the PO-item with the exact data that is entered in PCKG_NO, but it does not create the services.
With the added entry, the system ignores the given data (3808) and generates its own number for PCKG_NO based on the last number used. And then it also creates the services with their own generated package numbers.
Enjoy...
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |