SAP EDI Inter-Company Billing - Automatic Posting To Vendor Account

Inter-Company Billing - Automatic Posting To Vendor Account (SAP-EDI)

Automatic posting to vendor account is done by EDI. In our case where both companies
are proccessed in the same system (& client), it is sufficient to create Idoc.
This proccess requires several steps:
1. Creating a Customer to represent the receiving Company.
2. Creating a Vendor to represent the supplying company.
3. Creating a Port
4. Maintain an Output Type
5. Creating a Logical Address
6. Creating a Partner Profile for both Customer & Vendor
7. The relevant MM customizing is maintained.
8. The relevant FI customizing is maintained.



1. Creating a Customer to represent the receiving Company.
The customer has already been created (XD01) for the purpose of Intercompany
processing and entered in the approperiate transction in customizing (Sales and
Distribution à Billing à Intercompany Billing à Define Internal Customer Number By
Sales Organization).

Note: The cutomer has been created in the supplying company code.
The organizational data in this case is:
Supplying Company Code: 1180
Supplying Plant: 1180
Supplying Sales Organization: 1180
Supplying Distribution Channel: 01
Supplying Division: 00
Receiving Company Code: 3100
Customer representing the receiving Company Code: P3100


2. Creating a Vendor to represent the supplying company.
The Vendor is created with the standard transaction (XK01).
Note: The Vendor is created in the receiving Company Code. The organizational data in
this case is the same as above.

Vendor representing the supplying Company Code: P1180
NOTE: There is NO need to “connect” vendor to customer in the control screen.


3. Creating a Port
Tools à Business Communication à IDoc Basis à Idoc à Port Definition (T. Code WE21)
Maintain Transactional RFC: (Choose Transactional RFC and press the create icon).
A dialog box will open asking whether you want the system to generate an automatic
name or whether you wish to use your own name.

Port name: Automatically generated
Version: 4.x
RFC destination: PLD (This was defined by the basis people).



4. Maintain output type
Output Type RD04 - Invoice Receipt MM is a special function, responsible for the execution of the Idoc and will be entered in the Partner Profile later on.

Output type RD04 is maintained: Img: Sales and Distribution -> Basic functions -> Output control -> Output Determination -> Output Determination Using the Condition Technique -> Maintain Output Determination for Billing Documents à Maintain Output Types (T. Code V/40).








Partner functions


Sales and Distribution -> Basic Functions -> Output Control -> Output Determination à
Output Determination Using the Condition Technique -> Maintain Output Determination
for Billing Documents.

Assign Output Types To Partner Functions

Maintain Output Determination Procedure

Assign Output Determination Procedures



Master Data
Maintain output Master Data
Logistics -> Sales and Distribution -> Master Data -> Output -> (T. Code VV31)



5. Create Logical Address
Img: Sales and Distribution -> Billing à Intercompany Billing -> Automatic Posting To
Vendor Account (SAP-EDI) -> Assign vendor. (T. Code WEL1)
Logical address 1180P3100 is made of the supplying Company Code (1180) and the
receiving Customer (P3100).

Note: If the receiving Customer is a numeric number you must add zeros between the
Company code and Customer number so the Logical Address will be 14 digits.
E.g if the customer number was 3100, than the logical address would have been
11800000003100 as can be seen in the second line.
(In our case the customer is an alpha numeric number so the second line was not necessary. It was created just for this documentation and was not saved)

The Logical address is completed when the receiving Company Code and the Vendor are
entered in the detail screen.


It is also necessary to activate the account assignment.

IMG: Sales and Distribution -> Billing à Intercompany Billing -> Automatic Posting To
Vendor Account (SAP-EDI) -> Activate account assignment.


6. Creating a Partner Profile for both Customer & Vendor
Tools à Business Communication -> IDoc Basis -> Idoc -> Partner Profile (T. Code
WE20)

Customer:
Put cursor on Partner type KU and press create.
Enter typ, Agent & Lang,
SAVE


