09-11-2008 8:06 PM
Hi Gurus!
I have created a report to display the contarct details with the billing line details. Its basically is a combination of two reports which will show schedule line item detaisl on one hand and the billing plan lines on clicking another radiobutton.
Basically I want to bring in my billing document number in my report which I am unable to bring so. I have used the following tables in teh form of jon to bring in all the details but I am not sure how to bring the billing document number in my report.
TABLES: vbak, vbap, wbrk, zsdsched, fplt, fpla, tvlvt.
If I include the billing document through join its giving me run-time as its takinga long long time to process. Kindly give some clue as how to bring in my billing document number in the report.
Thanks
09-11-2008 8:45 PM
Any helpm on this please.
I could paste the part of report where I am facing teh problem.
Pleas ehelp.
Thanks
09-11-2008 8:58 PM
how about using this join.
VABK-VBELN > VBPA-VBELN>LIPS-->VBELN
LIPS-VBELN>VBRK-VGBEL & LIPS-POSNR>VBRK-VGPOS
From this you can read the billing document number which is VBRK-VBELN.
I am not sure if this is much more efficient than the other one but it might be worth a try.
Hope this helps you
Raghu.
09-11-2008 9:15 PM
I have used this , can we add add what you mentioned in your previous reply?
*&---------------------------------------------------------------------*
*& Form get_data
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM get_data .
* Select Billing plan line records
* Select the appropriate rental data.
IF p_rental = 'X' .
SELECT a~vbeln a~ktext a~erdat a~ernam a~audat a~vbtyp a~auart a~vkorg
a~vtweg a~spart a~vkbur a~guebg a~gueen a~kunnr a~kvgr4
b~posnr b~matnr b~charg b~matkl b~arktx b~pstyv b~zmeng
b~zieme b~kdmat b~werks b~lgort b~vstel b~netpr b~kpein
b~vkaus b~aufnr b~kmein b~shkzg b~oid_extbol b~oid_miscdl
b~oidrc b~oid_ship AS kunwe b~zzwprofid c~datbi c~datab b~route
e~fkdat e~nfdat e~fakwr e~fksaf e~afdat
f~fpart f~bedat f~endat f~horiz g~bezei
INTO CORRESPONDING FIELDS OF TABLE gt_sel
FROM vbak AS a
INNER JOIN vbap AS b ON a~vbeln = b~vbeln
INNER JOIN vbkd AS d ON a~vbeln = d~vbeln
INNER JOIN fplt AS e ON d~fplnr = e~fplnr
INNER JOIN fpla AS f ON e~fplnr = f~fplnr
* left outer join vbrp as m on a~vbeln = m~aubel
LEFT OUTER JOIN tvlvt AS g ON b~vkaus = g~abrvw
and g~spras = 'E'
LEFT OUTER JOIN zsdsched AS c ON b~vbeln = c~vbeln
AND b~posnr = c~posnr
WHERE a~vbeln IN s_vbeln
AND a~ktext IN s_ktext
AND a~erdat IN s_erdat
AND a~vbtyp = gc_g
AND a~ernam IN s_ernam
AND a~vkorg IN s_vkorg
AND a~vtweg IN s_vtweg
AND a~spart IN s_spart
AND a~vkbur IN s_vkbur
AND a~guebg IN s_guebg
AND a~gueen IN s_gueen
AND a~auart IN s_auart
AND a~kunnr IN s_kunnr
AND b~oid_ship IN s_kunwe
AND b~werks IN s_werks
AND b~lgort IN s_lgort
AND b~vstel IN s_vstel
AND b~route in s_route
AND b~matnr IN s_matnr
AND e~afdat IN s_afdat
AND e~fksaf IN s_fksaf
AND b~pstyv in s_pstyv.
SORT gt_sel.
IF NOT gt_sel[] IS INITIAL.
Thanks
09-11-2008 9:21 PM
Since MATNR appears to be part of the selection criteria, I would add table VAPMA to the JOIN and SELECT MATNR from there. VAPMA is a secondary index table for sales orders based on material.
Rob
09-11-2008 9:36 PM
The thing is that lots of other things in the report depend on the joins that are presently there . The only thing that I need to get into my report is the billing document number . Is that possible without changing the present tables and usoing the tables already there with addition of some other tables to get in teh billing document number in my report?
Thanks
09-12-2008 3:59 PM
09-12-2008 4:09 PM
The billing document number should be in the sales document flow - table VBFA.
Rob