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

Problem when using BAPI_PO_CREATE1

Former Member
0 Likes
624

Hi,

I am getting error message

"Control indicators for controlling area UPS do not exist"

when I use BAPI BAPI_PO_CREATE1 . 'UPS' is the new controlling area that in which I am creating the Purchase order.

Please suggest me some solution.

Thanks,

Sonali.

4 REPLIES 4
Read only

Former Member
0 Likes
590

Check the below code:

&----


*& Report YPRA_SAMPLE88 *

*& *

&----


*& *

*& *

&----


REPORT ypra_sample88.

DATA: i_poitem TYPE STANDARD TABLE OF bapimepoitem,

i_poitemx TYPE STANDARD TABLE OF bapimepoitemx,

i_poitem_sch TYPE STANDARD TABLE OF bapimeposchedule,

i_poitem_schx TYPE STANDARD TABLE OF bapimeposchedulx,

i_acct_ass TYPE STANDARD TABLE OF bapimepoaccount,

i_acct_assx TYPE STANDARD TABLE OF bapimepoaccountx,

i_services TYPE STANDARD TABLE OF bapiesllc ,

i_srvacc TYPE STANDARD TABLE OF bapiesklc,

i_return TYPE STANDARD TABLE OF bapiret2,

wa_header TYPE bapimepoheader,

wa_headerx TYPE bapimepoheaderx,

wa_poitem TYPE bapimepoitem,

wa_poitemx TYPE bapimepoitemx,

wa_poitem_sch TYPE bapimeposchedule,

wa_poitem_schx TYPE bapimeposchedulx,

wa_acct_ass TYPE bapimepoaccount,

wa_acct_assx TYPE bapimepoaccountx,

wa_services TYPE bapiesllc,

wa_srvacc TYPE bapiesklc,

wa_return TYPE bapiret2,

ws_po TYPE bapimepoheader-po_number,

ws_wait TYPE bapita-wait.

CONSTANTS: c_x TYPE char01 VALUE 'X'.

break gbpra8.

wa_header-doc_type = 'ZDET'.

wa_header-vendor = '0002000000'.

PERFORM conversion_output USING wa_header-vendor

CHANGING wa_header-vendor.

wa_header-comp_code = 'DE03'.

wa_header-purch_org = 'DE03'.

wa_header-pur_group = 'DE1'.

wa_header-vper_start = '20060730'.

wa_header-vper_end = '20070621'.

wa_headerx-comp_code = c_x.

wa_headerx-doc_type = c_x.

wa_headerx-creat_date = c_x.

wa_headerx-created_by = c_x.

wa_headerx-vendor = c_x.

wa_headerx-purch_org = c_x.

wa_headerx-pur_group = c_x.

wa_headerx-vper_start = c_x.

wa_headerx-vper_end = c_x.

wa_poitem-po_item = 100.

wa_poitem-short_text = 'Sample'.

wa_poitem-plant = 'DE03'.

wa_poitem-quantity = 1.

wa_poitem-tax_code = 'V1'.

wa_poitem-item_cat = 'D'.

wa_poitem-acctasscat = 'K'.

wa_poitem-matl_group = 'ZDESS'.

wa_poitem-pckg_no = 10.

wa_poitem-gr_ind = space.

wa_poitem-gr_basediv = space.

APPEND wa_poitem TO i_poitem .

wa_poitemx-po_item = 100.

wa_poitemx-po_itemx = c_x.

wa_poitemx-short_text = c_x.

wa_poitemx-plant = c_x.

wa_poitemx-quantity = c_x.

wa_poitemx-tax_code = c_x.

wa_poitemx-item_cat = c_x.

wa_poitemx-acctasscat = c_x.

wa_poitemx-matl_group = c_x.

wa_poitemx-pckg_no = c_x.

wa_poitemx-gr_ind = c_x.

wa_poitemx-gr_basediv = space.

APPEND wa_poitemx TO i_poitemx.

wa_poitem-po_item = 200.

wa_poitem-short_text = 'Sample'.

wa_poitem-plant = 'DE03'.

wa_poitem-quantity = 1.

wa_poitem-tax_code = 'V1'.

wa_poitem-item_cat = 'D'.

wa_poitem-acctasscat = 'K'.

wa_poitem-matl_group = 'ZDESS'.

wa_poitem-pckg_no = 40.

wa_poitem-gr_ind = space.

wa_poitem-gr_basediv = space.

APPEND wa_poitem TO i_poitem .

wa_poitemx-po_item = 200.

wa_poitemx-po_itemx = c_x.

wa_poitemx-short_text = c_x.

wa_poitemx-plant = c_x.

wa_poitemx-quantity = c_x.

wa_poitemx-tax_code = c_x.

wa_poitemx-item_cat = c_x.

wa_poitemx-acctasscat = c_x.

wa_poitemx-matl_group = c_x.

wa_poitemx-pckg_no = c_x.

wa_poitemx-gr_ind = c_x.

wa_poitemx-gr_basediv = space.

APPEND wa_poitemx TO i_poitemx.

wa_acct_ass-po_item = 100.

wa_acct_ass-serial_no = 01.

wa_acct_ass-gl_account = '0006360100'.

wa_acct_ass-co_area = '1000'.

wa_acct_ass-costcenter = 'KC010000'.

APPEND wa_acct_ass TO i_acct_ass.

wa_acct_assx-po_item = 100.

wa_acct_assx-serial_no = 01.

wa_acct_assx-po_itemx = c_x.

wa_acct_assx-serial_nox = c_x.

wa_acct_assx-gl_account = c_x.

