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

Return order with ORDERS05

Former Member
0 Likes
4,384

Hi,

I have an inbound IDOC to create Return order, I am expecting the system to copy the line item from the reference doc and create the return order.

Whle processing it from WE19, it is expecting Sales Area data, Doc type , Material and Sold To party. Now I am passing these values as well. With all these it is creating the return order but it NOT REFERENCING to the original order, which is not expected. VBAP-VGBEL is blank for the order.

Here are the data I am passing in WE19.

Segment Qualf value

E1EDK14 012 ZNRC (return order doc type)

E1EDK14 008 NP01 (Sales Org)

E1EDK14 007 01 (Distr. Channel)

E1EDK14 006 01 (Division)

E1EDKA1 AG 2000001050 (Sold to Party)

E1EDK02 018 6170000012 (Reference order - Normal SO)

For E1EDK02 I have tried for both 011/018 qualifier.

I am just passing the ref doc number.

E1EDP01 - I am passing quantity

E1EDP02 018 6170000012 000010

For E1EDP02 I am passing both the ref doc number and line item. Qualf 018/011.

E1EDP19 - 003 MATERIAL1

Can You please let me know, what could be the issue?

Am I missing any required data to be provided.

Thanks,

Hari

4 REPLIES 4
Read only

Former Member
0 Likes
2,065

Well, if you look at the coding in IDOC_INPUT_ORDERS -> PERFORM call_va01_new_orders_return that deals with returns, it doesn't at all deal with linking the return items to related reference document items (order / billing against which you want to create the return)

WHEN 'R'.
* Aufruf Transaktion Auftragerfassung für Auftragsarten mit Vertiebs-
* belegtypen H (z.B. Konsigantionsretoure)
* call transaction Order Entry VA01 for order types with
* SD document category H (for example consingment return)
            PERFORM call_va01_new_orders_return USING ok.

So you CANNOT create a return order from a reference doc using ORDERS05 / IDOC_INPUT_ORDERS

We had same situation in a previous project, there we have copied the IDOC_INPUT_ORDERS to our own Z function, retained the logic that parse the IDoc segments to XVBAK, XVBAP, XVBPA etc tables.

Later, to create the return order we call SD_SALESDOCUMENT_CREATE with BUSINESS_OBJECT = 'BUS2102' (for return order).

If you have BAPI_CUSTOMERRETURN_CREATE in your system you can use that as well, you can see that this BAPI is calling SD_SALESDOCUMENT_CREATE internally with 'BUS2102'.

BAPI_CUSTOMERRETURN_CREATE has RETURN_ITEMS_IN-REF_DOC and RETURN_ITEMS_IN-REF_DOC_IT that allow you to pass referenc doc and item number to relate the return item to its parent

Best regards,

Vishnu Tallapragada

Read only

0 Likes
2,065

Hi Vishnu,

Thanks for your reply.

I was gone with another issue so could not reply on this.

I am using now SD_SALESDOCUMENT_CREATE and able to create the credit request with reference to the sales document.

I can see the linkage in document flow but it is not copying the Pricing detaiils from the reference document.

here is what I am passing to the FM:

************************************************

wa_header-doc_type = c_znrc. "ZNRC

wa_header-sales_org = wa_xvbak-vkorg.

wa_header-distr_chan = wa_xvbak-vtweg.

wa_header-division = wa_xvbak-spart.

wa_header-refdoc_cat = c_c.

wa_header-ref_doc = wa_xvbak-vgbel.

wa_header-bill_block = wa_xvbak-faksk.

wa_header-ord_reason = wa_xvbak-augru.

READ TABLE it_xvbap INTO wa_xvbap index 1. "WITH KEY posnr = '000010'.

IF sy-subrc EQ 0.

    • Populate Item

wa_item-itm_number = '000010'. "000010

wa_item-material = wa_xvbap-matnr.

wa_item-target_qty = wa_xvbap-wmeng.

wa_item-reason_rej = wa_xvbap-abgru.

wa_item-bill_block = wa_xvbap-faksp.

wa_item-ref_doc = wa_xvbak-vgbel.

APPEND wa_item TO it_item

and partner details.

**************************************************************

Is there anyway we can get pricing values automatically or we need to copy them into the CONDITION table by fetching it from the reference order.

Thanks ,

Hari

Read only

0 Likes
2,065

Hi,

The issue resolved. I have my screen sequence for return order in the customer exit, which is over writing the standard screen sequence for that doc type and creating the doc.

Closing the thread.

Thanks,

Hari

Edited by: Harrnaadh on Jan 25, 2012 11:42 PM

Read only

0 Likes
2,065

resolved