Dlver Lsmw Con Bapi

35
Generación de LSMW utilizando BAPI 1. Crear Proyecto....................................................2 2. Activar Puerto de archives para IDOCS.............................2 Creating Ports......................................................3 Partner Types...................................................... 6 Partner Numbers.................................................... 7 Checking the Workflow Customizing..................................9 3. Maintain Object Attributes.......................................11 4. Maintain Source Structures.......................................14 5. Maintain Source Fields...........................................16 6. Maintain Structure Relations.....................................19 7. Maintain Field Mapping and Conversion Rules......................20 8. Specify Files....................................................21 9. Assign Files.....................................................22 10. Read Data...................................................... 23 11. Display Read Data.............................................. 23 12. Convert Data................................................... 25 13. Display Converted Data.........................................25 14. Start IDoc Generation.......................................... 26 15. Start IDoc Processing.......................................... 27 16. Create IDoc Overview........................................... 30 17. Recomendaciones................................................ 31

Transcript of Dlver Lsmw Con Bapi

Page 1: Dlver Lsmw Con Bapi

Generación de LSMW utilizando BAPI1. Crear Proyecto..................................................................................................................................2

2. Activar Puerto de archives para IDOCS........................................................................................2

Creating Ports..........................................................................................................................................3

Partner Types..........................................................................................................................................6

Partner Numbers.....................................................................................................................................7

Checking the Workflow Customizing.......................................................................................................9

3. Maintain Object Attributes..............................................................................................................11

4. Maintain Source Structures...........................................................................................................14

5. Maintain Source Fields...................................................................................................................16

6. Maintain Structure Relations.........................................................................................................19

7. Maintain Field Mapping and Conversion Rules..........................................................................20

8. Specify Files....................................................................................................................................21

9. Assign Files.....................................................................................................................................22

10. Read Data....................................................................................................................................23

11. Display Read Data......................................................................................................................23

12. Convert Data................................................................................................................................25

13. Display Converted Data.............................................................................................................25

14. Start IDoc Generation.................................................................................................................26

15. Start IDoc Processing.................................................................................................................27

16. Create IDoc Overview................................................................................................................30

17. Recomendaciones......................................................................................................................31

Page 2: Dlver Lsmw Con Bapi

1. Crear Proyecto

Se crea el proyecto, sub proyecto y objeto de manera normal

2. Activar Puerto de archives para IDOCS

Para esto nos podemos basar en la help sap

http://help.sap.com/saphelp_erp2004/helpdata/en/91/08e5ba2def11d3bc3600105a6588b2/frameset.htm

IDoc Inbound Processing

Use

IDocs (intermediate documents) have been developed for the exchange of messages between different systems. Providing a standard interface with the SAP system, this technique can also be used to transfer data.

For more information, choose IDoc Interface in transaction WEDI. .

See also: Starting IDoc Generation

Prerequisites

To be able to use IDoc inbound processing, you have to define settings and perform preparatory tasks. These tasks are grouped on the initial screen of the LSM Workbench under Settings ® IDoc Inbound Processing.

To use IDoc inbound processing, you must first perform the following steps:

1.           Define or select a file port for transporting the file. Optionally, you can also create a tRFC port.

See Creating Ports

2.           The partner type has to be defined or selected.

See Partner Types

Page 3: Dlver Lsmw Con Bapi

3.           The partner number has to be defined or selected.

See Partner Numbers

4.           IDoc inbound processing must be activated, and the workflow customizing must be checked. Both of these tasks are performed once in each system.

See Verifying the Workflow Customizing

Creating Ports Use

A port has to be available for a transfer of data from a legacy system to the SAP System by means of IDocs. As well as the file port, you can also specify a tRFC port.

For data conversion, you can decide whether a file should be created or whether the data should be passed to inbound processing by "packages" directly.

See Starting IDoc Generation

Prerequisites

You have chosen Settings ® IDoc inbound processing on the LSMW initial screen, and the IDoc inbound processing: Preparations screen is displayed.

