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: 

how to use SD_VBAK_ARRAY_READ functional module

Former Member
0 Kudos

hello

can you please tell me how to use SD_VBAK_ARRAY_READ functional module. that means what i have to pass and what i should get.

Please help me

5 REPLIES 5

gopi_narendra
Active Contributor
0 Kudos

Check the <a href="http://www.se37.com">site</a>

Regards

Gopi

Former Member
0 Kudos

Hi Darshana,

Check the following:

call function 'SD_VBAK_ARRAY_READ'

exporting

i_refresh_buffer = 'NO'

tables

it_vbak_key = vbak_key_tab

et_vbak = lt_vbak

exceptions

records_not_found = 1

records_not_requested = 2

others = 3.

lt_vbak contains the returned data.

pass vbeln in the vbak_key_tab-vbeln field.

Reward if helpful.

Regards,

Ravi G

0 Kudos

Hi Ravi,

i want to display vkorg,kunnr,and some other fields from the VBAK. User enters VKORG and some other fields but VKORG is compulsory.

so i written the code like this.

TYPES :BEGIN OF TEITAB_VBAK,

VKORG type VBAK-VKORG,

KUNNR TYPE VBAK-KUNNR,

VBELN TYPE VBAK-VBELN,

AUDAT TYPE VBAK-AUDAT,

VDATU TYPE VBAK-VDATU,

ERNAM TYPE VBAK-ERNAM,

END OF TEITAB_VBAK.

DATA: ITAB_VBAK TYPE TABLE OF TEITAB_VBAK,

WA_VBAK TYPE TEITAB_VBAK.

SELECT-OPTIONS: s_VKORG FOR P_VKORG OBLIGATORY, " Sales Organization

s_KUNNR FOR P_KUNNR, " Sold-to party.

s_VBELN FOR P_VBELN, " Sales Document.

s_MATNR FOR P_MATNR, " Material number.

s_AUDAT FOR P_AUDAT, " Document Date (Date Received/Sent).

s_VDATU FOR P_VDATU, " Requested delivery date.

s_ERNAM FOR P_ERNAM, " Name of Person who Created the Object.

s_VKAUS FOR P_VKAUS. " Usage indicator.

SELECT VKORG KUNNR VBELN AUDAT VDATU ERNAM

FROM VBAK

INTO CORRESPONDING FIELDS OF TABLE ITAB_VBAK

WHERE VKORG IN S_VKORG AND AUART EQ 'ZRA'.

CALL FUNCTION 'SD_VBAK_ARRAY_READ'

  • EXPORTING

  • I_BYPASSING_BUFFER = ' '

  • I_REFRESH_BUFFER =

TABLES

IT_VBAK_KEY =

  • ET_VBAK =

  • EXCEPTIONS

  • RECORDS_NOT_FOUND = 1

  • RECORDS_NOT_REQUESTED = 2

  • OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

so i confused where to call this fucntional module and what to pass. That means call this functional module before the select query or after the select query and what to pass.

i am new in ABAP.

Please help me to solve this problem .

Former Member
0 Kudos

HI

look at the code i have used in 1 of my programs

  • buffer fetch for SD order headers

if not lt_vbak_key[] is initial.

call function 'SD_VBAK_ARRAY_READ'

exporting

i_refresh_buffer = true

tables

it_vbak_key = lt_vbak_key

exceptions

records_not_found = 1

records_not_requested = 2.

if sy-subrc = 1.

  • internal error -> no message

raise object_not_found.

endif.

endif.

thanks

vivekanand

Former Member
0 Kudos

Hi

Lokale Schnittstelle:

<b>IMPORTING</b> VALUE(I_BYPASSING_BUFFER) TYPE C DEFAULT SPACE

VALUE(I_REFRESH_BUFFER) TYPE C OPTIONAL

<b> TABLES</b> IT_VBAK_KEY STRUCTURE SALES_KEY

ET_VBAK STRUCTURE VBAK OPTIONAL

by defining the structure like sales_key and giving the input to the parameter as I_BYPASSING_BUFFER and I_REFRESH_BUFFER you will get the data into the final structure

reward if usefull