{"id":383,"date":"2010-01-15T16:38:48","date_gmt":"2010-01-15T14:38:48","guid":{"rendered":"http:\/\/websha.de\/xstepcafe\/?p=383"},"modified":"2018-06-01T06:45:22","modified_gmt":"2018-06-01T04:45:22","slug":"display-40-character-material-text","status":"publish","type":"post","link":"https:\/\/websha.de\/xstepcafe\/2010\/01\/15\/display-40-character-material-text\/","title":{"rendered":"Display 40 Character Material Text"},"content":{"rendered":"<p>One annoying thing with material text is that this field holds up to 40 characters but all PI characteristics are restricted to 30 characters. How do you display all 40 characters in the PI Sheet despite this? There are 2 different constellations: PI Sheet with or without XSteps. I will explain solutions for both.<\/p>\n<p><!--more--><\/p>\n<h1>PI Sheet with XSteps<\/h1>\n<p>Here the solution is very simple but you still have to know how to do it. The trick is to define the XStep parameter which\u00a0holds the material description not with the characteristic PPPI_MATERIAL_SHORT_TEXT but with PPPI_FRAGMENT_HTML instead (you can also use other longtext characteristics but I always prefer that one). The rest is procedure as usual: assign the valuation symbol for the material description to that parameter and add an output element for that parameter in your instruction.<\/p>\n<h1>PI Sheet with Process Instructions<\/h1>\n<p>What most customers fugure out very quickly is to use a second characteristic which I call for example Z_MAT31TO40 and assign an automatic valuation in the user exit:<\/p>\n<p>SE37\u00a0\u2192 EXIT_SAPLCOAV_001\u00a0\u2192 Include ZXCRCU01<\/p>\n<blockquote>\n<pre><code>\r\n...\r\nCASE characteristic.\r\n\r\n\tWHEN 'Z_MAT31TO40'.\r\n\t\tCLEAR l_matnr.\r\n\t\tLOOP AT pichar_tab.\r\n* Look for existing valuation for PPPI_MATERIAL\r\n\t\t\tIF pichar_tab-atinn = '9999999510'.\r\n\t\t\t\tl_matnr = pichar_tab-atwrt.\r\n\t\t\t\tEXIT.\r\n\t\t\tENDIF.\r\n\t\tENDLOOP.\r\n\t\tIF l_matnr IS INITIAL.\r\n\t\t\tl_matnr = header-matnr.\r\n\t\tENDIF.\r\n\t\tSELECT SINGLE maktx FROM makt INTO l_maktx\r\n\t\t\tWHERE matnr = l_matnr\r\n\t\t\tAND spras = sy-langu.\r\n\t\tSHIFT l_maktx BY 30 PLACES LEFT.\r\n\t\tvalue_initwert = 'X'.\r\n\t\tvalue_char = l_maktx.\r\n\r\n\tWHEN OTHERS.\r\n\t\traise cancelled.\r\n\r\nENDCASE.\r\n...<\/code><\/pre>\n<\/blockquote>\n<p>But instead of just plainly adding a second\u00a0output field it looks much nicer if you combine these two characteristics into one. Here is an example instruction:<\/p>\n<table cellspacing=\"0\" cellpadding=\"0\">\n<thead>\n<tr>\n<th>No.<\/th>\n<th>Characteristic<\/th>\n<th>Characteristic Value<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>0010<\/td>\n<td>PPPI_DATA_REQUEST_TYPE<\/td>\n<td>Simple Data Request<\/td>\n<\/tr>\n<tr>\n<td>0020<\/td>\n<td>PPPI_MATERIAL<\/td>\n<td><span style=\"color: #888888;\">&lt;automatic&gt;<\/span><\/td>\n<\/tr>\n<tr>\n<td>0030<\/td>\n<td>PPPI_MATERIAL_SHORT_TEXT<\/td>\n<td><span style=\"color: #888888;\">&lt;automatic&gt;<\/span><\/td>\n<\/tr>\n<tr>\n<td>0040<\/td>\n<td>Z_MAT31TO40<\/td>\n<td><span style=\"color: #888888;\">&lt;automatic&gt;<\/span><\/td>\n<\/tr>\n<tr>\n<td>0050<\/td>\n<td>PPPI_INSTRUCTION<\/td>\n<td><span style=\"background: #999;\">&amp;0030&amp;<\/span><span style=\"background: #999;\">&amp;0040&amp;<\/span><\/td>\n<\/tr>\n<tr>\n<td>0100<\/td>\n<td>PPPI_OUTPUT_TEXT<\/td>\n<td>Material Description<\/td>\n<\/tr>\n<tr>\n<td>0110<\/td>\n<td>PPPI_OUTPUT_CHARACTERISTIC<\/td>\n<td>PPPI_INSTRUCTION<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Please note that there are two commands entered in the longtext PPPI_INSTRUCTION (&amp;0030&amp; and &amp;0040&amp;). They must not be written directly into the long text but included each separately with &#8216;Insert Command (Ctrl F9)&#8217; when you are in the rich text editor mode. You will not see this working until you finally create a control recipe in the order (no simulation in the recipe). There you get this popup &#8216;Replace text symbol values?&#8230;&#8217;. If you say &#8216;yes&#8217; then those command elemens (e.g. &amp;0030&amp;) will be replaced by the value of the characteristics in that line (e.g. &amp;0030&amp; will be replaced by the first 30 characters of the material short text).<\/p>\n<p>Now you can display the complete material description in one field.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to display the material description with 40 characters in the PI Sheet.<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_links_to":"","_links_to_target":""},"categories":[52,72],"tags":[45],"_links":{"self":[{"href":"https:\/\/websha.de\/xstepcafe\/wp-json\/wp\/v2\/posts\/383"}],"collection":[{"href":"https:\/\/websha.de\/xstepcafe\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/websha.de\/xstepcafe\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/websha.de\/xstepcafe\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/websha.de\/xstepcafe\/wp-json\/wp\/v2\/comments?post=383"}],"version-history":[{"count":25,"href":"https:\/\/websha.de\/xstepcafe\/wp-json\/wp\/v2\/posts\/383\/revisions"}],"predecessor-version":[{"id":879,"href":"https:\/\/websha.de\/xstepcafe\/wp-json\/wp\/v2\/posts\/383\/revisions\/879"}],"wp:attachment":[{"href":"https:\/\/websha.de\/xstepcafe\/wp-json\/wp\/v2\/media?parent=383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/websha.de\/xstepcafe\/wp-json\/wp\/v2\/categories?post=383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/websha.de\/xstepcafe\/wp-json\/wp\/v2\/tags?post=383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}