wa_acct_assx-co_area = c_x.

wa_acct_assx-costcenter = c_x.

APPEND wa_acct_assx TO i_acct_assx.

wa_acct_ass-po_item = 100.

wa_acct_ass-serial_no = 02.

wa_acct_ass-gl_account = '0006360100'.

wa_acct_ass-co_area = '1000'.

wa_acct_ass-costcenter = 'KC010000'.

APPEND wa_acct_ass TO i_acct_ass.

wa_acct_assx-po_item = 100.

wa_acct_assx-serial_no = 02.

wa_acct_assx-po_itemx = c_x.

wa_acct_assx-serial_nox = c_x.

wa_acct_assx-gl_account = c_x.

wa_acct_assx-co_area = c_x.

wa_acct_assx-costcenter = c_x.

APPEND wa_acct_assx TO i_acct_assx.

wa_acct_ass-po_item = 200.

wa_acct_ass-serial_no = 01.

wa_acct_ass-gl_account = '0006360100'.

wa_acct_ass-co_area = '1000'.

wa_acct_ass-costcenter = 'KC010000'.

APPEND wa_acct_ass TO i_acct_ass.

wa_acct_assx-po_item = 200.

wa_acct_assx-serial_no = 01.

wa_acct_assx-po_itemx = c_x.

wa_acct_assx-serial_nox = c_x.

wa_acct_assx-gl_account = c_x.

wa_acct_assx-co_area = c_x.

wa_acct_assx-costcenter = c_x.

APPEND wa_acct_assx TO i_acct_assx.

wa_acct_ass-po_item = 200.

wa_acct_ass-serial_no = 02.

wa_acct_ass-gl_account = '0006360100'.

wa_acct_ass-co_area = '1000'.

wa_acct_ass-costcenter = 'KC010000'.

APPEND wa_acct_ass TO i_acct_ass.

wa_acct_assx-po_item = 200.

wa_acct_assx-serial_no = 02.

wa_acct_assx-po_itemx = c_x.

wa_acct_assx-serial_nox = c_x.

wa_acct_assx-gl_account = c_x.

wa_acct_assx-co_area = c_x.

wa_acct_assx-costcenter = c_x.

APPEND wa_acct_assx TO i_acct_assx.

wa_services-pckg_no = 10.

wa_services-line_no = 1.

wa_services-outl_no = '0'.

wa_services-outl_ind = c_x.

wa_services-subpckg_no = 20.

wa_services-from_line = 1.

wa_services-to_line = 2.

APPEND wa_services TO i_services.

wa_services-pckg_no = 20.

wa_services-line_no = 2.

wa_services-service = 'H007'.

wa_services-quantity = '12'.

wa_services-gr_price = '100'.

wa_services-userf1_txt = 'Firm'.

APPEND wa_services TO i_services.

wa_services-pckg_no = 40.

wa_services-line_no = 1.

wa_services-outl_no = '0'.

wa_services-outl_ind = c_x.

wa_services-subpckg_no = 50.

wa_services-from_line = 1.

wa_services-to_line = 2.

APPEND wa_services TO i_services.

wa_services-pckg_no = 50.

wa_services-line_no = 2.

wa_services-service = 'H008'.

wa_services-quantity = '12'.

wa_services-gr_price = '100'.

wa_services-userf1_txt = 'Firm'.

APPEND wa_services TO i_services.

wa_srvacc-pckg_no = 10.

wa_srvacc-line_no = 1.

wa_srvacc-serno_line = 01.

wa_srvacc-serial_no = 01.

wa_srvacc-percentage = 100.

APPEND wa_srvacc TO i_srvacc.

wa_srvacc-pckg_no = 20.

wa_srvacc-line_no = 2.

wa_srvacc-serno_line = 02.

wa_srvacc-serial_no = 02.

wa_srvacc-percentage = 100.

APPEND wa_srvacc TO i_srvacc.

wa_srvacc-pckg_no = 40.

wa_srvacc-line_no = 1.

wa_srvacc-serno_line = 01.

wa_srvacc-serial_no = 01.

wa_srvacc-percentage = 100.

APPEND wa_srvacc TO i_srvacc.

wa_srvacc-pckg_no = 50.

wa_srvacc-line_no = 2.

wa_srvacc-serno_line = 02.

wa_srvacc-serial_no = 02.

wa_srvacc-percentage = 100.

APPEND wa_srvacc TO i_srvacc.

CALL FUNCTION 'BAPI_PO_CREATE1'

EXPORTING

poheader = wa_header

poheaderx = wa_headerx

IMPORTING

exppurchaseorder = ws_po

TABLES

return = i_return

poitem = i_poitem

poitemx = i_poitemx

poschedule = i_poitem_sch

poschedulex = i_poitem_schx

poaccount = i_acct_ass

poaccountx = i_acct_assx

poservices = i_services

posrvaccessvalues = i_srvacc.

break gbpra8.

LOOP AT i_return INTO wa_return.

ENDLOOP.

ws_wait = 5.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = ws_wait.

&----


*& Form conversion_output

&----


  • Conversion exit input

----


FORM conversion_output USING p_ip

CHANGING p_op.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = p_ip

IMPORTING

output = p_op.

ENDFORM. " conversion_output

Regards,

Prakash.

Read only

0 Likes
590

Thank You!

My problem is solved.

Read only

0 Likes
590

Hi frnds,

Myself too facing this problem now.

Even after giving the control area value.

its promting that error.

Kindly help me to solve this...

thanks

Sugana

Read only

Former Member
0 Likes
590

Thank You all for the responses.