Application Development 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: 

BAPI_PR_CREATE update field ADPRI

Former Member
0 Kudos


Hi Gurus,,

Someone knows how to fill this field when creating a PR? I am using BAPI_PR_CREATE and send the value N(3) to this field through the parameter internal table pritem and pritemx ('X') but this fields doesn't get updated.

1) Perhaps I am filling an incorrect value, so Which table has the list of values of this field?

2) How Can I fill this field?

.

.

.

.

.

wa_item-prio_requirement  = '001'

APPEND wa_item TO t_item.

.

.

.

.

wa_itemx-prio_requirement = 'X'.

APPEND wa_itemx TO t_itemx.

* Create the PR with the above data's.
  CALL FUNCTION 'BAPI_PR_CREATE'
    EXPORTING
      prheader     = wa_header
      prheaderx    = wa_headerx
    IMPORTING
      number       = pw_pr_number
    TABLES
      return       = t_return
      pritem       = t_item
      pritemx      = t_itemx

.

.

.

.

19 REPLIES 19

Former Member
0 Kudos

The field 'prio_requirement' should update the field Requirement Priority on item level, this field is in the tab Source of Supply. Is it the same field that you trying to update?

Check this document for some reference regarding the bapi fields 'prio_requirement' and 'prio_urgency'.

Regards,

Felipe

0 Kudos

Hi Felipe,

I found this, can you help how to solve it? thank you for your time.

Note 868736 - Field selection for SPEC2000 fields in purchase requisition

Symptom

It is not possible to set field selection for SPEC2000 fields in enjoy transactions of purchase requisition, Viz., ME51N, ME52N.

Other Terms

ADMOI, ADPRI, ADACN, fieldselection, Model ID code, Order Priority, Aircraft Registration Number

0 Kudos

Enrique, this note is related to SAP Discrete Industries and Mill Products, is it your case? I think that note won't help you.

I have found two notes that match with your issue, but seems to work only with Purchase order BAPI's:

578063 - Purchase order BAPI's in A&D - 1

595623 - Purchase order BAPI's in A&D - 2

Regards,

Felipe

0 Kudos

Hi Felipe,

This is the technical info of the field ADPRI. I am using BAPI_PR_CREATE. I can create the PR but this field ADPRI is not saved whe creating the PR.

I have read the notes, but I dont understand how to solve my problem.

Thanks for answer.

0 Kudos

Enrique, the field that you are trying to update does not exists as parameter in the BAPI_PR_CREATE, the OSS notes that I posted solves the problem in the bapis for purchase order but I am not sure if solves for the PR bapi's. I recommend you to contact SAP openning a ticket.

Regards,

Felipe

0 Kudos

Hi Felipe,

So, I was using the wrong field in the structure? take a look at the images, theres is a table with the values of the combo.

DATA:

t_item        LIKE TABLE OF bapimereqitemimp WITH HEADER LINE,

CALL FUNCTION 'BAPI_PR_CREATE'
    EXPORTING
      prheader     = wa_header
      prheaderx    = wa_headerx
    IMPORTING
      number       = pw_pr_number
    TABLES
      return       = t_return
      pritem       = t_item
      pritemx      = t_itemx
      praccount    = t_praccount
      praccountx   = t_praccountx
      "pritemsource = t_itemsource
      "pritemtext   = t_itext
      EXTENSIONIN  = lt_extensionin
    EXCEPTIONS
      OTHERS       = 1.

0 Kudos

The fields 'prio_requirement' and 'prio_urgency' are from tab 'Source of Supply' tab:

0 Kudos

Hi Felipe,

Those fields doesn't exists in the PR, perhaps they are hidden.

Can you show me please how to make them visible in the Source of Supply Tab?

Thanks Felipe

0 Kudos

Hi Felipe,

I have found this note about fields PRIO_URG and PRIO_REQ


840488 - Priority fields in ME51N do not have a function


0 Kudos

Felipe,

I have found this.

0 Kudos

