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

Function module to get VBAK using VGBEL

Subbaka11
Participant
0 Likes
2,062

Hello team,

As per project requirement.. I have to fetch VBAK data using VGBEL.

Since VGBEL is not a key field of VBAK I am facing performance issues.

Can any one suggest me a function module to get VBAK-VBELN using LIPS-VGBEL.

We also need to fetch TKNUM from vttp using vbeln (non key field of VTTP)

5 REPLIES 5
Read only

FredericGirod
Active Contributor
1,662

First, stop thinking Function Module will solved everything because it is ... a FM

it is old school, forget it

VGBEL is a reference document, it could be the key of VBAK

The performance optimization depends of the context, how did you access the data, what do you need in VBAK ?

Read only

0 Likes
1,662

Hi Frederic,

I am fetching TKNUM from VTTP table passing VBELN in where condition

since VBELN is not a key field of VTTP it would be bad in performance, so I am looking for FM.

Select

tknum,

tpnum,

vbeln

from VTTP

into table @dat(it_vttp)

for all entries in @it_likp_lips

where vbeln = @it_likp_lips-vbeln.

Thank you.

Read only

0 Likes
1,662

Check VEPVG Index, it is a link between Sales order & Transport.

Read only

MateuszAdamus
Active Contributor
0 Likes
1,662

Hello dubbaka

If you're facing performance issue reading VBAK by VGBEL then consider creating an additional index on the VBAK table with the VGBEL field as one of the fields.

Kind regards,
Mateusz
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,662

Your question is not very clear. I'm afraid I can't answer precisely.

Why do you want to read via a function module?

What is your LIPS-VGTYP value? (example, if VGTYP='C' then VGBEL refers to a sales order in VBAK i.e. LIPS-VGBEL -> VBAK-VBELN directly)

Concerning VTTP, it has THE index VBL over field VBELN in my S/4HANA system.