cancel
Showing results for 
Search instead for 
Did you mean: 

Line items are different between IDOC and PO

Former Member
0 Kudos

Hi

How can I replicate (create) PO with the same line items that are there in IDOC?

Scenario is...

PO will be replicated from one SAP to another SAP using PORDCR1 message type

Line items in the IDOC are 11,12,13,21,22,23 (all these are main items)

When I process this IDOC, line items in PO are coming either 10,20,30 or 1,2,3 but i need as 11,12,13.

Can you tell me how can I replicate PO with external line item number.

Thanks in Advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

The P.O item number intervals are controlled at the document type level in the below path,

IMG-> MM-> Purchasing-> Purchase order-> Define document types.

Due to above setting, the sytem will allocate the item numbers as 10, 20, 30...ect if you interval is 10.

But if you wanted to create the items with 11,12,13 ..etc, you can directly enter the item number manually in the P.O item, then it will create the line items with the given number.

Regards

Vijay

Former Member
0 Kudos

Hi

I agree with you if we create PO by manually but we replicate PO with IDOC and item number in the PO should be same as item number in the IDOC.

Is there any other way to fulfill my requirement?

Thanks in advance.

Former Member
0 Kudos

Hi

Can anybody suggest the solution for my query?

Former Member
0 Kudos

It was done through a small development.

0 Kudos

This message was moderated.

0 Kudos

Hi Nageswara Rao,

I have a the same problem like you, In IDoc PO Item number is 10, But PO created with item number 1.

Could you please let me know how you solved this problem?

Thanks

Srinivas

Former Member
0 Kudos

Hi

It is possible only through enhancement to have PO line item number same as in IDOC.

Please look into the enhancement details.

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""$"$:(1) Form RENUMBER, End A
*$*$-Start: (1)---------------------------------------------------------------------------------$*$*
ENHANCEMENT 1 ZPO_LINEITEM.    "active version
**
*
* break sealwms01.
TYPES:
BEGIN OF type_item,
source_value TYPE ebelp,
target_value TYPE ebelp,
END OF type_item .

data:wa_item type type_item,
po_item type  bapimepoitem,
po_itemx type bapimepoitemx.

data:lv_ind type i.
FIELD-SYMBOLS:<fs_item> type bapimepoitem,
<fs_itemx> type bapimepoitemx,
<fs_sche>  type bapimeposchedule,
<fs_schex> type bapimeposchedulx.

loop at conversion_poitem into wa_item.
lv_ind = sy-tabix.
loop at cht_poitem ASSIGNING <fs_item> where po_item = wa_item-target_value.
if lv_ind = sy-tabix.
<fs_item>-po_item = wa_item-source_value.
else.
CONTINUE.
endif.
endloop.
loop at cht_poitemx ASSIGNING <fs_itemx> where po_item = wa_item-target_value.
if lv_ind = sy-tabix.
<fs_itemx>-po_item = wa_item-source_value.
else.
CONTINUE.
endif.
endloop.

loop at cht_poschedule ASSIGNING <fs_sche> where po_item = wa_item-target_value.
if lv_ind = sy-tabix.
<fs_sche>-po_item = wa_item-source_value.
else.
CONTINUE.
endif.
endloop.


loop at cht_poschedulex ASSIGNING <fs_schex> where po_item = wa_item-target_value.
if lv_ind = sy-tabix.
<fs_schex>-po_item = wa_item-source_value.
else.
CONTINUE.
endif.
endloop.



endloop.
ENDENHANCEMENT.
*$*$-End: (1)---------------------------------------------------------------------------------$*$*

0 Kudos

Hi Nag,

Thanks for your time and help. Really appreciated your help. I will implement this logic in my system and will let you know.

Thanks

Srinivas