Procedure

We recommend to maintain the following entries:

...

Choose Maintain ports.The WF-EDI: Port Definition screen appears.

Activate the change mode.

Position the cursor on File and choose Create.Fill in the given fields. Recommendation:

Port: LSMW

Description: Legacy System Migration Workbench

Page 4: Dlver Lsmw Con Bapi

Version: IDoc record types: SAP Release 4.x

If you additionally want to create the transactional RFC port:

Position the cursor on Transactional RFC and choose Create.Fill in the given fields.

Save your entries.

Choose F3 or Back to return to the IDoc inbound processing: Preparations screen.

Si exportas un LSMW de alguno existente debes de refrescar el proceso de creacion para que actualice los perfiles

Kehren Sie über F3 oder Zurück zu dem Bild en zurück

Result

The partner port has been created.

More Information

See also: Partner Types

See also: Partner Numbers

Page 5: Dlver Lsmw Con Bapi
Page 6: Dlver Lsmw Con Bapi

Partner Types Use

You must select a partner type when you transfer data from an external system or legacy system to an SAP system in IDocs. For the LSMW, we recommend that you use the partner type US.

Prerequisites

You have chosen Settings ® IDoc Inbound Processing on the LSMW initial screen, and you are on the screen IDoc Inbound Processing: Preparatory Measures.

Procedure

Enter US as the partner type.

To do this, proceed as follows:

1. Choose Maintain Partner Types.

2. Activate the change mode.

A table is displayed.

3. Choose New Entries.

4. Fill in the fields.

Recommended values:

Partner type: US

Report name: /SAPDMC/SAP_LSMW_PARTNERTYPES

Form routine: READ_USER

Short text: <any>

5.           Save your data and choose F3 or Back to return to the screen IDoc Inbound Processing: Preparatory Measures.

See also: Transaction WE20 ® Maintain Partner Profiles

Result

The partner type has been created.

Page 7: Dlver Lsmw Con Bapi

Partner Numbers Use

You must select a partner number when you transfer data from an external system or legacy system to an SAP system in IDocs.

Prerequisites

You have chosen Settings ® IDoc inbound processing on the LSMW initial screen, and the IDoc inbound processing: Preparations screen is displayed.

Procedure

Enter LSMW as partner number.

Or:

...

       1.      Choose Maintain partner numbers.The Partner Profiles screen appears.

       2.      Choose Create.

       3.      Fill in the given fields.Recommendation:

Page 8: Dlver Lsmw Con Bapi

Partner number: LSMW

Partner type: US

Partner status: A (active)

Type: US

Language: EN or DE

ID: Your user ID

       4.      Save your data and choose F3 or Back to return to the IDoc inbound processing: Preparations screen.

Result

The partner numbers have been maintained.

Page 9: Dlver Lsmw Con Bapi

Checking the Workflow Customizing Use

Workflow Customizing defines the requirements for using IDoc inbound processing.

Prerequisites

You have chosen Settings ® IDoc inbound processing on the LSMW initial screen, and the IDoc inbound processing: Preparations screen is displayed.

Procedure

...

       1.      Choose Workflow customizing.The Workflow Customizing screen appears.

       2.      Choose Perform Automatic Workflow Customizing.The auto customizing log for the runtime system is displayed.

Page 10: Dlver Lsmw Con Bapi

       3.      Check the entries.The following entries of the workflow runtime system must have a green checkmark assigned to them:

– Maintain System Administrator for Workflow.– Configure RFC Destination.– Classify Decision Task as General.– Activate Send to Objects and HR Objects.

Page 11: Dlver Lsmw Con Bapi

3. Maintain Object Attributes

El primer paso es seleccionar Maintain Object Attributes.

Se da click al botón y se selecciona la opción Business Object Method (BAPI)

En el campo Business Object se selecciona el objeto, para este ejemplo utilizare BUS1001006, para crear material estandar

Page 12: Dlver Lsmw Con Bapi

