Author Topic: Trim values returned from RFC call using 'rfctrim' command  (Read 6654 times)

Benjamin Dasari

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 96
    • View Profile
Trim values returned from RFC call using 'rfctrim' command
« on: June 09, 2017, 03:02:05 PM »
Purpose: To trim the values returned from RFC call.

When we make an RFC call like below:
     rfcres = call("BAPI_USER_GET_DETAIL",{"in.USERNAME":"&V[_user]","out.DEFAULTS":"z_defaults"});

In this case, z_defaults can either be a string value (variable), or a control if defined by inputfield like this:
     inputfield([15,1], 'Test', [15,20], {name:'z_defaults', size:255});

In either one of these cases, the z_defaults value would have to be 'trim' by using the trim command of string.
Without trim, the string length will be 4096, unless the inputfield command is executed again, in which case, it will be truncated to 255.

Using the rfctrim command, you will be able to control this behavior.
By default it will right trim the string (not left trim), which means, all space characters at the end of the string will be removed.
You will now NO longer need to call .trim to trim the string after the RFC call.

To disable this default behavior, use this command-
disable('rfctrim')

And to enable it again, use this command-
enable('rfctrim')

NOTE - This feature is available from Liquid UI Server version 548 onward.
« Last Edit: June 12, 2017, 11:11:55 AM by Benjamin Dasari »