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

Table and function modules

Former Member
0 Likes
1,164

Xperts,

i have matnr,vkorg,vtweg,spart ,kunnr

i need to get the sales details

suggest some table and function modules plz..

8 REPLIES 8
Read only

GauthamV
Active Contributor
0 Likes
1,013

Tables : VBAK,VBAP.

Read only

Former Member
0 Likes
1,013

Hi,

Try this FM-

SD_SALES_DOCUMENT_READ.

Or you can check FM 'SD_SALES_DOCUMENT_PREFETCH'.

Pass 'X' to all fields in structure I_SALES_VIEW.

Pass SD number to I_VBAK_KEYTAB table.

Read only

Former Member
0 Likes
1,013

Check the below tables and function modules/BAPI

Tables are VBAK,VBAP,

Function modules are SD_SALES_DOCUMENT_READ

BAPI_SALESORDER_GETLIST or BAPISDORDER_GETDETAILEDLIST

Read only

Former Member
0 Likes
1,013

Hello Anoop,

U start with VBRK,VBRP and for Basic Price and other taxes fetch data from KONV based on 'kschl'.

If u want Excise doc number use table j_1iexchdr.

For ur help refer sample code

SELECT DISTINCT avbeln afkart avkorg avtweg afkdat bnetwr aknumv bwerks bmwsbp afksto

ckunnr akunag dname1 dstras dort01 dregio e~spart

ftrntyp fexgrp fexnum fexdat bvgbel baubel bmatnr bposnr bfkimg bgsber berdat blgort bkursk_dat akdgrp arfbsk abukrs

INTO CORRESPONDING FIELDS OF TABLE vvk

FROM ( vbrk AS a

INNER JOIN vbrp AS b

ON avbeln = bvbeln

JOIN likp AS c

ON bvgbel = cvbeln

JOIN kna1 AS d

ON ckunnr = dkunnr

JOIN tspa AS e

ON bspara = espart

LEFT OUTER JOIN j_1iexchdr AS f

ON avbeln = frdoc

and f~trntyp = 'DLFC')

WHERE ( a~vbeln IN s_bill )

AND a~fkart IN s_fkart

AND a~vkorg IN s_vkorg

AND a~vtweg IN s_vtweg

AND ( a~fkdat IN s_bdate )

AND a~kdgrp IN s_kdgrp

AND ( a~kunag IN s_kunag )

AND b~gsber IN s_gsber

AND b~matnr IN s_matnr

AND ( b~spara IN s_spart )

AND b~werks IN s_werks

AND ( b~lgort IN s_lgort )

AND ( c~kunnr IN s_kunnr ).

********************************Basic Price

IF vvk[] IS NOT INITIAL.

SELECT knumv kschl kwert ksteu kbetr kposn FROM konv

INTO (i_konv2-knumv,i_konv2-kschl,i_konv2-basic,i_konv2-ksteu,

i_konv2-kbetr,i_konv2-kposn)

FOR ALL ENTRIES IN vvk WHERE

knumv = vvk-knumv

AND ksteu IN ('C','D','A','F')

AND kschl EQ 'PR00'.

COLLECT i_konv2.

CLEAR i_konv2.

ENDSELECT.

ENDIF.

Like wise for other taxes u can proceed.

Aastha

Read only

Former Member
0 Likes
1,013

hi

VBRK and VBRP are sales invoice tables.for check numbers use PAYR

hope this helps

regards

Aakash Banga

Read only

Former Member
0 Likes
1,013

Hi,

To check the sales related table,

in SE11 you can write VB* and

then press F4, it will fetch you all sales

related tables.

Hope it helps

Regards

Mansi

Read only

Former Member
0 Likes
1,013

hi u will get all Sales order details from

VBAK -- HEADER

VBAP --ITEM

KONV -- PRICING CONDITION pass vbak-knumv and vbap-posnr.

VBEP-- SCHEDULE LINE

VBPA -- PARTNER FUNCTIONS

Read only

Former Member
0 Likes
1,013

Hi,

Try with tables KNVV and MVKE (Customer and material sales data).

Regards,

Raju.