Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
10 views

01-Upload Purchase Order Data Using Multiple Flat Files

Uploaded by

waiyong2020
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

01-Upload Purchase Order Data Using Multiple Flat Files

Uploaded by

waiyong2020
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 27

Upload Purchase Order data using multiple flat files (LSMW)

By Muthuvel Kumaran, Kaavian Systems

Scenario:

In this tutorial, we will see how to generate Purchase Order using LSMW in Standard Batch/Direct Input
Method. Here, am using two flat files for generating the PO, one file for Header data and another one for
Item data.

Step I:

Before, we go to the LSMW Process. Make the Flat files as shown below with the delimiter as
‘Tabulator’.

Header file:

Item
file:

Step II:

Create an Object in T-Code: LSMW.


Step III:

Press ‘F8’ for Execute the object.

Step IV:

Initial screen for LSMW object


Step 1:

a). Double Click ‘Maintain Object Attributes’ and below screen show and click Standard Batch/Direct
Input and click the F4 for Object and select 0085 Purchase order
b). Click ‘F4’ for choosing the method and select ‘0001’ ‘Purchase order’ ‘RM06EEI0’ and press Enter.
Then Save and Back.

Step2:

a). Double Click on ‘Maintain Source Structures’ then click create a structure(CTRL+F4)
b). Create structure for Header data and Save it.

c). Then click the header structure and create the second structure for Item data and define the
relationship in Lower level and press Enter.

d). create the source structure for Item data and Save it.
e). You will the screen like this.

Step3:

a). Double click on ‘Maintain Source Fields’.

b). click the zheader (source fields) and click the copy fields (CTRL+F8) and select the radio
button ‘Date file (Field name is 1.line)’ and press Enter .

c). Give 99 or more for two fields and press Enter.

d). Browse the header file for source fields and press Enter.
e). Source fields created as below.

f). Click the zline (source fields) and proceeds the same procedure as above step and the source
fields created for Item data, then below screen appears. Finally Save and go Back.
Step4:

Double click on ‘Maintain Structure Relations’

a). Click the Purchase order header and create the Relationship or CTRL+F4.

b). After created the relationship for header and select the source structure zheader and press
Enter.
c). Then Click the second one (Purchase order item) and do the same procedure for Create the
Relationship and assign source structure for Item.

d). Save and Back.

Step5:

Double click on ‘Maintain Field Mapping and Conversion Rules’.


a). Go to ‘Extra’ in menu bar and select the ‘Auto field mapping’.

b). Select the Radio button as same as shown in the below screen and press Enter.
c). You will get the Popup window as shown below and press Enter.

d). After the Auto field mapping completed. You will get the screen like this
e). Add the code for LIFNR conversion routine and double click on the LIFNR field. You will get this code
screen ‘MBEPOH-LIFNR = ZHEADER-LIFNR’.

f). Add the code:

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

INPUT = ZHEADER-LIFNR

IMPORTING

OUTPUT = MBEPOH-LIFNR.

After entered the code ‘Save and Back (F3)’.


g). Double click the code: ZHEADER-BEDAT (BEDAT) for conversion routine and add the code as
shown below:

CALL FUNCTION 'DATE_CONV_EXT_TO_INT'

EXPORTING

i_date_ext = ZHEADER-BEDAT

IMPORTING

E_DATE_INT = MBEPOH-BEDAT.

After entered the code ‘Save and Back (F3)’.


h). Double click on Code: MBEPOI-EINDT = ZLINE-EINDT, then add the below code.

CALL FUNCTION 'DATE_CONV_EXT_TO_INT'

EXPORTING

i_date_ext = ZLINE-EINDT

IMPORTING

E_DATE_INT = MBEPOH-EINDT.

Then Save and Back (F3).


i). Save and go Back.

Step6:

If add any fixed values or other things, we click the ‘Maintain Fixed Values, Translations, User-Defined
Routines’ and add necessary fields and Save it and then press Back. Otherwise, no need to go for 6 th
step.
Step7:

Double click on ‘Specify Files’ and click on the legacy data and choose the ‘Add Entry’ or (CTRl + F2)
for header legacy data file.

a). Select the radio buttons and check boxes as same as shown below.
b). Browse the flat file as shown below.
c). Give the file name ‘header file’ and press Enter.

d).You will get the screen as below.


e). Again we click the legacy data for Item data and click the ‘Add entry’ or (CTRl+F2) for Item Data
legacy file. Follow the same procedure like header legacy data.

f). Double click on Converted Data ‘File for Converted Data (Application Server)’.
g). Assign the Logical Path and give the Logical File Name and press Enter. Then it shows some warning
and press Enter. Finally add the name as shown below.

h). You will get the below screen and Save & go Back.
Step8:

a). Double click on ‘Assign Files’ and click zheader and then click the ‘Assignment’ button or
(CTRL+F2).

b). Select the header file and press Enter.


c). Assign files for Item data and click the Assignment button. Then Save and go Back.

Step9:

a). Double click on ‘Read Data’ and press F8.

b). After the execution and make sure ‘Not written’ is 0 like the below screen and go Back.
Step10:

a). Double click on ‘Display Read Data’ and Dialog screen appears and press Enter.

b). If you want to check the data, just double click on the fields.
c). Verify the data should be correct or not and go Back.

Step11:

Double click on ‘Convert Data’ and Check with that below screen.
Step12:

Double click on ‘Display Converted Data’ and Check with that below screen.

Step13:

Double click on ‘Start Direct Input Program’ and Click the radio button ‘With database update’ and
‘Log with error messages’. Then press F8.
Step V:

Once, the database updated successfully, you will get the screen as shown below and in the meantime
Purchase order numbers also created.

You might also like