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

Populate the fields in Custom Table

Former Member
0 Likes
1,080

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.

6 REPLIES 6
Read only

Former Member
0 Likes
980

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

Read only

0 Likes
980

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.

Read only

0 Likes
980

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.

Read only

0 Likes
980

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

Read only

0 Likes
980

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

Read only

Former Member
0 Likes
980

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