Press in outbound paratrs. Section, to maintain detail screens
The following screen will appear.

Enter the following data in the appropriate fields:
Partn.funct. BP
Message type INVOIC
Message Code FI
Receiving port A000000001
Basic Type INVOIC01

Press enter and the screen will change to the following:
Enter PacketSize 1


Go to the Message Control tab press and enter the data as specified in the following
screen.

You can repeat the process for cases where invoice verification is done against purchase
order. in this case enter MM in “message code field.

As you can see the only difference between the FI & MM invoice is in the message code
and output type.
NOTE: You cannot use output type RD04 again therefore you must copy it in
customizing to another output type (in this case RD00)

Vendor
Follow the same procedures but maintain the inbound parameter Screen as follows:


7. FI CUSTOMIZING
Financial Accounting à Accounts Receivable and Accounts Payable à Business
Transactions -> Incoming Invoices/Credit Memos -> EDI -> Enter Program Parameters
for EDI Incoming Invoice (T. Code OBCE)

Make sure to maintain posting types, tax code and invoice doc.type.
Use KR when not using purchase order & RE when using purchase order.

Assign Company Code for EDI Incoming Invoice
By leaving the field CoCD blank, all company codes are available.
Assign G/L Accounts for EDI Procedures (T. Code OBCB)

P1180 = Vendor
3100 = Company Code of receiving company (of customer)


NOTE:
G/L account should not be connected to CO. Assign Tax Codes for EDI Procedures (T.Code OBCD) It is necessary to match the output tax from the sales order to the input tax.
Tax type = Output Tax
Tx = Input Tax


Accounting -> Financial Accounting -> General Ledger -> Master Records -> Individual
Processing -> Centrally (T.Code FS00)


G/L account no. = account number that was entered in transaction OBCB (page 24)
Tax category must allow for input tax.

Make sure manual posting is allowed for the G/L account. (“Create/Bank/Interest”
screen).

TEXT
In many cases the G/L account has been configured so that text is mandatory. This could
be either Header Text or Item Text.
Header Text
No special configuration is necessary. Just enter text in the “Header note”. You may use
the following access sequence.

Item Text
It is necessary to implement a userexit in order to fill the item text field. Detailed
instructions are found in note 39503


8. MM Customizing:
Make sure the Unit of Measure’s ISO Codes are configured correctly.
General Settings à Check units of measurement (T. Code CUNI)



Optional MM Customizing:
NOTE: This is only necessary for logistics invoice verification.
Materials Management à Logistics Invoice Verification à EDI à Enter Program
Parameters



Monitoring
There are several transaction that allow you to monitor the IDoc. First you need to know
the IDoc number. You can see the IDoc number in the processing log in the “Header
output” screen in the billing document.

You can use transaction WE02 or WE05. Enter the IDoc number in the selection screen. If you have an error in the IDoc, you could analyze it with transaction WE19

Copy or Upload Excel Journal Entry to SAP

SAP F.02 Copy from .XLS Excel Journal Entry

You can copy journal entries from Excel (.xls) and & paste them into SAP FB50 and F-02.

-when in FB50, fill out the required header rows,
-then choose menu path ENVIRONMENT -> COMPLEX POSTING (F6)


-Click "FAST DATA ENTRY" button this will give you the old GL fast entry screen which have 20 journal lines

or faster way is to go to SAP T-code F-02 directly.


If you can shrink your windows screen controls, you should be able to double the number of entry lines available. (depending on your screen resolution)

To move from cell to cell in Fast entry screen , use TAB key instead of "Enter" .


SAP F-02 fast entry display more journal lines and for allocating Debit or Credit journal entries , you enter posting keys in your excel sheet and copy manually to SAP F.02 screen.


If it is regular , you may create a program to upload excel data (.xls) to SAP.
There are two function modules you can use:
(1)'ALSM_EXCEL_TO_INTERNAL_TABLE'
(2) 'KCD_EXCEL_OLE_TO_INT'.
Very similar but the first function module (ASLM) used in for foregroundprocessing


