Вы находитесь на странице: 1из 25

Generacin de LSMW utilizando BAPI

Generacin de LSMW utilizando BAPI..............................................................................1 Crear Proyecto................................................................................................................ 1 Activar Puerto de archives para IDOCS...........................................................................2 Creating Ports ............................................................................................................. 3 Partner Types .............................................................................................................. 5 Partner Numbers ......................................................................................................... 6 Checking the Workflow Customizing ...........................................................................9 Maintain Source Structures...........................................................................................11 Maintain Source Fields.................................................................................................. 13 Maintain Structure Relations.........................................................................................15 Maintain Field Mapping and Conversion Rules..............................................................16 Specify Files..................................................................................................................17 Assign Files...................................................................................................................18 Read Data..................................................................................................................... 19 Display Read Data.........................................................................................................19 Convert Data................................................................................................................. 20 Display Converted Data................................................................................................ 20 Start IDoc Generation....................................................................................................21 Start IDoc Processing....................................................................................................22 Create IDoc Overview....................................................................................................24 Recomendaciones......................................................................................................... 25

Crear Proyecto

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

Activar Puerto de archives para IDOCS

Para esto nos podemos basar en la help sap http://help.sap.com/saphelp_erp2004/helpdata/en/91/08e5ba2def11d3bc3600105a658 8b2/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 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: Description: Version: Legacy System Migration Workbench IDoc record types: SAP Release 4.x LSMW

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 Zurck zu dem Bild en zurck

Result The partner port has been created. More Information See also: Partner Types See also: Partner Numbers

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. 2. Choose Maintain Partner Types. Activate the change mode.

A table is displayed. 3. Choose New Entries.

4.

Fill in the fields.

Recommended values: Partner type: Report name: Form routine: Short text: US /SAPDMC/SAP_LSMW_PARTNERTYPES READ_USER <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.

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: Partner number: Partner type: Partner status: Type: Language: ID: LSMW US A (active) US EN or DE 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.

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. 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.

Maintain Object Attributes


El primer paso es seleccionar Maintain Object Attributes.

Se da click al botn Method (BAPI)

y se selecciona la opcin Business Object

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

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

Y se puede grabar el primer paso.

Maintain Source Structures


Se selecciona la opcin Maintain Source Structures

Se da click al boton de modificar y luego al de crear. Cuando se genera una estructura para una grabacin 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

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

Indicador para posicin

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

BAPI.xlsx

Maintain Structure Relations


Se da click a la opcin Maintain Structure Relations

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

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 confirmacin, 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 transaccin SE37 para validar el trabajo estndar de la BAPI, una vez conociendo su funcionamiento, es ms fcil generar su LSMW

Specify Files
Se especifica el archive de carga

Se debe tener cuidado en seleccionar la opcin de datos para multiples estructuras de origen

Este es el archivo que se cargara en el ejemplo

BAPI.txt

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 opcin indicada en el punto 8.

Read Data
Se ejecuta la opcin de manera normal

Display Read Data


Se ejecuta la opcin de manera normal

Convert Data
Se ejecuta la opcin de manera normal

Display Converted Data


Se ejecuta la opcin de manera normal

Cada lnea verde representa un documento generado y abajo las estructuras que se ocupan para el envo de datos.

Start IDoc Generation


Se ejecuta la opcin de manera normal

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

Start IDoc Processing


Se ejecuta la opcin de manera normal

Visualizamos el material creado

Create IDoc Overview


Se ejecuta la opcin de manera normal; esta opcin permite visualizar los mensajes de los IDOCS ejecutados

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

Вам также может понравиться