Vbfa and vbrk tables invoice issue
Hi friends,
Here I am facing one problem in one of my report in that i am first match delivery no with likp and vbfa table then i am take vbeln from vbfa table
like that
SELECT SINGLE *
FROM vbfa WHERE vbelv = likp-vbeln AND vbtyp_n = 'M'
AND vbtyp_v = 'J' AND rfmng NE 0 AND rfwrt NE 0.
itab2-invno = vbfa-vbeln.
Then I go in vbrk table like
IF sy-subrc = 0.
SELECT SINGLE * FROM vbrk WHERE vbeln = itab2-invno AND fksto <> 'X'.
itab2-invdt = vbrk-fkdat .
endif.
so here its take's cancelled invoice also so I add one condition for from vbrk and add it here " fksto 'X' ".
so my problem is that I want to filter vbeln which have fksto <> 'X'.
So how can I edit my code and take vbeln fvbrk.
see this code and modify it if u hv any idea.
THnaks,
Prashant.
Check how different was your code especially in the extraction parameters compared to the one in the above.
When you need FKSTO NE 'X' i.e Non-Cancelled document, ofcourse you can change the condition and use accordingly.
Eg: I dont have any syntax errors with the following code:
PARAMETERS: p_vbelv TYPE vbeln_vl.
DATA: l_vbeln TYPE vbeln,
l_fkdat TYPE fkdat.
SELECT SINGLE a~vbeln b~fkdat INTO (l_vbeln, l_fkdat)
FROM vbfa AS a
INNER JOIN vbrk AS b
ON a~vbeln = b~vbeln
WHERE a~vbelv = p_vbelv "likp-vblen
AND a~vbtyp_n = 'M'
AND a~vbtyp_v = 'J'
AND a~rfmng NE 0
AND a~rfwrt NE 0
AND b~fksto NE 'X'.
IF sy-subrc EQ 0.
WRITE:/ 'Billing Document:', l_vbeln,
/ 'Date:', l_fkdat.
ENDIF.
Similar Messages
-
Problem with panelbox and af:table scrollbar issue and panelstretchlayout
Hi,
<af:panelStretchLayout >
<f:facet name="center">
<af:panelSplitter orientation="vertical" positionedFromEnd="true" inlineStyle="vertical-align:inherit;">
<f:facet name="first">
<af:subform default="false" id="xyz">
<af:panelBox background="light" text="Advance Search" inlineStyle="color:InactiveCaption;" type="default">
<af:panelGroupLayout layout="scroll">
<af:commandButton text="Search" id="advSearch" actionListener="#{ADFStandardsLeftMenu.getAdvancedSearchData}"/>
<af:spacer width="20"/>
<af:commandLink text="Search Tips" id="searchtips2" inlineStyle="font-weight:bold;" partialSubmit="true" clientComponent="true">
<af:showPopupBehavior triggerType="click" align="afterEnd" popupId="advSearchPopupId"/>
</af:commandLink>
</af:panelGroupLayout>
</af:panelBox>
</af:subform>
</f:facet>
<f:facet name="second">
<af:panelBox background="light" text="Basic Search" inlineStyle="color:InactiveCaption;" type="default">
<af:spacer height="20"/>
<af:panelGroupLayout layout="scroll" >
--- some inputtext command buttion, dropdowns...selectonechoice..are there inside this
</af:panelGroupLayout>
</af:panelBox>
</f:facet>
</af:panelSplitter>
</f:facet>
</af:panelStretchLayout>
problem:
(we have 2 panels) of vertical
when i run this application it is working fine. But when we minimise the browser(half size) or if we add more no of toolbars in browser (important) obviously browser size will decrease,
that time 1 panel getting decreased second panel is maintaing fixed size, not resizing.
I tried to give fixed size (percentage) for both panels wt ever the operation does.
and 2nd issue
========
<af:panelStretchLayout>
<f:facet name="center">
<af:panelSplitter orientation="vertical"
positionedFromEnd="true" >
<af:panelBox background="light" text="Search For Standards" inlineStyle="color:InactiveCaption;vertical-align:50%;" >
<af:table value="#{ADFStandardsLeftMenu.mostCommonAgencySelectedList}"
id="t1" width="100%" var="stdURL"
emptyText="<html><b><font color='red'><center>No Records Found</center></font></center></b></html>"
disableColumnReordering="true"
columnSelection="multiple"
rowSelection="multiple"
inlineStyle="text-align:left;"
verticalGridVisible="true"
horizontalGridVisible="true">
<af:column>
</af:column>
---- we have more 8-10 columns
</af:table>
</af:panelbox>
</af:panelsplitter>
</f:facet>
</af:panelstretchlayout>
problem: that time im getting by default horizontal and vertical scrollbar, but if user add toolbars in browser (view->customize)add toolbar no of say 10-15 that time window size decreasing
so, table size is crossing panelbox size, and bottom scrollbar is not visible (hiding under site bottom layout say site is divided into 4 parts (leftmenu, body(2 panels), right, bottom) (im not using any right layout)
regards,
sandeepHi,
if minimises browser window(half) or by adding more no of toolbars, i given an option as panelgrouplayout layout=scroll.
it is working fine for 1st panel.
but 2nd panel scrollbar not coming.
thanks in adv.
regards,
sandeep -
"How to sum FKIMG in VBRK and VBRP Table with sample output
Sir\Mam\Gurus ;
I hardly found it difficult in resolving my program in getting the sum of FKIMG inside the VBRP and VBRK tables
The scenario is that i have one Sales Order with multiple invoices . What i need to do is to sum up the fkimg or the quanitity of specific material regardless of how many invoices the material have in a particular SO
Example I have Sales Order number 35678952 with
3 invoices
Invoice # 123 with material number mat1=12, mat2=5 , mat3=7
345 with material number mat1=7, mat2=7
678 with material number mat1=5, mat3=10
Output shoud be
salesorder# 35678952
mat1 = 24
mat2 = 12
mat3 = 17
Below is my Sample Codes:
DATA : it_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
ls_vbrp_details TYPE wa_vbrp_details,
ls_vbrp_details1 TYPE wa_vbrp_details,
lsfinal_vbrp_details TYPE wa_vbrp_details,
it2_vbrp_details TYPE STANDARD TABLE OF wa2_vbrp_details,
ls2_vbrp_details TYPE wa2_vbrp_details,
it3_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
itfinal1_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
itfinal2_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
itfinal3_vbrp_details TYPE STANDARD TABLE OF wa_vbrp_details,
ls3_vbrp_details TYPE wa_vbrp_details,
rtime1 TYPE i,
rtime2 TYPE i,
rtime3 TYPE i,
s_erdate type d,
scr_erdat type d,
s_erdate = scr_erdat.
CALL FUNCTION 'MONTH_PLUS_DETERMINE'
EXPORTING
months = 1 " Negative to subtract from old date, positive to add
olddate = s_erdate
IMPORTING
newdate = new_date.
""" This is another way manual adding by days
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
days = +30
start_date = s_erdate
IMPORTING
result_date = new_date.
result_date = ddate.
REFRESH: it_vbrp_details.
SELECT
vbrp~matnr
vbrp~aubel
vbrp~aupos
vbrp~vbeln
vbrp~kzwi1
vbrp~kzwi2
vbrp~kzwi3
vbrp~kzwi4
vbrp~kzwi5
vbrp~kzwi6
vbrp~mvgr1
vbrp~mvgr2
vbrp~mvgr3
vbrp~mvgr4
vbrp~mvgr5
vbrp~knuma_pi
vbrp~knuma_ag
vbrp~mwsbp
vbrp~vkaus
vbrp~fkimg
vbrk~vbeln
vbrk~fkart
vbrk~belnr
vbrk~xblnr
vbrk~vbtyp
vbrk~kunag
vbrk~fksto
vbap~posnr
INTO TABLE it_vbrp_details
FROM vbrp INNER JOIN vbrk ON vbrkvbeln EQ vbrpvbeln
where vbeln eq gt_data-vbeln
where vbrpaubel eq vbapvbeln
WHERE vbrp~posnr GE ''
AND vbrk~vbtyp EQ 'M'
AND vbrk~fksto NE 'X'
AND ( vbrperdat GE s_erdate OR vbrperdat LE new_date OR vbrp~erdat IN s_erdat ) " + JP 09 19 2011 Additional Optimization
ORDER BY aubel aupos .
ORDER BY aubel aupos matnr.
"""" This where i need your help Sir\Mam\Gurus
it3_vbrp_details = it_vbrp_details.
SORT it3_vbrp_details BY aubel matnr fkimg kzwi1 kzwi2 kzwi3 kzwi4 kzwi5 kzwi6 aupos vbeln
mvgr1 mvgr2 mvgr3 mvgr4 mvgr5 knuma_pi knuma_ag mwsbp vkaus fkart belnr vbtyp kunag fksto.
LOOP AT it3_vbrp_details INTO ls_vbrp_details.
COLLECT ls_vbrp_details INTO itfinal1_vbrp_details.
APPEND ls_vbrp_details TO it_vbrp_details.
ENDLOOP.
kzwi1,kzwi2,kzwi3 is also been sum up
Sir the output is something like this
Sales Ord# Material Qty KWIZ1 KWIZ2 KWIZ3 MGVR1 VBELN
1234 Mat1 24 23.2 22 12 LastInvoice#
1234 Mat2 12 20.0 21 15 LastInvoice#
1234 Mat3 37 22.0 22 16 LastInvoice#
5432 Mat1 30 25.0 23 15 LastInvoice#
5432 Mat2 24 22.0 24 23 LastInvoice#
5432 Mat3 20 18.0 20 12 LastInvoice#
Hope you can help me as i cant hardy sleep thinking of this ...
I will really appreciate your great help..
Thanks !
I will really appreciate your great help..
Thanks !
Moderator message: duplicate post locked.
Edited by: Thomas Zloch on Sep 20, 2011 3:05 PMHi,
How you want to display the output?..
If you want to display the output as mentioned below, then you have to use nested loop & dynamic field assignments to get result.
Output column
sales order Mat1 Mat2 Mat3 ......
1234 24 12 37
Kindly let me know, if you have any questions
Regards,
S.Senthilkumar -
hi folks
whatt's the link between vbap and vbrk table.
gauravHi Gaurav
VBAP is Sales document item detail table and VBRK is Billing header data table.
VBRK is linked to VBRP by VBELN (i.e. VBAP-VBELN = VBRK-VBELN).
VBRP is linked to LIPS(SD document: Delivery: Item data)by
VBRP-VGBEL = LIPS-VBELN.
VBRP-VGPOS = LIPS-POSNR.
And LIPS is linked to VBAP by
LIPS-VGBEL = VBAP-VBELN.
LIPS-VGPOS =VBAP-POSNR.
the flow of the SD tables is like after creation of the sales document the header details of the document is filled in VBAK.THe item details of the sales document is stored in VBAP.After creation of the delivery the delivery documnet number is updated in the LIPS table and than if the INVOICE for the particular delivery is done than the BILLING document is generated the details of which can be looked in VBRK. -
All,
When does the table VBAK gets updated. I have a several billing documents with no material group 4 assignment in VBAK. This is all part of researching about COPA repot
1) When I looked at one billing document in VBRP and VBRK tables, there is material group assignment group4/A30
2) In VBAP table, for the same billing document, the material group4 field has no value in it. It's causing the values not picking up in COPA
3) When I looked at the COPA value field and characteristic config, the characteristic material group4 is pointing out from VBAP table.
What is causing this table not getting updated? how can we point out the material to VBAP table.
4) I also have to exclude the material gr from a COPA report. How can I do this?Thank you so much for your response. I have assigned full points for you.
--Yes there is no material group4 assignment in sales document. When I hit FI on material group4 field in sales document and view the technical data, the field data tab has MVKE,/MVGR4 and field description has MVKE-MVGR4. Does it mean, even if it has the value in the field, it pass the values to those tables showing in the technical information tabs? Why it's not VBAP table?
--How come the billing document has the material group 4 assignment when the sales document doesn't have.
--When I looked at the material data in MM03, that doesn't have material group4 assignment either.
-- I thought material that they are using on sales document triggers to sales and billing documents.
Could you please explain this to me. I appreciate your time.
Thanks,
Sri -
How to update the VBFA table without entries in VBRK and VBRP tables
Hello,
I have a requirement , where the sales order , delivery happens in one SAP system say X system and billing document wil happens in other sap system say Y.
Now in this particular case , if the user want to know the billing document number in X system. what would be the solution.
Is there any possibility to update the VBFA table with invoice number of Y system (without updating the VBRK and VBRP tables).
User want to see the billing doc number from sales order in the form of document flow in X system
Thanks in advance
PradeepHii
Without updating VBRK/VBRP table and updating VBFA is not possible, So you have to play with work arround to create one Z TABLE, so whenever system Y will create billing document with the reference of System X data you have to update Ztable with Invoice number created in System Y, The primary key will be in Z TABLE is Delivery document number to track one to one with billing doc.
Thanks and Regards
Shambhu Sarkar -
VBRK and KONA tables data (Agreements)
hi experts,
i have created view based on VBRK and KONA tables, but why some of the agreements are missing in VBRK??
i not able to find the solutions, as i am ABAP developer.
please tell me the reason why some of the agreements missed in VBRK?
regards
venuscmHi
Normally the rebate agreement is updated in KONA table. The rebate is created for a specific combination of customer and material or customer and rebate group etc. The rebate agreement appears in VBRK only if the combination in the invoice is same as that maintained in the rebate. This means that for the invoice the rebate is accrued or provision is kept aside if the conditions of the invoice are similar to that of the rebate. To describe it through an example. Lets say customer has a rebate agreement for material Cadbury Dairy Milk and the rebate agreement is based on that. So if customer buys Cadbury 5-star and the rebate is not on that the acrrual would not be possible and hence VBRK would have no entry as it did not satisfy the condition of the rebate. If VBRK had customer and the material as Cadbury Dairy milk.
Hope this explains.
Thanks
Indranil Ain -
Vbrk and Vbrp tables performance problem
Hi all,
The below query is taking lot of time in QAS i need to decrease the time without affecting the logic.....
SELECT vbrk~kunag
vbkd~bstkd
vbkd~bstdk
INTO TABLE c_tab_po FROM vbrp
INNER JOIN vbrk ON vbrkmandt = vbrpmandt AND vbrk~vbeln =
vbrp~vbeln
INNER JOIN vbkd ON vbkdmandt = vbrpmandt AND vbkd~vbeln =
vbrp~aubel
AND vbkd~posnr = con_zposnr
WHERE vbrp~vbeln EQ nast-objky.
DELETE ADJACENT DUPLICATES FROM c_tab_po COMPARING ALL FIELDS.
*Getting the other Invoices based on the customer PO number
IF c_tab_po[] IS NOT INITIAL.
SELECT
vbrk~kunag
vbkd~bstkd
vbkd~bstdk
vbkdposex_e vbrkvkorg
vbrpvbeln vbrpposnr vbrp~erdat
vbpakunnr vbrpaubel vbrpaupos vbakerdat
vbrpmatnr vbrkmwsbk vbrp~netwr
vbrkvaldt vbrkzterm vbrk~vbtyp
INTO TABLE g_tab_invoice FROM vbrp
INNER JOIN vbrk ON vbrkmandt = vbrpmandt AND vbrk~vbeln =
vbrp~vbeln
INNER JOIN vbkd ON vbkdmandt = vbrpmandt AND vbkd~vbeln =
vbrp~aubel
AND vbkd~posnr = con_zposnr
INNER JOIN vbpa ON vbpamandt = vbrpmandt AND vbpa~vbeln =
vbrp~aubel
AND vbpaposnr = con_zposnr AND vbpaparvw =
con_parvw
INNER JOIN vbak ON vbakmandt = vbakmandt AND vbak~vbeln =
vbrp~aubel
FOR ALL entries IN c_tab_po
WHERE vbrk~kunag EQ c_tab_po-kunag AND
vbkd~bstkd EQ c_tab_po-bstkd AND
vbkd~bstdk EQ c_tab_po-bstdk.
ENDIF.Hi Younus,
First join seems to be oku2026
But you are querying Db tables multiple times to avoid this.
Fetch the fields
vbkdposex_e vbrkvkorg
vbrpvbeln vbrpposnr vbrp~erdat
vbrpaubel vbrpaupos
vbrpmatnr vbrkmwsbk vbrp~netwr
vbrkvaldt vbrkzterm vbrk~vbtyp
in the first join itself.
SELECT vbrk~kunag
vbkd~bstkd
vbkd~bstdk
vbkd~posex_e vbrk~vkorg
vbrp~vbeln vbrp~posnr vbrp~erdat
vbrp~aubel vbrp~aupos
vbrp~matnr vbrk~mwsbk vbrp~netwr
vbrk~valdt vbrk~zterm vbrk~vbtyp
INTO TABLE c_tab_po FROM vbrp
INNER JOIN vbrk ON vbrk~mandt = vbrp~mandt AND vbrk~vbeln =
vbrp~vbeln
INNER JOIN vbkd ON vbkd~mandt = vbrp~mandt AND vbkd~vbeln =
vbrp~aubel
AND vbkd~posnr = con_zposnr
WHERE vbrp~vbeln EQ nast-objky.
then Just join VBPA & VBAK and get required data.
Thanks,
Sudha -
Reg:VBFA linking VBRK and VBAK
Hi All,
I am fetching vbrk, vbrp data. Now, i need to fetch data from vbak and vbap. i have passed the vbeln from vbrk to vbfa-vbeln and finally passed the vbelv value to vbak to get data from it. Is it the correct way?
Regards,
SwathiHi
U can find the link between VBRK and VBAK without to use VBFA table, this improves the performance of the program:
SELECT SINGLE * FROM VBRK WHERE VBELN = P_VBELN.
WRITE: 'Nr. bill:', VBRK-VBELN.
SELECT * FROM VBRP WHERE VBELN = VBRK-VBELN.
WRITE: / 'Nr. item:', VBRP-POSNR,
'Sales Order:', VBRP-AUBEL,
'Sales Order Item:', VBRP-AUPOS.
ENDSELECT.
So you can read the link in VBRP table.
If you want to read the VBFA
VBFA-VBELN = VBRK-VBELN.
VBFA-VBTYP_V = 'C'.
In this way you should select all records linked to the order, u find the number in VBFA-VBELV.
But you can also use fm RV_ORDER_FLOW_INFORMATION
Max -
Excise invoice table and billing table relation???
Can anyone please tell me how excise invoise and billing table are related??
Hi
check these table VBRP and VBRK
you wil get idea.
if its useful reward points
thanks
senthil -
I need a report that will join two tables BKPF and VBRK in QuickViewer. The only field with the right character length is XBLNR but when creating the join no records are dispalyed beacuse the values of this field in both tables are not the same.
There are also other fields available in BKPF but the char length is not the appropriate.
Does anyone have any idea how I can link these two tables?
Thank youNeither of these combinations is possible with QuickViewer because the fields need to have the same length of characters in order to create the join.
VBRK - VBLEN char(10) and BKPF - AWKEY char(20)
VBRK -ZUONR char(18) BKPF- BELNR char (10)
Any other idea?
Thank you, JP -
Question about tables LIKP and VBRK
I am looking for a join, view, etc... between the tables LIKP (Sales header data) and VBRK (delivery header data). What we want is information from LIKP and one piece of information from VBRK for the corresponding shipment. From what I can tell, the only way to join these two tables is by going through tables LIPS (Sales items) and VBRP (delivery items). Does anybody know of an easier and quicker way? We will only look at this once or twice a year so creating a program for it is the last resort.
Regards,
DavisHi
Please check the function 'RV_ORDER_FLOW_INFORMATION'
CLEAR : gt_vbco6, gt_vbfatab[], gt_vbfatab.
gt_vbco6-mandt = sy-mandt.
gt_vbco6-vbeln = p_vbeln.
CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
EXPORTING
comwa = gt_vbco6
n_stufen = '50'
v_stufen = '50'
TABLES
vbfa_tab = gt_vbfatab.
LOOP AT gt_vbfatab WHERE vbtyp_n EQ 'J'
AND vbtyp_v EQ 'M'.
ENDLOOP.
Hope this helps
Caglar -
Performance issue in BI due to direct query on BKPF and BSEG tables
Hi,
We had a requirement that FI document number fieldshould be extracted in BI.
Following code was written which has the correct logic but performance is bad.
It fetched just 100 records in more than 4-5 hrs.
The reason is there was a direct qury written on BSEG and BKPF tables(without WHERE clause).
Is there any way to improve this code like adding GJAHR field in where clause? I dont want to change the logic.
Following is the code:
WHEN '0CO_OM_CCA_9'." Data Source
TYPES:BEGIN OF ty_bkpf,
belnr TYPE bkpf-belnr,
xblnr TYPE bkpf-xblnr,
bktxt TYPE bkpf-bktxt,
awkey TYPE bkpf-awkey,
bukrs TYPE bkpf-bukrs,
gjahr TYPE bkpf-gjahr,
AWTYP TYPE bkpf-AWTYP,
END OF ty_bkpf.
TYPES : BEGIN OF ty_bseg1,
lifnr TYPE bseg-lifnr,
belnr TYPE bseg-belnr,
bukrs TYPE bseg-bukrs,
gjahr TYPE bseg-gjahr,
END OF ty_bseg1.
DATA: it_bkpf TYPE STANDARD TABLE OF ty_bkpf,
wa_bkpf TYPE ty_bkpf,
it_bseg1 TYPE STANDARD TABLE OF ty_bseg1,
wa_bseg1 TYPE ty_bseg1,
l_s_icctrcsta1 TYPE icctrcsta1.
"Extract structure for Datasoure 0co_om_cca_9.
DATA: l_awkey TYPE bkpf-awkey.
DATA: l_gjahr1 TYPE gjahr.
DATA: len TYPE i,
l_cnt TYPE i.
l_cnt = 10.
tables : covp.
data : ref_no(20).
SELECT lifnr
belnr
bukrs
gjahr
FROM bseg
INTO TABLE it_bseg1.
DELETE ADJACENT DUPLICATES FROM it_bseg1 COMPARING belnr gjahr .
SELECT belnr
xblnr
bktxt
awkey
bukrs
gjahr
AWTYP
FROM bkpf
INTO TABLE it_bkpf.
IF sy-subrc EQ 0.
CLEAR: l_s_icctrcsta1,
wa_bkpf,
l_awkey,
wa_bseg1.
LOOP AT c_t_data INTO l_s_icctrcsta1.
MOVE l_s_icctrcsta1-fiscper(4) TO l_gjahr1.
select single AWORG AWTYP INTO CORRESPONDING FIELDS OF COVP FROM COVP
WHERE belnr = l_s_icctrcsta1-belnr.
if sy-subrc = 0.
if COVP-AWORG is initial.
concatenate l_s_icctrcsta1-refbn '%' into ref_no.
READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(10) =
l_s_icctrcsta1-refbn
awtyp = COVP-AWTYP
gjahr = l_gjahr1.
IF sy-subrc EQ 0.
MOVE wa_bkpf-belnr TO l_s_icctrcsta1-zzbelnr.
MOVE wa_bkpf-xblnr TO l_s_icctrcsta1-zzxblnr.
MOVE wa_bkpf-bktxt TO l_s_icctrcsta1-zzbktxt.
MODIFY c_t_data FROM l_s_icctrcsta1.
READ TABLE it_bseg1 INTO wa_bseg1
WITH KEY
belnr = wa_bkpf-belnr
bukrs = wa_bkpf-bukrs
gjahr = wa_bkpf-gjahr.
IF sy-subrc EQ 0.
MOVE wa_bseg1-lifnr TO l_s_icctrcsta1-lifnr.
MODIFY c_t_data FROM l_s_icctrcsta1.
CLEAR: l_s_icctrcsta1,
wa_bseg1,
l_gjahr1.
ENDIF.
ENDIF.
ELSE. " IF AWORG IS NOT BLANK -
concatenate l_s_icctrcsta1-refbn COVP-AWORG into ref_no.
READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(20) =
ref_no
awtyp = COVP-AWTYP
gjahr = l_gjahr1.
IF sy-subrc EQ 0.
MOVE wa_bkpf-belnr TO l_s_icctrcsta1-zzbelnr.
MOVE wa_bkpf-xblnr TO l_s_icctrcsta1-zzxblnr.
MOVE wa_bkpf-bktxt TO l_s_icctrcsta1-zzbktxt.
MODIFY c_t_data FROM l_s_icctrcsta1.
READ TABLE it_bseg1 INTO wa_bseg1
WITH KEY
belnr = wa_bkpf-belnr
bukrs = wa_bkpf-bukrs
gjahr = wa_bkpf-gjahr.
IF sy-subrc EQ 0.
MOVE wa_bseg1-lifnr TO l_s_icctrcsta1-lifnr.
MODIFY c_t_data FROM l_s_icctrcsta1.
CLEAR: l_s_icctrcsta1,
wa_bseg1,
l_gjahr1.
ENDIF.
ENDIF.
endif.
endif.
CLEAR: l_s_icctrcsta1.
CLEAR: COVP, REF_NO.
ENDLOOP.
ENDIF.Hello Amruta,
I was just looking at your coding:
LOOP AT c_t_data INTO l_s_icctrcsta1.
MOVE l_s_icctrcsta1-fiscper(4) TO l_gjahr1.
select single AWORG AWTYP INTO CORRESPONDING FIELDS OF COVP FROM COVP
WHERE belnr = l_s_icctrcsta1-belnr.
if sy-subrc = 0.
if COVP-AWORG is initial.
concatenate l_s_icctrcsta1-refbn '%' into ref_no.
READ TABLE it_bkpf INTO wa_bkpf WITH KEY awkey(10) =
l_s_icctrcsta1-refbn
awtyp = COVP-AWTYP
gjahr = l_gjahr1.
Here you are interested in those BKPF records that are related to the contents of c_t_data internal table.
I guess that this table does not contain millions of entries. Am I right?
If yes, the the first step would be to pre-select COVP entries:
select BELNR AWORG AWTYP into lt_covp from COVP
for all entries in c_t_data
where belnr = c_t_data-belnr.
sort lt_covp by belnr.
Once having this data ready, you build an internal table for BKPF selection:
LOOP AT c_t_data INTO l_s_icctrcsta1.
clear ls_bkpf_sel.
ls_bkpf_sel-awkey(10) = l_s_icctrcsta1-refbn.
read table lt_covp with key belnr = l_s_icctrcsta1-belnr binary search.
if sy-subrc = 0.
ls_bkpf_sel-awtyp = lt_covp-awtyp.
endif.
ls_bkpf_sel-gjahr = l_s_icctrcsta1-fiscper(4).
insert ls_bkpf_sel into table lt_bkpf_sel.
ENDLOOP.
Now you have all necessary info to read BKPF:
SELECT
belnr
xblnr
bktxt
awkey
bukrs
gjahr
AWTYP
FROM bkpf
INTO TABLE it_bkpf
for all entries in lt_bkpf_sel
WHERE
awkey = lt_bkpf_sel-awkey and
awtyp = lt_bkpf_sel-awtype and
gjahr = lt_bkpf_sel-gjahr.
Then you can access BSEG with the bukrs, belnr and gjahr from the selected BKPF entries. This will be fast.
Moreover I would even try to make a join on DB level. But first try this solution.
Regards,
Yuri -
Issue with child and parnet table
how i can identified that which table is chiald and which one is parent table.
If you are keeping referential integrity in the database, not in the application, it is easy to find the child and parent tables. Here is a quick and dirty query. You can join this to dba_cons_columns to find out on which columns the referential constraints are defined. This lists all child-parent table including SYS and SYSTEM users. You can run this for specific users of course.
select cons1.owner child_owner,cons1.table_name child_table,
cons2.owner parent_owner,cons2.table_name parent_table
from dba_constraints cons1,dba_constraints cons2
where cons1.constraint_type='R'
and cons1.r_constraint_name=cons2.constraint_name; -
T-code for cancelled Invoice and cancelled Excise Invoice
Dear Guru,
kindly let me know the T-code for cancelled Invoice and cancelled Excise Invoice.
Wishes,
AbhishekHi Abhishek,
I am not aware of any T-code through which you can see the cancelled invoice. I think either you have to go for development (SQVI)
or
Extract the list of your all billing document like billing document created from 01.01.2010 to 22.04.2010
Now go to SE16 --> Table VBFA --> Give your billing document number in field "Preceding Doc." --> and in the field "Subs.doc.categ." --> choose entry "N Invoice cancellation" --> system will show you all the entries for which cancellation billing document has been created.
or
Go to SE16 --> Table VBRK --> enter your billing document list --> In the field "Posting status" --> Choose option "E Billing Document Canceled"
Hope it helps,
Regards,
MT
Maybe you are looking for
-
Dear Expert While doing F-48 Vendor Down Payment am getting below Error Customer 450822 is not defined in company code 1000 Message no. F5102 Diagnosis No master record was created in company code "1000" for customer number "450822". Syst
-
Purchase requisition header text in smart forms
Dear Experts, i want to pick the header text in smart form from purchase requisition ( Transaction code me52n).Can any one tell me from which table i can find out the header text of purchase requsition. please tell me table name objectid for incl
-
Object Part analysis in PMIS reports
Dear PM guys, Is there is any standard report for the object part which we are keying in notification.I hope reports are there for Damage and Causes of damage.Eg in object, Iam having Genset and under which cooling pump,engine,turbo charges etc are t
-
Datasets in Spry Tabbed Panels
Hey guys, I have a spry tabbed panel in which the contents are iframes that load a spry xml dataset. The problem I am encountering is that while the "default tab" spry loads...when toggling the other tab I get the errors Failed to retrieve data set (
-
Http Post(very urgent)
hi all, i have a problem with posting a http request.. the problem is i coudnt set the Content-length , and coulnt found a way to do it so here is the code sample, pls notify me... httpCon = (HttpConnection)Connector.open(url); httpCon.setRequestMeth