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: 

Internal table fields.

Former Member
0 Kudos

Hi ALL ,

I want to take the fields from tables vbak ,kna1, vbkd, zspers and display its fields into 1 single output without using inner join . If U know help me.

The required fields are :

erdat LIKE vbak-erdat, " Date on Which Record Was Created

ernam LIKE vbak-ernam, " Name of Person who Created the Object

auart LIKE vbak-auart, " Sales Document Type

kunnr LIKE vbak-kunnr, " Sold-to party

ps_psp_pnr LIKE vbak-ps_psp_pnr, " Work Breakdown Structure Element

-


KDGRP LIKE vbkd-KDGRP, " Customer group

-


ZSSIDC LIKE zspers-ZSSIDC , " Salesman ID

-


PSTLZ LIKE kna1-PSTLZ , " Postal Code

-


4 REPLIES 4

ashwin_bhat
Participant
0 Kudos

If you do not want to code explicitely in the program, create a view with these tables.

Former Member
0 Kudos

try using SELECT FOR ALL ENTRIES....its a better alternative to inner join

Regards,

Ravikanth

Former Member
0 Kudos

Hello Vinoth,

you can fetch data from the tables VBAK ,LNA1,VBKD,ZSPERS.

by using the for all entries .

get the entries from VBAK based on your requirement.

if not it_VBAK[] is initial.

select * from vbkd into table it_vbkd for all entries in it_vbak

where vbeln = it_vbak-vbeln.

endif.

use the same logic for KNA1 table aslo and get the data.

The relation between VBAK & KNA1 is the customer number.

in the same way check the relation for your custom table ZSEPRS and get the data.

loop the it_vbak and use the read statement and move the data from it_vbkd, from kna1 table & ZSPERS into it_vbak.

if your final table is it_vbak modify it_vbap else append the data into your new final table.

Reward if useful.

Regards,

Phani.

Former Member
0 Kudos

hi,

check this one.

select-options: s_kunnr like kna1-kunnr.

select a~erdat

a~ernam

a~auart

a~kunnr

a~ps_psp_pnr

b~kdgrp

c~zssidc

d~pstlz

into table itab

from vbak as a

inner join vdkd as b on akunnr = bkunnr

inner join zspers as c on bkunnr = ckunnr

inner join kna1 as d on ckunnr =dkunnr

where a~kunnr in s_kunnr.

in the above join st

iused kunnr as common field in all tables and u canchange according to our wish and i taken a s_kunnr as a select option..

REWARD ALL USEFUL ANSWERS.

WITH REGARDS,

SURESH ALURI.