Urgent:  Problem in making Link b/w MKPF and BKPF

Hi,
I am making a report in which i have to make a relationship b/w BKPF and MKPF through AWKEY present in the BKPF with the MBLNR field in MKPF.
Plzzz help me how to do dis as i am having the select statement like dis: -
SELECT AMBLNR AXBLNR BBELNR BBUDAT BGJAHR BAWKEY FROM MKPF AS A  INNER JOIN BKPF AS B ON BXBLNR = AXBLNR INTO TABLE ITBSAK WHERE AXBLNR > 0 AND BBELNR IN P_BELNR.
plzz help me out how to reterive data as in dis statement i am not using the AWKEY concept .plzz help me how do i do this as help will be definately rewarded.

Hi check this sample code:
form get_data.
*************----------- VARIABLES ---------------**************
data: vl_addrnum type t499s-addrnum,
vl_city1 type adrc-city1.
*************----------- Constants ---------------------**************
constants:cl_ca01(4) value 'CA01'.
***********---------Field symbols ----------------------************
field-symbols: <fs_mseg> type t_mseg.
select a~mblnr a~mjahr a~zeile a~werks a~matnr a~bwart
a~lifnr a~menge a~meins a~lgort a~grund a~sakto
a~ps_psp_pnr a~ablad a~rsnum a~rspos a~kostl
a~umlgo a~wempf a~ebeln a~ebelp a~bukrs a~belnr
a~buzei a~sobkz
b~budat b~xblnr b~bktxt b~xabln b~frbnr b~cputm
c~matkl a~kzvbr a~shkzg
from mseg as a
join mkpf as b
on a~mblnr = b~mblnr and
a~mjahr = b~mjahr
join mara as c
on c~matnr = a~matnr
into table i_mseg
where a~werks in s_werks and
a~bwart in s_bwart and
a~lifnr in s_lifnr and
a~umwrk in s_umwrk and
a~wempf in s_scar and
a~ablad in s_ablad and
a~ebeln in s_ebeln and
a~sjahr in s_yyyy and
b~budat in s_date and
b~cputm in s_time and
b~mjahr in s_yyyy.
if not i_mseg[] is initial.
select pspnr fkokr fkstl posid stort
from prps
into table i_prps
for all entries in i_mseg
where pspnr eq i_mseg-ps_psp_pnr.
select bwart sobkz btext from t156t
into table i_text
for all entries in i_mseg
where bwart eq i_mseg-bwart
and spras eq v_lan
and sobkz eq i_mseg-sobkz
and kzvbr eq i_mseg-kzvbr.
select lifnr name1 from lfa1
into table i_lfa1
for all entries in i_mseg
where lifnr eq i_mseg-lifnr.
endif.
*Awkey is the combination of MBLNR and MJAHR
loop at i_mseg assigning <fs_mseg>.
concatenate <fs_mseg>-mblnr <fs_mseg>-mjahr into <fs_mseg>-awkey.
*To get the Vertex Catagory
move <fs_mseg>-matnr to w_ztfi_product-matnr.
move <fs_mseg>-matkl to w_ztfi_product-matkl.
select single prdtc
from ztfi_product
into w_ztfi_product-prdtc
where matkl eq w_ztfi_product-matkl.
append w_ztfi_product to i_ztfi_product.
endloop.
if not i_mseg[] is initial.
select bukrs belnr gjahr awkey waers
from bkpf
into table i_bkpf
for all entries in i_mseg
where gjahr = i_mseg-mjahr
and bukrs = i_mseg-bukrs
and budat = i_mseg-budat
and awkey = i_mseg-awkey.
select matnr maktx from makt
into table i_makt
for all entries in i_mseg
where matnr = i_mseg-matnr
and spras = v_lan.
endif.
if not i_bkpf[] is initial.
select bukrs " Company Code
belnr " Document Number
gjahr " Fiscal Year
buzei " Line Item
shkzg " Debit / Credit indicator
wrbtr " Amount
sgtxt " Line Item Text
vbund " Trading Partner
kostl " Cost Center
hkont " Account
matnr " Material Number
werks " Plants
txjcd " Tax Jurisdiction
projk " WBS Element
into table i_bseg
from bseg
for all entries in i_bkpf
where bukrs eq i_bkpf-bukrs and
belnr eq i_bkpf-belnr and
gjahr eq i_bkpf-gjahr.
endif.
sort: i_prps by pspnr,
i_bkpf by bukrs awkey gjahr,
i_makt by matnr,
i_bseg by bukrs belnr gjahr,
i_text by bwart sobkz.
*Move to output table
loop at i_mseg into w_mseg.
move-corresponding w_mseg to w_output.
if not w_mseg-lifnr is initial.
select single name1 from lfa1
into w_output-name1
where lifnr = w_mseg-lifnr.
endif.
read table i_prps into w_prps with key pspnr = w_mseg-ps_psp_pnr
binary search.
if sy-subrc eq 0.
move-corresponding w_prps to w_output.
if not w_prps-fkstl is initial and not w_prps-fkokr is initial.
select single ktext from cskt
into w_output-ktext
where spras = sy-langu
and kokrs = w_prps-fkokr
and kostl = w_prps-fkstl
and datbi ge sy-datum.
endif.
select single addrnum from t499s into vl_addrnum
where stand = w_prps-stort.
select single city1 from adrc into vl_city1
where addrnumber = vl_addrnum
and addr_group = cl_ca01.
w_output-city1 = vl_city1.
endif.
read table i_text into w_text with key bwart = w_mseg-bwart
sobkz = w_mseg-sobkz
binary search.
if sy-subrc eq 0.
w_output-btext = w_text-btext.
endif.
read table i_makt into w_makt with key matnr = w_mseg-matnr
binary search.
if sy-subrc eq 0.
w_output-maktx = w_makt-maktx.
endif.
read table i_bkpf into w_bkpf with key bukrs = w_mseg-bukrs
awkey = w_mseg-awkey
gjahr = w_mseg-mjahr
binary search.
if sy-subrc eq 0.
move-corresponding w_bkpf to w_output.
read table i_bseg into w_bseg with key bukrs = w_bkpf-bukrs
belnr = w_bkpf-belnr
gjahr = w_bkpf-gjahr
binary search.
if sy-subrc eq 0.
move-corresponding w_bseg to w_output.
w_output-matnr = w_mseg-matnr.
w_output-werks = w_mseg-werks.
if w_mseg-shkzg = 'H'. " checking the mseg value.
w_output-wrbtr = - w_bseg-wrbtr.
w_output-menge = - w_output-menge.
endif.
perform cal_vertex_tax using w_bseg changing w_output-wmwst.
endif.
endif.
perform format_output using w_output-matnr
w_output-wrbtr w_output-budat
w_output-rsnum w_output-rspos.
append w_output to i_output.
clear: w_output, vl_city1, w_prps,vl_addrnum, w_text, w_makt,
w_bkpf, w_bseg.
endloop.
endform. " get_data

