2013 Jul 21 2:51 AM
Dear experts:
This is my very first post to the SCN world so if I’m not following established etiquette please forgive. I have been working with LSMW’s for about 4 years now but I have never done any custom coding in the field mapping and conversion rules section as of myself. I would normally have that done by a developer but I am now wanting to learn how to do this.
I have created a LSMW using the BAPI/Idoc method to create Material Masters and have been able to run it successfully until I added custom code to the Availability Check field (MTVFP). I checked the syntax function and it says it is correct and works. The code says if (XCHPF) is ‘X’ then (MTVFP) equals ‘CH’ else (MTVFP) equals ‘02’.
When I run ‘Read Data’ step it populates the input file correctly with the right values. When I run the ‘Convert Data’ step and display the results it populates and translates the right values as well but when I finish creating the material, (XCHPF) and (MTVFP) are both blank in the material master.
Please let me know what I am missing or how to get this to work.
Please see attached file for more detailed information and screen shots.
Dear experts:
This is my very first post to the SCN world so if I’m not following established etiquette please forgive. I have been working with LSMW’s for about 4 years now but I have never done any custom coding in the field mapping and conversion rules section as of myself. I would normally have that done by a developer but I am now wanting to learn how to do this.
I have created a LSMW using the BAPI/Idoc method to create Material Masters and have been able to run it successfully until I added custom code to the Availability Check field (MTVFP). I checked the syntax function and it says it is correct and works. The code says if (XCHPF) is ‘X’ then (MTVFP) equals ‘CH’ else (MTVFP) equals ‘02’.
When I run ‘Read Data’ step it populates the input file correctly with the right values. When I run the ‘Convert Data’ step and display the results it populates and translates the right values as well but when I finish creating the material, (XCHPF) and (MTVFP) are both blank in the material master.
Please let me know what I am missing or how to get this to work.
Please see attached file for more detailed information and screen shots.
2013 Jul 21 11:23 PM
The coding is right and works as you could see in the Display converted data step.
The usual error people make with BAPIs is that they miss to care about the corresponding fields in X-structures
In this case with the batch indicator it is even more important to know what your batch level setting is, because SAP knows 2 batch management fields, one at MARA (batch level is client or material level) and one at MARC (batch level is plant level).
2013 Jul 22 3:51 PM
Hi Can you Please check if the BAPI is released in your system.Did you try to use the BAPI manually.PLease try to check the BAPI first.Let me know if it works.
Thanks,
VIjay
2013 Jul 22 8:12 PM
Jurgen - Thanks for the heads-up on the different batch levels. That solved the problem. Thanks again for the comments and help.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |