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_REQUISITION_CREATE - Posting for Services Short Text

Former Member
0 Likes
1,122

Hi,

I would like to post the Services short text and info for each of items for services purchase requisition.

Below is my coding.

  • PR HEADER.

itab_bapiebanc-deliv_date = tt_itab-eeind. " Deliery Date

itab_bapiebanc-preq_name = tt_itab-afnam. " Requisitioner

itab_bapiebanc-trackingno = tt_itab-bednr. " Tracking No

itab_bapiebanc-plant = tt_itab-werks. " Plant

itab_bapiebanc-doc_type = tt_itab-bsart. " Doc. Type

  • PR Line Column

IF tt_itab-matnr EQ space.

itab_bapiebanc-item_cat = '9'.

itab_bapiebanc-mat_grp = 'SERV'.

ELSE.

itab_bapiebanc-item_cat = '0'.

ENDIF.

itab_bapiebanc-material = tt_itab-matnr. " Material No

itab_bapiebanc-short_text = tt_itab-txz01. " Short Text

itab_bapiebanc-quantity = tt_itab-menge. " Quantity

itab_bapiebanc-unit = tt_itab-meins. " UOM

itab_bapiebanc-currency = tt_itab-waers. " Currency.

itab_bapiebanc-c_amt_bapi = tt_itab-brtwr. "Valuation Price

  • itab_bapiebanc-mat_grp = tt_itab-wgbez.

  • itab_bapiebanc-pur_group = tt_itab-ekgrp.

  • itab_bapiebanc-mat_grp = '03'.

itab_bapiebanc-pur_group = 'P01'.

itab_bapiebanc-acctasscat = 'K'. " Cost Center

itab_bapiebkn-cost_ctr = tt_itab-kostl. " Sakto

itab_bapiebkn-g_l_acct = tt_itab-sakto. " GL

itab_bapiebkn-g_l_acct = '40000500'. " GL

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = itab_bapiebkn-cost_ctr

IMPORTING

output = itab_bapiebkn-cost_ctr.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = itab_bapiebkn-g_l_acct

IMPORTING

output = itab_bapiebkn-g_l_acct.

CALL FUNCTION 'NUMBER_GET_NEXT'

EXPORTING

nr_range_nr = '01'

object = 'SERVICE'

IMPORTING

number = itab_bapiesllc-service

EXCEPTIONS

interval_not_found = 1

OTHERS = 8.

itab_bapiebanc-pckg_no = itab_bapiesllc-service + 1.

itab_bapiebanc-PREQ_ITEM = '00010'.

itab_bapiebkn-preq_item = '00010'.

itab_bapiesllc-short_text = tt_itab-txz01. " Short Text

itab_bapiesllc-quantity = tt_itab-menge.

itab_bapiesllc-base_uom = 'UN'.

itab_bapiesllc-pckg_no = itab_bapiebanc-pckg_no.

itab_bapiesllc-subpckg_no = itab_bapiebanc-pckg_no + 1.

itab_bapiesllc-line_no = '0000000001'.

itab_bapiesklc-pckg_no = itab_bapiesllc-pckg_no .

itab_bapiesklc-line_no = itab_bapiesllc-line_no .

itab_bapiesklc-serno_line = '01'.

CLEAR itab_bapiesllc-service.

    • itab_bapiesllc-EXT_LINE = '0000000000'.

    • itab_bapiesllc-FROM_LINE = '1'.

    • itab_bapiesllc-PLN_LINE = '0000000001'.

itab_bapiesklc-serial_no = '01'.

itab_bapiesklc-percentage = '100.00'.

itab_bapiesklc-quantity = '1.000'.

APPEND itab_bapiebkn.

APPEND itab_bapiebanc.

APPEND itab_bapiebantx.

APPEND itab_bapiesllc.

APPEND itab_bapiesklc.

AT END OF header.

CALL FUNCTION 'BAPI_REQUISITION_CREATE'

TABLES

requisition_items = itab_bapiebanc

requisition_account_assignment = itab_bapiebkn

requisition_item_text = itab_bapiebantx

requisition_services = itab_bapiesllc

return = gw_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

I had successfully create the Purchase Requisition, but still unable to get the services short text at each of items. ESLL got my packno, but not maintain in ESLH. If i manually maintain in ME51N, ESLH got packno of this.

Any problem for my coding? is it miss out someting?

Thanks

1 REPLY 1
Read only

Former Member
0 Likes
373

Any solutions? Have to append what data to show the services text items for services PR in ME51N?