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: 

Function module that does Production Order Conformation in C011N screen ?

Former Member
0 Kudos

Hi all

I need to do Production Order Conformation for an operation once the operation is actually completed in the workcenter.

Is there any function module available such that taking Production Order Conformation number for a particular operation, it actually conforms the operation in CO11n screen and updates the Master tables with the Conformation information.

I have been trying hard for the relevant information. Does some one know is there any standard Function Module available which actually does the Production Order Conformation for aparticular operation ?

Regards,

Jessica.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

use this bapi

BAPI_PRODORDCONF_CREATE_HDR

For activity

BAPI_PRODORDCONF_CREATE_ACT

13 REPLIES 13

Former Member
0 Kudos

use this bapi

BAPI_PRODORDCONF_CREATE_HDR

For activity

BAPI_PRODORDCONF_CREATE_ACT

0 Kudos

Hey Sunil,

How should i use these BAPI's, what information need to be passed

Can you give me a sample code for the same

I need to do production order conformation using a function module for BAPI(which is manually done through CO11N screen in a normal scenario).

The input that i have with me is the Conformation number and i need to conform it. which BAPI should i be using from the 2 u suggested.

Please help me with some sample code on the same.

0 Kudos

it depends on the data you would be passing to the FM.first one is easy to use.

1.if you want to confirm at order level use 1 .if the order is confirmed all the operations within that order are also confirmed .for this you have to fill ATHDRLEVELS.

BAPI_PRODORDCONF_CREATE_HDR

2.but if you want to confirm the operations within an order individually use

BAPI_PRODORDCONF_CREATE_ACT

for 1 fill.

ATHDRLEVELS

ORDERID = 8000366

FIN_CONF = X

CLEAR_RES = X

POSTG_DATE = 7/24/2006

YIELD = 1

EXEC_START_DATE = 7/24/2006

EXEC_START_TIME = 0:00:00

EXEC_FIN_DATE = 7/24/2006

EXEC_FIN_TIME = 0:00:00

GOODSMOVEMENTS -- Finish Good

MATERIAL = QBS-SM7-001-S2

PLANT = 1000

STGE_LOC = 1121

BATCH = 1234511111

MOVE_TYPE = 101

ENTRY_QNT = 1

ENTRY_UOM = PC

NO_MORE_GR = X

RESERV_NO = ''

RES_ITEM = ''

WITHDRAWN = ''

MVT_IND = F

GOODSMOVEMENTS -- COMPONENTS

MATERIAL = DM-RS1-601-014-0

PLANT = 1000

STGE_LOC = 1121

BATCH = 71023

MOVE_TYPE = 261

ENTRY_QNT = 2

ENTRY_UOM = EA

NO_MORE_GR = ''

RESERV_NO = 142238

RES_ITEM = 1

WITHDRAWN = X

MVT_IND = ''

0 Kudos

Hey Sunil, i need to Conform only one activity.

So i am planning to use the second BAPI that u suggested

CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_ACT'

  • EXPORTING

  • POST_WRONG_ENTRIES = '0'

  • IMPORTING

  • RETURN =

TABLES

ACTIVITIES =

  • DETAIL_RETURN =

.

but here i dont know what values to pass.

can u give me some info on the same with sample code so that i can correlate.

Regards,

Jessica.

Former Member
0 Kudos

Hi,

Use this BAPI

BAPI_PRODORDCONF_EXIST_CHK Existence Check for Confirming Production Order

BAPI_PRODORDCONF_GETDETAIL Detailed Data for Production Order Confirmation

BAPI_PRODORDCONF_GETLIST Confirmations List

Regards

Ranga

Edited by: Ranga Swamy on Oct 30, 2008 5:31 PM

Former Member
0 Kudos

Hey Sunil, i need to Conform only one activity.

So i am planning to use the second BAPI that u suggested

CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_ACT'

EXPORTING

POST_WRONG_ENTRIES = '0'

IMPORTING

RETURN =

TABLES

ACTIVITIES =

DETAIL_RETURN =

.

but here i dont know what values to pass.

can u give me some info on the same with sample code so that i can correlate.

Regards,

Jessica.

0 Kudos

I have entered only the mandatory fields, in ur case you may have to enter other fields as well. you have to explicitly do the commit.

once the operation is confirmed ,an entry is created in table AFRU.

DATA : ls_act TYPE STANDARD TABLE OF BAPI_CORU_ACTIV WITH HEADER LINE.
DATA : ls_return TYPE STANDARD TABLE OF BAPI_CORU_RETURN
       WITH HEADER LINE.

ls_act-ORDERID = '000010000000'.
ls_act-SEQUENCE = '000000'.
ls_act-OPERATION = '0010'.
ls_act-POSTG_DATE = sy-datum.
APPEND ls_act TO ls_act.

CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_ACT'
* EXPORTING
*   POST_WRONG_ENTRIES       = '0'
* IMPORTING
*   RETURN                   =
  TABLES
    ACTIVITIES               = ls_act
   DETAIL_RETURN            = ls_return
          .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
 EXPORTING
   WAIT          = 'X'
