Skip to Content
avatar image
Former Member

Error not unicode convertible to select data

i want to select data from 2 table, and in the line error in from bseg INTO TABLE li_bseg the error is unicode convertible , please help

*&---------------------------------------------------------------------*

*& Report  ZX

*&

REPORT  ZX.

TABLES : bkpf,

         bseg.

TYPES :

BEGIN OF ty_bkpf,

    bukrs TYPE bkpf-bukrs, "1

    belnr TYPE bkpf-belnr, "2

    gjahr TYPE bkpf-gjahr, "3 Fiscal Year

    budat TYPE bkpf-budat,

    waers TYPE bkpf-waers,

  end of ty_bkpf,



BEGIN OF ty_bseg,

    bukrs       TYPE bseg-bukrs, "1

    belnr       TYPE bseg-belnr, "2 Doc no

    gjahr       TYPE bseg-gjahr, "3

    buzei       TYPE bseg-buzei, "4

    wrbtr       TYPE bseg-wrbtr, "5 Ammount in other currency

    hkont       TYPE bseg-hkont, "6

END OF ty_bseg,



ty_t_bkpf TYPE TABLE OF ty_bkpf,

ty_t_bseg TYPE TABLE OF ty_bseg,

ty_r_budat TYPE RANGE OF bkpf-budat.



SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME TITLE text-b01.

PARAMETERS : p_bukrs TYPE bkpf-bukrs,

             p_gjahr TYPE bkpf-gjahr.

SELECT-OPTIONS :

        so_belnr FOR bkpf-belnr,

        so_budat FOR bkpf-budat.

SELECTION-SCREEN END OF BLOCK b01.



START-OF-SELECTION.

PERFORM f_get_bkpf USING p_bukrs

                         p_gjahr

                         so_budat[].

END-OF-SELECTION.



FORM  f_get_bkpf USING pp_bukrs TYPE bukrs

                       pp_gjahr TYPE gjahr

                       pso_budat TYPE ty_r_budat.



DATA : li_bkpf TYPE ty_t_bkpf,

       li_bkpf_temp TYPE ty_t_bkpf,

       li_bseg TYPE ty_t_bseg,

       wa_bseg TYPE ty_bseg.



"DATA : li_bkpf TYPE itab.

        select bukrs

               belnr

               gjahr

               budat

               waers

        from bkpf

        INTO TABLE li_bkpf

        where bukrs = pp_bukrs

        AND gjahr = pp_gjahr

        AND budat IN pso_budat.



        IF li_bkpf IS NOT INITIAL.

           li_bkpf_temp = li_bkpf.

          SELECT *

          from bseg

          INTO TABLE li_bseg

          FOR ALL ENTRIES IN li_bkpf_temp

          WHERE bukrs = li_bkpf_temp-bukrs

          AND gjahr = li_bkpf_temp-gjahr.



          LOOP AT li_bseg into wa_bseg.

            WRITE :/ wa_bseg-bukrs, wa_bseg-belnr.

          ENDLOOP.

       ENDIF.

ENDFORM.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers