How Many Characters Can Be Uploaded in Spa

This blog shall explain how to load long text with LSMW direct input method.

It does not actually matter if the long text belongs to material main or vendor primary, customer master or even to transactional data like contracts or beak of materials.

Long text to any object is stored in the SAP's long text tables STXH (header) and STXL.(lines)

Most objects practice not take any indicator that tells almost existing long text, It is just a slice of lawmaking that is executed when you go to the text screens and retrieves the text from STXH and STXL tabular array if present.  Hence inserting text with the right key into these tables will automatically make this text available when you east.g. go MM02 Cloth master change transaction into the buy order text view.

Our business case here is to add buy club long text to material masters that got migrated earlier.

The source file is prepared in Excel and has just 3 columns: old cloth number, buy order long text and line number

Text_Step0.JPG

I do non explain whatever unmarried LSMW step in this blog in deep detail every bit I described information technology in in my other blogs:

LSMW Fabric chief by BAPI method – Function 1

LSMW Fabric master by BAPI method – Part 2

Then i am but focusing here on the difference to these other blogs and the specifics with the straight 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 MM_PO_TEXT

LSMW Stride 1 Maintain object attributes

Set the radio button to Standard/Direct Input Import Method

Then movement the cursor into the Object field and use F4 to find the object for Long texts

Do the same for the Method.

The Programme proper noun and the programme type volition then be defaulted by SAP itself.

The icon with the glasses allows you to display the source code of this plan (I have used twice in lifetime, but only to answer a question in the forum, I never needed it for myself, especially non to execute this LSMW method)

Text_Step1.JPG

LSMW Stride 2 Maintain Source Structures

My source file is just a flat file without deeper structure, so only one entry in this stride needed. I proper name my structure LONGTEXT

Text_Step2.JPG

LSMW Pace 3 Source Fields

Now I am adding the fields to this construction. As I accept merely a few fields I am doing it using the tabular array icon.

Defining the fields in the same sequence as they appear in my source file

Define them as graphic symbol fields, with a field length similar it was in the legacy organization,

The length of the old material number does not affair in this case every bit the  material number itself was never that long in the legacy system.

The attentive reader volition 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 merely require this line number in the Excel file as an objective evidence for the sequence of lines in example there are multiple lines.

Text_Step3.JPG

LSMW Step iv Maintain Structure Relations

The target structure is automatically proposed based on the called import method in LSMW step 1.

I assign my source structure to both structures, header and row.

Text_Step4.JPG

LSMW Step v Maintain Field Mapping and Conversion Rules

To continue my plan flexible for any language that need to be loaded (per source file one language)

I am calculation a pick parameter in the __GLOBAL_DATA__ section.

Merely double click the light bluish field with the name  __GLOBAL_DATA__ to get into the lawmaking editor

Enter hither a argument   PARAMETER: PSPRAS like MAKT-SPRAS

PSPRAS is my field name and with the Similar MAKT-SPRAS I tell the program that it shall exist like the linguistic communication field from MAKT table.

Further I add a data declaration for 2 other fields:

W_SKIP TYPE i. this is an integer number field that I desire to apply to count the records I cannot convert

and

W_SKIP_FLAG type C VALUE ' '  which describes a graphic symbol field with no initial content. I will use this to trigger the event to skip the transaction.

Text_Step5_1.JPG

In the header structure I assign a abiding "Cloth" to the object field, and a constant "All-time" to the ID field

(You 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 bill of fare Goto > header and you will run into the key fields and its content)

The Proper name field shall get the new cloth number. Simply my source file has only the erstwhile material number.

Hence I need to add coding to determine the cloth number based on the one-time number.

Every bit you know, the erstwhile material number is stored in the basic information view of cloth principal. Go into the material master Press F1 in that field and then the icon for technical field help and you tin can run into the field name and the tabular array.

With this information nosotros tin create the coding to get the material number.

Outset I add a information declaration to define a workarea. which will receive the found data.I could have done this already in the __GLOBAL_DATA__ section, only it tin be done everywhere in the source.

Then a select statement to notice a record in table MARA that matches with my sometime cloth number.

If a tape is found, and so the material number is moved to the target field /SAPDMC/LTXTH-NAME

