Custom Program - Transport Cost
Custom Program - Transport Cost
Custom Program - Transport Cost
We need to create three new tables: One Header and two-Line tables for this requirement with the
fields specified in the below tables. Fields JOB ID, JOB date & Sub Job No must be created as key
fields and as foreign key for the item tables.
Table Name: -
Header: ZINVHEADER
Item 1: ZINVITEMPROS
Item 2: ZINVITEMUNPROS
Header Table
Field Name Nature
JOB ID Key Field - System Generated
JOB Date Key Field - System Generated
Sub Job No Key Field - System Generated
Vendor No Input Field
Vendor Name System Generated
Bill of Lading Input Field
Reference No Input Field
Tax Code Input Field
Currency Input Field
Status System Generated
Doc date Input Field
Posting Date Input Field
FI Document No System Generated
Year System Generated
REV Doc date Input Field
REV Posting Date Input Field
REV FI Document System Generated
REV Year System Generated
Total Freight Cost System Generated
Total Import Duty System Generated
Total Other Cost System Generated
Message System Generated
Input Screen: -
Input Fields: -
MKPF-FRBNR: Bill of Lading
Total Freight Cost
Total Import Duty Cost
Job ID
Job Date
Sub Job No
Field Name Field Description Required Criteria
MKPF-FRBNR Bill of Lading X Radio Button 1, 2, 3 & 4
Custom Total Freight Cost Radio Button 1
Custom Total Import Duty Cost Radio Button 1
Custom JOB ID X Radio Button 2
Custom JOB Date Radio Button 2
Custom Sub Job No X Radio Button 2
Radio Button 1 Process
Radio Button 2 Failed
Radio Button 3 Display
Radio Button 4 Report
Table: MSEG
MBLNR: Material Doc
MJAHR: Year
MATNR: Material
WERKS: Plant
WAERS: Currency
DMBTR: Amount in LC
BUALT: Amount in POC
ERFMG: Quantity in UnE
ERFME: Unit of Entry
EBELN: Purchase order
EBELP: PO Line
BDC Program: -
We need three different BDC recordings (Transaction code: FB60) for this custom program to post
the other cost as stated below.
1. Freight Invoice
2. Import Duty Invoice
3. Freight & Import Duty Invoice
BDC Recording: -
Required Fields: -
Vendor Number – Input field
Invoice Date – Input Field
Posting Date – Input Field
Reference – Input Field
Header Amount – System Generated
Currency – Input Field
Text – Input Field (Bill of lading Number)
GL Account – Default Value (Table Variable)
Line Amount - System Generated
Tax code – Input Field
Cost Center – Default Value (Table Variable)
Table variable: -
ZFREIGHTGL – Default Freight GL
ZFREIGHTCC – Default Freight Cost Center
ZIMPORTGL – Default Import Duty GL
ZIMPORTCC – Default Import Duty Cost Center
Program Logic: -
Radio Button 1: -
When the radio button 1 is selected, the selection screen should appear only with the fields like Bill
of Lading, Total Freight Cost and Total Import Duty Cost as specified in the above table.
Pass the bill of lading number into the table: MKPF and extract all the records with the field data as
specified in the required tables and fields.
Pass all the material documents and year into the table: MSEG and extract all the records with the
field data as specified in the required tables and fields.
Bring all the extracted information’s into the second processing screen as shown below with the
specified nature of the fields for the data processing.
The system should generate job ID based on the next available JOB ID in the table: ZINVHEADER.
Mandatory fields in the second screen are Vendor Number, Document date, Posting date, Reference
Number & Tax code.
Tax Code – Dropdown list same as the Table: T007S where SPRAS (language) = EN and KALSM
(Procedure) = TAXB
Enable “Post” button if the FI Document Number AND FI Document Year = Blank.
Enable “Reverse” button if the REV FI Document Number AND REV FI Document Year NE Blank
Post Button: -
Calling BDC logic: -
If Total Import Duty Cost = Blank, then call BDC 1.
If Total Freight Cost – Blank, then call BDC 2
If both the Total Import Duty Cost & Total Freight Cost NE BLANK, then call the BDC 3.
If both Distributed Freight Cost AND Distributed Import Duty Cost = BLANK, then consider that line
as the unprocessed line.
Else, processed line.
If BDC posting is successful, then update the FI document No & Year and Status = Posted, and store
all the information in the