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_CREAT- Adding new components

Former Member
0 Likes
2,190

Hi,

i am trying to replace existing BOM of item ( category L'. ) with new materails . I passed new components in table below

BAPI_PR_CREATE

PRCOMPONENTS

PRCOMPONENTSX

PR is created , but stil old BOM  of  PR LINE Item is appearing.  instead of new components i added in above table.

Please if any one have program, Please share.

Regards

Ramakrishnaiah Y

1 ACCEPTED SOLUTION
Read only

former_member201275
Active Contributor
0 Likes
1,546

Hi,

So, you are filling PRCOMPONENTS. Are you filling PRCOMPONENTSX with 'X'?

Maybe try PRITEM and PRITEMX.


5 REPLIES 5
Read only

Former Member
0 Likes
1,546

Hi Experts,

Any body have clue and worked on above requirement. Please send me sample code if you have.

Regards

Ramakrishnaiah Y

Read only

0 Likes
1,546

HI,

Any one any inputs on it. How to replace existing BOM of subcon items iwth new components using BAPI...

Regards

Ramakrishnaiah Y

Read only

former_member201275
Active Contributor
0 Likes
1,547

Hi,

So, you are filling PRCOMPONENTS. Are you filling PRCOMPONENTSX with 'X'?

Maybe try PRITEM and PRITEMX.


Read only

0 Likes
1,546

Hi Glen,

Thanks for your reply. Yes i am passing data to both PRCOMPONENTS and X table. But not updated.

Any one have sample code for this please.

PRITEM AND PRITEMX are used to fill PR items.  But i need add componentes for each PR item.

Regards

Ramakrishnaiah Y

Read only

0 Likes
1,546

Hi,

i can able to achieve this by calling FM ' ME_COMPONENTS_UPDATE'  twice.

one time for deleting the existing components of PR items and one more time new values

    lv_rsnum = ls_eban-rsnum"use this for comp insert

     ls_vmdpm_i-ebeln  ls_vmdpm_d-ebeln  =   ls_eban-banfn.

     ls_vmdpm_i-ebelp  ls_vmdpm_d-ebelp  = ls_eban-bnfpo.

     ls_vmdpm_i-rsnum  ls_vmdpm_d-rsnum  = ls_eban-rsnum.

     ls_vmdpm_i-sobkz  ls_vmdpm_d-sobkz  = 'Q'..

     ls_vmdpm_i-knttp   ls_vmdpm_d-knttp  = 'Q'.

     ls_vmdpm_d-updkz   = 'D'.

     append ls_vmdpm_d to lt_vmdpm_d.

     clear ls_vmdpm_d.

call function 'ME_COMPONENTS_UPDATE' in update task

     exporting

       i_number = gv_preqno

     tables

       t_vmdpm  = lt_vmdpm_d.

   commit work .

* Insert new components

     ls_vmdpm_i-updkz = 'I'.

     append ls_vmdpm_i to lt_vmdpm_i.

     clear ls_vmdpm_i.


call function 'ME_COMPONENTS_UPDATE' in update task

       exporting

         i_number = gv_preqno

       tables

         t_vmdpm  = lt_vmdpm_i

         t_xmdpm  = lt_xmdpm

         t_xmdsb  = lt_xmdsb

         t_mdlb   = lt_mdlb.