Example from Marc Hoffmann
*Internal table to receive excel data
Data: Begin of in occurs 0.
include structure ALSMEX_TABLINE.
Data: End of in.

*internal table with result (your 3 field-table)
Data: begin of ex occurs 0,
f01(32), "max
f02(32),
f03(32),
.....
End of ex.

Data: fname(10).
Field-symbols: .

* so now you call the function to receive the data from EXCEL into table IN
* after that:
Fname = 'EX-F'.
Loop at in. "per column one line entry
at new row. Clear: ex. Endat.
move in-col+2 to fname+4(2).
assign (fname) to .
move in-value to .
at end of row.
append ex2.
Clear: ex.
endat.
Endloop.
* result: your table EX is filled matching your EXCEL sheet
That works flexible for whatever number of column you will receive (in my example max 99).


If you use ALSM_EXCEL_TO_INTERNAL_TABLE
Then:

parameters: p_fname LIKE rlgrap-filename
default 'C:\temp\cpv25000.xls' obligatory.

form upload_one_sheet.
Data: st_col type i value 1,
st_row type i value 1,
en_col type i value 90,
en_row type i value 9999. "max number of lines
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = p_fname
I_BEGIN_COL = st_col
I_BEGIN_ROW = st_row
I_END_COL = en_col
I_END_ROW = en_row
TABLES
INTERN = in
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
case sy-subrc.
when 0.
when 1. message e016(38) with 'Inconsistent parameters'.
when 2. message e016(38) with 'Error upload OLE'.
when others. message e016(38) with 'Error'.
endcase.
endform.

SAP SD related transaction codes

SAP SD related transaction codes

Customer
XD01 Create Customer (Centrally)
XD02 Change Customer (Centrally)
XD03 Display Customer (Centrally)
XD04 Customer Changes (Centrally)
XD05 Block customer (centrally)
XD06 Mark customer for deletion (centr.)
XD07 Change Customer Account Group
XD99 Customer master mass maintenance
XDN1 Maintain Number Ranges (Customer)

Vendor
XEIP Number range maintenance: EXPIMP
XK01 Create vendor (centrally)
XK02 Change vendor (centrally)
XK03 Display vendor (centrally)
XK04 Vendor Changes (Centrally)
XK05 Block Vendor (Centrally)
XK06 Mark vendor for deletion (centrally)
XK07 Change vendor account group

Sales Order
VA00 Initial Sales Menu
VA01 Create Sales Order
VA02 Change Sales Order
VA03 Display Sales Order
VA05 List of Sales Orders
VA07 Compare Sales - Purchasing (Order)
VA08 Compare Sales - Purchasing (Org.Dt.)

Inquiry
VA11 Create Inquiry
VA12 Change Inquiry
VA13 Display Inquiry
VA14L Sales Documents Blocked for Delivery
VA15 Inquiries List

Quotation
VA21 Create Quotation
VA22 Change Quotation
VA23 Display Quotation
VA25 Quotations List
VA26 Collective Processing for Quotations

Contract
VA41 Create Contract
VA42 Change Contract
VA42W Workflow for master contract
VA43 Display Contract
VA44 Actual Overhead: Sales Order
VA45 List of Contracts
VA46 Coll.Subseq.Processing f.Contracts

Item Proposal
VA51 Create Item Proposal
VA52 Change Item Proposal
VA53 Display Item Proposal
VA55 List of Item Proposals
VA88 Actual Settlement: Sales Orders

