2007 Jan 30 7:52 AM
Hi,
My Require is Populate the fields in Custom Table:
ZV57_DISTSLSHIST:
The field Sales Unit (VRKME) should be populated from the sales order (VBAP-VRKME) once it is created.
The field Doc Currency (WAERK) should be populated from the sales order (VBAK-WAERK) once it is created.
In the System Spec they given like this:
The sales unit field and the doc currency field in the sales history table ZV57_DISTSLSHIST should be updated with these details from the sales order that is created.
Fields from the created Sales Document to be passed back to the Sales History Table (ZV57_DISTSLSHIST):
1. sales unit field VBAP-VRKME
2. doc currency VBAK-WAERK
Populate: ZV57_DISTSLSHIST field VRKME
Populate: ZV57_DISTSLSHIST field WAERK
Here they are using one BAPI that is Custom BAPI it referes Standard BAPI:BAPI_SALESORDER_CREATE
This BAPI return some tables.
So Please give me the solution for given requirement.
Thanks,
Satish.
Hi,
My Require is Populate the fields in Custom Table:
ZV57_DISTSLSHIST:
The field Sales Unit (VRKME) should be populated from the sales order (VBAP-VRKME) once it is created.
The field Doc Currency (WAERK) should be populated from the sales order (VBAK-WAERK) once it is created.
In the System Spec they given like this:
The sales unit field and the doc currency field in the sales history table ZV57_DISTSLSHIST should be updated with these details from the sales order that is created.
Fields from the created Sales Document to be passed back to the Sales History Table (ZV57_DISTSLSHIST):
1. sales unit field VBAP-VRKME
2. doc currency VBAK-WAERK
Populate: ZV57_DISTSLSHIST field VRKME
Populate: ZV57_DISTSLSHIST field WAERK
Here they are using one BAPI that is Custom BAPI it referes Standard BAPI:BAPI_SALESORDER_CREATE
This BAPI return some tables.
So Please give me the solution for given requirement.
Thanks,
Satish.
2007 Jan 30 8:14 AM
Dear Satish,
There is no BAPI called 'BAPI_SALESORDER_CREATE'.
However, a Custom BAPI has been used, you can always write your own code to populate your custom table within BAPI itself. Here, I am assuming that custom BAPI is returning a details of Docs. which are created using this BAPI.
Regards,
Chetan
2007 Jan 30 9:04 AM
Hi Chetan,
This is the custom BAPI they used in the existing program.
Generate the sales order
CALL FUNCTION 'Z_V57_BAPI_SALESORDER_CREATE'
EXPORTING
order_header_in = itab_header
testrun = p_test
business_object = w_busobj
IMPORTING
salesdocument = w_vbeln
TABLES
return = itab_order_msg
order_items_in = itab_detail
order_partners = itab_partner
order_schedules_in = itab_schedule
order_conditions_in = itab_conditions.
Here itab_detail table has the two fields VRKME and WAERK, Custom table also have these 2 fields. here i have to populate these values to custom table.
here i am not able to find where there are populating to custom table .
Regards,
Satish.
2007 Jan 30 9:16 AM
Hi Satish,
Okey,
Tell me one thing, Are the fields VRKME and WAERK updated in itab_detail which is returned from BAPI.
Best Regards,
Chetan.
2007 Jan 30 9:31 AM
Hi Chetan,
These two fields VRKME and WAERK are updated in itab_detail table.
here they are moving some fields to itab_detal table
detail line
itab_detail-itm_number = w_posnr.
itab_detail-material = itab_sord_detail-matnr.
itab_detail-batch = itab_sord_detail-charg.
itab_detail-item_categ = itab_sord_detail-pstyv.
itab_detail-target_val = itab_sord_detail-netpr.
itab_detail-target_qty = itab_sord_detail-kwmeng.
itab_detail-cust_group = itab_sord_detail-kdgrp. "CT77041
APPEND itab_detail.
Regards,
Satish
2007 Jan 30 11:52 AM
Hi Satish,
If it is updating those 2 fields in table itab_detail, then get those doc specific values and update in respective dDictionary tabel as per ur requirement.
Best Regards,
Chetan
2007 Jan 30 8:48 AM
Hi Satish,
Theres no BAPI "BAPI_SALESORDER_CREATE" as such..
You want the VRKME and WAERS to be populated dynamically when u create a sales order...
Please find any User exit and include your code in that.. This can help u..
Cheers
rajiv