dlver lsmw con bapi
TRANSCRIPT
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
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
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
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
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.
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: 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.
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.
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
Una vez seleccionado, en el campo Method, se selecciona la BAPI que se desea utilizar
Y se puede grabar el primer paso.
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
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
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.
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.
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
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
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.
10.Read Data
Se ejecuta la opción de manera normal
11. Display Read Data
Se ejecuta la opción de manera normal
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.
14.Start IDoc Generation
Se ejecuta la opción de manera normal
El proceso genera un IDOC por cada registro que se va crear
15.Start IDoc Processing
Se ejecuta la opción de manera normal
Visualizamos el material creado
16.Create IDoc Overview
Se ejecuta la opción de manera normal; esta opción permite visualizar los mensajes de los IDOCS ejecutados
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.