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

Custom processing fm for ZPORDCH

Former Member
0 Likes
598

Hi Experts,

Please help me for imp query. Am developing Z function module for custom PORDRCH idoc type. Am not sure how to handle below functionality using bapi_po _change,

                         Delete an Item line?

                          Add an item line?

                         PO line change?

                          In case of failure, how to hold the document change?

Suppose initailly PO has 3 line items and in next run, po is changed and deleted 1 line item, will the BAPI_PO_Change automatically handle the situation or should i manually check EKPO table and validate what has changed before passing data to Bapi_PO_Change?

I have researched through the forum and BAPI documentation, however could not find any proper solution. Please help me, thanks.

Regards,

MB

Hi Experts,

Please help me for imp query. Am developing Z function module for custom PORDRCH idoc type. Am not sure how to handle below functionality using bapi_po _change,

                         Delete an Item line?

                          Add an item line?

                         PO line change?

                          In case of failure, how to hold the document change?

Suppose initailly PO has 3 line items and in next run, po is changed and deleted 1 line item, will the BAPI_PO_Change automatically handle the situation or should i manually check EKPO table and validate what has changed before passing data to Bapi_PO_Change?

I have researched through the forum and BAPI documentation, however could not find any proper solution. Please help me, thanks.

Regards,

MB

4 REPLIES 4
Read only

Former Member
0 Likes
557

It shall be helpful if atleast approach is mentioned

Read only

0 Likes
557

If this is for an Inbound IDOC, from an external source, used to update PO's in SAP, then yes, I would validate ALL the critical data prior to calling any change modules.  But, that's just my opinion.   But, what do you mean by manually?  One would have a custom process code that called a custom function module.  Part of that would be reading in the ZPORDCH data and storing in internal tables, then constructing the pieces for BAPI_PO_CHANGE?  Why are you doing 'Z' version instead of extending existing SAP version?

Part of that validation would be...adding but does the item already exist?  deleting but am I deleting an existing row and is it deleting what should be deleted, and changing but am I changing a row that exists and not flagged as deleted and did something actually change on the row, etc.

If the BAPI fails, what to do is up to you...do you report the content of the input IDOC, or send emails with the error message and description or ??  That should be a decision for the business.  If the BAPI fails, then the PO will not have been modified.

Read only

Former Member
0 Likes
557

Hi Manjunath,

Is you are developing Function module which is use as IDOC process and one more detail need to know how you are getting changes is it through change pointer ?

Please put some more information ......

Regards,

Yukti

Read only

0 Likes
557

Sorry David and Yukti for late reply, was Out of office.

Yes am developing a new function module for custom IDOC(ZPORDCH) processing. I need to build POHEADERX and POITEMX and POSCHEDULEX based on indicator (E for entry and C for deleting lineitem) from IDOC data. 

To Put in simple words, we are developing a interface which converts a file data into an custom PO IDOC and the processing function module will fetch the required data from IDOC data and builds the BAPI_PO_CREATE1 or BAPI_PO_CHANGE based on the indicator. Create ,am able to do it successfully, not sure how to handle the PO changes from the legacy system.

Further suggestion and help is much appreciated, thanks.

Regards,

Manjunath