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_PR_CREATE going to dump

Former Member
0 Likes
907

Hi all ,,

*i am calling BAPI_PR_CREATE here but when i executing or when i debuggin it is going to dump and error is*Type conflict when calling a function module (field length).

*-- Count of Item lines per school code

g_itmcnt = g_itmcnt + c_one.

wa_header-pr_type = c_pr_type. "purchase requisition documentation type

wa_header-memory = c_x.

APPEND wa_header TO it_header.

wa_headerx-pr_type = c_x. "purchase requisition documentation type

wa_header-memory = c_x. "Purchase Requisition not yet Complete

APPEND wa_headerx TO it_headerx.

wa_item-item_cat = c_item_cat. "Item Category

wa_item-acctasscat = c_ac_asign. "Account Assignment Category

wa_item-material = wa_data-stock_item. "Material number

wa_item-suppl_plnt = c_sup_plnt. "supplying plant

wa_item-pur_group = c_pur_grp. "purchase Group

wa_item-purch_org = c_pur_org. "Purchase Organisation

wa_item-unit = c_unit. "Unit of measure

wa_item-plant = c_r_plant. "Receiving plant

wa_item-store_loc = wa_data-sc_code. "Storage Location

wa_item-quantity = wa_data-quantity. "Quantity

wa_item-deliv_date = sy-datum + 7. "Delivary date

APPEND wa_item TO it_item.

wa_itemx-item_cat = c_x. "Item Category

wa_itemx-acctasscat = c_x. "Account Assignment Category

wa_itemx-material = c_x. "Material number

wa_itemx-suppl_plnt = c_x. "supplying plant

wa_itemx-pur_group = c_x. "purchase Group

wa_itemx-purch_org = c_x. "Purchase Organisation

wa_itemx-unit = c_x. "Unit of measure

wa_itemx-plant = c_x. "Receiving plant

wa_itemx-store_loc = c_x. "Storage Location

wa_itemx-quantity = c_x. "Quantity

wa_itemx-deliv_date = c_x. "Delivary date

APPEND wa_itemx TO it_itemx.

wa_atasg-fund = wa_data-fincode. "SAP Fund

wa_atasg-func_area_long = wa_data-fkber. "Functional Area

wa_atasg-bus_area = wa_data-gsber . "Business Area

wa_atasg-costcenter = wa_data-kostl. "Cost Center

wa_atasg-gl_account = wa_data-saknr . "G/L Account

APPEND wa_atasg TO it_atasg .

wa_atasgx-fund = c_x. "SAP Fund

wa_atasgx-func_area_long = c_x. "Functional Area

wa_atasgx-bus_area = c_x . "Business Area

wa_atasgx-costcenter = c_x. "Cost Center

wa_atasgx-gl_account = c_x . "G/L Account

APPEND wa_atasgx TO it_atasgx .

wa_ittxt-text_line = wa_data-course. "Item Text

APPEND wa_ittxt TO it_ittxt.

*-- If item line count per school code is 98, call BAPI to create STR/PR

IF ( g_itmcnt = c_98 ).

PERFORM requisition_create.

REFRESH : it_item,it_atasg,it_ittxt.

CLEAR : g_itmcnt.

CONTINUE.

ENDIF.

*-- At end of school code, call BAPI to create STR/PR

AT END OF sc_code.

PERFORM requisition_create.

ENDAT.

CLEAR:wa_data.

ENDLOOP.

ENDFORM. " CREATE_STR

&----


*& Form REQUISITION_CREATE

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM requisition_create .

CALL FUNCTION 'BAPI_PR_CREATE'

EXPORTING

prheader = it_header

prheaderx = it_headerx

  • TESTRUN =

IMPORTING

number = g_reqstno

  • PRHEADEREXP =

TABLES

return = it_return

pritem = it_item

pritemx = it_itemx

  • pritemexp =

  • PRITEMSOURCE =

praccount = it_atasg

  • PRACCOUNTPROITSEGMENT =

praccountx = it_atasgx

  • PRADDRDELIVERY =

pritemtext = it_ittxt.

  • PRHEADERTEXT =

  • EXTENSIONIN =

  • EXTENSIONOUT =

  • PRVERSION =

  • PRVERSIONX =

  • ALLVERSIONS =

IF g_reqstno IS NOT INITIAL.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = c_x.

  • IMPORTING

  • return = it_return.

ENDIF.

READ TABLE it_return INTO wa_return WITH KEY type = c_etype.

IF sy-subrc EQ 0.

WRITE: / wa_return-message.

ELSE.

WRITE: / g_reqstno.

ENDIF.

ENDFORM. " REQUISITION_CREATE

3 REPLIES 3
Read only

Former Member
0 Likes
753

Run Code inspector there you can find the related error.

Read only

Former Member
0 Likes
753

You have the exact error in the dump 'Type conflict when calling a function module (field length).

'

Check all the parameterts you are passign tto the BAPI and compare the types with the ones specified in the BAPI interface itself

Read only

Former Member
0 Likes
753

usefull thanks