Skip to Content
Technical Articles

Migrating Service Purchase Orders with S/4HANA Migration Cockpit

Purchase Order Service Item Category is not supported by Migration of Purchase Orders (Only Open) Migration Cockpit object. In order to migrate Service PO object should be enhanced. In this blog post you will learn how to adjust it.

BAPI_PO_CREATE1 is used for PO migration. OSS note 2114353 – BAPI_PO_CREATE1: Template for creating service PO provide you with the sample test records for various business cases. I will use PO with one service line + single account assignment as example.

 

1 Create new Migration Project. In LTMC t-code fill Name and Mass Transfer ID.

2 Run LTMOM t-code. Open your migration project and create new migration object from Template.

Menu Project – Create Migration Object – From Template

Select Purchase order (only open PO)

Change Object description to Service Purchase order (only open PO). Also switch Names view via menu Settings -> Technical Names On/Off.

3 Adjust source structures. Append new structures below to lower level S_EKPO Item Data.

a – S_ESKL Create Comm. Structure: Acct Assgt Distr. for Service Line fields

Key Name Data Type Length Decimal Places Amount Field Column Header Group Text Check Table
1 EBELN CHAR 10 0 Purchasing Document Number S_EKPO
1 EBELP NUMC 5 0 Item Number of Purchasing Document S_EKPO
1 PCKG_NO NUMC 10 0 Package number
1 LINE_NO NUMC 10 0 Line Number
0 SERNO_LINE NUMC 2 0 Seq. Number of Acc. Assignment Specifica
0 PERCENTAGE DEC 4 1 0 Percentage for Account Assignment Value
0 SERIAL_NO NUMC 2 0 Sequential Number of Account Assignment

 

S_ESKL foreign keys relationship

Field Name Type of Foreign Relat. Check Table Field of Check Table or Literal
EBELN Field S_EKPO EBELN
EBELP Field S_EKPO EBELP
PCKG_NO Field S_EKPO
LINE_NO Field S_EKPO
SERNO_LINE Field S_EKPO

 

 

b – S_ESLL Lines of Service Package fields

Key Name Data Type Length Decimal Places Amount Field Column Header Group Text Check Table
1 EBELN CHAR 10 0 Purchasing Document Number S_EKPO
1 EBELP NUMC 5 0 Item Number of Purchasing Document S_EKPO
1 PCKG_NO NUMC 10 0 Package number
1 LINE_NO NUMC 10 0 Internal line number
0 EXT_LINE NUMC 10 0 Line Number
0 OUTL_LEVEL INT1 3 0 Hierarchy level of group
0 OUTL_IND CHAR 1 0 Indicator: Outline line
0 SUBPCKG_NO NUMC 10 0 Subpackage number
0 QUANTITY QUAN 13 0 Quantity with Sign
0 BASE_UOM UNIT 3 0 Base Unit of Measure
0 GR_PRICE DEC 23 2 0 Gross price
0 SHORT_TEXT CHAR 40 0 Short Text
0 OVF_TOL DEC 3 0 Overfulfillment Tolerance
0 OVF_UNLIM CHAR 1 0 Unlimited Overfulfillment

 

S_ESLL  foreign keys relationship

Field Name Type of Foreign Relat. Check Table Field of Check Table or Literal
EBELN Field S_EKPO EBELN
EBELP Field S_EKPO EBELP
PCKG_NO Field S_EKPO
LINE_NO Field S_EKPO

 

c – add custom field in S_EKPO Item Data fields

Key Name Data Type Length Decimal Places Amount Field Column Header Group Text Check Table
PCKG_NO NUMC 10 0 Package number

 

 

4 Set up structure mapping as follow

Target Structure           T16_POSERVICES Communication Structure: Create Service Line

Source Structure Description Access Type Mapping Type Source Cardinality Target Cardinality Data Path Type
S_EKKO Header Data Mapping only 1:1 Relation 1 1 Not Applicable
S_EKPO Item Data LOOP AT TABLE 1:1 Relation 1 1 Default Path
S_ESLL Lines of Service Package LOOP AT TABLE 1:1 Relation 1 1 Default Path

 

Target Structure           T17_POSRVACCESSVALUE Create Comm. Structure: Acct Assgt Distr. for Service Line

Source Structure Description Access Type Mapping Type Source Cardinality Target Cardinality Data Path Type
S_EKKO Header Data Mapping only 1:1 Relation 1 1 Not Applicable
S_EKPO Item Data LOOP AT TABLE 1:1 Relation 1 1 Default Path
S_ESKL Create Comm. Structure: Acct Assgt Distr. for Service Line LOOP AT TABLE 1:1 Relation 1 1 Default Path

 

5 Map fields according data in table

