Skip to Content

Sales Documents upload using Standard Direct Input Program in LSMW

Table of Contents

  1. OVERVIEW.. 5

LSMW using Direct Input Program.. 6

STEP-1:  Maintain Object Attributes. 8

STEP-2:  Maintain Source Structures. 9

STEP-3:  Maintain Source Fields. 10

STEP-4:  Maintain Structure Relationships. 11

STEP -5:  Maintain Field Mapping. 11

STEP -6 :  Maintain Fixed Values, translations, user Routines. 13

STEP -7:  Specify Files. 14

STEP-8: Assign Files. 15

STEP- 9: Read Data. 16

STEP -10:  Display Read Data. 17

STEP-11: Convert Data. 18

STEP-12: Display Converted Data. 18

STEP-13: Check Data against Customising. 19

STEP-14:  Start Direct Input Program.. 20

STEP-15:  Frame Program for Periodic Data Transfer 22

Appendix-A: Logical File Path and File Name Definition. 25



In most of the SAP Implementation / Support projects it is a common requirement to have a facility to upload sales documents to SAP. These Sales Documents may be the open sales orders during cutover stage or the documents generated in non-sap systems on a regular basis.

The challenge lies in the multiple line items of the documents to be uploaded. This makes it difficult to create a Recording in LSMW as the number of line items is not fixed. The general solution to this is to create a BDC program. This takes cares of the multiple line items  in the documents to  be uploaded.

However, the same can be done via SAP’s Standard Direct Input Program. The SAP Program RVINB10 provides Eight Hierarchical Structures to capture Sales Documents data. The data that can be uploaded includes header data, item Data, Schedule Line data, Partner Data and Text data (Both header and line item texts).

All the sales documents can be processed by this direct Input Program. The sales Documents include Contracts, Scheduling Agreements, quotations, Inquires and sales orders.

In this document, we will see how to set up such a LSMW Project. The exported LSMW project is also attached in .TXT format. In Appendix-A, the process of creating Logical File Path and Logical File names is also explained.


LSMW using Direct Input Program

In LSMW TCode, Create a Project, Sub project and Object.

Note: It is recommended to  keep the  names of the Project , sub project and Object short as the converted file name is a concatenation of the above three names. If names are of longer length, the converted file name may exceed the max file name length.

Now, We will look into each of the 15 Steps of the LSMW.


STEP-1:  Maintain Object Attributes

In Object Attributes, select Standard batch / Direct Input Option.

Select Object as 90: Sales Documents and method as 0000.

The program Name RVINB10 is automatically selected and Displayed.

Display Object Attributes.jpg


STEP-2:  Maintain Source Structures

In Second Step create as many Source Structures as the data you want to supply.

The Program has following eight Structures :

  • BVBAKKOM : Sales Document Header
  • BVBPAKOM: Sales Document Partners
  • BVBAPKOM: Sales Document Items
  • BVBEPKOM: Sales Documents Schedule Lines
  • BTEXHKOM: Sales Documents: Text header
  • BTEXLKOM: Sales Documents: Text  Lines

The Text Structures are available both at sales Documents Header and Item level, facilitating upload of both header and line item texts.

We need only create those many structures which we are going to upload data with.

In our example, we will be creating only three Structures for source Data:

  • ZVBAKKOM : Sales Document Header
  • ZVBPAKOM: Sales Document Partners
  • ZVBAPKOM: Sales Document Items

Source Structures.jpg

Note: Kindly create the source Structures as per the hierarchical relationship of the program structure.

STEP-3:  Maintain Source Fields

The Source Fields can be created using reference from the standard Structures

Note: It is mandatory to pass all the dates in the input structure.

It is recommended to use table Maintenance view [CTRL+F9] to create the source Fields.

STEP-4:  Maintain Structure Relationships

Assign the Source Structures to their Counterparts

Structure Relations.jpg

STEP -5:  Maintain Field Mapping

For all the  fields we want to  pass to the  program, map a  corresponding field from the source Structure.

If the number of  the fields to be mapped are more, it  is recommended to use Auto Field Mapping Feature.

It is available at Extras -> Auto Field Mapping

STEP -6 :  Maintain Fixed Values, translations, user Routines

In this example we are not using any  fixed values, translations or User Routines.


STEP -7:  Specify Files

Specify  three Input files  one each for each structure.

The Converted and Read File Names are automatically Created.

Double click on Converted Data.

In the Popup that  opens, Enter Logical path and Logical File Name.

Converted data.jpg

Note: For Creation of Logical Path and Logical File, Refer Appendix-A


STEP-8: Assign Files

Assign a  Input File to each of the Structures

Assign files.jpg

Note: An Input File cannot be assigned to Multiple Structures


STEP- 9: Read Data

Once you have placed the input data in the respective files in same format as the source structures, you can execute this step.

To get a sample input file you can execute Program: RVINVBT0.

It will give you a excel file with values for all fields in the standard Structures.

This can be used to create input files as per our requirement.

Use  the option: Write file to presentation server with a physical file name to download the sample file to your system.

STEP -10:  Display Read Data

The Display Read data option can be used to verify the data that has been read into the respective Structures.

Note:  Use From-To Lines to see the data in respective structures, as in some systems by default it will only show the contents of the last line.


STEP-11: Convert Data

This will convert the read data and fill in the Logical File as specified in the specify files step.

STEP-12: Display Converted Data

Note:  Use From-To Lines to see the data in respective structures, as in some systems by default it will only show the contents of the last line.


STEP-13: Check Data against Customising

In this step, you can check whether the fields provided in the input file are valid as per configuration.

Note:  It will give error for all blank fields, you can ignore them.

Clicking on With Duplicate will remove the errors repeated for line items.

STEP-14:  Start Direct Input Program

On executing this step, the system gives a pop up asking to select either the program or the transaction.

We will generally be using the Program RVINB10.

Selecting Program RVINVB10 will give you the following selection screen.

Select the Option: File on Application Server with a logical File name,

Enter the logical File name given in the specify Files Step.

Transfer Sales Docs.jpg

On executing the Document Upload will begin.

This is a Foreground upload and will give you a Standard Message:

working online.jpg

For background Processing, refer Step 15.

If you select Transaction BMV0 option, the following screen is displayed.

It is generally used when you have a Direct Input Job defined and you want to monitor that job.


STEP-15:  Frame Program for Periodic Data Transfer

If you wish to use this LSMW in background or as a periodic Job, you can execute this 15th Step.

This is same as the program /SAPDMC/SAP_LSMW_INTERFACE.

You can create a variant with the desired values for the Parameters available with this program.

This variant can be used to Schedule a job for periodic from SM36. 


Appendix-A: Logical File Path and File Name Definition

In FILE Tcode:

  1. 1. In Logical File Path Definition
  2. 2. Create New Entries
  3. 3. Enter Logical Path and Logical Path Name (Description)
  4. 4. Select the newly created Logical path and Select Assignment of Physical path
  5. 5. Enter Syntax Group as Windows NT
  6. 6. Enter Physical path as <FILENAME>

Logical File Path1.jpg

In Logical File Name Definition

  1. 1. Click on New Entries
  2. 2. Enter  Logical File
  3. 3. Logical File Name
  4. 4. Physical File and  Logical path Name
  5. 5. The Physical File name must be exactly same as the Converted Data File of the LSMW Project.

Logical File Path.jpg

You must be Logged on to comment or reply to a post.