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

Former Member
0 Likes
371

i write source code like this,looking lfstk value in vbuk, select'c' value& fill records in vbak which contains c value in vbuk,(common field in both tables is vbeln).

TABLES :VBAK, VBUK.

DATA :V_LFSTK LIKE VBUK-LFSTK ,I_TAB LIKE VBAK OCCURS 0 WITH HEADER LINE.

SELECT * FROM VBAK INTO CORRESPONDING FIELDS OF I_TAB.

APPEND I_TAB.

ENDSELECT.

LOOP AT I_TAB.

SELECT SINGLE LFSTK FROM VBUK INTO V_LFSTK WHERE VBELN = I_TAB-VBELN.

IF V_LFSTK <> 'C'.

DELET I_ITAB.

ELSE.

E_T_DATA- VBELN = I_TAB-VBELN.

E_T_DATA- ERDAT = I_TAB-ERDAT.

E_T_DATA- NETWR = I_TAB-NETWR.

E_T_DATA- WAERK = I_TAB-WAERK.

APPEND E_T_DATA.

ENDIF.

ENDLOOP.

but when i check no.of recs in RSA3 in it shows ' 0 records',

how can i get ,pls help me ,

best answr rewarding point will be giving..

1 REPLY 1
Read only

RaymondGiuseppi
Active Contributor
0 Likes
298

Could you give the actual source of your DataSource function module, the code here (except from syntax error) should work (if you want order not fully delivered)

LFSTK is strictly the delivery status, and at the header level (VBUK), this field tells you if you have items that are either completely delivered, partially delivered or are still open. LFGSK basically tells you the status of the document from the subsequent delivery processing stand-point.

Maybe when you test the first records processed (i suppose via an OPEN CURSOR and a FETCH) are old and already delivered, so the first call don't give any records. Maybe you could read VBUK first, if this is the only criterion this would help to insure the correct size of package and improve performance. Here your program will read the whole tables VBAK and VBUK, where when you read VBUK first with filtering LFSTK NE 'C' should provide better performance.

Regards