This blog has been discontinued (See latest posts)
Friday, January 15, 2010 Display 40 Character Material Text
VN:F [1.9.22_1171]
Rating: 4.6/5 (5 votes cast)

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.

PI Sheet with XSteps

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 holds 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.

PI Sheet with Process Instructions

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:

SE37 → EXIT_SAPLCOAV_001 → Include ZXCRCU01


...
CASE characteristic.

	WHEN 'Z_MAT31TO40'.
		CLEAR l_matnr.
		LOOP AT pichar_tab.
* Look for existing valuation for PPPI_MATERIAL
			IF pichar_tab-atinn = '9999999510'.
				l_matnr = pichar_tab-atwrt.
				EXIT.
			ENDIF.
		ENDLOOP.
		IF l_matnr IS INITIAL.
			l_matnr = header-matnr.
		ENDIF.
		SELECT SINGLE maktx FROM makt INTO l_maktx
			WHERE matnr = l_matnr
			AND spras = sy-langu.
		SHIFT l_maktx BY 30 PLACES LEFT.
		value_initwert = 'X'.
		value_char = l_maktx.

	WHEN OTHERS.
		raise cancelled.

ENDCASE.
...

But instead of just plainly adding a second output field it looks much nicer if you combine these two characteristics into one. Here is an example instruction:

No. Characteristic Characteristic Value
0010 PPPI_DATA_REQUEST_TYPE Simple Data Request
0020 PPPI_MATERIAL <automatic>
0030 PPPI_MATERIAL_SHORT_TEXT <automatic>
0040 Z_MAT31TO40 <automatic>
0050 PPPI_INSTRUCTION &0030&&0040&
0100 PPPI_OUTPUT_TEXT Material Description
0110 PPPI_OUTPUT_CHARACTERISTIC PPPI_INSTRUCTION

Please note that there are two commands entered in the longtext PPPI_INSTRUCTION (&0030& and &0040&). They must not be written directly into the long text but included each separately with ‘Insert Command (Ctrl F9)’ 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 ‘Replace text symbol values?…’. If you say ‘yes’ then those command elemens (e.g. &0030&) will be replaced by the value of the characteristics in that line (e.g. &0030& will be replaced by the first 30 characters of the material short text).

Now you can display the complete material description in one field.

Display 40 Character Material Text, 4.6 out of 5 based on 5 ratings
Please rate the article:
VN:F [1.9.22_1171]
Rating: 4.6/5 (5 votes cast)
1 Comment Create new comment
  1. 21.Sep.2010 at 00:24 | Permalink

    very happy with sharing a given, and allow me to make this place as my reference

References & Trackbacks

News

This blog has been discontinued!

Archives

Calendar

January 2010
M T W T F S S
 123
45678910
11121314151617
18192021222324
25262728293031