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

"additional data B"

Former Member
0 Likes
1,464

Hi together,

I´ve created an additional input field "additional data B" (Trx va01) in program SAPMV45A.

Now I want to fill this field with a (customer own) intervace based on ALE/IDOC technology.

Does anybody know, which USER-EXIT I have to take to fill the new field?

Thanks for any help

Hi together,

I´ve created an additional input field "additional data B" (Trx va01) in program SAPMV45A.

Now I want to fill this field with a (customer own) intervace based on ALE/IDOC technology.

Does anybody know, which USER-EXIT I have to take to fill the new field?

Thanks for any help

6 REPLIES 6
Read only

Former Member
Read only

0 Likes
1,252

Hi,

the message you mention is about how to fill an additional field manually. But I want to do it with an interface based ond ALE/IDOC.

I´ve extended the given segment....

Everything looks fine in Trx. BD87, but the new field is not beeing filled.

There must be a user exit but I can´t find it.

best regards

Read only

0 Likes
1,252

Hi Gerd,

I have a requirement to send idocs on successful creation of sales order for custom fields....not yet finalised though and am planning to use USEREXIT_SAVE_DOCUMENT in the include MV45AFZZ(you can access it through se38)..the code for sending idocs, i am planning to be call it in a function module with update task in the exit mentioned above........don't forget that this user exit is trigerred for VA01/Va02/Va03/VA41/VA42/VA43....so do the filter accordingly

Pls check if it helps and revert..

Reward if helpful

Regards

Byju

Read only

0 Likes
1,252

Hi Byju,

so far so good.

But how can I import my IDOC data to this program? there is no ex- or import parameter.

I´ve no clue how this could work.

How can I update table vbap here?

Besr Regards

Gerd

Read only

0 Likes
1,252

Basically you are going to have to enhance the IDOC_INPUT_ORDERS function module. This function module reads the IDOC data, does some error checking, maps the data to a BDC and calls VA01 using the BDC data. In general you will need to do two ehnahcements:

1. Map your data from the IDOC to the VBAP data

2. Map your VBAP data to BDC data

It can get kind of tricky so you may have to do some trial and error and debugging of the function module to get this to work correctly. But here is what you need to look at:

1. SMOD Enhancement VEDA0001 contains all of the function module exits you will need. If not already implemented, you will have to implement this in CMOD.

2. In function module IDOC_INPUT_ORDERS there is a subroutine called intrepret_idoc_orders. This subroutine translates data from the idoc segments to the sales order internal tables such as VBAP and VBAK. There is a subroutine called customer_function_idoc that calls the function module EXIT_SAPLVEDA_001. If you extended the VBAP table correctly, you should be able to map your segment field to the XVBAP internal table

3. Further down there is a subroutine called CALL_VA01_NEW_ORDERS. (There are actually multiple of these subroutines basd on order types but it shouldn't matter which one you drill into). You will have to dig through this to figure out exactly how it works but find the appropriate spot and there is another subroutine called customer_function_dynpro. This contains a call to EXIT_SAPLVEDA_002 which allows you to put your own bdc data in. This is where you will map to the additional data b screen.

One thing to be aware of. These user exits are called mulitple times. In the first one you will need to ensure you are doing the appropriate check on your segment within the function module. In the second one, it becomes more tricky because you want to avoid updating the bdc data more than once, and you also want to make sure you insert the bdc data at the appropriate sequence. Too early or too late and your data might not get processed.

Hopefully this is enough to get you started. .

Best Regards,

Chris H.

Read only

0 Likes
1,252

Hi Gerd,

Here is my idea in mind for you....

in user_exit_save_document....

there will be 2 tables XVBAK , XVBAP

XVBAK -> contains all header data

XVBAP -> contains all item data

Since you have extended VBAP/VBAK structure as per ur requirement...these fields will be present in XVBAP/XVBAK

So you need to fetch the data in idocs in user exit

it goes like the following

FORM USER_EXIT_SAVE_DOCUMENT.

*fetch data from idoc for that contract number

*you must be having some logic here to map which sales order *number the idoc additional field relates to

*if it is a new sales order there must still be some logic...

i think in this user exit sales order(VBELN) number range is generated by SAP but not saved in table....not sure but will confirm later if you need that info

You have data in XVBAP(item) XVBAK(header)

Create temporary internal tables/workareas

Loop at the item/header as per your requirement and

change them from idoc data for that extra field and save them

So when user preseese the 'SAVE' your data goes into the additional VBAP through XVBAP modification in this user exit and same for header VBAK

So you have a workable suggestion

Please check ,revert and reward helpful; answers pls

my only concern is how you are planning to map this idoc data if this is a sales order creation...VA01...please let me know the logic

Regards

Byju