Bapi Programming Guide Pdf

Bapi Programming Guide Pdf Average ratng: 3,7/5 8029votes

YtwwP8kDBA/UAFPpLUwQeI/AAAAAAAAHLo/iwOF59sSPKg/s1600/2.png' alt='Bapi Programming Guide Pdf' title='Bapi Programming Guide Pdf' />LSMW Long text load by Direct Input method. This blog shall explain how to load long text with LSMW direct input method. It does not really matter if the long text belongs to material master or vendor master, customer master or even to transactional data like contracts or bill of materials. Long text to any object is stored in the SAPs long text tables STXH header and STXL. Most objects do not have any indicator that tells about existing long text, It is just a piece of code that is executed when you go to the text screens and retrieves the text from STXH and STXL table if present. Hence inserting text with the correct key into these tables will automatically make this text available when you e. MM0. 2 Material master change transaction into the purchase order text view. Our business case here is to add purchase order long text to material masters that got migrated earlier. The source file is prepared in Excel and has just 3 columns old material number, purchase order long text and line number. I do not explain any single LSMW step in this blog in deep detail as I described it in in my other blogs LSMW Material master by BAPI method Part 1 LSMW Material master by BAPI method Part 2. Are you aware that we have started tutorials on Workflow For more details, click here. Please send us your feedbacksuggestions at webmaster. So i am just focusing here on the difference to these other blogs and the specifics with the direct input method and how do deal with long text. I am continuing in my existing project SCN, with subproject MATERIAL and create a new object called MMPOTEXTLSMW Step 1 Maintain object attributes. Set the radio button to StandardDirect Input Import Method. Then move the cursor into the Object field and use F4 to find the object for Long texts. Do the same for the Method. The Program name and the program type will then be defaulted by SAP itself. The icon with the glasses allows you to display the source code of this program I have used twice in lifetime, but only to answer a question in the forum, I never needed it for myself, especially not to execute this LSMW methodLSMW Step 2 Maintain Source Structures. There are so many good ABAP tips and tricks posted all over SDN and other forums and websites that I though it might be good to begin collating them here. Please feel. My source file is just a flat file without deeper structure, so only one entry in this step needed. I name my structure LONGTEXTLSMW Step 3 Source Fields. Now I am adding the fields to this structure. As I have only a few fields I am doing it using the table icon. Defining the fields in the same sequence as they appear in my source file. Define them as character fields, with a field length like it was in the legacy system,The length of the old material number does not matter in this case as the  material number itself was never that long in the legacy system. The attentive reader will see that I just entered 2 fields in the source field definitions while my source file has 3 fields. Reason I am lazy. To be honest I do not make use of the content of the line number field in this upload program. I only require this line number in the Excel file as an objective evidence for the sequence of lines in case there are multiple lines. LSMW Step 4 Maintain Structure Relations. The target structure is automatically proposed based on the chosen import method in LSMW step 1. I assign my source structure to both structures, header and row. LSMW Step 5 Maintain Field Mapping and Conversion Rules. Every Breath You Take Pdf Piano. To keep my program flexible for any language that need to be loaded per source file one languageI am adding a selection parameter in the GLOBALDATA section. Just double click the light blue field with the name  GLOBALDATA to get into the code editor. Enter here a statement   PARAMETER PSPRAS like MAKT SPRASPSPRAS is my field name and with the LIKE MAKT SPRAS I tell the program that it shall be like the language field from MAKT table. Further I add a data declaration for 2 other fields WSKIP TYPE i. I want to use to count the records I cannot convertand. WSKIPFLAG type C VALUE   which describes a character field with no initial content. I will use this to trigger the event to skip the transaction. In the header structure I assign a constant MATERIAL to the object field, and a constant BEST to the ID fieldYou can obtain these values if you go into the text view of existing data and click there the text editor icon. After you are taken to the text editor chose from menu Goto header and you will see the key fields and its contentThe NAME field shall get the new material number. But my source file has only the old material number. Hence I need to add coding to determine the material number based on the old number. As you know, the old material number is stored in the basic data view of material master. Go into the material master Press F1 in that field and then the icon for technical field help and you can see the field name and the table. With this information we can create the coding to get the material number. First I add a data declaration to define a workarea. I could have done this already in the GLOBALDATA section, but it can be done everywhere in the source. Then a select statement to find a record in table MARA that matches with my old material number. If a record is found, then the material number is moved to the target field SAPDMCLTXTH NAMEIf not found, then I write a message into the conversion log to know which old material number could not be converted. And I move a Y for YES into my help field wskipflag This is as well for safety reasons. The direct input will not check if your material exists. It will just post what you deliver, regardless if correct or nonsense. So you can create a lot of ghost texts if you do not care enough. Hence you need to control it yourself. SELECT  single  FROM  MARA into WAMARA       WHERE  BISMT  longtext oldnumber. SAPDMCLTXTH NAME WAMARA MATNR. WRITE longtext oldnumber, not in MARA BISMT. Y. Next is the language field which needs some attention. You remember, I had defined a selection parameter for the language to be flexible and to use the same LSMW object for whatever language that will be loaded. I start again with a data declaration for a workarea for the language, because I need to check that I do not enter nonsense into the language parameter field. So I verify the entered language if it is available in the language table T0. If the entered language cannot be found, then I skip the record from being loaded. Which is then the case for all records as the language parameter is only entered once. And in that case I write as well a small message into the conversion log. Now look what I have done at the ENDOFRECORD   processing time. I changed the default transferrecord into onchangetransferrecordThis little change controls that the header record is only written when the material number changes material number is the only variable in the header structureThis means I write just one header record while I write several rows. In the structure for the row I only assign my long text line. SAP is processing the source file from the first record in sequence to the last record, thus I do not need the line number from my source file. Now to the final manipulations. ENDOFTRANSACTION I check my help field. This help field has the value Y in case the material number could not be found for the given old material number, hence I have to skip this transaction from posting. And at the ENDOFPROCESSING I write the numbers of skipped records to the conversion log. LSMW Step 6 Maintain fixed values, Translations, user defined routines. Not necessary for this business case. LSMW Step 7 Specify files.


Dutch For English-Speaking Expats Pdf