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

BAPI_PR_CREATE issue

Hi ,

i am creating PR for item category L and accassingment category Q.

I have passed all the values.

Now issue is ..in account table i am passing WBS element and cost center.

If i run BAPI wiht below data in SE37 it works fine and generating PR number .

But if i call this BAPI in SE38,, I am getting error Please enter WBS element.

Message class : ME

Error number 83.

Please advise.

Ls_header-PR_TYPE = GC_NB.

Ls_header-AUTO_SOURCE = gc_x.

Ls_headerX-PR_TYPE = gc_x.

Ls_headerX-AUTO_SOURCE = gc_x.

*Ls_ITEM-pREQ_ITEM = '00010'.

Ls_ITEM-MATERIAL = gs_psdata-HEAD_MATNR.

Ls_ITEM-PLANT = gs_psdata-werks.

Ls_ITEM-PUR_GROUP = 'A01'.

Ls_ITEM-QUANTITY = gs_psdata-QUANTITY.

Ls_ITEM-ITEM_CAT = gc_l.

Ls_ITEM-ACCTASSCAT = gc_q.

APPEND ls_item to lt_item.

CLEAR ls_item.

*Ls_ITEMx-pREQ_ITEM = '00010'.

Ls_ITEMx-MATERIAL = GC_X.

Ls_ITEMx-PLANT = GC_X.

Ls_ITEMX-PUR_GROUP = GC_X.

Ls_ITEMx-QUANTITY = GC_X.

Ls_ITEMx-ITEM_CAT = GC_X.

Ls_ITEMx-ACCTASSCAT = GC_X.

APPEND ls_itemx to lt_itemx.

CLEAR ls_itemx.

*Ls_acct-PREQ_ITEM = '00010'.

Ls_acct-SERIAL_NO = 01.

Ls_acct-COSTCENTER = gs_psdata-kostl.

Ls_acct-WBS_ELEMENT = gs_psdata-wbs_element.

append ls_acct to lt_acct.

Ls_acct-SERIAL_NO = 01.

Ls_acct-COSTCENTER = gs_psdata-kostl.

Ls_acct-WBS_ELEMENT = gs_psdata-wbs_element.

append ls_acct to lt_acct.

*Ls_acctx-PREQ_ITEM = '00010'.

Ls_acctx-SERIAL_NO = gc_x.

Ls_acctx-COSTCENTER = GC_X.

Ls_acctX-WBS_ELEMENT = GC_X.

append ls_acctx to lt_acctx.

Ls_acctx-SERIAL_NO = gc_x.

Ls_acctx-COSTCENTER = GC_X.

Ls_acctX-WBS_ELEMENT = GC_X.

append ls_acctx to lt_acctx.

*LS_COMP-PREQ_ITEM = '00010'.

LS_COMP-MATERIAL = gs_psdata-COMP_MATNR.

LS_COMP-PLANT = gs_psdata-werks.

LS_COMP-CHANGE_ID = gc_value_r.

LS_COMP-ENTRY_QUANTITY = gs_psdata-QUANTITY.

APPEND LS_COMP TO LT_COMP.

CLEAR LS_COMP.

*LS_COMPx-PREQ_ITEM = '00010'.

LS_COMPX-MATERIAL = GC_X.

LS_COMPX-CHANGE_ID = 'R'.

LS_COMPX-ENTRY_QUANTITY = GC_X.

LS_COMPx-PLANT = gc_x.

APPEND LS_COMPX TO LT_COMPX.

CLEAR LS_COMPX.

call function 'BAPI_PR_CREATE'

EXPORTING

PRHEADER = Ls_header

PRHEADERX = Ls_headerX

* TESTRUN =

IMPORTING

NUMBER = gv_preqno

* PRHEADEREXP =

tables

RETURN = gt_bapiret

pritem = lt_item

PRITEMX = lt_itemX

PRACCOUNT = lt_acct

* PRACCOUNTPROITSEGMENT =

PRACCOUNTX = lt_acctX

PRCOMPONENTS = LT_COMP

PRCOMPONENTSX = LT_COMPX

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jun 03, 2014 at 12:52 PM

    Probably:

    Ls_acctx-SERIAL_NO = gc_x.

    should be

    Ls_acctx-SERIAL_NO = '01'.


    And uncomment PREQ_ITEM.


    Regards,


    Jarek

    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.