Application Development and Automation 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: 
Read only

fields that getting mismatched

Former Member
0 Likes
1,618

hi all ,

i need to do one loan report for that nearly am using some 2 tables one vtbfha and td07t in these two i got one common field that is product type from the both but the fields is moreover both are same  sgsart and gsart but nearly it is same but when i

types:begin of ty_loan1,

       bukrs type vtbfha-bukrs, " company code

       rfha  type vtbfha-rfha" transaction

       sanlf TYPE vtbfha-sanlf, " product category

       sfgtyp type vtbfha-sfgtyp," transaction category

       sgsart type vtbfha-sgsart," product type

       sfhaart type vtbfha-sfhaart," transaction type

       kontrh type vtbfha-kontrh,   " partner no.

       rportb type vtbfha-rportb, "portfolio

       zuonr type vtbfha-zuonr, "finance proj

       merkm type vtbfha-merkm, "characteristics

       zuond type vtbfha-zuond" Assignment

       wgschft type vtbfha-wgschft," currency

       dblfz type vtbfha-dblfz," start term

       delfz TYPE vtbfha-delfz," end term

       end of ty_loan1,

       begin of ty_loan2,

       gsart type td07t-gsart,

       xtext  type td07t-xtext" text

       xkbez type td07t-xkbez" shortname

       xlbez type td07t-xlbez" longname

       end of ty_loan2,

       begin of ty_loanfinal,

       bukrs type vtbfha-bukrs, " company code

       rfha  type vtbfha-rfha" transaction

       sanlf TYPE vtbfha-sanlf, " product category

       sfgtyp type vtbfha-sfgtyp," transaction category

       sgsart type vtbfha-sgsart," product type

       sfhaart type vtbfha-sfhaart," transaction type

       kontrh type vtbfha-kontrh,   " partner no.

       rportb type vtbfha-rportb, "portfolio

       zuonr type vtbfha-zuonr, "finance proj

       merkm type vtbfha-merkm, "characteristics

       zuond type vtbfha-zuond" Assignment

       wgschft type vtbfha-wgschft," currency

       dblfz type vtbfha-dblfz," start term

       delfz TYPE vtbfha-delfz," end term

       xtext  type td07t-xtext" text

       xkbez type td07t-xkbez" shortname

       xlbez type td07t-xlbez" longname

       end of ty_loanfinal.

******      table declarations

DATA:it_loan1 type STANDARD TABLE OF ty_loan1,

      wa_loan1 type ty_loan1,

      it_loan2 type STANDARD TABLE OF ty_loan2,

      wa_loan2 type ty_loan2,

      it_loan_final type STANDARD TABLE OF ty_loanfinal,

      wa_loan_final type ty_loanfinal.

select bukrs rfha sanlf sfgtyp sgsart sfhaart kontrh rportb zuonr merkm zuond wgschft dblfz delfz from vtbfha into table it_loan1 where sgsart = it_loan1-sgsart.

*****loop at it_loan1 into wa_loan1.

*****

*****endloop.

if it_loan1 is not INITIAL.

select gsart xtext xkbez xlbez from td07t into table  it_loan2 for all entries in it_loan1 where gsart = it_loan1-sgsart.

endif.

loop at it_loan2 .

  it_loan_final-xtext = it_loan2-xtext.

   it_loan_final-xkbez = it_loan2-xkbez.

   it_loan_final-xlbez = it_loan2-xlbez.

   read table it_loan1 into wa_loan1 WITH  KEY sgsart = wa_loan1-sgsart .

   if sy-subrc is INITIAL.

     it_loan_final-bukrs = it_loan1-bukrs.

     it_loan_final-rfha  it_loan1-rfha.

     it_loan_final-sanlf = it_loan1-sanlf.

     it_loan_final-sfgtyp = it_loan1-sfgtyp.

     it_loan_final-sfhaart = it_loan1-sfhaart.

     it_loan_final-kontrh = it_loan1-kontrh.

     it_loan_final-rportb = it_loan1-rportb.

     it_loan_final-zuonr = it_loan1-zuonr.

     it_loan_final-merkm = it_loan1-merkm.

     it_loan_final-zuond = it_loan1-zuond.

     it_loan_final-wgschft = it_loan1-wgschft.

     it_loan_final-dblfz = it_loan1-dblfz.

     it_loan_final-delfz = it_loan1-delfz.

     endif.

     append  it_loan_final.

     endloop.

    loop at it_loan_final into wa_loan_final.

     endloop.

     CALL FUNCTION 'GUI_DOWNLOAD'

       EXPORTING

         FILENAME                        = 'C:\Users\windows\Desktop\sap.xls'

        FILETYPE                        = 'ASC'

        WRITE_FIELD_SEPARATOR           = 'x'

       TABLES

         DATA_TAB                        = it_loan_final[].