Similar Messages

  • Link B/w MKPF and BKPF

    is there any link B/W  tables MKPF and BKPF

    hii
    refer link
    Link between Accounting Header (BKPF) amd Goods Reciepts Header (MKPF)
    you can do following way too
    select MJAHR & MBLNR fields from MKPF table
    CONCATENATE these fields into one variable like wa_val.
    now use
    SELECT * from BKPF where BKPF-AWKEY = wa_val
    regards
    twinkal

  • Really Urgent: Problem in making link b/w sales order and production order

    Hi,
    I am trying to make link b/w the sales order delivery(VL03) by taking its Batch Number(LIPS- Delivery table) and linking with AFPO(Production order Table) field (batch no) so that i can see the fruther operations done o dat production order made against sales order,but it is not coming .
    I want to have help which allows me to make link b/w delivery (vf03) and the productiona order.
    plzz help me out it is really urgent.
    Edited by: ric .s on Apr 11, 2008 7:43 AM
    Edited by: ric .s on Apr 11, 2008 7:59 AM
    Edited by: ric .s on Apr 11, 2008 9:23 AM

    You have delivery no(VBELN) & itam no (Posnr)from lips table.
    Now
    1. go to VBFA table end get the corresponding sales oredr no and order item no.
    In VBFA table pass the delivery no in VBELN and delivery item in POSNN and 'J' in VBTYP_N and 'C' in VBTYP_V.
    Now VBELV & POSNV will return the sales order no and sales order item.
    2. Got to VBAP table and get the corresponding AUFNR to the order no and item no.
    3. Now with that AUFNR you will get a connection with AFPO(Production order Table.

  • Urgent : Link b/w MKPF and BKPF and BSIS

    Hi,
    I am making a report in which i have to display the vendor payment status.
    In table BKPF there is a field called AWKEY and AWTYP and i want to reterive data form it and after that in BSIS table there is a field called XREF3 which is similar to the AWKEY in the BKPF table.
    plzz tel me how to make the realtion b/w these tables as help will be deifnately rewarded.

    hi,
    i am able to reterive data from now but i want to have this method also which u had told.
    i am doing inner join concept but accorind to tyou :-
    pass the first 10 characters of AWKEY to MBLNR of MKPF.
    how should i use this concept?
    Edited by: abaper2008 on May 24, 2008 8:48 AM

  • Urgent problem : array of linked list

    In order to save memory I am trying to build an array of linkedlist with the following program. It compiles well but when I execute it, error occurs as follows,
    Exception in thread "main" java.lang.NullPointerException
    at testLL2.main(testLL2.java:10)
    My program:
    import java.net.*;
    import java.io.*;
    import java.util.LinkedList;
    public class testLL2 {
    public static void main(String[] args) throws IOException {
    int myLLLength;
    LinkedList myLL2 [] = new LinkedList[10];
    for (int i = 0; i < 10; i++) {
    for (int j=0; j < 5; j++) {
    myLL2.add(" "+j);
    for (int i = 0; i < 10; i++) {
    myLLLength = myLL2[i].size();
    for (int j=0; j<myLLLength; j++) {
    System.out.println(myLL2[i].get(j));
    Since I tried many alternatives to solve it but one of them succeed. Please kindly help me! Thanks in advance!

    [snip]
    2. Where you have 'myLL2.add(" "+j);' it should read
    myLL2. The is probably a typo. If not, make sure
    you understand why you need to change your code.
    The forum posting code will muck up your code if you don't surround it in [ code] [code ] (no spaces) tags.  Even if you do use the code tags, it preprocesses [ i] into <i> to avoid turning your code into italics.

  • Problems with the link between PXI chassis and PC via MXI-4

    MAX display the chassis with a yellow exclamation point, and the MXI-4 conection monitor indicates taht the connection to the chassis has timed out.
    Under the windows device manager appears PCI std PCI-to-PCI bridge and MXI-4 connection monitor working properly.
    The system has bben working properly for one year and suddenly start to fail.
    I've tried to uninstall fromn device manager and reinstall again, and teh problem continues. When the PC starts detect new hardware and reinstall from CD with MXI-4 software for windows v 1.0
    Only the led PWR lights. The link indicator remains always off, from power up continuously. The cable connection has benn checked ok.
    The chassis is powered up in the proper sequence, first the PXI chassis, and the the PC.
    Operating system windows XP service pack 2; latest update KB835732 30/12/2004 (V 6.2)
    labwindows/cvi (fds) 7.0
    ivi compliance oackage 2.1.2
    max 3.1
    ni-daq 7.3
    visa 3.1
    chassis pxi-1000b with PXI-8331.

    Hello,
    it could it be an incompatibility with the desktop PC (maybe?). I know of cases in which the PCI board can be incompatible with a certain PC for various reasons (PCI bus not 100% compliant to PCI standards, PCI power rails, PCI bus-master capabilities, motherboard/chipset issues, etc..).
    I mean, has the PC been changed?
    Wich PC model/brand is it?
    Have you tested it on another of PC (another model)?
    In case you have already tested your mxi-4 in other PCs and the behavior is the same, I suggest you to contact your local NI office for assistance.
    Regards,
    Jorge M.

  • Urgent : Problem with Editable  ALV Grid  for Quantity and Currency Fields

    Hi All,
    I am using Editable ALV Grid display and have quantity and value as editable fields in the display.
    When user changes these values these values are not changing properly .
    For the quantity field the domain is MENG13 with 3 deciamal places and here  if we enter 500 it takes it as 0.500   .
    The same problem is for the currency field. Here the Domain is WERT7 with 3 decimal places.
    Here also it takes last 2 digits after decimal places by default.
    Please advice how to get proper values in this case from ALV editable fields.
    Thanks and Regards
    Harshad
    Edited by: Harshad Rahirkar on Dec 25, 2007 7:39 AM

    for all the currency field , it will display like that only.
    u have to manipulate uin program before displaying.
    if they are giving 500, in program multiply with 100 and move it to table.
    when u are getting from table, divinde and display.
    this is what I am doing.
    Reward if helpfull.

  • To link MKPF and BKPF Tables.

    Hi Experts,
    I basically need to retieve all the accounting documents posted for a particular material document. How is this possible ?
    Regards,
    Sunitha

    Step 1
    GET KEY FIELDS FROM MKPF namely
    MKPF-MBLNR
    MKPF-MJAHR
    Now CONCATENATE these fields into say STR1
    SELECT all records from BKPF where
    BKPF-AWKEY = STR1
    You get the corresponding FI record

  • (URGENT) problem with JTable: can't catch ENTER and control focus in JTable

    I hava a JTable and a AbstractTableModel.
    Here is what i want to DO.
    When I press the ENTER or TAB I want to set focus to cell wich is 2 position away from the the sell I am editing
    on the same row in the JTable. How can I do this.
    in fact, that is my real question HOW to ?
    When I press the ENTER or TAB in JTABLE I want to tell to JTable which cell to grab the focus

    In the UI is defined the InputMap/ActionMap pair to respond to keys. There is defined an action for ENTER. I have had the same problem, and the only thing that worked for me was to clear the actionMap, and reassign some keys to their original action, and some (e.g. ENTER, TAB) to my actions. This worked. With TAB is harder beacuse i guess it's deeper in the JVM implemented, but after a while i've managed to overwrite that too.

  • Urgent: problem with sharing HttpSession  object between Jsp and servlets.

    Hi,
              We are using weblogic 6.0 sp2.
              I m setting a particular object in session in a servlet using
              session.setAttribute() but when i try to retrieve that object using
              session.getAttribute() in a jsp page the value of that object is null. Is
              there any way to configure HttpSession in weblogic so that jsps and servlet
              can share the same session? Or any workaround for this problem.
              Any help in this regard is appreciated.
              Thanks
              -Shree
              

    Just a guess, but it sounds like you have cookies turned off and are not
              using encodeURL. Try enabling cookies and see if that solves the problem.
              Also, it is generally good practice to use encodeURL to protect yourself
              from users who disable session cookies.
              Here's how we use encodeURL in our Servlets:
              gotoPage("/jsp/someJSP.jsp");
              private void gotoPage( String address,
              HttpServletRequest request,
              HttpServletResponse response )
              throws ServletException, IOException
              RequestDispatcher dispatcher =
              etServletContext().getRequestDispatcher( response.encodeURL( address ));
              dispatcher.forward( request, response );
              "Shree Unde" <[email protected]> wrote in message
              news:[email protected]..
              > Hi,
              > We are using weblogic 6.0 sp2.
              > I m setting a particular object in session in a servlet using
              > session.setAttribute() but when i try to retrieve that object using
              > session.getAttribute() in a jsp page the value of that object is null. Is
              > there any way to configure HttpSession in weblogic so that jsps and
              servlet
              > can share the same session? Or any workaround for this problem.
              > Any help in this regard is appreciated.
              > Thanks
              > -Shree
              >
              >
              

  • Problems with Dinamic Link between Premiere pro CC and After Effects CC

    I'm having serious problems with dinamic link between premiere pro and after effects, really serious problems that have 2 big projects in trouble (a documentary and a video clip) and I had to redo all the work pipeline to the consumer.
    The documentary for a spanish TV was made on CC 2014 and a video clip was made on CC. Both of them with a lot of after effects composition in the premiere pro timeline. Render freeze, a lot of playback issues, and many more problems... Until I decided to remove these links between premiere and after effects and render out all the after effects compositions one by one and insert as clips in premiere pro. 1 week working away with back and fourth.
    I've got a huge workstation:
    i7 4990
    32Gb ram
    GTX780 3gb
    256 gb system ssd
    2 Tb project storage
    *All my hardware and software are update.
    I know that a lot of folks are on the same huge problem and I want to ask everyone:
    How do you save this?
    What is your pipeline?
    Are there any solution?
    Best practice to use dinamic link in a huge project?
    Thanks,
    Ruben Gimenez.
    R&D iceblink.es
    www.rambot.es

    Thank You, Jim -
    Unfortunately that specifically did not work.
    Based on another comment sent to me, here is what did.
    In PProCC
    File > Adobe Dynamic Link > New After Effects Composition
    In AECC
    From that composition created from PPro, I imported the project (aep) initially created in AECC from another team member. Saved the file.
    Back in PProCC
    File > Adobe Dynamic Link > Import After Effects Composition
    Magic.

  • Problem with making a database link.

    Hello All
    I got a problem with making a database link.
    When I execute this query
    CREATE PUBLIC DATABASE LINK DBNAME
    CONNECT TO database IDENTIFIED BY name
    USING 'DBNAME.europe.company.com';
    I am using other names because its private information
    But when I look at the table dba_db_links I see this
    OWNER | DB_LINK | USERNAME |HOST
    PUBLIC| DBNAME.europe.company.com| name| DBNAME.europe.company.com
    So the DB_Link name is changed. And this causes a problem with my asp website. I get the fault message
    ORA-02085: database link DBNAME.europe.company.com connects to DBNAME
    Cause: a database link connected to a database with a different name. The connection is rejected.
    The global_names = true and I prefer to keep it that way.
    So does anyone knows what is wrong about my Query or how I can change the DB_Link name.
    Thanks for the support,
    Remco

    Thanks for the help Mohit
    But thats whats I was doing.
    The query in the first post is the same as what you are posting.
    But by an (for me) unknown reason the database converts DBNAME to DBNAME.europe.company.com

  • Problem In creating link between info source to DSO(Urgent)

    Dear Experts,
    I am facing an problem in creating an link between info source and DSO.My problem is: I am actually loading data from R/3 into two data sources 2lis_01_s951 and 2lis_01_s952 there is a need for me to calcualte revenue % i.e diving revenue by qty from different data sources so i created one Info Source for 2 data sources,So i am facing a problem in creating an link from Info Source to DSO.Is there any other way to solve this problem.
    Points will be awarded.
    Regards,
    Shivu.

    Shivu,
    I’m suggesting either of the following 2 solutions.  Both of them require some abap programming.
    A. Permanently store calculation result in DSO :
    A1) You’ll need to decide which of the 2 DSOs you want to store the result of the % calculation, then add a new infoobject for that purpose;
    A2) Load ALL the data into the DSO that will NOT store the result of the % calculation; let’s call this DSO “DSO1”.  The data records in this DSO will be retrieved later on when loading the other DSO;
    A3) For the DSO that will store the result of the % calculation (let’s call this DSO “DSO2”),  create a transformation rule (i.e. update rule) that will SELECT the related data record from DSO1 and carry out the calculation before storing the data record in DSO2 ( this can also be done in the Start Routine to loop through all the data records of a packet.)
    B. Carry out the calculation at query time :
    B1) Create a multiprovider (i.e. multicube or infoset) to combine your infocubes or DSOs together.  Keep in mind that a multicube works as a union of the infoproviders, while an Infoset works as a join of the infoproviders.
    B2) Create a formula in your query to calculate the %.
    Hope this helps.

  • Urgent problem: customizing collaboration room annoucement page

    Hi all,
    I am creating a project room template by modifying the Standard Project Room template delivered by SAP.
    Here is what I want to do:
    For the Announcement page that contains the Date Announcements (roomNews) iView and the Milestones iView, I want to make it such that only someone in the projectLead room role can edit them.  Regular project members can only view the Date Annoucements and the Milestones but cannot create new news or milestones.
    1) I guess the best way is to create copies of the iViews and remove the 'new' link from them.  Any hints about how to go about doing this?  I realize that the layout sets of the two iViews (called AppMilestoneExplorer and AppAnnouncementExplorer respectively) do not have any command groups in their Resource Renderers.  The 'edit' link from the option tray of these iViews will open up to a new page containing either the AppAnnouncementExplorerEdit or the AppMilestoneExplorerEdit iViews (this is by default, from SAP).  How can I see the connection between these two sets of iViews (the ones appended with 'Edit' and the ones without)?  The Annoucement page only contains the iViews with the AppMilestoneExplorer and AppAnnouncementExplorer layout sets...
    2) In order to remove the 'new' link, do I just go into the Link Command Group and remove the command from the command list itself?  What are the difference between Resource, Folder, and Link Command groups?
    3) I am to create two iViews (one with the corresponding command in the layout intact and one modified), assign each of them to different pages and then furthermore assign the projectLead role to one page and the regular member role to the other.  However, how is it possible to make the two pages in 'sync' to one and other.  For instance, if the projectLead creates a new annoucement in his own annoucement page, then the regular members should be able to see this annoucement updated on theirs.  Does this has something to do with setting up an extension in the template, relating to the two iViews together (ie. by having the two iViews pointing to the same extension)?  Anyone can elaborate on this? (I am just making an eduated guess)
    Thanks, urgent problems, points will be awarded generously
    Charles

    Hi sweta,
    It is known issue and recently I have the same problem ;). You must add suitable permission for end user to the iView: portal_content/com.sap.pct/Collaboration/iViews/com.sap.netweaver.coll.CMSearch. It is placed here: Portal Content->Content Provided by SAP->Collaboration->iViews->CM Search. For me it seems to be a bug, because template worksets which you are using for your room doesn't contain this iView. I've opened OSS request and they suggested changing permissions. I've also asked for some explanation why wrong search iView is used inside room worksets but I am still waiting for replay.
    Best Regards,
    Michal M.

  • Really urgent: help in making report for status of vendor payement

    Hi,
    I am making a report in which i have to display the status of vendor whether it is paid or not?
    Till now i am able to have knowledge that when we do MIGO there are the Financial Documents form there i get the account no.. whichit is stored in the BKPF table. From there we have the account no... and after that there are 4 tables into which i have to look after the tables i.e. BSAS,BSIK,BSIS, n BSAK.
    Plzz tell me how should i make a report as the Acount no.. have to move among these tables to get the status of it pament.
    plzz provide me some guidelines for making a report for it as help will be deifnately rewarded.
    Edited by: abaper2008 on May 21, 2008 6:52 AM

    Hi,
    Hi,
    I making a report in which i have to display the vendor payment is done or not?
    Curently i am using the 4 tables of Financial :-
    BSAK,BSIS,BSIK AND BSAS which gives the status of vendor whether it is paid or not . 1 thing i observed that data compared wit htew MKPF table among these tables(BSAS,BSIK N BSAK) is not coming right as i am taking common field XBLNR among them all .
    One more thing i observed that BLART is getting changed in each table.
    for instance,
    if the BLART is WE for material document and i am taking XBLNR filed from this table MKPF and den looking XBLNR in BKPF where the entry consist of BLART - RE n WE and finally when i look up in the BSAK table the field consist of RE .
    How can i see that it is being paid or not the BLART is keep on changing.
    Plzz proivde me guidelines as how to rectify the problem?
    Edited by: abaper2008 on May 21, 2008 9:03 AM

Maybe you are looking for