Enrique, in my first reply I posted a link with a step by step of this process:

Regards,

Felipe

AnoopMayamkote
Participant
0 Kudos

Hi,

Please do the Commit Work after the BAPI and put wait for 5 seconds it may work.

Thanks & Regards

Anoop Kumar

0 Kudos

Hi Annop,

Yes I have already done that, this is how I make commit..

CALL FUNCTION 'BAPI_PR_CREATE'

     EXPORTING

       prheader     = wa_header

       prheaderx    = wa_headerx

     IMPORTING

       number       = pw_pr_number

     TABLES

       return       = t_return

       pritem       = t_item

       pritemx      = t_itemx

       praccount    = t_praccount

       praccountx   = t_praccountx

       "pritemsource = t_itemsource

       "pritemtext   = t_itext

       EXTENSIONIN  = lt_extensionin

     EXCEPTIONS

       OTHERS       = 1.

       IF pw_pr_number IS NOT INITIAL.

         CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

       ENDIF.


Is it necesary to put a 5 seconds wait?


When I go to ME52N and give a value to the field ADPRI there's no problem, but when I create the PR using BAPI_PR_CREATE this field doesn't save the value I gave it


Thanks for answer

0 Kudos

just check after commit wats the error avilable in the return (t_return) internal table

0 Kudos

Hi Anoop,

I don't have any error, the BAPI returns the number generated for the PR, I go to ME53N to check the PR and I see all the fields sent where updated except the ADPRI field.

Thanks for answer.

raymond_giuseppi
Active Contributor
0 Kudos

Did you also pass value in PRIO_URGENCY field, also look for Warning messages in RETURN (not Error ones) ?

Regards,

Raymond

0 Kudos

Hi Raymond,

I have updated both fields, but nothing.

DATA:

t_item        LIKE TABLE OF bapimereqitemimp WITH HEADER LINE,

t_itemx       LIKE TABLE OF bapimereqitemx WITH HEADER LINE,

wa_item       TYPE bapimereqitemimp,

wa_itemx      TYPE bapimereqitemx

wa_item-prio_requirement        = wa_gt_data-adpri.
wa_item-PRIO_URGENCY      = wa_gt_data-adpri.

APPEND wa_item TO t_item.

wa_itemx-prio_requirement = 'X'.

wa_itemx-PRIO_URGENCY     = 'X'.

APPEND wa_itemx TO t_itemx.

* Create the PR with the above data's.

   CALL FUNCTION 'BAPI_PR_CREATE'

     EXPORTING

       prheader     = wa_header

       prheaderx    = wa_headerx

     IMPORTING

       number       = pw_pr_number

     TABLES

       return       = t_return

       pritem       = t_item

       pritemx      = t_itemx

       praccount    = t_praccount

       praccountx   = t_praccountx

       "pritemsource = t_itemsource

       "pritemtext   = t_itext

       EXTENSIONIN  = lt_extensionin

     EXCEPTIONS

       OTHERS       = 1.

       IF pw_pr_number IS NOT INITIAL.

         CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

       ENDIF.

     FIELD-SYMBOLS: <retorno> like BAPIRET2.

     LOOP AT t_return ASSIGNING <retorno>.

         WRITE:<retorno>-message.

     ENDLOOP.

0 Kudos

Some translation missing ?

Nevertheless, did you get warning message in RETURN, could you perform some test on your Customizing of FM PR_PRIO_DETERMINE which converts BAPI parameter PRITEM structure BAPIMEREQITEMIMP to MEREQ_ITEM structure or set a break-point at start of this FM and check your program ?

Some Customizing may be missing, are you actually working in Aerospace & Defense Industry (SPEC 2000),; is there an activation record in table PACT, etc.

Regards,

Raymond

0 Kudos

Hi Raymond,

Nope, I work in a construction company, as Felipe said, I think I must use perhaps then "Source Supply Tab", here there are two fields Priority and Urgency.

But these fields are hidden in the me51n, how can I make them visible? which part of SPRO