Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BDC error:Field BSEG-WRBTR . input value is longer than screen field

Former Member
0 Kudos

I did BDC for F-29 , passing data from ZTABLE.

I tried WRBTR(16) also in both ZTABLE and program.it throwing the below error

Formatting error in the field __.__.____; see next message

ZTABLE : ZFI_RECEIPT

WRBTR    WRBTR    CURR    13    2    Amount in Document Currency

BDC PROGRAM : sample code

data : begin of WAREA occurs 0,    

         WRBTR     like BSEG-WRBTR,  

         end of WAREA.

Thanks,

SG

1 ACCEPTED SOLUTION

Former Member

Issue solved..

1.BSEG-WRBTR:

   data : amt1(16) type C.

   write WAREA-WRBTR  to AMT1 .
    condense AMT1.


perform BDC_FIELD       using 'BSEG-WRBTR'
                                       AMT1."WAREA-WRBTR.

2.date format is also wrong before .


data :date1(10) type C.


write WAREA-BLDAT to date1 dd/mm/yyyy.


perform BDC_FIELD       using 'BKPF-BLDAT'
                                      date1."WAREA-BLDAT.

Thanks for Reply,

SG     

10 REPLIES 10

Former Member
0 Kudos

Hello,

Please provide more information so that we can help.

Check whether the field value your are passing to BDC screen field and the one in table

have same data type.

0 Kudos

report ZRECEIPT_PROGRAM
        no standard page heading line-size 255.

tables : ZFI_RECEIPT.


data : begin of WAREA occurs 0,
        ZIN4_REF  like ZFI_RECEIPT-ZIN4_REF,
        BLDAT     like ZFI_RECEIPT-BLDAT,
        BUKRS     like ZFI_RECEIPT-BUKRS,
        BUDAT     like ZFI_RECEIPT-BUDAT,
        XBLNR     like ZFI_RECEIPT-XBLNR,
        NEWKO     like ZFI_RECEIPT-NEWKO,
        UMSKZ     like ZFI_RECEIPT-UMSKZ,
        KONTO     like ZFI_RECEIPT-KONTO,
        WRBTR     like BSEG-WRBTR,
*       WRBTR(16),
        VALUT     like ZFI_RECEIPT-VALUT,
        PRCTR     like ZFI_RECEIPT-PRCTR,
        SGTXT     like ZFI_RECEIPT-SGTXT,
        ZUONR     like ZFI_RECEIPT-ZUONR,
        ZWRBTR    like BSEG-WRBTR,
*       ZWRBTR(16),
        ZFBDT     like ZFI_RECEIPT-ZFBDT,
        ZPRCTR    like ZFI_RECEIPT-ZPRCTR,
        ZZUONR    like ZFI_RECEIPT-ZZUONR,
        ZSGTXT    like ZFI_RECEIPT-ZSGTXT,
        MESSAGE   like ZFI_RECEIPT-MESSAGE,
end of WAREA.




* WAREA llike table of WAREA ,
*       WA     llike WAREA,
data :     ETABLE type table of BDCMSGCOLL,
      EWA    type BDCMSGCOLL,
      ESTR   type STRING,
      CTU    type CTU_PARAMS,
      BDCDATA type table of BDCDATA with header line,
      SALES type VBAK-VBELN.



start-of-selection.
   select
        ZIN4_REF
        BLDAT
        BUKRS
        BUDAT
        XBLNR
        NEWKO
        UMSKZ
        KONTO
        WRBTR
        VALUT
        PRCTR
        SGTXT
        ZUONR
        ZWRBTR
        ZFBDT
        ZPRCTR
        ZZUONR
        ZSGTXT
        MESSAGE
   from ZFI_RECEIPT
   into table WAREA where MESSAGE = SPACE
   order by ZIN4_REF.


   if WAREA[] is not initial.

     loop at WAREA ."into WA.

       perform BDC_DYNPRO      using 'SAPMF05A' '0111'.
       perform BDC_FIELD       using 'BDC_CURSOR'
                                     'BSEG-ZUONR'.
       perform BDC_FIELD       using 'BDC_OKCODE'
                                     '/00'.
       perform BDC_FIELD       using 'BKPF-BLDAT'
                                      WAREA-BLDAT.        "'23.04.2013'.
       perform BDC_FIELD       using 'BKPF-BLART'
                                     'DZ'.
       perform BDC_FIELD       using 'BKPF-BUKRS'
                                      WAREA-BUKRS.           "'2000'.
       perform BDC_FIELD       using 'BKPF-BUDAT'
                                      WAREA-BUDAT.        "'23.04.2013'.