* IMPORTING
*   RETURN        =
          .

Former Member
0 Kudos

Hey sunil,

Thanks a lot for the sample code.

My requirement is that i dont have the values that i need to pass for this BAPI to create an Order Conformation and i need to get the data from master tables.

that is if a person is doing a production Order conformation for an activity in CO11n screen and enters the Conformation number and presses enter some data is pulled. and if he presses on actual data tab, the system populates the actual data of that particular conformation.

With this data only i need to genreate a conformation for a activity using my BAPI.

How will i get this actual data. from which tables the actual data is getting populated?

Regarda,

Jessica

0 Kudos

Hi,

you will get the confirmation number only when the PP order is partially/fully confirmed.in your case i would assume that it is partially confirmed. for this bapi you only have to enter the confirmation number and it will pick all the data pertaining to that number and do the confirmation.

check this code.

DATA : ls_timeticket TYPE STANDARD TABLE OF BAPI_PP_TIMETICKET

WITH HEADER LINE,

ls_return TYPE STANDARD TABLE OF BAPI_CORU_RETURN.

ls_timeticket-CONF_NO = '0000005000'.

ls_timeticket-fin_conf = 'X'. " Final Confirmation

APPEND ls_timeticket.

CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'

  • EXPORTING

  • POST_WRONG_ENTRIES = '0'

  • TESTRUN =

  • IMPORTING

  • RETURN =

TABLES

TIMETICKETS = ls_timeticket

  • GOODSMOVEMENTS =

  • LINK_CONF_GOODSMOV =

DETAIL_RETURN = ls_return

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

  • IMPORTING

  • RETURN =

.

Former Member
0 Kudos

Hi,

adding sunil posting

append the fildes whatever you have . pass into activities

ls_act-field1 = '000010000000'.

ls_act-field2 = '000000'.

APPEND ls_act TO ls_act.

CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_ACT'

  • EXPORTING

  • POST_WRONG_ENTRIES = '0'

  • IMPORTING

  • RETURN =

TABLES

ACTIVITIES = ls_act

DETAIL_RETURN = ls_return

Regards

swamy

.

Former Member
0 Kudos

Hi all, With all your inputs also i am finding it difficult to create a Conformation for an activity in CO11N screen.

My requirement is to Create the Conformation for an activity in CO11N screen with following entries in the screen. what BAPI should i use, out of all those that you suggested and How ahould i pass my data.

Data with which the conformation needs to be done in CO11N screen.

Order Number = 1000243.

Material Number = 20098765.

Operation/Activity = 0010.

Sequence = 0.

Work Center = ABCD.

Plant = UK45.

Conformation Type = Partial Conformation.

Yield = 7.

Machine = 1.0

Labor = 1.0.

Execution Start Data = 11/01/2008

Execution Start Time = 12:53:55

Execution Finish time = 11/01/2008

Execution Finish Time = 12:53:55

Can some one help me with the Function Module or BAPI, where i can pass all the above information.

ALso i dont want to hard code the program with fixed values.

Can some one tell me in which table does all these values get stored?

So that i can pass all these values to a function module/BAPI that will create the conformation for a particular activiy in CO11N screen

Regards,

Jessica.

Posting Data

0 Kudos

Hi Jessica,

Have you tried the with BAPI_ALM_CONF_CREATE .

If i am wrong correct me.

Check the below link can be helpful for you.

And coming to tables information keep the cursor on the fields that you want for tables and field information opens a performance assistance window in which you can see 4th button technical information click on that you can get the table and field names of all the information that you have been asked for.

Few Table and Field details

Order no - AFRUD-AUFNR

Material Number - CAUFVD-MATNR

Operation Activity - AFRUD-VORNR

Seq - AFRUD-APLFL

work center - AFVGD-ARBPL

Plant- AFVGD-WERKS

confirmation Type - AFRUD-AUERU

Yield - AFRUD-LMNGA

Cheers!!

VEnk@

Edited by: Venkat Reddy on Nov 1, 2008 11:52 PM

Former Member
0 Kudos

Hey Sunil, Swamy and Venkat, with your timely inputs i was able to solve my problem.

My actual requirement is to build a web service for a function module which does the conformation in CO11N screen by taking the input as production Conformation number, Start Date, Start Time, Finish Date and Finish time.

I was able to create the Production order Conformation for an activity and was able to see the entry in AFRU table.

But now when in SE37, in utilities->More Utilities--> Create Web Service option and i create a web service for the function module. It is generated sucessfully and i see a green tabe in WSCONFIG t-code.

When i test the Web Service in WSADMIN t-code, the web service throws an error.

But the function module is executing perfectly and i am able to create a production order conformation for a particlular activty and able to see entries in afru table.

I have earlier created web services for lot of RFC enabled function module, but this is the first time it is throwing an error, where in thr RFC enabled function module that i created works perfectly well.

Unable to figure out where i am missing. did anyone encounter this situation earlier. Please help me with some inputs.

Regards,

Jessica.'