If not plant, then I write a message into the conversion log to know which old material number could not be converted. And I motility a Y (for Yes) into my assistance field w_skip_flag: This is as well for safety reasons. The direct input will not check if your material exists. Information technology volition just mail what you lot deliver, regardless if correct or nonsense. So y'all can create a lot of ghost texts if yous practise not care enough. Hence yous demand to control it yourself.

SELECT  single  * FROM  MARA into WA_MARA

       WHERE  BISMT  = longtext-old_number.

if sy-subrc = 0. "record found

  /SAPDMC/LTXTH-NAME = WA_MARA-MATNR.

else.

  WRITE:/ longtext-old_number , 'non in MARA-BISMT'.

  w_skip_flag = 'Y'.

endif.

LTXTH.PNG

Adjacent is the language field which needs some attending. You remember, I had defined a selection parameter for the linguistic communication to be flexible and to use the same LSMW object for whatever language that volition be loaded.

I first again with a data annunciation for a workarea for the language, because I demand to cheque that I do not enter nonsense into the language parameter field.

So I verify the entered language if information technology is available in the language table T002.

If the entered language cannot be found, so I skip the tape from being loaded. Which is then the instance 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.

Text_Step5_3.JPG

Now look what I have done at the __END_OF_RECORD__   processing time.

I changed the default "transfer_record" into "on_change_transfer_record"

This trivial change controls that the header record is only written when the cloth number changes (material number is the but variable in the header structure)

This means I write just 1 header record while I write several rows.

In the structure for the row I merely assign my long text line. SAP is processing the source file from the offset record in sequence to the last record, thus I do not need the line number from my source file.

Text_Step5_4.JPG

Now to the concluding manipulations. in the processing time __END_OF_TRANSACTION__ I cheque my help field. This help field has the value 'Y' in instance the material number could not be plant for the given old fabric number, hence I take to skip this transaction from posting.

And at the __END_OF_PROCESSING__ I write the numbers of skipped records to the conversion log.

/wp-content/uploads/2012/12/longtext_corre_177887.jpg

which will and then expect like in this screenshot:

Text_Step9_1.JPG

LSMW Step half-dozen Maintain fixed values, Translations , user divers routines

Not necessary for this business example

LSMW Pace 7 – Specify files

Relieve the Excel source file as Unicode Text. Then specify this text file in step 7.

Text_Step7.JPG

LSMW Footstep 8 – Assign Files

Every bit there is but ane source structure and one source file, SAP does the proposal and you only need to click relieve

LSMW Step 9 – Read Information

SAP generates the read plan, you can execute information technology for the entire file or just for a option of records.

SAP will give you a summary of read records and read transactions.

Compare it with your source file to be certain that everything was read.

LSMW Stride x – Display read data

Important step to bank check that you data was correct read and that information technology was transferred to the fields defined in stride 3.

From the overview click a line to get to its detail view..

Text_Step10.JPG

LSMW Step eleven – Catechumen Data

In the conversion step you can execute the conversion for all records that where read from your source file, or just for a option for a examination case.

Hither you tin can see the parameter PSPRAS for the language, that I divers in stride 5 Mapping rules.

Text_Step9.JPG

LSMW Step 12 – Brandish converted data

In this screenshot of the converted data yous can meet that the new material number is assigned.

The xanthous lines correspond the header, and the blue lines the text lines.

So y'all meet that nosotros have ii materials with just one long text line followed by a textile with 6 lines

Text_Step12.JPG

LSMW Footstep xiii – Execute Straight Input

In this pace you execute, post the data to your SAP system.

SAP defaults all information. you just need to click execute

text_step13.JPG

The long text upload is really washed in a few seconds for many hundred records, don't be surprised, zero wrong.

When finished SAP gives you lot this summary:

text_step14.JPG

Loading long text means that SAP does Replace existing text with the same key.

Fifty-fifty the old text has many hundred lines and the new text simply 1, all lines of former text are deleted and so the new text written.

clinecaravered.blogspot.com

Source: https://blogs.sap.com/2012/12/28/lsmw-long-text-load-by-direct-input-method/

0 Response to "How Many Characters Can Be Uploaded in Spa"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel