Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Open PO

Former Member
0 Kudos

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

10 REPLIES 10

raymond_giuseppi
Active Contributor
0 Kudos

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

0 Kudos

Dear Giuseppi,

Thanks for your valuable input!

Regards,

Antony Thomas

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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

0 Kudos

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