abap

Field input value is longer than screen field ABAP


When running the BATCH INPUT since a program type ABAP I receive the next error: Field BKPF-BLART . input value is longer than screen field P.

PARAMETERS:
    p_bldat  TYPE CHAR10,   "Fecha de documento.
    p_budat  TYPE CHAR10,   "Fecha de contabilización.
    p_xblnr  TYPE XBLNR,    "Referencia.
    p_bktxt  TYPE BKTXT,    "Texto cabecera.
    p_blart  TYPE BLART,    "Clase.
    ...........

    PERFORM OPEN_GROUP.
     PERFORM BDC_DYNPRO USING 'SAPMF05A' '0100'.
      PERFORM BDC_FIELD  USING 'BKPF-BLDAT'  'p_bldat'.
      PERFORM BDC_FIELD  USING 'BKPF-BUDAT'  'p_budat'.
      PERFORM BDC_FIELD  USING 'BKPF-XBLNR'  'p_xblnr'.
      PERFORM BDC_FIELD  USING 'BKPF-BKTXT'  'p_bktxt'.
      PERFORM BDC_FIELD  USING 'BKPF-BLART'  'p_blart'.
      PERFORM BDC_FIELD  USING 'BKPF-MONAT'  'p_monat'.
     ......

I tried utilizing the sentence CONDENSE and changing the type of data CHAR2 of my var BLART.


Solution

  • You are not passing parameters as you think but character sequences that happen to be your parameter names.

    It should be done like that (without quotes for parameter names).

    PERFORM BDC_FIELD  USING 'BKPF-BLDAT'  p_bldat.
    PERFORM BDC_FIELD  USING 'BKPF-BUDAT'  p_budat.
    PERFORM BDC_FIELD  USING 'BKPF-XBLNR'  p_xblnr.
    PERFORM BDC_FIELD  USING 'BKPF-BKTXT'  p_bktxt.
    PERFORM BDC_FIELD  USING 'BKPF-BLART'  p_blart.
    PERFORM BDC_FIELD  USING 'BKPF-MONAT'  p_monat.