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_PR_CHANGE with custom field

Former Member
0 Likes
2,963

Hello All,

I'm using BAPI_PR_CHANGE to upload a custom field value. Here is my code:

wa_pheader TYPE BAPIMEREQHEADER-PREQ_NO,

s_bapi_te_mereqitem TYPE bapi_te_mereqitem,

s_bapi_te_mereqitemx TYPE bapi_te_mereqitem,

t_bapi_te_mereqitem TYPE STANDARD TABLE OF bapi_te_mereqitem,

t_bapi_te_mereqitemx TYPE STANDARD TABLE OF bapi_te_mereqitem,

   lv_extensionin type BAPIPAREX,

   lt_extensionin type STANDARD TABLE OF BAPIPAREX.

wa_pheader = wa_upload-banfn.

s_bapi_te_mereqitem-PREQ_ITEM = wa_upload-bnfpo.

s_bapi_te_mereqitem-zzarno = wa_upload-zzarno.

s_bapi_te_mereqitemx-PREQ_ITEM = wa_upload-bnfpo.

s_bapi_te_mereqitemx-zzarno = 'X'.

lv_extensionin-structure = 'BAPI_TE_MEREQITEM'.

lv_extensionin-valuepart1 = s_bapi_te_mereqitem.

APPEND lv_extensionin TO lt_extensionin .

lv_extensionin-structure = 'BAPI_TE_MEREQITEMX'.

lv_extensionin-valuepart1 = s_bapi_te_mereqitemx.

APPEND lv_extensionin TO lt_extensionin .

CALL FUNCTION 'BAPI_PR_CHANGE'

   EXPORTING

     number                       = wa_pheader

  TABLES

    RETURN                       = it_return

    EXTENSIONIN                  lt_extensionin.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

     EXPORTING

       wait   = 'X'

     IMPORTING

       return = it_commitret.

I can see the success message which says 'PR Number has been changed'. But the custom field value is still not updated. Is there anything which I'm mistaken ?

Regards.


Hello All,

I'm using BAPI_PR_CHANGE to upload a custom field value. Here is my code:

wa_pheader TYPE BAPIMEREQHEADER-PREQ_NO,

s_bapi_te_mereqitem TYPE bapi_te_mereqitem,

s_bapi_te_mereqitemx TYPE bapi_te_mereqitem,

t_bapi_te_mereqitem TYPE STANDARD TABLE OF bapi_te_mereqitem,

t_bapi_te_mereqitemx TYPE STANDARD TABLE OF bapi_te_mereqitem,

   lv_extensionin type BAPIPAREX,

   lt_extensionin type STANDARD TABLE OF BAPIPAREX.

wa_pheader = wa_upload-banfn.

s_bapi_te_mereqitem-PREQ_ITEM = wa_upload-bnfpo.

s_bapi_te_mereqitem-zzarno = wa_upload-zzarno.

s_bapi_te_mereqitemx-PREQ_ITEM = wa_upload-bnfpo.

s_bapi_te_mereqitemx-zzarno = 'X'.

lv_extensionin-structure = 'BAPI_TE_MEREQITEM'.

lv_extensionin-valuepart1 = s_bapi_te_mereqitem.

APPEND lv_extensionin TO lt_extensionin .

lv_extensionin-structure = 'BAPI_TE_MEREQITEMX'.

lv_extensionin-valuepart1 = s_bapi_te_mereqitemx.

APPEND lv_extensionin TO lt_extensionin .

CALL FUNCTION 'BAPI_PR_CHANGE'

   EXPORTING

     number                       = wa_pheader

  TABLES

    RETURN                       = it_return

    EXTENSIONIN                  lt_extensionin.

    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

     EXPORTING

       wait   = 'X'

     IMPORTING

       return = it_commitret.

I can see the success message which says 'PR Number has been changed'. But the custom field value is still not updated. Is there anything which I'm mistaken ?

Regards.


2 REPLIES 2
Read only

Former Member
0 Likes
2,006

Hi Roshni,

The best way to analyze this is debug and see if your field is getting changed. At times updation takes time.

Read only

silver1
Explorer
0 Likes
2,006

It's a very late reply and hope it helps others.

Please populate table parameters PRITEMS and PRITEMX even they are not changed.