Import Parameter Parameter Value Rule Target Field
Target Structure T16_POSERVICES
SENDERFIELD S_ESLL-PCKG_NO MOVE PCKG_NO
SENDERFIELD S_ESLL-LINE_NO MOVE LINE_NO
SENDERFIELD S_ESLL-EXT_LINE MOVE EXT_LINE
SENDERFIELD S_ESLL-OUTL_LEVEL MOVE OUTL_LEVEL
SENDERFIELD S_ESLL-OUTL_IND MOVE OUTL_IND
SENDERFIELD S_ESLL-SUBPCKG_NO MOVE SUBPCKG_NO
SENDERFIELD S_ESLL-QUANTITY MOVE QUANTITY
IV_ISOCD_UNIT S_ESLL-BASE_UOM CVT_ISOCD_UNIT UOM_ISO
SENDERFIELD S_ESLL-OVF_TOL MOVE OVF_TOL
SENDERFIELD S_ESLL-OVF_UNLIM MOVE OVF_UNLIM
SENDERFIELD S_ESLL-GR_PRICE MOVE GR_PRICE
SENDERFIELD S_ESLL-SHORT_TEXT MOVE SHORT_TEXT
Target Structure T17_POSRVACCESSVALUE
SENDERFIELD S_ESKL-PCKG_NO MOVE PCKG_NO
SENDERFIELD S_ESKL-LINE_NO MOVE LINE_NO
SENDERFIELD S_ESKL-SERNO_LINE MOVE SERNO_LINE
SENDERFIELD S_ESKL-PERCENTAGE MOVE PERCENTAGE
SENDERFIELD S_ESKL-SERIAL_NO MOVE SERIAL_NO
Target Structure T02_POITEM
SENDERFIELD S_EKPO-PCKG_NO MOVE PCKG_NO
Target Structure T03_POITEMX
IV_VALUE S_EKPO-PCKG_NO SET_X_IF_NOT_INIT PCKG_NO

Save and generate run time object.

 

6 Run LTMC t-code, open your project choose adjusted migration object and download Template.  Populate purchase order data as follow. Empty fields are omitted here.

 

Header data

EBELN BUKRS BSART LIFNR EKORG EKGRP WAERS
Key General Data  
Legacy Purchasing Document Number* Company Code* Purchasing Document Type* Vendor Account Number* Purchasing Organization* Purchasing Group Currency Key(ISO format)*
Ord_5 1710 NB 17386001 1710 001 USD
Ord_6 1710 NB 17386001 1710 001 USD

 

Item Data

EBELN EBELP PSTYP KNTTP MATNR TXZ01 WERKS LGORT MATKL WEPOS WEUNB REPOS WEBRE PCKG_NO
Key General Data    
Legacy Purchasing Document Number* Item Number of Purchasing Document* Item category Account assignment category Material Number Short Text Plant Storage location Material Group Indicator: Goods Receipt Indicator: Goods Receipt, Non-Valuated Indicator: Invoice receipt Indicator: GR-Based Invoice Verification Package number
Ord_5 10 9 P Material-1 1710 L001 X X X X 1
Ord_6 10 9 P Material-2 1710 L001 X X X X 1

 

Account Assignment

EBELN EBELP ZEKKN SAKTO WBS_ELEMENT
Key  
Legacy Purchasing Document Number* Item Number of Purchasing Document* Sequential Number of Account Assignment* G/L Account Number WBS Element
Ord_5 10 1 65008000 00000000000000000255TTO
Ord_6 10 1 65008000 00000000000000000255TTO

 

Create Comm. Structure  Acct A

EBELN EBELP PCKG_NO LINE_NO SERNO_LINE PERCENTAGE SERIAL_NO
Purchasing Document Number* Item Number of Purchasing Document* Package number* Line Number* Seq. Number of Acc. Assignment Specifica Percentage for Account Assignment Value Sequential Number of Account Assignment
Ord_5 10 2 2 100 1
Ord_6 10 2 2 100 1
Ord_6 10 2 3 100 1
Ord_6 10 2 4 100 1
Ord_6 10 2 5 100 1
Ord_6 10 2 6 100 1

 

Lines of Service Package

EBELN EBELP PCKG_NO LINE_NO EXT_LINE OUTL_LEVEL OUTL_IND SUBPCKG_NO QUANTITY BASE_UOM GR_PRICE SHORT_TEXT
Purchasing Document Number* Item Number of Purchasing Document* Package number* Internal line number* Line Number Hierarchy level of group Indicator: Outline line Subpackage number Quantity with Sign Base Unit of Measure Gross price Short Text
Ord_5 10 1 1 0 X 2
Ord_5 10 2 2 10 0 1,00 PC 400,20 Maintenance
Ord_6 10 1 1 0 X 2
Ord_6 10 2 2 10 0 1,00 PC 2 000,00 Job1 August 2020
Ord_6 10 2 3 20 0 1,00 PC 109,00 Job1 August 2020
Ord_6 10 2 4 30 0 1,00 PC 120,00 Job1 August 2020
Ord_6 10 2 5 40 0 1,00 PC 130,00 Job1 August 2020
Ord_6 10 2 6 50 0 1,00 PC 140,55 Job1 August 2020

 

