Hi
My customer is using SAP 4.7(Enterprise Management Version) / SAP BASIS Release 6.20 (Kernel 640).
We have a requirement to print a product label using a 2D Datamatrix barcode following HIBC standards. We are using a custom development object (Z function module) that builds the barcode string (variable length string) using a Mod43 calculated check digit as the last character of the string. One of the valid check digits is a "space" character as the last character of this barcode string.
Everything in our solution is working fine, except for the situation of the "space" check digit character at the end. We are running into an ABAP syntax limitation when we are trying to concatenate the calculated check digit onto the barcode string.
For example, we have a barcode value "+M53210250 " (within the quotes). This string ends with a SPACE character at the end. We are calculating the barcode value (some fixed elements + SAP material number, batch, etc.), then calculating the check digit, and concatenating the check digit onto the end of the initial barcode string value.
I have tried this in a higher version system and am able to make it work by using the statement CONCATENATE RESPECTING BLANKS. This syntax is not available with WebAS 620 however.
Here are the attempts we have made:
*Get HIBC 2D Barcode String
CONCATENATE E_HIBC_2D_BC L_CHECK_DIGIT INTO E_HIBC_2D_BC.
IF L_CHECK_DIGIT = SPACE.
The following attempts does not work
CONCATENATE with SPACE at end
Concatenate HIBC SPACE and a dummy variable like 'TEST' into HIBC builds a space in between the dummy and HIBC
and then when i split it the space is lost again.
Insert SPACE in the beginning bulding a new variable with 0(1) space followed by HIBC and then SHIFT CIRCULAR BY 1 place
It will work only if moved to a variable of length which is exactly HIBC + 1 char in length then by default the last char is SPACE.
Use a replacement variable which is not a HIBC Check Digit like # & ! ? ^ or other for SPACE
ECC 5.0 and HIGHER
*CONCATENATE {dobj1 dobj2 ...}|{LINES OF itab}
INTO result
[IN {BYTE|CHARACTER} MODE]
[SEPARATED BY sep]
[RESPECTING BLANKS].
*4.7 Version *
*CONCATENATE f1 ... fn INTO g.
*1. ... SEPARATED BY h
*2. ... IN BYTE MODE
*3. ... IN CHARACTER MODE
Having the customer upgrade to ECC 5.0 is not feasible to solve this.
If anyone has any alternative ideas on how to manage this variable length string and respect the trailing space, I would appreciate it.
I have searched the forums but the only solutions that are close deal with outputting to a file during a download or FTP, or else mention the newer syntax of CONCATENTATE with the option RESPECTING BLANKS, but that is not available in this release.