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 Problem.....

Former Member
0 Likes
555

Hi Gurus,

I am trying to use BAPI_PRODORDCONF_CREATE_TT and for this I have written the following code:

CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'

IMPORTING

return = return1

TABLES

timetickets = timetickets

goodsmovements = goodsmovements.

read table return1 with key type = 'S'.

if syst-subrc eq 0.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

IMPORTING

RETURN = return2.

endif.

data: ord_num TYPE bapi_order_key-order_number,

timetickets like bapi_pp_timeticket occurs 0 with header line,

goodsmovements like bapi2017_gm_item_create occurs 0 with header line,

t_component TYPE STANDARD TABLE OF bapi_order_component,

component TYPE bapi_order_component,

return1 like BAPIRET1 occurs 0 with header line,

return2 type BAPIRET1.

but the tables timetickets and goodsmovement are not returning anything, can you please tell me where the problem is.

Thanks,

Rajeev./..........

Message was edited by:

Rajeev Gupta

3 REPLIES 3
Read only

naimesh_patel
Active Contributor
0 Likes
517

I think you need to fill the data in those internal tables to create the tickets.

See the documentation of the FM you will have more ideas.

REgards,

Naimesh Patel

Read only

Former Member
0 Likes
517

Rajeev,

check this below sample code may be helpful for you

data: return type bapiret1.

data: i_timetickets type table of BAPI_PP_TIMETICKET with header line.

DATA: I_DETAIL TYPE TABLE OF BAPI_CORU_RETURN WITH HEADER LINE.

i_timetickets-conf_no = '4061'.

i_timetickets-orderid = '000001000853'.

i_timetickets-operation = '0010'.

i_timetickets-work_cntr = '31258'.

i_timetickets-plant = 'US19'.

i_timetickets-yield = '5'.

i_timetickets-conf_quan_unit = 'ST'.

i_timetickets-scrap = ''.

i_timetickets-dev_reason = ''.

APPEND i_timetickets.

CLEAR i_timetickets.

i_timetickets-conf_no = '4061'.

i_timetickets-orderid = '000001000853'.

i_timetickets-operation = '0010'.

i_timetickets-work_cntr = '31258'.

i_timetickets-plant = 'US19'.

i_timetickets-yield = ''.

i_timetickets-scrap = '1'.

i_timetickets-conf_quan_unit = 'ST'.

i_timetickets-dev_reason = '101'.

APPEND i_timetickets.

CLEAR i_timetickets.

i_timetickets-conf_no = '4061'.

i_timetickets-orderid = '000001000853'.

i_timetickets-operation = '0010'.

i_timetickets-work_cntr = '31258'.

i_timetickets-plant = 'US19'.

i_timetickets-yield = ''.

i_timetickets-scrap = '1'.

i_timetickets-conf_quan_unit = 'ST'.

i_timetickets-dev_reason = '103'.

APPEND i_timetickets.

CLEAR i_timetickets.

i_timetickets-conf_no = '4061'.

i_timetickets-orderid = '000001000853'.

i_timetickets-operation = '0010'.

i_timetickets-work_cntr = '31258'.

i_timetickets-plant = 'US19'.

i_timetickets-yield = ''.

i_timetickets-scrap = '1'.

i_timetickets-conf_quan_unit = 'ST'.

i_timetickets-dev_reason = '104'.

APPEND i_timetickets.

CLEAR i_timetickets.

DATA: I_GM TYPE TABLE OF BAPI2017_GM_ITEM_CREATE WITH HEADER LINE.

I_GM-MATERIAL = '000000000200090301'.

I_GM-PLANT = 'US19'.

I_GM-STGE_LOC = '0001'.

I_GM-BATCH = '0000003109'.

I_GM-MOVE_TYPE = '261'.

I_GM-ENTRY_QNT = '5'.

I_GM-ENTRY_UOM = 'PC'.

I_GM-ORDERID = '000001000853'.

APPEND I_GM.

CLEAR I_GM.

I_GM-MATERIAL = '000000000200090301'.

I_GM-PLANT = 'US19'.

I_GM-STGE_LOC = '0001'.

I_GM-BATCH = '0000003101'.

I_GM-MOVE_TYPE = '261'.

I_GM-ENTRY_QNT = '75'.

I_GM-ENTRY_UOM = 'PC'.

I_GM-ORDERID = '000001000853'.

APPEND I_GM.

CLEAR I_GM.

CALL FUNCTION 'BAPI_PRODORDCONF_CREATE_TT'

  • EXPORTING

  • POST_WRONG_ENTRIES = '0'

  • TESTRUN = 'X'

IMPORTING

RETURN = return

TABLES

timetickets = i_timetickets[]

GOODSMOVEMENTS = I_GM[]

  • LINK_CONF_GOODSMOV =

DETAIL_RETURN = I_DETAIL[].

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.

Read only

Former Member
0 Likes
517

I don't think they are supposed to return data. This is where you export data to the BAPI.

Rob