04-09-2007 10:37 AM
Hi all,
I need to fetch all the open purchase orders. My selection conditions include cost center , cost center gorup, order, order group.Advise me how to proceed. At least I need the link between a purchase order, order and order group. I mean table relations. Urgent please!
Regards
Anto
04-09-2007 10:44 AM
Purchase order
EKKN <b>Account assignment</b> in purchasing document
EKPO Purchasing document item
EKKO Purchasing document header
To link order or cost-center to group, the key functions modules are
G_SET_LIST_SELECT,
G_SET_LIST_SELECT_RANGES
G_SET_GET_INFO.
to identify a set from type, controlling area and name via FM
G_SET_ENCRYPT_SETID or G_SET_GET_ID_FROM_NAME
<i>Cost center group 'MYGROUP' from controlling area '0001', is identified internally via the set ID '01010001MYGROUP', for example, (the set class for cost center groups is '0101').</i>
The modules G_SET_SELECT, G_RW_SET_SELECT and K_GROUP_SELECT can be used for the value help for sets or groups as before. These modules now also return the set ID of the selected set.
Regards
04-10-2007 8:54 AM
Dear Giuseppi,
Thanks for your valuable input!
Regards,
Antony Thomas
04-10-2007 9:51 AM
Just an info :
Table SETCLS give the list of Set Classes
You are interested in
CLASS NAMLENG NAMTAB NAMFLD OBART DESCRIPT
0101 15 RKSB1 KSGRU HI Cost center group
0103 15 RKSB1 AUFGR Order group
Regards
04-12-2007 6:00 AM
Dear Raymond,
Thanks for your concern.I need some more info regarding LDB.
My Selection screen contain LDB parameters (MEPOLDB) + cost center , cost center group, order, order group.
By using setclass related function modules I can fetch all the cost centers or orders. Now I have to fetch data for these cost centers/orders. Can I use LDB statements for fetch the data.If possible how? I cant call the same LDB again using function module ldb_process coz it will give an exception that LDB already used. Please advice me!
Regards
Antony Thomas
04-09-2007 10:54 AM
Hi,
Use the fun module G_SET_TREE_IMPORT to get all the Cost centers for a cost center group.Or you can use SETNODE,SETLEAF tables to get them.
From EKKN table take all the PO's related to that Cost centers/group and also ORDER AUFNR.
If Pur OrderNo/Pur order group is entered take them staright away.
Use the Tables EKKO, EKPO for the above EBELN,EBELP fetched from EKKN table and fecth the data. Also fetch the data from MSEG,EKBE using the EBELN, EBELP fields.
To prepare the Open PO report:
Take all the purchase order details from EKKO and EKPO tables by writing a JOIN based on the selection screen paramters:(into ITAB)
Then fetch the related GR and GI data from the table MSEG for each PO Item (using for all entries of ITAB passing EBELn and EBELP to MSEG).
Here based on the movement type you have to consider the GR or GI.
generally for 101 movement types it is fresh GR(goods receipt).
so in this table MSEG you have many entries with different movement types for each PO items, so summing up the correct quanitities(ERFMG) for GR and other s is importants.So from ITAB you know the PO qty for a particular PO and from MSEG you know the qty received(GR QTY), if the both qty's are equal then that order is closed, if bothe qty's are not equal then that order is OPEN.
Fetch the invoice related data from EKBE or RSEG tablse passing EBELN and EBELP fields for them.
GR dat is in MSEG
and Invoice data is in EKBE or RSEG.
reward if useful
regards,
ANJI
Message was edited by:
Anji Reddy Vangala
04-09-2007 12:12 PM
Hi Anji,
Please be specific in how to use FM, G_SET_TREE_IMPORT or how can I fetch data from tables SETNODE,SETLEAF. The other part means fetching open POs from EKPO etc... I know. But <b>I need to find out all the orders/cost centers coresponding to an Order group/ cost center group.</b>
Regards,
Antony Thomas
04-09-2007 11:07 AM
Hi Thomas ,
in normal PO process , cost will not HIT any Cost Centre , but it will directly hit G/L Codes , but in case of Service PO it will hit CC this will ref of Internal Orders.
first u have to know what is Open PO -->
based on ur definations , u can link EKKO + EKPO itself to get complet data of Open PO, for Accouting ass.ment data use EKKN.
or check BAPIPOget.
no need to link MSEG or any other table.
Hi Thomas,
<b>first see the transaction level entry by pressing F1 on the fields which u want to link , then only u will come to know how to link.
first u have to get the Internal Order number out of PO then u can get Order Group or Type , same in case of Cost Centre Group.
</b>
Regards
Prabhu
04-09-2007 12:02 PM
Hi Prabu,
Customer need cost center , cost center gorup, order , order gorup in adition to selection parameters of LDB MEPOLDB.So any way i need to link thease parameters with a purchase order.
Regards
Antony Thomas
04-09-2007 1:26 PM
These fields, cost-center and order, are in <b>EKKN</b>.
If user select group of these, you have to convert group to ranges/select-options of cost-centers or orders using the FM i mentioned above.
Regards
04-09-2007 1:48 PM
Prabhu,
If I have order group/ or cost center group with me( as input) I need to know what are the corresponding Orders/ cost centers? what is the procedure for that? Leave the case PO s.That I can do.
Regards,
Antony Thomas