Skip to Content
author's profile photo Former Member
Former Member

BAPI_PO_CREATE1 Error

Hi Friends,

I am getting a error in Purchase Order Create BAPI_PO_CREATE1.

Error :

Please maintain services or limits

Thanks & Regards:

Sridhar.J

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2008 at 10:32 AM

    Hi,

    When we create Purchase Order using "BAPI_PO_CREATE1", it works for all cases but we can have problems when we create Service Items in PO. Either we get an error u201CPlease maintain services or limitsu201D or u201CIn case of Account assignment, please enter acc. assignment data for itemu201D.

    Service PO occurs when we enter item category u2018Du2019 (Service) and Account category u2018Ku2019 (Cost Center).

    When we use BAPI_PO_CREATE1 to create service PO, following tables are populated at item level:

    a) POITEM

    b) POITEMX

    c) POACCOUNT

    d) POACCOUNTX

    e) POSERVICES

    f) POSRVACCESSVALUES

    For service items: POITEM-PCKG_NO = u20180000000001u2019. (assign package no as a dummy number)

    Set PCKG_NO flag in POITEMX table as u2018Xu2019.

    Package No is the link that connect POITEM table to POACCOUNT table through tables POSERVICES and POSRVACCESSVALUES.

    Set POACCOUNT-SERIAL_NO to u201801u2019.

    Set same PCKG_NO to u20180000000001u2019 in POSERVICES table. Maintain two entries in POSERVICES table like this:

    WA_POSERVICES-PCKG_NO = u20180000000001u2019.

    WA_POSERVICES-LINE_NO = u20180000000001u2019.

    WA_POSERVICES-OUTL_IND = u2018Xu2019.

    WA_POSERVICES-SUBPCKG_NO = u20180000000003u2019. (Dummy No.)

    WA_POSERVICES-QUANTITY = u2018100.000u2019.

    WA_POSERVICES-BASE_UOM = u2018EAu2019.

    WA_POSERVICES-PRICE_UNIT = u20181u2019.

    WA_POSERVICES-GR_PRICE = u2018100.000u2019.

    WA_POSERVICES-SHORT_TEXT = u2018SERVICE TESTu2019.

    APPEND WA_POSERVICES TO IT_POSERVICES.

    WA_POSERVICES- PCKG_NO = u20180000000003u2019.

    WA_POSERVICES- LINE_NO = u20180000000002u2019.

    WA_POSERVICES-QUANTITY = u201810.000u2019.

    WA_POSERVICES- BASE_UOM = u2018EAu2019.

    WA_POSERVICES--PRICE_UNIT = u20181u2019.

    WA_POSERVICES-GR_PRICE = u2018100.000u2019.

    WA_POSERVICES-SHORT_TEXT = u2018SERVICE 1u2019.

    WA_POSERVICES-MATL_GROUP = u20180012u2019.

    APPEND WA_POSERVICES TO IT_POSERVICES.

    Set PCKG_NO as SUB_PCKG_NO in table POSRVACCESSVALUES this:

    WA_POSRVACCESSVALUES-PCKG_NO = u20180000000003u2019.

    WA_POSRVACCESSVALUES-LINE_NO = u20180000000002u2019.

    WA_POSRVACCESSVALUES-SERNO_LINE = u201801u2019.

    WA_POSRVACCESSVALUES-SERIAL_NO = u201801u2019.

    WA_POSRVACCESSVALUES-QUANTITY = u201910.000u2019.

    APPEND WA_POSRVACCESSVALUES TO IT_ POSRVACCESSVALUES.

    This logic will work definitely and PO Service Items will be created.

    Thanks & Regards.

    Rakesh Bajaj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:39 PM

    Hi,

    It seems that you might use position type (or purchase order type?) which requires service directory items (parameters POSERVICES and POSRVACCESSVALUES). I did it some time ago and do not remember precisely, but there is a trick on filling in POSERVICES properly as it has hierarchic structure via PCKG_NO, SUBPCKG_NO fields. I would recommend to create some purchase order manually and then try to test BAPI_PO_GETDETAIL just to explore return parameters. Hope this will help somehow.

    Thanks

    Vikranth

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 17, 2008 at 12:46 PM

    Hi sridhar,

    Here below is the example .

    Step 1 : First extend the table EEKO with custom fileds .

    Step 2 : Extend Structure BAPI_TE_MEPOHEADER and BAPI_TE_MEPOHEADERZ with same fields.

    Step 3 : While extending BAPI_TE_MEPOHEADERX , make sure that for custom fields you have to give 1 CHAR ( BAPI UPDATE ).

    Step 4 : In program you have collect the custom field values and pass append both structures ( ie BAPI_TE_MEPOHEADER and BAPI_TE_MEPOHEADERX ) to EXTENSIONIN Structure and values to EXTENSIONIN VALUEPART1.

    Example :

    DATA : BEGIN OF T_EXTENSIONIN OCCURS 0.

    INCLUDE STRUCTURE BAPIPAREX .

    DATA: END OF T_EXTENSIONIN .

    DATA : T_BAPI_TE_MEPOHEADER TYPE BAPI_TE_MEPOHEADER.

    DATA : T_BAPI_TE_MEPOHEADERX TYPE BAPI_TE_MEPOHEADERX.

    DATA : T_CUSTDATA_IN TYPE BAPI_TE_MEPOHEADER.

    DATA : T_CUSTDATA_INX TYPE BAPI_TE_MEPOHEADERX.

    • Customer Data

    T_CUSTDATA_IN-ZZRLDATE = '20040110'.

    T_CUSTDATA_IN-ZZRADATE = '20041210'.

    T_CUSTDATA_IN-ZZPOSTATUS = 'OPEN'.

    T_CUSTDATA_IN-ZZSTATE = 'TN'.

    T_CUSTDATA_IN-ZZCITY = 'MEP'.

    T_CUSTDATA_INX-ZZRLDATE = 'X'.

    T_CUSTDATA_INX-ZZRADATE = 'X'.

    T_CUSTDATA_INX-ZZPOSTATUS = 'X'.

    T_CUSTDATA_INX-ZZSTATE = 'X'.

    T_CUSTDATA_INX-ZZCITY = 'X'.

    ********move custom data

    MOVE 'BAPI_TE_MEPOHEADER' TO T_EXTENSIONIN-STRUCTURE.

    *CLEAR T_BAPI_TE_PO_HEADER-PO_NUMBER.

    MOVE-CORRESPONDING T_CUSTDATA_IN TO T_BAPI_TE_MEPOHEADER.

    MOVE T_BAPI_TE_MEPOHEADER TO T_EXTENSIONIN-VALUEPART1.

    APPEND T_EXTENSIONIN.

    MOVE 'BAPI_TE_MEPOHEADERX' TO T_EXTENSIONIN-STRUCTURE.

    *CLEAR T_BAPI_TE_PO_HEADER-PO_NUMBER.

    MOVE-CORRESPONDING T_CUSTDATA_INX TO T_BAPI_TE_MEPOHEADERX.

    MOVE T_BAPI_TE_MEPOHEADERX TO T_EXTENSIONIN-VALUEPART1.

    APPEND T_EXTENSIONIN.

    Finally pass this T_EXTENIONIN to BAPI_PO_CREATE1 ( EXTENSIONIN )..

    I think this will help you...

    thanks

    karthik

    happy learning

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 11, 2008 at 10:37 AM

    i am sending a program follow this this might be helpfull

    &----


    *& Report ZBAPI_PO

    *&

    &----


    *&

    *&

    &----


    REPORT ZBAPI_PO.

    TYPES : BEGIN OF TY_HEAD,

    ident(4) type c,

    COMP_CODE(4) type c,

    DOC_TYPE(4) type c,

    VENDOR(10) type c,

    PMNTTRMS(4) type c,

    PURCH_ORG(4) type c,

    PUR_GROUP(3) type c,

    CURRENCY(5) type c,

    DOC_DATE(10) type c,

    INCOTERMS1(3) type c,

    INCOTERMS2(28) type c,

    end of ty_head.

    TYPES : begin of ty_item,

    ident(4) type c,

    PO_ITEM(5) type c,

    MATERIAL(18) type c,

    QUANTITY(13) type c,

    MATL_GROUP(9) type c,

    PLANT(4) type c,

    STGE_LOC(4) type c,

    TRACKINGNO(10) type c,

    PREQ_NAME(12) type c,

    TAX_CODE(2) type c,

    NET_PRICE(28) type c,

    DELIVERY_DATE(10) type c,

    end of ty_item.

    data : wa_head type ty_head,

    tt_head type standard table of ty_head.

    data : wa_item type ty_item,

    tt_item type standard table of ty_item.

    DATA : WA_BAPIMEPOHEADER TYPE BAPIMEPOHEADER,

    WA_BAPIMEPOHEADERX TYPE BAPIMEPOHEADERX,

    WA_BAPIMEPOITEM TYPE BAPIMEPOITEM,

    WA_BAPIMEPOITEMX TYPE BAPIMEPOITEMX,

    WA_BAPIMEPOSCHEDULE TYPE BAPIMEPOSCHEDULE,

    WA_BAPIMEPOSCHEDULX TYPE BAPIMEPOSCHEDULX.

    DATA : TT_BAPIMEPOHEADER TYPE STANDARD TABLE OF BAPIMEPOHEADER,

    TT_BAPIMEPOHEADERX TYPE STANDARD TABLE OF BAPIMEPOHEADERX,

    TT_BAPIMEPOITEM TYPE STANDARD TABLE OF BAPIMEPOITEM,

    TT_BAPIMEPOITEMX TYPE STANDARD TABLE OF BAPIMEPOITEMX,

    TT_BAPIMEPOSCHEDULE TYPE STANDARD TABLE OF BAPIMEPOSCHEDULE,

    TT_BAPIMEPOSCHEDULX TYPE STANDARD TABLE OF BAPIMEPOSCHEDULX.

    data : wa_return type bapiret2.

    DATA : TT_RETURN TYPE STANDARD TABLE OF BAPIRET2.

    data : v_msg type string.

    data : q_fname type string.

    data : v_doc_date(10),

    v_del_date(10),

    v_amount(16).

    parameters : p_fname type rlgrap-filename.

    parameters : s_fname type rlgrap-filename.

    at selection-screen on value-request for p_fname.

    CALL FUNCTION 'F4_FILENAME'

    • EXPORTING

    • PROGRAM_NAME = SYST-CPROG

    • DYNPRO_NUMBER = SYST-DYNNR

    • FIELD_NAME = ' '

    IMPORTING

    FILE_NAME = p_fname

    .

    move p_fname to q_fname.

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    FILENAME = q_fname

    FILETYPE = 'ASC'

    HAS_FIELD_SEPARATOR = 'X'

    • HEADER_LENGTH = 0

    • READ_BY_LINE = 'X'

    • DAT_MODE = ' '

    • CODEPAGE = ' '

    • IGNORE_CERR = ABAP_TRUE

    • REPLACEMENT = '#'

    • CHECK_BOM = ' '

    • VIRUS_SCAN_PROFILE =

    • NO_AUTH_CHECK = ' '

    • IMPORTING

    • FILELENGTH =

    • HEADER =

    TABLES

    DATA_TAB = tt_head

    • EXCEPTIONS

    • FILE_OPEN_ERROR = 1

    • FILE_READ_ERROR = 2

    • NO_BATCH = 3

    • GUI_REFUSE_FILETRANSFER = 4

    • INVALID_TYPE = 5

    • NO_AUTHORITY = 6

    • UNKNOWN_ERROR = 7

    • BAD_DATA_FORMAT = 8

    • HEADER_NOT_ALLOWED = 9

    • SEPARATOR_NOT_ALLOWED = 10

    • HEADER_TOO_LONG = 11

    • UNKNOWN_DP_ERROR = 12

    • ACCESS_DENIED = 13

    • DP_OUT_OF_MEMORY = 14

    • DISK_FULL = 15

    • DP_TIMEOUT = 16

    • OTHERS = 17

    .

    IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    clear q_fname.

    at selection-screen on value-request for s_fname.

    CALL FUNCTION 'F4_FILENAME'

    • EXPORTING

    • PROGRAM_NAME = SYST-CPROG

    • DYNPRO_NUMBER = SYST-DYNNR

    • FIELD_NAME = ' '

    IMPORTING

    FILE_NAME = s_fname

    .

    move s_fname to q_fname.

    CALL FUNCTION 'GUI_UPLOAD'

    EXPORTING

    FILENAME = q_fname

    FILETYPE = 'ASC'

    HAS_FIELD_SEPARATOR = 'X'

    • HEADER_LENGTH = 0

    • READ_BY_LINE = 'X'

    • DAT_MODE = ' '

    • CODEPAGE = ' '

    • IGNORE_CERR = ABAP_TRUE

    • REPLACEMENT = '#'

    • CHECK_BOM = ' '

    • VIRUS_SCAN_PROFILE =

    • NO_AUTH_CHECK = ' '

    • IMPORTING

    • FILELENGTH =

    • HEADER =

    TABLES

    DATA_TAB = tt_item

    • EXCEPTIONS

    • FILE_OPEN_ERROR = 1

    • FILE_READ_ERROR = 2

    • NO_BATCH = 3

    • GUI_REFUSE_FILETRANSFER = 4

    • INVALID_TYPE = 5

    • NO_AUTHORITY = 6

    • UNKNOWN_ERROR = 7

    • BAD_DATA_FORMAT = 8

    • HEADER_NOT_ALLOWED = 9

    • SEPARATOR_NOT_ALLOWED = 10

    • HEADER_TOO_LONG = 11

    • UNKNOWN_DP_ERROR = 12

    • ACCESS_DENIED = 13

    • DP_OUT_OF_MEMORY = 14

    • DISK_FULL = 15

    • DP_TIMEOUT = 16

    • OTHERS = 17

    .

    IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    loop at tt_head into wa_head.

    WRITE : wa_head-DOC_DATE TO v_doc_date. "converting the date to output length compatable

    move : wa_head-COMP_CODE to WA_BAPIMEPOHEADER-COMP_CODE,

    wa_head-DOC_TYPE to WA_BAPIMEPOHEADER-DOC_TYPE,

    wa_head-VENDOR to WA_BAPIMEPOHEADER-VENDOR,

    wa_head-PMNTTRMS to WA_BAPIMEPOHEADER-PMNTTRMS,

    wa_head-PURCH_ORG to WA_BAPIMEPOHEADER-PURCH_ORG,

    wa_head-PUR_GROUP to WA_BAPIMEPOHEADER-PUR_GROUP,

    wa_head-CURRENCY to WA_BAPIMEPOHEADER-CURRENCY,

    • wa_head-DOC_DATE to WA_BAPIMEPOHEADER-DOC_DATE,

    v_doc_date to WA_BAPIMEPOHEADER-DOC_DATE,

    wa_head-INCOTERMS1 to WA_BAPIMEPOHEADER-INCOTERMS1,

    wa_head-INCOTERMS2 to WA_BAPIMEPOHEADER-INCOTERMS2,

    'X' to WA_BAPIMEPOHEADERX-COMP_CODE,

    'X' to WA_BAPIMEPOHEADERX-DOC_TYPE,

    'X' to WA_BAPIMEPOHEADERX-VENDOR,

    'X' to WA_BAPIMEPOHEADERX-PMNTTRMS,

    'X' to WA_BAPIMEPOHEADERX-PURCH_ORG,

    'X' to WA_BAPIMEPOHEADERX-PUR_GROUP,

    'X' to WA_BAPIMEPOHEADERX-CURRENCY,

    'X' to WA_BAPIMEPOHEADERX-DOC_DATE,

    'X' to WA_BAPIMEPOHEADERX-INCOTERMS1,

    'X' to WA_BAPIMEPOHEADERX-INCOTERMS2.

    LOOP AT TT_ITEM INTO WA_ITEM WHERE IDENT = WA_HEAD-IDENT.

    WRITE : wa_item-DELIVERY_DATE TO v_del_date. "converting the date to output length compatable

    WRITE : wa_item-NET_PRICE TO v_amount. "converting the amount to output length compatable

    move : wa_item-PO_ITEM to wa_BAPIMEPOITEM-PO_ITEM,

    wa_item-MATERIAL to WA_BAPIMEPOITEM-MATERIAL,

    wa_item-QUANTITY to WA_BAPIMEPOITEM-QUANTITY,

    wa_item-MATL_GROUP to WA_BAPIMEPOITEM-MATL_GROUP,

    wa_item-PLANT to WA_BAPIMEPOITEM-PLANT,

    wa_item-STGE_LOC to WA_BAPIMEPOITEM-STGE_LOC,

    wa_item-TRACKINGNO to WA_BAPIMEPOITEM-TRACKINGNO,

    wa_item-PREQ_NAME to WA_BAPIMEPOITEM-PREQ_NAME,

    wa_item-tax_code to WA_BAPIMEPOITEM-tax_code,

    • wa_item-NET_PRICE to WA_BAPIMEPOITEM-NET_PRICE.

    v_amount to WA_BAPIMEPOITEM-NET_PRICE.

    APPEND WA_BAPIMEPOITEM TO TT_BAPIMEPOITEM.

    MOVE : wa_item-PO_ITEM to WA_BAPIMEPOITEMX-PO_ITEM,

    'X' to WA_BAPIMEPOITEMX-PO_ITEMX,

    'X' to WA_BAPIMEPOITEMX-MATERIAL,

    'X' to WA_BAPIMEPOITEMX-QUANTITY,

    'X' to WA_BAPIMEPOITEMX-MATL_GROUP,

    'X' to WA_BAPIMEPOITEMX-PLANT,

    'X' to WA_BAPIMEPOITEMX-STGE_LOC,

    'X' to WA_BAPIMEPOITEMX-TRACKINGNO,

    'X' to WA_BAPIMEPOITEMX-PREQ_NAME,

    'X' to WA_BAPIMEPOITEMX-tax_code,

    'X' to WA_BAPIMEPOITEMX-NET_PRICE.

    APPEND WA_BAPIMEPOITEMX TO TT_BAPIMEPOITEMX.

    MOVE : wa_item-PO_ITEM to WA_BAPIMEPOSCHEDULE-PO_ITEM,

    • wa_item-DELIVERY_DATE to WA_BAPIMEPOSCHEDULE-DELIVERY_DATE.

    v_del_date(10) to WA_BAPIMEPOSCHEDULE-DELIVERY_DATE.

    APPEND WA_BAPIMEPOSCHEDULE TO TT_BAPIMEPOSCHEDULE.

    MOVE : wa_item-PO_ITEM to WA_BAPIMEPOSCHEDULX-PO_ITEM,

    'X' to WA_BAPIMEPOSCHEDULX-PO_ITEMX,

    'X' to WA_BAPIMEPOSCHEDULX-DELIVERY_DATE.

    APPEND WA_BAPIMEPOSCHEDULX TO TT_BAPIMEPOSCHEDULX.

    ENDLOOP.

    AT END OF IDENT.

    CALL FUNCTION 'BAPI_PO_CREATE1'

    EXPORTING

    POHEADER = WA_BAPIMEPOHEADER

    POHEADERX = WA_BAPIMEPOHEADERX

    • POADDRVENDOR =

    • TESTRUN =

    • MEMORY_UNCOMPLETE =

    • MEMORY_COMPLETE =

    • POEXPIMPHEADER =

    • POEXPIMPHEADERX =

    • VERSIONS =

    • NO_MESSAGING =

    • NO_MESSAGE_REQ =

    • NO_AUTHORITY =

    • NO_PRICE_FROM_PO =

    • IMPORTING

    • EXPPURCHASEORDER =

    • EXPHEADER =

    • EXPPOEXPIMPHEADER =

    TABLES

    RETURN = TT_RETURN

    POITEM = TT_BAPIMEPOITEM

    POITEMX = TT_BAPIMEPOITEMX

    • POADDRDELIVERY =

    POSCHEDULE = TT_BAPIMEPOSCHEDULE

    POSCHEDULEX = TT_BAPIMEPOSCHEDULX

    • POACCOUNT =

    • POACCOUNTPROFITSEGMENT =

    • POACCOUNTX =

    • POCONDHEADER =

    • POCONDHEADERX =

    • POCOND =

    • POCONDX =

    • POLIMITS =

    • POCONTRACTLIMITS =

    • POSERVICES =

    • POSRVACCESSVALUES =

    • POSERVICESTEXT =

    • EXTENSIONIN =

    • EXTENSIONOUT =

    • POEXPIMPITEM =

    • POEXPIMPITEMX =

    • POTEXTHEADER =

    • POTEXTITEM =

    • ALLVERSIONS =

    • POPARTNER =

    • POCOMPONENTS =

    • POCOMPONENTSX =

    • POSHIPPING =

    • POSHIPPINGX =

    • POSHIPPINGEXP =

    .

    LOOP AT tt_return into wa_return WHERE type = 'S' OR type = 'I' OR type = 'W'.

    EXIT.

    ENDLOOP.

    IF sy-subrc = 0.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

    .

    ELSE.

    &----


    *& ROLL BACK

    &----


    CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'

    .

    ENDIF.

    ENDAT.

    loop at tt_return into wa_return.

    CALL FUNCTION 'FORMAT_MESSAGE'

    EXPORTING

    ID = wa_return-id

    LANG = sy-langu

    no = wa_return-number

    v1 = wa_return-message_v1

    v2 = wa_return-message_v2

    v3 = wa_return-message_v3

    v4 = wa_return-message_v4

    IMPORTING

    MSG = v_msg

    EXCEPTIONS

    NOT_FOUND = 1

    OTHERS = 2

    .

    IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    write : v_msg.

    endloop.

    endloop.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.