Skip to Content
author's profile photo Former Member
Former Member

RV_SCHEDULE_CHECK_DELIVERIES

Hi Experts,

I am writing a program to give a report to my client which contains, the schedule line confirmed quantity

and delivered quantity at schedule line level. I am using the below mentioned fm 'RV_SCHEDULE_CHECK_DELIVERIES'

and the code i have written is.

SELECT vbeln

erdat

vbtyp

vtweg

spart

vkgrp

vkbur

auart

bstnk

kunnr

kvgr5

FROM vbak

INTO TABLE gt_vbak

WHERE vbtyp EQ gc_c

AND erdat IN s_erdat

AND vtweg IN s_vtweg

AND spart IN s_spart

AND vkbur IN s_vkbur

AND auart IN s_auart

AND vkorg EQ p_vkorg.

IF gt_vbak[] IS NOT INITIAL.

SELECT *

FROM vbap

INTO CORRESPONDING FIELDS OF TABLE xvbap

FOR ALL ENTRIES IN gt_vbak

WHERE vbeln = gt_vbak-vbeln.

  • AND werks IN s_werks.

  • AND abgru = space.

IF sy-subrc EQ 0.

SELECT *

FROM vbup

INTO TABLE xvbup

FOR ALL ENTRIES IN xvbap

WHERE vbeln = xvbap-vbeln

AND posnr = xvbap-posnr.

SELECT *

FROM vbfa

INTO TABLE xvbfa

FOR ALL ENTRIES IN xvbap

WHERE vbelv = xvbap-vbeln

AND posnv = xvbap-posnr

AND vbtyp_n = gc_j

AND vbtyp_v = gc_c.

SELECT *

FROM vbep

INTO TABLE xvbep

FOR ALL ENTRIES IN xvbap

WHERE vbeln = xvbap-vbeln

AND posnr = xvbap-posnr.

ENDIF.

ENDIF.

  • DATA: zvbap TYPE TABLE OF vbapvb ,

  • lzvbap TYPE vbapvb.

DATA: lvbep TYPE vbepvb.

  • LOOP AT xvbap INTO lvbap.

LOOP AT xvbep INTO lvbep.

CALL FUNCTION 'RV_SCHEDULE_CHECK_DELIVERIES'

EXPORTING

fbeleg = lvbep-vbeln

fposnr = lvbep-posnr

TABLES

fvbfa = xvbfa

fvbup = xvbup

fxvbep = xvbep

fvbap = xvbap

EXCEPTIONS

fehler_bei_lesen_fvbup = 1

fehler_bei_lesen_fxvbep = 2

OTHERS = 3.

IF sy-subrc <> 0.

RETURN.

ENDIF.

LOOP AT xvbep INTO lvbep WHERE vbeln = lvbep-vbeln

AND posnr = lvbep-posnr

AND etenr = lvbep-etenr.

MOVE-CORRESPONDING lvbep TO lvbep_out.

APPEND lvbep_out TO vbep_out.

CLEAR lvbep_out.

CLEAR lvbep.

ENDLOOP.

ENDLOOP.

But the program is not working properly, please suggest me what wrong i am doing? Or if there is any other way to get the delivery qty at schedule line level.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2010 at 10:13 AM

    Solved by myself.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 10, 2010 at 10:13 AM

    Solved by myself.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.