Hi,
In my current project, we are facing a issue where we have to perform the following steps in below order in PI. Can this be achived using the PI by writing the Processing Logic in PI iteself.
Scenario Diagram:
SAP -
(IDOC)
-> SAP PI
(Inserts the data in Legacy Server, using Insert Statement)
--> LEGACY
SAP IDOC is having the structure let say
(1) Field1 - Number
(2) Field2 - Description
Example Values:
FIELD1 FIELD2 A1 Toys A2 Bicycles A3 T-Shirts
Legacy system is having a Table (Lets Say - ZTABL1) with 3 Columns:
(a) COL1 - PRIMARY Key
(b) COL 2 - MATNR
(c) COL 3 - Description
COL1 COL2 COL3 1224 A1 Boys Toys 1225 A2 Girls Bicycles 1226 A3 Kids T-Shirts 1227 A4 Kids Toys
Steps:
1. SAP Sends the IDOC - to SAP PI using tRFC Port.(The IDOC is triggerd on changes in Description)
2. SAP PI receives the data.
3. SAP PI goes to the Legacy system and using JCO connection, reads the last entry from table mentioned above - ZTABL1.
4. SAP PI formulates the data receieved from the IDOC and merges it with the ZTABL1 enteries in a temporary storage, something like this:
(1) Field1 - Number
(2) Field2 - Description
(3) NEW Field (in SAP PI) - Increment the Value from ZTABLE1-COL1( if in legacy Value of COL1's last entry was 1227, then in SAP PI it should be 1228 ; that is incremented by 1)
5. After doing the above processing, sends the INSERT Statement back in Legacy Table - ZTABL1 and makes a new entry there.
COL1 COL2 COL3 1224 A1 Boys Toys 1225 A2 Girls Bicycles 1226 A3 Kids T-Shirts 1227 A4 Kids Toys 1228 A1 Toys 1229 A2 Bicycles