Una vez seleccionado, en el campo Method, se selecciona la BAPI que se desea utilizar

Y se puede grabar el primer paso.

Page 13: Dlver Lsmw Con Bapi
Page 14: Dlver Lsmw Con Bapi

4. Maintain Source Structures

Se selecciona la opción Maintain Source Structures

Se da click al boton de modificar y luego al de crear. Cuando se genera una estructura para una grabación en batch, se crea una estructura única; para el caso de las bapis se deben crear mas estructuras; esto depende de las estructuras de import que maneja la BAPI.

Para este ejemplo se manejan dos estructuras.

Se crea la estructura de cabecera

Cuando se crea la segunda estructura se debe indicar que es de un nivel inferior

Page 15: Dlver Lsmw Con Bapi
Page 16: Dlver Lsmw Con Bapi

5. Maintain Source Fields

Se deben indicar los campos del layout; lo que diferencia este proceso con BAPI al del BATCH es que se debe generar un indicador para la cabecera y las posiciones en la BAPI.

Indicador para cabecera

Page 17: Dlver Lsmw Con Bapi
Page 18: Dlver Lsmw Con Bapi

Indicador para posición

Debido a que se generan dos estructuras, el layout contempla dos líneas para cada dato maestro que se desea generar.

Page 19: Dlver Lsmw Con Bapi

6. Maintain Structure Relations

Se da click a la opción Maintain Structure Relations

Se da click al botón de modificar y se asignan las estrucutras de origen con las estructuras de la BAPI.

Page 20: Dlver Lsmw Con Bapi

7. Maintain Field Mapping and Conversion Rules

Se asignan los campos de origen con los campos de las estructuras de las bapi.

Se debe considerar que algunas de las bapis tienen estructuras de confirmación, ejemplo:

Los datos capturados en la bapi E1BP_MARC deben ser confirmados con una X en al estructura E1BP_MARCX, de lo contrario no se actualizaran.

En este punto es imprescindible entrar a la transacción SE37 para validar el trabajo estándar de la BAPI, una vez conociendo su funcionamiento, es más fácil generar su LSMW

Page 21: Dlver Lsmw Con Bapi

8. Specify Files

Se especifica el archive de carga

Se debe tener cuidado en seleccionar la opción de datos para multiples estructuras de origen

Este es el archivo que se cargara en el ejemplo

Page 22: Dlver Lsmw Con Bapi

9. Assign Files

Aquí se asigna el archivo dos veces, una por cada estructura, solo se puede hacer si existen 2 estructuras de origen y si se selecciono la opción indicada en el punto 8.

Page 23: Dlver Lsmw Con Bapi

10.Read Data

Se ejecuta la opción de manera normal

11. Display Read Data

Se ejecuta la opción de manera normal

Page 24: Dlver Lsmw Con Bapi
Page 25: Dlver Lsmw Con Bapi

12.Convert Data

Se ejecuta la opción de manera normal

13.Display Converted Data

Se ejecuta la opción de manera normal

Cada línea verde representa un documento generado y abajo las estructuras que se ocupan para el envío de datos.

Page 26: Dlver Lsmw Con Bapi

14.Start IDoc Generation

Se ejecuta la opción de manera normal

El proceso genera un IDOC por cada registro que se va crear

Page 27: Dlver Lsmw Con Bapi

15.Start IDoc Processing

Se ejecuta la opción de manera normal

Page 28: Dlver Lsmw Con Bapi

Visualizamos el material creado

Page 29: Dlver Lsmw Con Bapi
Page 30: Dlver Lsmw Con Bapi

16.Create IDoc Overview

Se ejecuta la opción de manera normal; esta opción permite visualizar los mensajes de los IDOCS ejecutados

Page 31: Dlver Lsmw Con Bapi

17.Recomendaciones

Buscar la bapi y ejecutarla en la transacción se37, el objetivo es conocerla y saber la totalidad de campos0020a llenar y la estructura de labapi.