7 Go throw migration steps. Couple Service Purchase Orders should be created at the and.

 

Now you have learned how to adjust Purchase Order migration object for Services. The same approach could be used for other service\limit business cases.

10 Comments
You must be Logged on to comment or reply to a post.
  • Dear Alexey,

    Following the logic of Purchase Order migration object I have tried to create a template in Migration Cockpit for Purchase Requisition. Functional module that is used is BAPI_PR_CREATE.

    Is this the correct FM?

    The Source Structure in LTMOM is as follow:

    Header texts

    Item Data

    Item Address

    Account Assignment

    Components for Subcontracting

    Item texts

    Unfortunately there are errors during the load of sample data that I use for test.

    Do you have any idea how should be build the Source structure and the Field mapping for this migration object.

    Thanks a lot!

    BR,

    • Hello Marina.
      Looks like BAPI_PR_CREATE is ok for PR migration object creation. Source structure depends on your business needs and basically should be pretty same as for PO. I suggest to use minimum data just to create a prototype. Please try to use program DMC_MC_MIGOBJ_EXEC_FILE in order to have a look how BAPI data is populated. Based on BAPI return kindly try to figure out what is wrong or missed. One more useful option is to test BAPI via se37. You can easily investigate what data should be populated.
      Br,

      Alexey.

  • Hello Alexey,

     

    Thanks for your wonderful blog and it was quite informative. Could you also let me know the steps to be followed to enable LTMC to migrate Framework orders with expected values. With reference to your blog I have added 3 structures ESUH, ESKL and ESLL. But when re-generating the object in LTMOM getting Syntax error in function module /1LT/SRQOLC_100000000000253. Could you please guide me on this

    Warm Regards,

    Kiran Krapa.

    • Hello Kiran.

      If I have very strange errors in LTMOM I try to change Global Data by typing space. Then save object and Generate Migration Object. If no luck then please go Display Generated Function Group /1LT/SRQOLC_100000000000253 and try to analyze it.

      Br,

      Alexey.

  • Hello Alexey,

     

    I tried multiple options. Below is the screenshot of how I appended the structures. But I am getting error while generating the object. Do we also need ESLL structure also to be appended?

     

    Can you please help me in this regard.

    Regards,

    Kiran Krapa.

    /
  • Dear Alexey,

    I have created Migration object for PR but I have faced following problem. When I want to create two items in one PR document the system created two PR numbers – for each item.

    This is what I have in the file:

    Legacy Purchase Requisition Number*

    Type: Text
    Length: 80

    Item Number of Purchase Requisition*

    Type: Number
    Length: 5

    Document type*

    Type: Text
    Length: 4

    10000307 10 NB
    10000307 20 NB

    This is what the system created:

    Purchase Requisition Item of requisition Document Type Purch. Doc. Category
    10000212 10 NB B
    10000213 20 NB B

    What should be the reason for this. Maybe I missed something.

    Best regards, Radoslava

     

     

    /
    • Hello Rodoslava. 
      You assigned S_EBAN_TEXT to HEADER. For every record in S_EBAN_TEXT new PR will be created. Looks like S_EBAN should be there. Please check it.
      Br

      Alexey.

  • Hi Alexey Danshin,

    We are migrating the data from SAP ECC to SAP S/4 HANA .We had requirement to migrate the Service contract data .There is no standard template for service contract, even though there is purchase contract standard program in SAP HANA Cockpit .In purchase contract there is no fields for service contract as mentioned below  we are looking to load. Please see the field names to load the data .We are looking to load the below fields to load the data with purchase contracts .But in SAP HANA Cockpit in the standard load program of purchase contract the below fields are not available.so please help us to load the data and  suggest us load methodology ,please let us more details.

    Description Field Name Table Screen Field Name
    Item Number EXTROW ESLL ESLL-EXTROW
    Service Number SRVPOS ESLL ESLL-SRVPOS
    Short Text KTEXT1 ESLL ESLL-KTEXT1
    User Field 3 USERF1_TXT ESLL ESLL-USERF1_TXT
    Quantity MENGE ESLL ESLL-MENGE
    Unit of Measure MEINS ESLL ESLL-MEINS
    Gross Price TBTWR ESLL ESLL-TBTWR
    Currency WAERS ESLH ESLH-WAERS
    Material Group MATKL ESLL ESLL-MATKL

    Thanks

    srini