Search code examples
sapscript

Error when showing the value of VBDKR-WAERK in Form Painter ABAP


I am trying to fix a bug in the Form Painter which is related to the VBDKR-WAERK. The problem is as shown in the screenshot below:

enter image description here

So in place of VBDKR-WAERK should be EUR. The code in Form painter for this part is:

&VBDKR-ZTERM_TX1(IC)&
&'(='SKONTOWERT1(ICZ)' VBDKR-WAERK&)'&
&VBDKR-ZTERM_TX2(IC)&
&'(='SKONTOWERT2(ICZ)' VBDKR-WAERK&)'&
&VBDKR-ZTERM_TX3(IC)&

SKONTOWERT1 and SKONTOWERT2 are type KOMVD-KWERT.

May anyone know what the problem may be? Please do tell me if you need additional information.

Thank you all in advance!


Solution

  • Field names in SAPScript always have to be entered with leading and closing '&':

    VBDKR-WAERK& => &VBDKR-WAERK&

    &VBDKR-ZTERM_TX1(IC)&
    &'(='SKONTOWERT1(ICZ)' &VBDKR-WAERK&)'&
    &VBDKR-ZTERM_TX2(IC)&
    &'(='SKONTOWERT2(ICZ)' &VBDKR-WAERK&)'&
    &VBDKR-ZTERM_TX3(IC)&