You are on page 1of 17

Interface Specification Technical Document

Interface Name: NIS Inbound to SAP - Shipment Contents


Generated Document Name: TSD_MTD_WM_FSD_MTD_ASN
from NIS to SAP_ABAP
ENTERPRISE FIRST: Global Template

Market / Project : PBNA Wave 1


Author: Sourish Mohan Chakraborty

1|Page
1. Document Information

Document Location

Document Solman Link


Document Name Sol Man Folder Path
#
TSD_MTD_WM_FS Solution>Libraries>Development>Library>ZS4HANA> I002337 TSD_MTD_WM_FS
D_MTD_ASN from <PACKAGES>ZGEF_MTD_WM/FSD_MTD_WM_FSD_MT D_MTD_ASN from
NIS to SAP_ABAP D_ASN from NIS to SAP/TSD_MTD_WM_FSD_MTD_ASN NIS to SAP_ABAP
from NIS to SAP_ABAP

Revision History
Revision Summary of Changes Revised
Revision Date Project
Number By(GPID/Name)
1 05/05/2021 PBCW1 Initial version 09308604(Sourish
Mohan Chakraborty)
2 31/05/2021 PBCW1 Final Version 09308604(Sourish
Mohan Chakraborty
3 11/08/2021 PBCW1 FUT Defects: 09308604 / Sourish
# 1383270 Ortec Import Material Chakraborty
Data - Design Update

4. 10/12/2021 PBCW1 FUT Defects 09308604 / Sourish


#1487294 Segments line number Chakraborty
(POSNR) incorrect
ENTERPRISE FIRST: Global Template

Design Authority Approval Details

Approval Date Approved By

2|Page
Table of Contents
0. Document Information_____________________________________________________2
Document Location_________________________________________________________________________2
Revision History____________________________________________________________________________2

1. General Information_______________________________________________________3
2. High Level Technical Design_________________________________________________4
2.1 High level Business Requirement__________________________________________________4
2.2 Possible Technical approaches with brief pros & Cons_________________________________4
2.3 Proposed Technical approach_____________________________________________________5
3. Technical Details / Process Flows_____________________________________________5
4. Technical Details_________________________________________________________10
4.1 Interface Type________________________________________________________________10
4.2 Selection Screen Validations_____________________________________________________10
4.3 Object/Import Type____________________________________________________________10
4.4 Legacy System Extract / Load procedure___________________________________________11
4.5 Data Mapping Matrix__________________________________________________________11
4.6 Inbound / Outbound File Information_____________________________________________11
E4.7
N T E Custom
R P R I S Transaction____________________________________________________________12
E FIRST: Global Template
5. Additional Information and attachments______________________________________12
6. SAP Development Objects__________________________________________________12
7. Unit Test Plan____________________________________________________________13

2. General Information
Document Information

Development I002337
ID:
Program Type ( ) Conversion ( X ) Batch Interface ( ) Online Interface ( ) Report
( ) Form ( ) Enhancement ( ) Extension ( ) Online program
( ) Modification ( ) Unknown ( ) Others
FD Link FSD_MTD_WM_FSD_MTD_ASN from NIS to SAP

3|Page
Version 1.0

Area: MTD Date: 05-MAY-2021

Technical Sourish Mohan Email


Designer: Chakraborty sourish.chakraborty.contractor@pepsico.co
m
Technical Sourish Mohan Email sourish.chakraborty.contractor@pepsico.com
Resource: Chakraborty

Title: TSD_MTD_WM_FSD_MTD_ASN from NIS to SAP_ABAP

Short NIS Inbound to SAP - Shipment Contents


Description:

3. High Level Technical Design

3.1 High level Business Requirement


Stock transfer will be required between plants where SAP S4 is deployed in receiving plant but not
deployed in the sending plant. This will be achieved through an interim buy-sell type solution. When
the sending plant runs on NIS legacy system, an interface is required to receive the ASN in receiving
plant.

3.2
E N T EPossible
R P R I S E F I RTechnical
S T : G l o b a l approaches
Template with brief pros & Cons
1 IDoc message type WHSCON will be used for updating the inbound delivery.

IDoc Type/ Extension FSHGMCR01

Message Type WHSCON

IDOC Type DELVRY07

Process Code Custom

Partner Type LS

Partner No CALEDON

Direction Inbound (02)

We will create a custom process code by replicating the existing process code DELV.

In the custom process code, we will replace the standard function module with a custom one. The
custom function module will have the same signature to that of the standard function module and we
will also wrap the standard function module inside the newly created function module.

The standard function module that we are going to refer is IDOC_INPUT_DELVRY.

After the execution of the standard function module inside the custom one we will replace the following
fields inside the idoc_data with the new logic as mentioned by FO.

4|Page
****SOC*****Revision 3*****Changes related to 1348074: HU number range does not accept LPN number ,
1348074:
Functiona Table Field IDOC Segment ABAP Logic
l Name Name Name Segment Field
Name Name
HU VEKP EXIDV & E1EDL3 EXIDV & NR. object HU_VEKP (External Number Range) will not accept
Number EXIDV2 7& EXIDV2 alphanumeric no which is being passed to SAP in field EXIDV.
(EXIDV E1EDL4
and Hence as a workaround we will replace the below value in
4
EXIDV2) wrapper FM ZGFM_MTD_IDOC_DEL_INP just before calling
standard. FM IDOC_INPUT_DELIVERY: -

 We will move value of EXIDV to EXIDV2 in


segment E1EDL37.
 We will populate value of EXIDV by adding 1 to the
maximum number possible (whose next number is
not utilised) in VEKP-EXIDV which falls in the
external range of NR HU_VEKP and pass it to
EXIDV of E1EDL37 and E1EDL44.

****BOC*****Revision 4 Changes Related to


1487294 Segments line number (POSNR)
incorrect

We will add 1 to the EXIDV mentioned in the


above step only if segment E1EDL37 is
encountered. This is due to the reason that we
need to add 1 HU number for every E1EDL37 line
and not pack the contents of HU’s in a single one.
ENTERPRISE FIRST: Global Template
****EOC*****Revision 4 Changes Related to
1487294 Segments line number (POSNR)
incorrect

****EOC*****Revision 3*****Changes related to 1348074: HU number range does not accept LPN number ,
1348074:
Functiona IDOC Segment
l Name Table Field Segment Field
Name Name Name Name ABAP Logic
The Bill of lading number (E1EDL20-BOLNR) should be
searched in PO header (EKKO_IHREZ). Note this PO number.
Then find the Inbound delivery number corresponding to this
PO.
Delivery
Error Handling: If more than one PO from same supplier
Number
(EKPO-LIFNR) with same BOLNR is found, the IDOC should
get failed with appropriate message in the status for trouble
shooting.
LIKP VBELN E1EDL20 VBELN
In the inbound delivery determined as above, find the item
number that corresponds to the material (E1EDL24-MATNR).
Delivery
Item Note: If there is a batch split (meaning, more than one batch
Number specified for same line item, then the POSNR should be of the
pattern 90000* and original line-item number should be
LIPS POSNR E1EDL24 POSNR populated in E1EDL24-HIPOS field of IDOC)
Batch LIPS CHARG E1EDL24 CHARG  If SAP batch (CHARG) exists for combination of PO
Number supplier number and Supplier batch number
(LICHN), then update E1EDL24-CHARG with
existing SAP batch.
 If no SAP batch (CHARG) exists for combination,
then create batch by leveraging SAP Intelligent
batch design (E000340) and provided values for
supplier batch, manufacture date, and best-by date.

5|Page
Functiona IDOC Segment
l Name Table Field Segment Field
Name Name Name Name ABAP Logic
Supplier batch should be recorded as batch
characteristic value “Long Batch Number”.
 If SAP batch (CHARG) exists for combination of PO
supplier number and Supplier batch number
(E1EDL44-CHARG), then update E1EDL44-CHARG
with existing SAP batch.
Batch  If no SAP batch (CHARG) exists for combination,
Number then create batch by leveraging SAP Intelligent
batch design (E000340) and provided values for
supplier batch, manufacture date, and best-by date.
Supplier batch should be recorded as batch
VEPO CHARG E1EDL44 CHARG characteristic value “Long Batch Number”.

We are going to keep the rest of the fields and rest of the process flow as it is. Below information is part
of the development E00340 which will be used to created batch as mentioned.

3.3 Proposed Technical approach


We are going to follow approach 1 only.

4. Technical Details / Process Flows


Step1: - We are going to create a partner number in SALE->Basic Settings -> Define Logical System. It is
NISD for development.

ENTERPRISE FIRST: Global Template

Step 2: We copy the function module IDOC_INPUT_DELVRY to a wrapper function module


ZGFM_MTD_IDOC_DEL_INP which have the same signature as the standard Function Module.
IDOC_INPUT_DELVRY. We will revisit this part later.

Step3: In transaction BD51 we will register the custom function Module described above.

6|Page
Step 4: - Next we will have to go to T-Code WE57 where we will have to make an entry for the function
module with the IDoc Type and Message Type.

ENTERPRISE FIRST: Global Template

.
Step 5: In transaction We42 we create a New Process Code by copying existing Process Code DELV and
provide the below details.

7|Page
Step 6: In transaction WE20 we will assign the below details against partner no NISD.

ENTERPRISE FIRST: Global Template

Now we need to pass some additional information’s from SAP System to the IDOC_DATA parameters in
the function Module described below.

1. Delivery Number

We need to fetch ebeln (purchase order no.) from ekko by passing E1EDL20-BOLNR to EKKO-IHREZ. We
need to send first 12 characters from BOLNR to IHREZ which is confirmed by functional owner.

Next, we need to pass ekko-ebeln to lips-vgbel to fetch vbeln. We will pass this to segment E1EDL20-
VBELN as the inbound delivery no.

2. Manufacturing Date of Batch

8|Page
The format of LPN number is as follows and here we are just interested in the production date ie.
character numbers 7 to 11 ie. date in mmddy format is 04260. The below format is valid for e1edl37-
inhalt but for e1edl24-lichn we have to consider character number 3 to 7 .

e1edl24-lichn = 1632MG042603XXX(15 digits)


e1edl37-inhalt = 1604260XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX(40 digits)

If the segment e1edl24-lichn / e1edl37-inhalt is blank, we will pass system date to manufacturing date of
batch but if it is not blank then: -

For e1edl24-lichn.
 We will concatenate first 3 characters of system date (ie. 202 for year 2021), 11 th character of
e1edl24-lichn (0 in the above diagram ) , 7th to 10th character of e1edl24-lichn(ie.0426 in the
above diagram) to populate date in system date internal format and pass it to manufacturing
date of batch but if the first 4 character of the newly populated system date is greater than
first 4 character of system date by more than 1 deduct 1 from the first 4 digits of system date
and populate this in the first 4 digit of manufacturing date.

For e1edl37-inhalt.
 We will concatenate first 3 characters of system date (ie. 202 for year 2021), 7 th character of
e1edl24-inhalt (0 in the above diagram ) , 3th to 6th character of e1edl24-inhalt(ie.0426 in the
above diagram) to populate date in system date internal format and pass it to manufacturing
date of batch but if the first 4 character of the newly populated system date is greater than
first 4 character of system date by more than 1 deduct 1 from the first 4 digits of system date
and populate this in the first 4 digit of manufacturing date.
ENTERPRISE FIRST: Global Template

3. Generate smart batch number.

Smart batch Number is to be generated in the below Format.

YNNNPPPPLL

Y (Digit 1): Year, single last digit for manufacturing year


NNN (Digit 2-4): Julian Date code for manufacturing date
PPPP (Digit 5-8): Plant
LL (Digit 9-10): First 2 characters of name of vendor

Julian day code is to be derived logically using the below diagram.


Plant information is to be passed from lips-werks by passing vgbel.

9|Page
Pass smart batch number to segments e1edl24-charg and e1edl44-charg.

Further we need to check if the batch exists in MCHA for the batch number, plant and material and if it
doesn’t exist, we will create the batch using bapi_batch_create. We will have to pass batch, plant,
storage location, manufacturing date in batch attributes and batchcontrolfields-nocommit = blank.

Provide the standard error if batch creation fails.


ENTERPRISE FIRST: Global Template
4. Generate Line numbers: -

We need to pass line numbers to e1edl24-posnr, e1edl24-hipos and e1edl44-posnr. For this we need to
check if the segment e1edl19 is having qualifier as BAS. If BAS is present, we need to pass original line
item to posnr and its count in the series 900001 to hipos. The 900001, 90002, 90000N number is
generated on the number of splits.

If there is no BAS, then provide original item number in POSNR in all places.
****SOC*****Revision 3*****Changes related to 1348074: HU number range does not accept LPN number ,
1348074:
5. During FUT it was found that the external number range (02) for NR. Object(HU_VEKP) doesn’t
support Alphanumeric value so as a workaround which was suggested by Michael Foo of SAP , we
have pushed the value of E1EDL37-EXIDV to E1EDL37-EXIDV2.

To populate EXIDV we passed the external number range and NR object maintained in constant
table (Description Below) and passed it to FM NUMBER_GET_INFO to get the minimum & maximum
numbers maintained for NR. Object HU_VEKP.We have passed the minimum and maximum number
to table VEKP and fetched the largest VEKP-EXIDV and added 1 to it.

****BOC*****Revision 4 Changes Related to 1487294 Segments line number (POSNR) incorrect

We will add 1 to the EXIDV mentioned in the above step only if segment E1EDL37 is encountered. This is
due to the reason that we need to add 1 HU number for every E1EDL37 line and not pack the contents of
HU’s in a single one.

****EOC*****Revision 4 Changes Related to 1487294 Segments line number (POSNR) incorrect

10 | P a g e
We have added the log to provide error message if there is any exception in FM
NUMBER_GET_INFO. The error message for the exception is “Error in FM to fetch number Range /
Number range not maintained.” Lastly, we have passed the value in E1EDL37 & E1EDL44 segments
in field EXIDV just before calling standard FM “IDOC_INPUT_DELIVERY”.

Ext Number Range value 02 and NR object is maintained in constant table. Diagram below.

****EOC*****Revision 3*****Changes related to 1348074: HU number range does not accept LPN number ,
1348074:
6. Call the original function module “IDOC_INPUT_DELIVERY” with the updated data.
7. Show message if multiple purchase order is fetched for a single reference number(bolnr) and if
delivery is not fetched correctly.
8. Show error if there is any exception while calling Function Module “IDOC_INPUT_DELIVERY.
9. Show error if there is multiple delivery for a single purchase order.

Flow Diagrams

ENTERPRISE FIRST: Global Template

5. Technical Details

5.1 Interface Type


Interface type: Inbound

11 | P a g e
5.2 Selection Screen Validations
5.3 Object/Import Type
Intermediate Doc (IDoc)
Message Type Basic Type Extension Settings Information
WHSCON DELVRY07 Not Applicable Not Applicable

Partner Profile Details for IDOC


Populate these files, attach them here and provide them to Basis team to create the partner profile.
New Partner Details New Inbound IDOC Partner New Outbound IDOC Partner
profile profile
Not Applicable

Partner Inbound Partner


Profile_WE20_Template.xlsxProfile_WE20_Template.xlsx

5.4 Legacy System Extract / Load procedure


5.5 Data Mapping Matrix
5.6 Inbound / Outbound File Information
5.7
E N T ECustom
R P R I S E F ITransaction
RST: Global Template

5. Additional Information and attachments


5.1 Reconciliation Reporting

5.2 Attachments

6. SAP Development Objects


SAP Development Objects
ZGEF_MTD_WM
Development Class
Message Class Not Applicable
Package ZGEF_MTD_WM
Transport Request Number H1DK910678(Workbench)
H1DK910836(Customising)
****BOC*****Revision 3*****Changes related to 1348074: HU
number range does not accept LPN number , 1348074:
Task Number H1DK919252 TR no H1DK910678 .
****EOC*****Revision 3*****Changes related to 1348074: HU
number range does not accept LPN number , 1348074:

12 | P a g e
Object type Object Name
Function Group ZGFG_MTD_IDOC_DEL_INP
View Maintenance: Data VIEWNAME Table Keys
V_TBD51 ZGFM_MTD_IDOC_DEL_INP
View Maintenance: Data VIEWNAME Table Keys
VEDIEDIFCT ZGFM_MTD_IDOC_DEL_INP FDELVRY07
View Maintenance: Data View name Table Keys Table Keys
V_TBDLS TBDLS NISD
V_TBDLS TBDLST ENISD
****BOC*****Revision 3*****Changes related to 1348074: HU number range does not accept LPN number ,
1348074:
Table Contents ZGGLTDEV_CONS

Function Group ZGFG_MTD_IDOC_DEL_INP

****EOC*****Revision 3*****Changes related to 1348074: HU number range does not accept LPN number ,
1348074:

****BOC*****Revision 4*****#1487294 Segment’s line number (POSNR) incorrect:


Transport H1DK910678 -> Task H1DK921340 .
Object type Object Name
Function Group ZGFG_MTD_IDOC_DEL_INP

****EOC*****Revision 4*****#1487294 Segment’s line number (POSNR) incorrect:


ENTERPRISE FIRST: Global Template

13 | P a g e
ENTERPRISE FIRST: Global Template

7. Unit Test Plan

Test Step Step Description Test Data Expected Actual Result Executed Remarks
Condition Result By/Date
1.Check if 1. When data is received Delivery No 180005697 IDOC Sourish Mohan Pass in H1D200
IDOC is posted from outside system and Posted Chakraborty
and inbound once the IDOC is posted Purchase Order No Successfully 2337_1.docx
09308604
delivery is we check the data via 4500011580 Date
picked, packed transaction we02 and 22.05.2021
correctly for verify the correctness of Created Batch No
the same batch data. 11161007AD
having different
materials. 2. Check batch Vendor Name
manufacturing date in Admiral Beverages
transaction MSC3N.
Actual Material / Quantity
3. Check if correct batch 300100643 / 70
number is populated in 300100714 / 100
VL32N/VL33N.

4. Check if line numbers Splitted Material / Quantity


are populated correctly in 300100643 / 35
VL32N/VL33N. 300100643 / 35

5. Check status of IDOC in 300100714 / 75


WE02. 300100714 / 25

6. Check Handling Unit E1EDL24-LICHN


Status in VL32N / VL33N 160426130010000
Packaging Information.
E1EDL37-INHALT
1632MG04261300110108927102
7. Manufacturing date is 1633MG04261300110108928102
different as E1EDL37-
INHALT is different IDOC Number
0000000003832734

14 | P a g e
I002337 Technical Specification

Test Step Step Description Test Data Expected Actual Result Executed Remarks
Condition Result By/Date
2. Check if 1. When data is received Delivery No 180005693 IDOC Sourish Mohan Pass in H1D200
IDOC is posted from outside system and Posted Chakraborty
and inbound once the IDOC is posted Purchase Order No Successfully 2337_2.docx
09308604
delivery is we check the data via 4500011606
picked, packed transaction we02 and Date
correctly for verify the correctness of Created Batch No’s 22.05.2021
batch split data. 11161007AD
scenario 11171007AD
having different 2. Check batch
materials. manufacturing date in Vendor Name
transaction MSC3N. Admiral Beverages

3. Check if correct batch Actual Material / Quantity


number is populated in 300100643 / 140
VL32N/ VL33N. 300100714 / 100

4. Check if line numbers


are populated correctly in Splitted Material / Quantity
VL32N/VL33N. 300100643 / 5
300100643 /135
5. Check status of IDOC in
WE02. 300100714 / 65
300100714 / 5
6. Check Handling Unit
Status in VL32N/VL33N E1EDL24-LICHN respectively
Packaging Information. 160426130010000
160427130010000
7. Manufacturing date is
different as E1EDL37-
INHALT is different E1EDL37-INHALT
1632MG04261300110108927102
1634MG04271300110108928102

IDOC Number
0000000003832681

15 | P a g e
I002337 Technical Specification

****BOC*****Revision 3*****Changes related to 1348074: HU number range does not accept LPN number , 1348074:
3.Check if 1. When data is received Inbound Delivery: 180006739 IDOC Sourish Mohan Pass in H1D200
IDOC is from outside system and Posted Chakraborty
posted and once the IDOC is posted Purchase Order No Successfully 2337_3.docx
09308604
inbound we check the data via 4500012854
delivery is transaction we02 and Date
picked, verify the correctness of PO ref no 12.08.2021
packed data. 117820653286
correctly
where we are 2. Check batch Created Batch No’s
passing an manufacturing date in 03561007AD
Alphanumeric transaction MSC3N.
value from Vendor Name
Enumerated 3. Check if correct batch Admiral Beverages
External number is populated in
System in VL32N/ VL33N. Actual Material / Quantity
Field EXIDV. 300100643 / 216
4. Check if line numbers
are populated correctly in E1EDL24-LICHN respectively
VL32N/VL33N. AS122101

5. Check status of IDOC in EXIDV2


WE02. 1528AS1221010012
EXIDV
6. Check Handling Unit 459004971200038847
Status in VL32N/VL33N
Packaging Information. E1EDL37-INHALT
1528AS12210100120106760108

7. Check Manufacturing IDOC Number


date in E1EDL37- 4070593
INHALT.

8. Check EXIDV 1/2 value


in HU DENTIFIICATION
1 / 2. Can be checked
by clicking on HU
number in packing option
of VL33N

16 | P a g e
I002337 Technical Specification

****EOC*****Revision 3*****Changes related to 1348074: HU number range does not accept LPN number , 1348074:

****BOC*****Revision 4*****#1487294 Segment’s line number (POSNR) incorrect:

****EOC*****Revision 4*****#1487294 Segment’s line number (POSNR) incorrect:

Error Handling - functionality in case of errors (e.g., Customer not found, Record already exists)

Test Step Step Description Test Data Expected Result Actual Result Executed By/Date Remarks
Condition
Sourish Mohan Pass in H1D200
1 Multiple PO 1 When data is received PO Reference As Expected. Chakraborty
number exists from outside system number 2337_4.docx
09308604
for a particular and
Reference once the IDOC is 45000 Date
number. posted we check the 26.05.2021
data via transaction
we02 and verify the
correctness of data.
2
Here the IDOC will fail,
and the error will be for
multiple PO for a single
reference number

17 | P a g e

You might also like