Skip to Content
Technical Articles
Author's profile photo Robin Thakral

[Adobe Form]: Centre Alignment of BARCODE 128 with XML Schema


As you could see in my previous blog Use DDIC Interface based Regular Custom Adobe Form

We have generated a barcode for MATNR with data length of 40 CHAR.


Challenge: The value is generally coming in 10 CHAR or 18 CHAR (ECC length of MATNR) and as per that BARCODE generation covers the provided width, in layout having no option to auto-expand, making it visible as left/not-center aligned.


Solution: We need to handle the barcode appearing the whole width:

  1. Apply conversion approaches on MATNR value in the interface – it failed
  2. Change the data length of BARCODE in XML schema through scripting – worked, explained below:

In this blog post, we will cover the coding to Dynamically change the data length of UI variables as per the STRLEN of variable:



  1. Wrap the Barcode variable in a sub-form name ‘Barcode’.
  2. Go to Palletes -> Script Editor. opt for Form: Ready, Language: FormCalc and write below code
var strlen = len($.GV_MATNR_BAR.rawValue)
$.GV_MATNR_BAR.ui.#barcode.dataLength = strlen

Here, GV_MATNR_BAR is the variable name. Firstly, we will fetch the string length  ‘rawValue’ of the variable and then update the UI property ‘dataLength’.


Barcode Center Alignment Logic

  1. So, it will change the data length of the Barcode, and the assigned width will be fully covered with the generated code.




Topic page:

ABAP Topic:,

Do give your comments and feedback.
Follow for more: Robin Thakral

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.