cancel
Showing results for 
Search instead for 
Did you mean: 

Ordered, billed and delivered but unbilled (VF04) report in BW

jbreznar
Participant
0 Kudos

Hi,

I want to create a report that has the ordered value, billed value, unbilled value and delivered but unbilled value (like VF04 report) for customers. The request is that they can browse on the document level, sort of like document flow, but the delivery/billing value must be in the same line as the order value.

I created 3 DSOs, one that combines the following documents:

  • order data (2LIS_11_VAITM, 2LIS_11_VASTI, 2LIS_11_V_ITM and 2LIS_11_V_SSL),
  • deliveries (2LIS_12_VCITM) and
  • billing (2LIS_13_VDITM).

I then combine order and deliveries with an infoset into a DSO and then combine that with billing into another DSO. Then feed that into a infocube. I am having issues with statuses of documents. The users create deliveries in advance and not post them. But as soon as it is created, the overall status of the order item is set to C, so I cannot really determine what is not yet billed and what is completed but just billed less than in the order.

I have another DSO that has the unbilled deliveries that are in the VF04 report (from join of tables VKDFS and VBUP). I am thinking of doing a lookup to that DSO to mark deliveries that are unbilled with X.

How can I do a lookup and then mark X in my infoobject in the end routine? I am trying with a lookup routine but I have no idea how to not bring a field from the DSO, just mark the deliveries.

*Declaring local structure ls_zvf04
TYPES: BEGIN OF ls_zvf04,
DOC_NUMBER TYPE /BI0/OIDOC_NUMBER,
END OF ls_zvf04.
*Declaring internal table lt_customer and work area wa_customer
DATA: lt_zvf04 TYPE STANDARD TABLE OF ls_zvf04,
wa_zvf04 TYPE ls_zvf04.

*filling delivery into internal table from ZVF04
SELECT DOC_NUMBER FROM /BIC/AZVF0400
INTO CORRESPONDING FIELDS OF TABLE lt_ZVF04 FOR ALL ENTRIES IN
RESULT_PACKAGE
WHERE DOC_NUMBER = RESULT_PACKAGE-DELIV_NUMB.

*Deliveries population
CLEAR wa_zvf04.
LOOP AT RESULT_PACKAGE ASSIGNING <RESULT_FIELDS>.
READ TABLE lt_zvf04 INTO wa_zvf04
WITH KEY DOC_NUMBER = <RESULT_FIELDS>-DOC_NUMBER.
IF sy-subrc = 0.
<RESULT_FIELDS>-/BIC/ZFKSAA = 'X'.
ENDIF.
ENDLOOP.

I also feel like I am overcomplicating things so any recommendations for how to more elegantly solve this whole issue would be welcome.

Thank you! 🙂

Accepted Solutions (0)

Answers (0)