*perform bdc_field       using 'BKPF-MONAT'
*                              '1'.
       perform BDC_FIELD       using 'BKPF-WAERS'
                                     'INR'.
       perform BDC_FIELD       using 'BKPF-XBLNR'
                                      WAREA-XBLNR.           "'529'.
       perform BDC_FIELD       using 'RF05A-NEWKO'
                                      WAREA-NEWKO.           "'710057'.
       perform BDC_FIELD       using 'RF05A-UMSKZ'
                                      WAREA-UMSKZ.           " 'A'.
       perform BDC_FIELD       using 'RF05A-KONTO'
                                      WAREA-KONTO.           "'50202000'.
       perform BDC_FIELD       using 'BSEG-WRBTR'
                                      WAREA-WRBTR.           "'20000'.
       perform BDC_FIELD       using 'BSEG-VALUT'
                                      WAREA-VALUT.            "'23.04.2013'.
       perform BDC_FIELD       using 'BSEG-PRCTR'
                                      WAREA-PRCTR.             "'batika'.
       perform BDC_FIELD       using 'BSEG-SGTXT'
                                      WAREA-SGTXT.             "'test for in4 2'.
       perform BDC_FIELD       using 'BSEG-ZUONR'
                                      WAREA-ZUONR.           "'678678'.
       perform BDC_DYNPRO      using 'SAPMF05A' '0304'.
       perform BDC_FIELD       using 'BDC_CURSOR'
                                     'BSEG-SGTXT'.
       perform BDC_FIELD       using 'BDC_OKCODE'
                                     '=BU'.
       perform BDC_FIELD       using 'BSEG-WRBTR'
                                      WAREA-ZWRBTR .         "'20000'.
       perform BDC_FIELD       using 'BSEG-ZFBDT'
                                      WAREA-ZFBDT.               "'23.04.2013'.
       perform BDC_FIELD       using 'BSEG-ZUONR'
                                      WAREA-ZZUONR.          "'678678'.
       perform BDC_FIELD       using 'BSEG-SGTXT'
                                      WAREA-ZSGTXT.                 "'test for in4 2'.

       call transaction 'F-29' using BDCDATA options from CTU messages into ETABLE.

       read table ETABLE into EWA index 1.

       if SY-SUBRC = 0.
         call function 'FORMAT_MESSAGE'
          exporting
            ID              = EWA-MSGID
*   LANG            = '-D'
          NO              = EWA-MSGNR
*   V1              = SY-MSGV1
            V2              = SY-MSGV2
*   V3              = SY-MSGV3
*   V4              = SY-MSGV4
          importing
            MSG             = ESTR
* EXCEPTIONS
*   NOT_FOUND       = 1
*   OTHERS          = 2
                   .

         update ZFI_RECEIPT set MESSAGE = ESTR where ZIN4_REF = WAREA-ZIN4_REF.
         commit work.


       endif.
       refresh ETABLE.
     endloop.
   else.
     message 'INTERNAL TABLE EMPTY' type 'S'.
   endif.
*----------------------------------------------------------------------*
*        Start new screen                                              *
*----------------------------------------------------------------------*
form BDC_DYNPRO using PROGRAM DYNPRO.
   clear BDCDATA.
   BDCDATA-PROGRAM  = PROGRAM.
   BDCDATA-DYNPRO   = DYNPRO.
   BDCDATA-DYNBEGIN = 'X'.
   append BDCDATA.
endform.                    "BDC_DYNPRO

*----------------------------------------------------------------------*
*        Insert field                                                  *
*----------------------------------------------------------------------*
form BDC_FIELD using FNAM FVAL.
   if FVAL <> SPACE.
     clear BDCDATA.
     BDCDATA-FNAM = FNAM.
     BDCDATA-FVAL = FVAL.
     append BDCDATA.
   endif.
endform.                    "BDC_FIELD

gouravkumar64
Active Contributor
0 Kudos

Hi,

As per bseg table, wrbtr is currency field with 13 length.

You have to convert it to character field then pass like this thread

http://scn.sap.com/thread/1107203

Thanks

Gourav.

raymond_giuseppi
Active Contributor
0 Kudos

Use a syntax like

WRITE warea-wrbtr CURRENCY warea-waers TO bdcdata-value(16).

Regards,

Raymond

0 Kudos

hi,

Change the Reference type as WRBTR(15) TYPE C ,

insted of

WRBTR like BSEG-WRBTR,  

For uploading Curr & Qty Fields we must use Charector format insted of Dict. Reference

Try this it will work.

Thanks & Regards,

G.Kranthi Kumar Reddy

0 Kudos

Hi Kranthi,

This thread has answered status.

It means @abap wowsap already got his solution. So

Thanks

Gourav.

Former Member

Issue solved..

1.BSEG-WRBTR:

   data : amt1(16) type C.

   write WAREA-WRBTR  to AMT1 .
    condense AMT1.


perform BDC_FIELD       using 'BSEG-WRBTR'
                                       AMT1."WAREA-WRBTR.

2.date format is also wrong before .


data :date1(10) type C.


write WAREA-BLDAT to date1 dd/mm/yyyy.


perform BDC_FIELD       using 'BKPF-BLDAT'
                                      date1."WAREA-BLDAT.

Thanks for Reply,

SG     

0 Kudos

Hi,

Nice to see You got solution. Good Job.

Thanks

Gourav.

0 Kudos

Hoping for you that you will never use any currency code which doesn't allow decimals with this program... 

Regards,

Raymond

0 Kudos

Thanks Raymond..

In future ..i will use your code

Regards,

SG