Delivery (Outbound)
VL00 Shipping
VL01 Create Delivery
VL01N Create Outbound Dlv. with Order Ref.
VL01NO Create Outbound Dlv. w/o Order Ref.
VL02 Change Outbound Delivery
VL02N Change Outbound Delivery
VL03 Display Outbound Delivery
VL03N Display Outbound Delivery
VL04 Process Delivery Due List
VL06 Delivery Monitor
VL06C List Outbound Dlvs for Confirmation
VL06D Outbound Deliveries for Distribution
VL06F General delivery list - Outb.deliv.
VL06G List of Oubound Dlvs for Goods Issue
VL06I Inbound Delivery Monitor
VL06IC Confirmation of putaway inb. deliv.
VL06ID Inbound Deliveries for Distribution
VL06IF Selection inbound deliveries
VL06IG Inbound deliveries for goods receipt
VL06IP Inbound deliveries for putaway
VL06L Outbound Deliveries to be Loaded
VL06O Outbound Delivery Monitor
VL06P List of Outbound Dlvs for Picking
VL06T List Outbound Dlvs (Trans. Planning)
VL06U List of Uncheckd Outbound Deliveries
VL08 Confirmation of Picking Request
VL09 Cancel Goods Issue for Delivery Note
VL10 Edit User-specific Delivery List
VL10A Sales Orders Due for Delivery
VL10B Purchase Orders Due for Delivery

Customer management
FD01 Create Customer (Accounting)
FD02 Change Customer (Accounting)
FD02CORE Maintain customer
FD03 Display Customer (Accounting)
FD04 Customer Changes (Accounting)
FD05 Block Customer (Accounting)
FD06 Mark Customer for Deletion (Acctng)
FD08 Confirm Customer Individually(Actng)
FD09 Confirm Customer List (Accounting)
FD10 Customer Account Balance
FD10N Customer Balance Display
FD10NA Customer Bal. Display with Worklist
FD10NET Customer Balance Display
FD11 Customer Account Analysis
FD15 Transfer customer changes: send
FD16 Transfer customer changes: receive
FD24 Credit Limit Changes
FD32 Change Customer Credit Management
FD33 Display Customer Credit Management
FD37 Credit Management Mass Change

Pricing
V/03 Create Condition Table (SD Price)
V/04 Change Condition Table (Sales pr.)
V/05 Display Condition Table: (Sales Pr.)
V/06 Condition Categories: SD Pricing
V/07 Maintain Access (Sales Price)
V/08 Conditions: Procedure for A V
V/09 Condition Types: Account Determin.
V/10 Account Determination: Access Seqnc
V/11 Conditions: Account Determin.Proced.
V/12 Account Determination: Create Table
V/13 Account Determination: Change Table
V/14 Account Determination: Display Table

BOM
CS00 BOM Menu
CS01 Create Material BOM
CS02 Change Material BOM
CS03 Display Material BOM
CS05 Change Material BOM Group
CS06 Display Material BOM Group
CS07 Allocate Material BOM to Plant
CS08 Change Material BOM - Plant Alloc.
CS09 Display Allocations to Plant
CS11 Display BOM Level by Level
CS12 Multilevel BOM
CS13 Summarized BOM
CS14 BOM Comparison
CS15 Single-Level Where-Used List
CS20 Mass Change: Initial Screen
CS21 Mass Material Change: Initial Screen
CS22 Mass Document Change: Initial Screen
CS23 Mass Class Change: Initial Screen
CS25 Archiving for BOMs
CS26 BOM deletion
CS27 Retrieval of BOMs
CS28 Archiving for BOMs
CS31 Create class BOM
CS32 Change class BOM
CS33 Display class BOM
CS40 Create Link to Configurable Material
CS41 Change Material Config. Allocation
CS42 Display Material Config. Assignment
CS51 Create standard BOM
CS52 Change standard BOM
CS53 Display standard BOM
CS61 Create Order BOM
CS62 Change Order BOM
CS63 Display Order BOM
CS71 Create WBS BOM
CS72 Change WBS BOM
CS73 Display WBS BOM
CS74 Create multi-level WBS BOM
CS75 Change multi-level WBS BOM
CS76 Display multi-level WBS BOM
CS80 Change Documents for Material BOM
CS81 Change Documents for Standard BOM
CS82 Change documents for sales order BOM
CS83 Change documents for WBS BOM
CS84 Change documents for class BOM
CS90 Material BOM Number Ranges
CS91 Number Ranges for Standard BOMs
CS92 Number Ranges for Sales Order BOMs

SAP :Build a Form with SMART FORMS

SAP :Build a Form with SMART FORMS

Call the transaction SMARTFORMS.
Enter a name of a new Form to be built with SMARTFORMS and press the Create command button.



The Form Builder appears on the screen.
Any node can be selected or expanded from the left hand side tree menu.

Select the Form Interface node and provide the names of the internal tables containing the data. (In this example we have a Customer table and a Customer's Transaction Table connected with an one to many relationship).

Select the Global Definitions and provide the names of two variables for controlling the page break after finishing a section of a Customer.


In the initialization tab of the Global Definitions node, give the code calculating the number of Customers. Input and output parameters should be provided so that the code works correctly.


After expanding the %PAGE1 node, we can notice that a Main Window exists. From the context menu (appearing by clicking the right mouse button) of the Main window select Create -> Complex Section.


This Section has data which are processed repeatedly and the Output Type (the format) is Unstructured.


The data of this Section are retrieved from the internal table I_ZCUST and are stored in the data structure I_ZCUST in each iteration



At this point select the context menu of the Section and create a Text Element.


Type the names of the fields of the internal table in the General Attributes tab. The field names are enclosed in ampersands.


From the context menu of the Text Element create a series of Program lines.



This series of Program lines, (actually a single Program line), increases the index of Customers printed by one (Variable INDEX_CUST_PRN). Input and Output parameters should be declared on the appropriate fields of the tab (In this case the Input and the Output parameter is the variable INDEX_CUST_PRN).

From the context menu of the Program Lines create a second Complex Section

This Section has data which are processed repeatedly.
The Output Type (format) is a table.


Specify a Table Width and a Line Type.


Select the Data tab and specify the Loop in the I_ZTRANSACTIONS table and the Where condition.

On the Events tab select the Header and Footer events and specify a Height of the Footer.

Select the Header node and check the New Line checkbox


At this point from the %Section2 context menu select Create -> Text


On the Global Attributes tab of the Text Element type the fields of the internal table we wish to show on the form enclosed in ampersands. The Text node is Appended directly (check the relevant radio button).


From the context menu of the Footer Event select Create -> Command .


Drag the %Command1 created and drop it on the %Section2 node.
A popup window appears and select After the node %Section2.

So the %Command1 is aligned to the Footer of %Section2.
Check the Go to New Page checkbox


Select the Conditions tab of the Command element an set the condition that a new page is created if the last customer is not reached by the printing process (I e the Index of the Customers printed is less than the Number of Customers).

Start another session and call the transaction SE78


Expand the Graphics node on the left hand side tree menu, select BMAP Grid screens node and double click on it. On the right hand side provide the SAP name of a new graphic and check the Color radio button. Press the Import command button


On the appearing popup window provide the path where the bitmap image is stored and check the checkbox stating that Resides in the Printer Memory.
Press the Continue command button
The appearing screen shows that the graphic has been successfully imported into the SAP graphics management.
The appearing screen shows that the graphic has been successfully imported into the SAP graphics management.
On the General Attributes tab of the %Graphic1 created type the SAP Name of the graphic and provide the Object, ID, Color attribute and Resolution.
Activate the Form from the menu path Form -> Activate
The function module SSF_FUNCTION_MODULE_NAME has as its import parameter a name of a Form created with SMARTFORMS and gives as output a function module name. The latter when executed with table parameters the internal tables of the SMARTFORMS Form, gives the final printout

Further reading in the SAP Library on link http://help.sap.com/saphelp_46c/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm. Or through the path Basis Components -> Basis Services / Communication Interfaces (BC-SRV) -> SAP Smart Forms (BC-SRV-SCR) .
by Stefanos Moschidis