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

need help...?

Former Member
0 Likes
1,442

Hi,

I have to have a header data with fields

Vendor Number: RBKP-LIFNR

Vendor Name: LFA1-NAME1 (Link via LIFNR)

Purchase Order: EKBE-EBELN

SAP Inv: RBKP-BELNR

Vendor Invoice No: RBKP-XBLNR

what will be the syntax for this..shud i have one internal table or two..

please help..

cheers:jim

14 REPLIES 14
Read only

Former Member
0 Likes
1,345

hi,

Its better if u have two internal tables and join them

Read only

Former Member
0 Likes
1,345

Hi Jimmy,

you need to declare only one internal table as follows.

types: begin ot itype,

LIFNR type RBKP-LIFNR,

NAME1 type LFA1-NAME1,

EBELN type EKBE-EBELN,

BELNR type RBKP-BELNR,

XBLNR type RBKP-XBLNR,

end of itype.

data: itab type table of itype, "internal table

wtab type itype. "work area

regards,

Ruchika

Reward if useful.

Read only

0 Likes
1,345

But how will I raise a select command...I have the internal table with this structure but not able to figure out how to get data into the table...

Thnx

Read only

0 Likes
1,345

hi

u can use ctrl statements....

loop at itab.

write : / itab-fld1 , itab-fld2.

at new <fld>.

write : / <item fileds>.

endat.

hope it helps.....

sorry i think i got the question wrong...please ignore this.

Message was edited by:

Premalatha G

Read only

Former Member
0 Likes
1,345

Hi,

Check if u can relate like this:

using Customer Invoice search in VBFA for Sales Order and from VBFA search for Purchase Order corresponding to Sales Order and for Correspoding PO u can search for Corresponding Vendor Invoices in RBKP. I think for Vendor Invoice u can check in MIRO and in that tcode if u give the PO number all data related to PO u can get.

And also check this:

types: begin of ty_itab1,

LIFNR type RBKP-LIFNR,

NAME1 type LFA1-NAME1,

EBELN type EKBE-EBELN,

BELNR type RBKP-BELNR,

XBLNR type RBKP-XBLNR,

end of ty_itab1.

data: itab1 type standard table of ty_itab1,

wa1 type ty_itab1.

read table itab into wa with key lifnr = itab1-lifnr.

if sy-subrc eq 0.

move wa-lifnr = wa1-lifnr.

move wa-ebeln = wa1-ebeln.

move wa-xblnr = wa1-xblnr.etc.

append wa1 to itab1.

endif.

Regards

Kannaiah

Read only

Former Member
0 Likes
1,345

hi jimmy,

u first write select statment on table tbkp,

then use for all entries of first <itab>, write select statment on table lfa1,

now use for all entries of first <itab>, write select statemnet on table ekbe.

in loop u can move all these records one global <itab> then disply.

reward points if helpful,

regards,

seshu.

Read only

0 Likes
1,345

I have a selection screen with a select option field for EKBE-EBELN...Now for this range I have to fill this internal table with header data...

Not able to figure out the link between the tables...

thnx for ur help guys...

Jim

Read only

0 Likes
1,345

first select form ekbe table then use this <itab>, for all other selection statements through for all entries.

otherwise post your code then we'll try to adjust.

reward with points if helpful.

regards,

seshu.

Read only

Former Member
0 Likes
1,345

Hi jimmy,

sorry for previous reply.

try wid this way.

TYPES: begin of itype,

lifnr TYPE rbkp-lifnr,

belnr TYPE rbkp-belnr,

xblnr TYPE rbkp-xblnr,

END OF itype.

TYPES:BEGIN OF itype1,

name1 TYPE lfa1-name1,

END OF itype1.

TYPES: BEGIN OF itype2,

ebeln TYPE ekbe-ebeln,

END OF itype2.

DATA: itab TYPE TABLE OF itype, "internal table

wtab TYPE itype. "work area

DATA: itab1 TYPE TABLE OF itype1, "internal table

wtab1 TYPE itype1. "work area

DATA: itab2 TYPE TABLE OF itype2, "internal table

wtab2 TYPE itype2. "work area

SELECT lifnr belnr xblnr FROM rbkp INTO TABLE itab.

SELECT name1 FROM lfa1 INTO TABLE itab1 FOR ALL ENTRIES IN itab WHERE

lifnr = itab-lifnr.

select ebeln from ekbe into table itab2 for all entries in itab where

belnr = itab-belnr.

regards,

Ruchika

Read only

Former Member
0 Likes
1,345

Hi,

Now you can read these three internal tables in a final header table.

regards,

Ruchika

Read only

Former Member
0 Likes
1,345

Hi,

if you want to select according to your select-options then go in this way

TYPES: begin of itype,

lifnr TYPE rbkp-lifnr,

belnr TYPE rbkp-belnr,

xblnr TYPE rbkp-xblnr,

END OF itype.

TYPES:BEGIN OF itype1,

name1 TYPE lfa1-name1,

END OF itype1.

TYPES: BEGIN OF itype2,

ebeln TYPE ekbe-ebeln,

belnr type ekbe-belnr,

END OF itype2.

DATA: itab TYPE TABLE OF itype, "internal table

wtab TYPE itype. "work area

DATA: itab1 TYPE TABLE OF itype1, "internal table

wtab1 TYPE itype1. "work area

DATA: itab2 TYPE TABLE OF itype2, "internal table

wtab2 TYPE itype2. "work area

select ebeln belnr from ekbe into table itab2 .

SELECT lifnr belnr xblnr FROM rbkp INTO TABLE itab FOR ALL ENTRIES IN

itab2 WHERE

belnr = itab2-belnr.

.

SELECT name1 FROM lfa1 INTO TABLE itab1 FOR ALL ENTRIES IN itab WHERE

lifnr = itab-lifnr.

regards,

Ruchika

Read only

0 Likes
1,345

select ebeln belnr from ekbe into table itab2 where ebeln in s_ebeln.

Modify first select statement like this...............

Read only

0 Likes
1,345

Hey Ruchika,

Thanx for ur help...iam just trying this...also is it possible for us to do all this through one internal table and through one select statement using joins...in one select statement we can have more than one join...am i right...

But I am stilll trying...thanx again Ruchi...I appreciate...

Read only

0 Likes
1,345

Hi jimmy,

Yes you are right. but its advisable to avoid joins . but its your wish. if you want to use join you can use , becouse now you have common fields between these tables.

good luck

Ruchika