cancel
Showing results for 
Search instead for 
Did you mean: 

Extract Planned Order data from Live Cache

Former Member
0 Kudos

Hi,

I am searching for a FM or Bapi which fetches data from Live Cache,

I can see FMs like /SAPAPO/OM_ORDER_GET_DATA , but it has parameters IV_SIMSESSION, i am not sure what should be the value for this.

it always returns an exception LC_COM_ERROR.

<b>My main requirement</b> is like, i am fetching Planned order data from ODS table /BIC/AZDRP_0400 and Dependent orders data from table /BIC/AZDRP_0500

and creating Planned orders in APO.

Now , I have a condition like, before creating an order, I have to check whether that order already exists in APO, if it exists then i dont have to create it again.

if it exists and there are any changes to the quantity then i have to update the order.

Please suggest me on how to get Order Data.

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hello Prabha,

Once get the orderid from the /SAPAPO/ORDMAP table then pass the corresponding order-id to the table /SAPAPO/MM_DOC to fetch the respective material(MATID) and location(LOCID). Use the view /SAPAPO/V_MTLMOD for fetching the matnr and locno. Let me know if you have any issues.

Regards,

Siva.

Former Member
0 Kudos

Hi Prabha,

As I told u can fetch them by using the below select.

SELECT * FROM /sapapo/ordmap INTO TABLE gv_ordid

<b>CONNECTION lca</b>

WHERE r3obj = '5'

and delnr = <Pass the order number>

and DELPS = <Pass the item number>.

When u the statement connection LCA it fetches the data directly from the live cache.

Regards,

Siva.

Former Member
0 Kudos

Hi Prabha,

You can view the content of the table through the transaction /SAPAPO/OM19.

Thanks,

Siva.

Former Member
0 Kudos

Hi Siva,

I can see the records there but how i can i fetch them

Former Member
0 Kudos

Hello Prabha,

If u try to see the entries via SE11 or SE16 you can't see it.

Write a simple program with my select and check the internal table contents. You will see the entries which are available in the live cache. Copy ur code for the live cache error. I will check it and let you know.

Thanks,

Siva.

Former Member
0 Kudos

hi siva,

thank u very much for your help.

One more help, if i have an Order and i can see it in /sapapo/ordkey,

how can search for Material, plant and Creation Date of that order.

Its very urgent and your reply wil greatly help me

Former Member
0 Kudos

Hello Prabha,

Use the below to check the Planned Order is available in the system.

DATA: gv_ordid TYPE /sapapo/ordmap OCCURS 0 WITH HEADER LINE.

SELECT * FROM /sapapo/ordmap INTO TABLE gv_ordid

CONNECTION <b>lca</b>

WHERE r3obj = '5'

and delnr = <Pass the order number>

  • and DELPS = <Pass the item number>.

Note: Make sure the connection name 'LCA' is present in the table DBCON.

Let me know if you find any issues.

Thanks,

Siva.

Former Member
0 Kudos

Hello Prabha,

Use the below code for solving the sim session error and pass the variable gv_sims to the IV_SIMSESSION parameter.

Thanks,

Siva.

DATA : gv_sims TYPE /sapapo/om_simsession,

gv_params TYPE /sapapo/om_gen_params.

  • Check is there any sim session availble

CALL FUNCTION '/SAPAPO/RRP_SIMSESSION_GET'

IMPORTING

ev_simsession = gv_sims

es_gen_params = gv_params.

IF gv_sims IS INITIAL.

CALL FUNCTION '/SAPAPO/RRP_SIMSESSION_CREATE'

IMPORTING

ev_simsession = gv_sims.

CALL FUNCTION '/SAPAPO/RRP_SIMSESSION_GET'

IMPORTING

ev_simsession = gv_sims

es_gen_params = gv_params.

ENDIF.

Former Member
0 Kudos

Hi Siva,

Thanks for your reply.

i dont have data in /SAPAPO/ORDMAP table , so that solution will not work.

Regarding the Session ID, i used same procedure to get Session Id, still it is returing LC_COM_ERROR exception.

Please tell me if there is any other way of fetching data