LSMW and BAPI for create Project.docx

February 16, 2018 | Author: manish0246 | Category: Comma Separated Values, Software Development, Computer Engineering, Software Engineering, Software
Share Embed Donate


Short Description

LSMW and BAPI for create Project...

Description

LSMW and BAPI for create Project 1. Create Project Definitions with BUS2001 2. Create WBS Elements with BUS2054 3. Create Networks with BUS2002

Hi Stefan,

I'll do my best in order to describe this matter in an easy way. Supposively, there will be a lot of questions.

First of all: You will need the "MAINTAIN" method for the business object "bus2054". Because I do not have a "developer key", this method was provided by our IT-Department. They told me, that it is not a very difficult matter. It is done with transaction "BDBG" and, as far as i remember, it's about creating or editing ALE-structure. You will need to edit the "BAPI_PROJECT_MAINTAIN" respectively the business object "BUS2054".

Once you have added to MAINTAIN - method you can start to configure the LSMW-project.

1.) Create a new LSMW-project and make sure that IDoc Inbound processing is activated:

2.) Maintain the object attributes in the following way:

3.) The source-structures:

4.) Source Fields: Make sure to have a source field for every field in the corresponding BAPI-Table. This will allow you to ensure, that all possible fields in the tables of the BAPI_PROJECT_MAINTAIN will be filled by your source fields. Adjusting the values in the source fields is the most convenient way to adjust the behaviour of the interface. I created the source fields by simply copying the tables from se37. The screenhot shows the source fields for the project definition:

Be sure to check this Button:

This will show you the key values for the tables. There must(!) be a field named "PROJECT_DEFINITION" in each and every single Table. Project number is the key for all other tables including the METHOD table (this is because all other Tables are in the substructure of the Project_Definition Table) Having done so, you will later be able to import multiple projects at once.

4.) The structure relations:

I suppose this mapping is clear without further explaination.

5.) Field Mapping: Having defined a source field for every element in the bapi-tables the mapping is very easy. Just map the Field from the source table to the field from the BAPI - table. No special rule. Just "Move" the fields. Although one could customize the "Method" table with ABAP, i found it easier to create the Method Table from my source system as this table is fairly easy to understand.

5.) The step "Maintain fixed values..." (LSMW step 6) can be skipped.

6.) There are six source files for my LSMW project:

I_PROJECT_DEFINITION.csv WBS_HIERARCHY.csv WBS_ELEMENTS.csv I_NETWORKS.csv NETWORK_ACTIVITIES.csv

I_METHOD.csv

The I_Method.csv contains the roadmap for the project. In other words, what is to do. This files only contains metadata, but needs to be 100% consistent. If you don't know what kind of methods and objecttypes exists, i will be glad to help. Here's a screenshot from a project without network or network-activities.

The most problematic file to me was the WBS_HIERARCHY. This hierarchy needs to be correct and complete. It needed a lot of thinking to create a correct file. Another problem is, that if you encounter errors with this table, the BAPI_Message Table won't tell you where the error is. Sometimes, this can be a bothering. But if the logic you used to create the WBS_Hierarchy is consistent, there will be no problems.

7.) Once the files have been specified, they can be loaded into the system and converted.

8.) IDoc generation and processing is nothing special and can just be done by clicking through the steps.

9.) Debugging: Of course, things won't go well the first time you try. If they do, congrats!

But if not: I suggest to debug with transaction "we19". LSMW won't tell you exactly why things didn't go the way you wanted them to go. You will need the entries in the E_Message_Table from the BAPI_PROJECT_MAINTAIN. Here's how i debug: - Start WE19 - Choose your IDoc - Choose "Inbound function module" in debugging mode:

Function Module is "BAPI_IDOC_INPUT1", however, this may differ in your company.

- Set a break point at the function module "BAPI_PROJECT_MAINTAIN":

Now you can execute the IDoc. It will stop at the BAPI_PROJECT_MAINTAIN. Next step is to set another Breakpoint, so that you can read the messages returned by the BAPI:

Continue the execution by hitting the F8 key once more. Now, we have the information from the E_MESSAGE_TABLE available:

- Switch to the "Tables" View

- Type E_MESSAGE_TABLE in the field "Table"

Sometimes, looking for the reasons why things didn't work is a game of patience, but after the reason is found, things become a lot clearer ;-)

I hope this guide is of any use for you. I was quite in a hurry when writing it.. Please excuse grammar and/or spelling mistakes.

Feel free to ask any questions about this LSMW project.

Kind regards,

Pascal

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF