Skip to Content
avatar image
Former Member

Field symbol Assign/unassign issue

Hi Experts,

I am facing an issue. I get dump BDC_OVERFLOW dump. I understand it because I am inserting a 11+2(dec) value into 9+(2) variable.

ASSIGN COMPONENT 'PREIS' OF STRUCTURE <fs_gwa_tab> to <lw_amnt13>.


      if <lw_amnt13> IS ASSIGNED.

        CLEAR lw_value.

      lw_value = <lw_amnt13>.

            CALL FUNCTION 'CURRENCY_AMOUNT_SAP_TO_DISPLAY'

       EXPORTING

         CURRENCY              = 'KRW'

         AMOUNT_INTERNAL       = lw_value                                                   " =12146092.15

      IMPORTING                                                                                         "this FM multiplies value. 100 in this case.

        AMOUNT_DISPLAY         = lw_value.                                                  " = 1214609200.15

      <lw_amnt13> = lw_value.                                " Dump here

Endif.

How do I over come.

I tried, after above code.

UNASSIGN <lw_amnt>.

ASSIGN lw_int to <lw_amnt> .             " where lw_int is 11+2.

But this unassign doesnt modify value in STRUCTURE <fs_gwa_tab>.


Please help me with this issue.

Thanks,

Anil

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Jan 12, 2015 at 05:53 PM

    Hi,

    your problem is not one of field-symbol assignment.

    As you stated in your original post, you are trying to assign a value of 11+2, well actually 10+2 with 1214609200.15 in your example, to a field that can only hold 9+2!

    If you are free to alter the definition of the table, assigned to <fs_gwa_tab>, i would suggest you define field PREIS as 11+2 as well.

    If not, you'll have to wriggle your way around, like doing the currency adaption at a later time, leaving the value until you need to process it and probably are able to work with a field large enough.

    This has nothing to do with field-symbols. If you're not certain about using them and don't know exactly what you're doing, then just don't.

    Best regards - Jörg

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      wenn the table is "EBAN", then you can try to use the field price unit "PEINH". Maybe we are lucky, and the field is greater than 1.


      ........

          CALL FUNCTION 'CURRENCY_AMOUNT_SAP_TO_DISPLAY'

             EXPORTING

               CURRENCY              = 'KRW'

               AMOUNT_INTERNAL       = lw_value                                                 

            IMPORTING                                                                                      

              AMOUNT_DISPLAY         = lw_value.                                              

           FIELD-SYMBOLS <PEINH> type EPEIN.

           if  lw_value => 1000000000.

                ASSIGN COMPONENT 'PEINH' OF STRUCTURE <fs_gwa_tab> to <PEINH>.

                 if <PEINH> IS ASSIGNED.

                   if  <PEINH> > 1.

                     lw_value =  lw_value / <PEINH>.

                     <PEINH> = 1.

                   endif.           

               endif.    

           endif.

      ........


      Regards,

      Serge M

  • avatar image
    Former Member
    Jan 12, 2015 at 02:30 PM

    Hi

    But the dump?

    In which line?

    Max

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Max,

        <lw_amnt13> = lw_value.                                " Dump here


      Hi Sumeet,


      Dump : BDC_FIELD_OVERFLOW.


      Thanks,

      Anil

  • avatar image
    Former Member
    Jan 12, 2015 at 02:34 PM

    Hi,

    can you please provide the full code?

    And what dump are you getting?

    BR

    Sumeet

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 12, 2015 at 03:35 PM

    Hi,

    Kindly check the following code

    DATA lv_value TYPE wmto_s-amount.

    ASSIGN COMPONENT 'PREIS' OF STRUCTURE <fs_gwa_tab> to <lw_amnt13>.


          if <lw_amnt13> IS ASSIGNED.

            CLEAR lw_value.

          lw_value = <lw_amnt13>.


    CALL FUNCTION 'ROUND'

         EXPORTING

           DECIMALS            = 4

           input               = <lv_amn13>

        IMPORTING

          OUTPUT              =  lv_value

        EXCEPTIONS

          OTHERS              = 1.

                 .

                CALL FUNCTION 'CURRENCY_AMOUNT_SAP_TO_DISPLAY'

           EXPORTING

             CURRENCY              = 'KRW'

             AMOUNT_INTERNAL       = lw_value                                                   " =12146092.15

          IMPORTING                                                                                         "this FM multiplies value. 100 in this case.

            AMOUNT_DISPLAY         = lw_value.                                                  " = 1214609200.15

          <lw_amnt13> = lw_value.                                " Dump here

    CALL FUNCTION 'ROUND'

         EXPORTING

           DECIMALS            = 2

           input               = lv_value

        IMPORTING

          OUTPUT              =  <lv_amn13>

        EXCEPTIONS

          OTHERS              = 1.

    Endif.


    Regards,

    Serge M

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Serge,

      Thanks for your inputs.
      I get error while using call function 'ROUND', the second time. There seems top be an overflow. with return code 1.


      Still the same overflow issue.

      Can you please help further.

      Thanks,

      Anil

      2.JPG (40.5 kB)