Application Development and Automation 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: 
Read only

BAPI_PROCORDCONF_CREATE_TT

yogendra_bhaskar
Contributor
0 Likes
1,992

Hi ,

I am using BAPI_PROCORDCONF_CREATE_TT for the confirmation of the production order and goods movement.

Following is the code I have used.

Plz have a look on the parameters and suggest me ; Is there any parameter i am missing out ?

*** for timetickets data

wa_conf-orderid = wa_aufk-aufnr.

wa_conf-phase = wa_ppconf-vornr.

wa_conf-sec_resource = wa_ppconf-sumnr.

wa_conf-fin_conf = wa_ppconf-final.

wa_conf-postg_date = g_budat.

wa_conf-conf_text = g_ctext.

wa_conf-plant = wa_aufk-werks.

IF wa_ppconf-sumnr IS INITIAL.

wa_conf-yield = wa_ppconf-yield.

wa_conf-scrap = wa_ppconf-scrap.

ENDIF.

wa_conf-conf_activity1 = wa_ppconf-vgw01.

wa_conf-conf_acti_unit1 = wa_ppconf-vge01.

wa_conf-conf_activity2 = wa_ppconf-vgw02.

wa_conf-conf_acti_unit2 = wa_ppconf-vge02.

wa_conf-conf_activity3 = wa_ppconf-vgw03.

wa_conf-conf_acti_unit3 = wa_ppconf-vge03.

wa_conf-conf_activity4 = wa_ppconf-vgw04.

wa_conf-conf_acti_unit4 = wa_ppconf-vge04.

wa_conf-conf_activity5 = wa_ppconf-vgw05.

wa_conf-conf_acti_unit5 = wa_ppconf-vge05.

wa_conf-conf_activity6 = wa_ppconf-vgw06.

wa_conf-conf_acti_unit6 = wa_ppconf-vge06.

*** for goodsmovement data

wa_gmvt-material = wa_gi-matnr.

wa_gmvt-plant = wa_aufk-werks.

wa_gmvt-stge_loc = wa_gi-lgort.

wa_gmvt-batch = wa_gi-charg.

wa_gmvt-move_type = wa_gi-bwart.

wa_gmvt-entry_qnt = wa_gi-menge.

wa_gmvt-entry_uom = wa_gi-meins.

wa_gmvt-orderid = wa_aufk-aufnr.

wa_gmvt-activity = wa_gi-vornr.

APPEND wa_gmvt TO gt_gmvt.

CLEAR wa_gmvt.

**** for link_conf_goodsmov data

wa_link-index_confirm = wa_index-index.

wa_link-index_goodsmov = sy-tabix.

APPEND wa_link TO gt_link.

CLEAR wa_link.

CALL FUNCTION 'BAPI_PROCORDCONF_CREATE_TT'

EXPORTING

post_wrong_entries = space

testrun = space

IMPORTING

return = wa_ret1

TABLES

timetickets = gt_conf

goodsmovements = gt_gmvt

link_conf_goodsmov = gt_link

detail_return = gt_retn.

READ TABLE gt_retn INTO wa_retn

WITH KEY type = 'E'.

IF sy-subrc EQ 0.

PERFORM display_error.

ELSE.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

  • WAIT UP TO 3 SECONDS.

MESSAGE 'Order has been confirmed' TYPE 'I'.

leave to current transaction .

3 REPLIES 3
Read only

Former Member
0 Likes
1,281

Hi,

I had a look at the BAPI, the TABLES paramater:

...TIMETICKET LIKE BAPI_PI_TIMETICKET1 (BAPI 
Structure: PP Confirmation Time Ticket) is set as mandatory.

It should work properly the way you are passing the values. One thing I noted is that you didn't

...APPEND wa_conf TO gt_conf.

One more thing We will need to force a COMMIT after the BAPI call

Can you please specify the error u are getting ??

BR

Tanmoy

Edited by: Tanmoy Mondal on Aug 29, 2011 8:21 AM

Read only

0 Likes
1,281

Yes, include the APPEND if you are missing.

Also, include the OPERATION number in time ticket data if intended, what is your problem by the way ?

Read only

0 Likes
1,281

hi,

thanx 4 reply ,

the problem I was facing was of goods movement indicator , it was being set as 2 whereas i need that it should be set as 1.

the parameter i am missing was

wa_gmvt-RESERV_NO

wa_gmvt-RES_ITEM

Now I am getting the result as I want.

Thanx & regards

Yogendra