Serial number formatting issue
When printing the packing list at the front-end, the user gets an error message: ‘At least one string in the worklist contains an invalid character’- IO(415). Meanwhile, if the output has been triggered during the save event of VL02N, one update termination will show soon after the save button has been clicked.
Those validation errors could be generated when function module: ‘PROCESS_SERIALS_FOR_PRINT’ is called to formatting the serial number.
- 409 Error in print formatting
- 411 Method & does not exist for controlling the output of line edges
- 412 Delimiters are missing for the line edges
- 413 The separator is missing for intervals
- 414 Two identical character strings are contained in the worklist
- 415 At least one string in the worklist contains an invalid character
- 416 A character string in the worklist is not a direct special successor
- 417 The output length specified is not sufficient for the presentation
- 418 The separator is missing for the character strings
Function module ‘PROCESS_SERIALS_FOR_PRINT’ has been wildly used at driver programs for print sales documents/delivery/packing slips/invoices. It tries to find the pattern of inputted serial numbers and generate one string with pre-defined boundary/separator and other formatting settings. For example, you’ve serial numbers for one material like below:
The output of the string of those serial numbers will not be the concatenation of SN#1, SN#2, SN#3, SN#4, SN#5. But it will display like SN#1-SN#5 instead as the serial number is a continuous number. Here the input table is:
The output string is:
( 72721-5504521380_1 - 72721-5504521380_5 )
If you have some discontinuous serial number mixed with a continuous serial number like below:
Then you’ll get the below string:
( SNTEST001, SNTEST031 - SNTEST033, SNTEST088 )
Normally, the validation error is caused by incorrect input parameters for this function module especially ‘I_SPECIAL_CHARS’. The default value for this input is dash ‘-‘, but if the serial number contains other special characters like ‘_’ or ‘/’, you have to put them together like ‘-_/’ as ‘I_SPECIAL_CHARS’. Otherwise, an error like ‘At least one string in the worklist contains an invalid character’ will show for sure.
Here is one template of parameters for FM: PROCESS_SERIALS_FOR_PRINT.
*Call function to format the serial numbers CALL FUNCTION 'PROCESS_SERIALS_FOR_PRINT' EXPORTING i_boundary_left = '(_' i_boundary_right = '_)' i_sep_char_strings = ',_' "separator i_sep_char_interval = '_-_' "interval pattern i_use_interval = 'X' i_boundary_method = 'C' i_line_length = 50 "per line of final string i_no_zero = 'X' i_alphabet = sy-abcde "from A to Z i_digits = '0123456789' i_special_chars = '-/\_' "all possible special chars! i_with_second_digit = ' ' TABLES serials = tkomser "(input table) serials_print = tkomser_print "(output string) EXCEPTIONS boundary_missing = 01 interval_separation_missing = 02 length_to_small = 03 internal_error = 04 wrong_method = 05 wrong_serial = 06 two_equal_serials = 07 serial_with_wrong_char = 08 serial_separation_missing = 09.
Btw, I make 10 dumps of ‘PERFORM_CONFLICT_TYPE’ in 10 minutes when debugging ‘CHECK_STRING_SUCCESSOR’ at SM37 and have to give up back to driver program level 😛 it’s too scary.