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: 

LSMW - skipping PO w/ no line items

Former Member
0 Kudos

Hello All,

I'm loading open PO's using LSMW and would like to skip the Purchase Order Header(MBEPOH) if there are no Purchase Order Items(MBEPOI). I'm using two input files, one for the header and one for items. Any ideas?

Thanks,

Joe

1 ACCEPTED SOLUTION

Former Member
0 Kudos

In the 'Field Mapping' section, you should have '_END_OF_TRANSACTION_' event. In this event the default is 'transfer_transaction'. Here you need to do a check as follows.


READ TABLE item_tab INDEX 1.(item_tab is your input structure for the items)

If sy-subrc = 0.
*-- there is atleast one item
  transfer_transaction.
else.
*-- no items for this PO
  skip_transaction.
endif.

Regards,

Srinivas

1 REPLY 1

Former Member
0 Kudos

In the 'Field Mapping' section, you should have '_END_OF_TRANSACTION_' event. In this event the default is 'transfer_transaction'. Here you need to do a check as follows.


READ TABLE item_tab INDEX 1.(item_tab is your input structure for the items)

If sy-subrc = 0.
*-- there is atleast one item
  transfer_transaction.
else.
*-- no items for this PO
  skip_transaction.
endif.

Regards,

Srinivas