this is what i did am getting that it_loan has without a header line and has  no component  called sgsart

Hi,

     You are selecting data in same table which is used in where condition,

     Here  it_loan1 is blank .

    

DATA:it_loan1 type STANDARD TABLE OF ty_loan1,

      wa_loan1 type ty_loan1,

      it_loan2 type STANDARD TABLE OF ty_loan2,

      wa_loan2 type ty_loan2,

      it_loan_final type STANDARD TABLE OF ty_loanfinal,

      wa_loan_final type ty_loanfinal.

select bukrs rfha sanlf sfgtyp sgsart sfhaart kontrh rportb zuonr merkm zuond wgschft dblfz delfz from vtbfha into table it_loan1 where sgsart = it_loan1-sgsart.

6 REPLIES 6
Read only

Former Member
0 Likes
1,470

Hi Mahalakshmi,

select bukrs rfha sanlf sfgtyp sgsart sfhaart kontrh rportb zuonr merkm zuond wgschft dblfz delfz from vtbfha into table it_loan1 where sgsart = it_loan1-sgsart.

The error is at above mentioned code.in where condition you are using it_loan1-sgart but it_laon1 is declared without header line...anyway you have to give some definate value in where condition and even if u use wa_loan-sgsart there it will not be having value so better take that value via selection screen and then pass it here...

Regards,

Shashikanth

Read only

Former Member
0 Likes
1,470

Hi,

     You are selecting data in same table which is used in where condition,

     Here  it_loan1 is blank .

    

DATA:it_loan1 type STANDARD TABLE OF ty_loan1,

      wa_loan1 type ty_loan1,

      it_loan2 type STANDARD TABLE OF ty_loan2,

      wa_loan2 type ty_loan2,

      it_loan_final type STANDARD TABLE OF ty_loanfinal,

      wa_loan_final type ty_loanfinal.

select bukrs rfha sanlf sfgtyp sgsart sfhaart kontrh rportb zuonr merkm zuond wgschft dblfz delfz from vtbfha into table it_loan1 where sgsart = it_loan1-sgsart.

Read only

0 Likes
1,470

hi shukla,

Yeah now i changed that one when i gave some values over there

select bukrs rfha sanlf sfgtyp sgsart sfhaart kontrh rportb zuonr merkm zuond wgschft dblfz delfz from vtbfha into table it_loan1 where sgsart = '36a'


in the second table when i am making comparison it_loan2 its not taking some table records.

Read only

0 Likes
1,470

Hi,

     Check for Case of Input Value (Upper Case or Lower Case)

      this table is buffered TD07T ,use by passing buffer in select query

Read only

0 Likes
1,470

Hi,

     Table TD07T is buffered, Use By passing Buffer in your second Select Query

Read only

VenkatRamesh_V
Active Contributor
0 Likes
1,470

Hi Mahalakshmi,

Try,

loop at it_loan2 .

  it_loan_final-xtext = it_loan2-xtext.

   it_loan_final-xkbez = it_loan2-xkbez.

   it_loan_final-xlbez = it_loan2-xlbez.

   read table it_loan1 into wa_loan1 WITH  KEY sgsart =     wa_loan1-sgsart .    " Add  it_loan2--sgsart




Regards,

Venkat.