lsmw to upload journal entries

20
LSMW for Uploading Journal Entries This method uses several nice features: 1. Positives or negatives can be within the upload file. The program will determine debit or credit 2. Can be used for Cost Center Postings, Order Postings or balance sheet Profit Center postings within same file 3. Header text and line item text can be used 4. Compund entries are accepted rather than one debit and an offsetting credit being required Create Project, Subproject and Object First step is to assign the program or recording. We will use a program this time.

Upload: david-bragg

Post on 03-Jan-2016

299 views

Category:

Documents


16 download

DESCRIPTION

Use LSMW (Legacy System Migration Workbench) to upload Excel-based journal entries into SAP.

TRANSCRIPT

Page 1: LSMW to Upload Journal Entries

LSMW for Uploading Journal Entries

This method uses several nice features:

1. Positives or negatives can be within the upload file. The program will determine debit or credit

2. Can be used for Cost Center Postings, Order Postings or balance sheet Profit Center postings within same file

3. Header text and line item text can be used4. Compund entries are accepted rather than one debit and an offsetting credit being

required

Create Project, Subproject and Object

First step is to assign the program or recording. We will use a program this time.

Page 2: LSMW to Upload Journal Entries

Use the FB01 Program-

Page 3: LSMW to Upload Journal Entries

Create a header and detail (line items) section

Create all lines as the above example

Page 4: LSMW to Upload Journal Entries

Final Result-

Page 5: LSMW to Upload Journal Entries

Result-

This section is long and tedious but be careful and go slowly to avoid mistakes

Examples below is to use a source field for document date. However, the document type will be hard coded as SA. This simply reflects two styles to be used to make the user entry easier.

Page 6: LSMW to Upload Journal Entries

Final Header section-

Detailed Line Items Section:

In order to interpret positives as posting key 40 and negatives as posting key 50, use this logic in the Posting Key field:

* Target Field: BBSEG-NEWBS Posting Key for the Next Line Item

data wrk_amt type f.

wrk_amt = DOC_LINE_ITEMS-AMOUNT.

if wrk_amt > 0.

BBSEG-NEWBS = '40'.

else. BBSEG-NEWBS = '50'.

endif.

Page 7: LSMW to Upload Journal Entries

Now, the system knows when to apply debit or credit based on whether the value is positive or negative. We will need to convert the values now from the text file from negatives to positives. All values must end up as positives. Therefore, the next code will simply use the values designated as 40 (positives), and reverse the others (negatives).

if BBSEG-NEWBS = '40'.

BBSEG-WRBTR = DOC_LINE_ITEMS -AMOUNT.

else. BBSEG-WRBTR = DOC_LINE_ITEMS -AMOUNT * -1.

endif.

In our case, we wish to have cost center populated sometimes, order number sometimes and in the case of balance sheet accounts, neither one, here we only want profit center. Profit center will be derived for the cost center and order fields. This means we must have code that allows each of these elements to be populated or not, based on what the text file includes.

Page 8: LSMW to Upload Journal Entries

Code for Cost Center-

if DOC_LINE_ITEMS -COSTCTR NE ''.

BBSEG-KOSTL = DOC_LINE_ITEMS -COSTCTR.

endif.

Code for Order number-

if DOC_LINE_ITEMS -ORDERNO NE ''.

BBSEG-AUFNR = DOC_LINE_ITEMS -ORDERNO.

endif.

Code for Profit Center-

if DOC_LINE_ITEMS -PRCTR NE ''.

BBSEG-PRCTR = DOC_LINE_ITEMS -PRCTR.

endif.

Add Line item text-

Page 9: LSMW to Upload Journal Entries

Finally, Account number-

Record ID is only needed to link the Header and Detail together. No mapping is required here.

Page 10: LSMW to Upload Journal Entries

Add detail now-

Page 11: LSMW to Upload Journal Entries

Pull in 2 useful User menu items the first time to generate the program-

Page 12: LSMW to Upload Journal Entries
Page 13: LSMW to Upload Journal Entries

Make sure to create 2 text files (for the Header and Line Items) as the examples below-

Generation is only required the first time. Uncheck for other users (User Menu) after success.

Page 14: LSMW to Upload Journal Entries

After generating the program and reading the data, the result should look like this-

Display Read Data-

Above import looks like an extra line exists in the header file. Open file, delete extra lines and read again.

Page 15: LSMW to Upload Journal Entries

Converson Program also required only the first time.

Page 16: LSMW to Upload Journal Entries
Page 17: LSMW to Upload Journal Entries
Page 18: LSMW to Upload Journal Entries

Result in FB03-