Skip to Content
0

Unable to create service bapi_pr_create .

Feb 11, 2017 at 01:09 PM

147

avatar image
Former Member

Hello Experts,

I am creating a bapi for service PR .

The details passed to BAPI_REQUISITION_CREATE are as follows.

If i remove lines that are bold PR is created without service line.

If I add those lines I get error in PR creation E 06408 Please enter account assignment.

Can you please guide what exactly is wrong in creation of service lines. I have checked forums but was not successful.

Please guide its really urgent.

DATA: IT_REQ_ITEMS TYPE TABLE OF BAPIEBANC,
IT_REQ_ACC_cccI TYPE TABLE OF BAPIEBKN,
IT_REQ_SERVICES TYPE TABLE OF BAPIESLLC,
WA_REQ_ITEMS TYPE BAPIEBANC,
WA_REQ_ACC_cccI TYPE BAPIEBKN,
WA_REQ_SERVICES TYPE BAPIESLLC,
IT_RET TYPE TABLE OF BAPIRETURN,
it_REQ_SRV_ACCcccI_VALUES TYPE TABLE OF BAPIESKLC,
wa_REQ_SRV_ACCcccI_VALUES TYPE BAPIESKLC,
it_REQUISITION_SERVICES_TEXT type TABLE OF BAPIESLLTX,
wa_REQUISITION_SERVICES_TEXT type BAPIESLLTX.


WA_REQ_ITEMS-PREQ_ITEM = '00010'. "'00001'.
WA_REQ_ITEMS-DOC_TYPE = 'ZASR'.
WA_REQ_ITEMS-PLANT = 'VAMD'.
WA_REQ_ITEMS-SHORT_TEXT = 'SHORTTEXT'.
WA_REQ_ITEMS-STORE_LOC = 'VAMD'.
WA_REQ_ITEMS-TRACKINGNO = 'SA'.
WA_REQ_ITEMS-MAT_GRP = 'S29'.
WA_REQ_ITEMS-QUANTITY = '1'.
WA_REQ_ITEMS-UNIT = 'UA'.
WA_REQ_ITEMS-DELIV_DATE = '20160901'.
WA_REQ_ITEMS-ITEM_CAT = '9'.
WA_REQ_ITEMS-ACCTcccCAT = 'P'.
** 1/2/2017.
WA_REQ_ITEMS-pckg_no = '0000000001'.
WA_REQ_ITEMS-distrib = '2'.
WA_REQ_ITEMS-part_inv = '2'.


APPEND WA_REQ_ITEMS TO IT_REQ_ITEMS.

WA_REQ_ACC_cccI-PREQ_ITEM = '00010'.
WA_REQ_ACC_cccI-SERIAL_NO = '01'.
WA_REQ_ACC_cccI-G_L_ACCT = '50100088'.
WA_REQ_ACC_cccI-BUS_AREA = 'VAMD'.
WA_REQ_ACC_cccI-WBS_ELEM = 'VEPL/C/ADAN_SA'.

APPEND WA_REQ_ACC_cccI TO IT_REQ_ACC_cccI.
* 1.2.2017
WA_REQ_SERVICES-pckg_no = WA_REQ_ITEMS-pckg_no.
WA_REQ_SERVICES-subpckg_no = WA_REQ_SERVICES-pckg_no + 1.
WA_REQ_SERVICES-ext_line = 0.

WA_REQ_SERVICES-LINE_NO = '00010'.
WA_REQ_SERVICES-SERVICE = '350501'.
WA_REQ_SERVICES-QUANTITY = '1'.
WA_REQ_SERVICES-short_text = 'ser_text'.
APPEND WA_REQ_SERVICES TO IT_REQ_SERVICES.


wa_req_srv_acccccI_values-pckg_no = WA_REQ_SERVICES-pckg_no.
wa_req_srv_accccci_values-line_no = WA_REQ_SERVICES-line_no.
wa_req_srv_accccci_values-serno_line = WA_REQ_ACC_Accc-serial_no.
wa_req_srv_accccci_values-serial_no = wa_req_srv_accaccc_values-serno_line.
wa_req_srv_accccci_values-percentage = '100'.
append wa_req_srv_accccci_values to it_REQ_SRV_ACCccci_VALUES .
wa_requisition_services_text-pckg_no = WA_REQ_SERVICES-pckg_no.
wa_requisition_services_text-line_no = wa_req_srv_accccci_values-line_no.
wa_requisition_services_text-text_id = 'LLTX'.
wa_requisition_services_text-format_col = '*'.
append wa_requisition_services_text to it_requisition_services_text.

CALL FUNCTION 'BAPI_REQUISITION_CREATE'
* EXPORTING
* SKIP_ITEMS_WITH_ERROR =
* AUTOMATIC_SOURCE = 'X'
IMPORTING
NUMBER = IOCREPR
TABLES
REQUISITION_ITEMS = IT_REQ_ITEMS
REQUISITION_ACCOUNT_cccIGNMENT = IT_REQ_ACC_cccI
REQUISITION_SERVICES = IT_REQ_SERVICES
REQUISITION_SRV_ACCccci_VALUES = it_REQ_SRV_ACCccci_VALUES
RETURN = IT_RET
REQUISITION_SERVICES_TEXT = it_requisition_services_text

Thank you,

Supriya

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Jelena Perfiljeva
Feb 13, 2017 at 08:58 PM
0

Not sure what's the deal with those "ccc", they make the code unreadable... There is REQUISITION_ACCOUNT_ASSIGNMENT table, seems like a good spot for the account assignment info. Which fields exactly - check with your MM or FI consultant.

Analyze how data is entered in the transaction and search SAP notes, there is the whole bunch of KBAs for this BAPI.

Share
10 |10000 characters needed characters left characters exceeded