Application Development 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: 

User Exit for Sales Order-Contract Data on VA42

Former Member
0 Kudos

Dude,

I have copied the standard IDOC ORDERS05 to ZORDERS05 and enhanced it with two new custom segments with the fields from VA42 screen(table-VEDA, FBPA).

ORDERS message type is assigned with the FM IDOC_OUTPUT_ORDERS with BUS2032.

When I assign the output type KO00 in the Extras->Output->Header->Edit and save the transaction, an IDOC should be generated.

Actually, now the standard IDOC gets generated with the old segments, so I need to write the logic to assign the custom segments to the data record.

I tried using the user exit/BADI - MM06E001, V45B0001 etc.

I checked keeping the break-point in function module IDOC_OUTPUT_ORDERS assigned to the message type.

But it does not stop at the breaking point.

Could anyone sugest me which user exit or BADI should be used exactly to pass these custom segments.

Rgds,

JK

1 ACCEPTED SOLUTION

andrea_olivieri
Contributor
0 Kudos

Hi,

in my opinion you're using the wrong process code, because IDOC_OUTPUT_ORDERS is the FM for the purchase order sending.

With VA42 tcode you are able to process the sales contracts and therefore the correct function module is IDOC_OUTPUT_ORDRSP.

Inside the IDOC_OUTPUT_ORDRSP there is a wide range of customer exit or Badi; choose the technique that you prefer.

For example you can use the enhancement(SMOD) SDEDI001 "User exits for EDI".

The EXIT_SAPLVEDC_003 (Final userexit) should be used to change the internal table DINT_EDIDD or otherwise you could use the EXIT_SAPLVEDC_002 at segment level.

Regards,

Andrea

12 REPLIES 12

Former Member
0 Kudos

Hi Use the bellow two exits for customs segements inbound sales order.

Main exit

VEDA0001

Function exit EXIT_SAPLVEDA_001

DATA segnam(27).

DATA: BEGIN OF hxvbak.

INCLUDE STRUCTURE vbak.

DATA END OF hxvbak.

DATA ZSDE1EDP01 LIKE ZSDE1EDP01.

segnam = segment-segnam.

CASE segnam.

WHEN 'ZSDE1EDP01'.

ZSDE1EDP01 = segment-sdata.

hxvbak-ZZAWBNO1 = ZSDE1EDP01-ZZAWBNO1.

hxvbak-ZZAWBDT1 = ZSDE1EDP01-ZZAWBDT1.

hxvbak-ZZAWBNO2 = ZSDE1EDP01-ZZAWBNO2.

hxvbak-ZZAWBDT2 = ZSDE1EDP01-ZZAWBDT2.

MOVE hxvbak TO dxvbak.

ENDCASE.

EXIT EXIT_SAPLVEDA_002

DATA: ls_vbak TYPE vbak.

IF dlast_dynpro = '4001'.

CHECK l_vbak_added IS INITIAL.

  • Ok code for addition B Screen.

ls_vbak = dxvbak.

dxbdcdata-fnam = 'BDC_OKCODE'.

dxbdcdata-fval = '=KZKU'.

APPEND dxbdcdata.

CLEAR: dxbdcdata.

  • Additional data B screen

dxbdcdata-program = 'SAPMV45A'.

dxbdcdata-dynpro = '4002'.

dxbdcdata-dynbegin = 'X'.

APPEND dxbdcdata.

CLEAR: dxbdcdata.

  • Populate data.

dxbdcdata-fnam = 'ZSDSTRC_VBAK-ZZAWBNO1'.

dxbdcdata-fval = ls_vbak-ZZAWBNO1.

APPEND dxbdcdata.

CLEAR: dxbdcdata.

dxbdcdata-fnam = 'BDC_OKCODE'.

dxbdcdata-fval = '/EBACK'.

APPEND dxbdcdata.

CLEAR: dxbdcdata.

l_vbak_added = 'X'.

ENDIF.

Regards

0 Kudos

Hi Rajendra Kumar,

Will it work for the outbound IDOC as well.

Since I have tried keeping break point within the user exit as you mentioned but it does not stop.

Could you suggest me a user exit which could be used for triggering an outbound idoc from VA42.

Rgds,

JK

Former Member
0 Kudos

Hi,

Try to use component EXIT_SAPLEINM_002 in Enhancement MM06E001.

use the structure DVBAK and DVBAP.

Revert back if u have any issues.

Regards,

DSK

andrea_olivieri
Contributor
0 Kudos

Hi,

in my opinion you're using the wrong process code, because IDOC_OUTPUT_ORDERS is the FM for the purchase order sending.

With VA42 tcode you are able to process the sales contracts and therefore the correct function module is IDOC_OUTPUT_ORDRSP.

Inside the IDOC_OUTPUT_ORDRSP there is a wide range of customer exit or Badi; choose the technique that you prefer.

For example you can use the enhancement(SMOD) SDEDI001 "User exits for EDI".

The EXIT_SAPLVEDC_003 (Final userexit) should be used to change the internal table DINT_EDIDD or otherwise you could use the EXIT_SAPLVEDC_002 at segment level.

Regards,

Andrea

0 Kudos

Andrea,

In WE20, under partner type KU:

Outbound Parameters:

Partner Role: AG

Message type : ORDRSP

Process Code : SD10

Suggest me which outbound process code and message type should be used for triggering an Outbound IDOC.

Below are the assignment done in WE57.

FM Name : IDOC_OUTPUT_ORDRSP

Function type : F

Basic Type : ORDERS05

Enhancement : ZORDERS05

Message type : ORDERS

Object Type : BUS2032

+ : 1- Outbound

Suggest me the exact user exit since EXIT_SAPLVEDC_002 has no control record population but EXIT_SAPLVEDC_003 has both control and data record population.

Even I tried using the above user exits, but the break-point does not stop.

Help me ASAP.

Rgds,

JK

0 Kudos

Hi,

in the Partner profile (outbund params) you must specify the following parameters for your customer (KU) partner type:

Partner Role: SP Sold-to party

Message Type: ORDRSP

Basic type: ORDERS05

Extension: ZORDERS05

In the message control tab:

Application:V1

Message(Output) type:KO00

Process Code:SD10

You don't need the assignment in WE57,because it's required for the inbound processing, so you can also delete the record.

Now the userexit...

You could still use the EXIT_SAPLVEDC_002.

For example you can save the control record in an abap memory area( Export to memory) or in the top include of a custom(Z) function group or, if you prefer, as an attribute of a custom(Z) class using the EXIT_SAPLVEDC_004 and then get it from EXIT_SAPLVEDC_002.

Otherwise use EXIT_SAPLVEDC_003 if for you it is easier.

Regards,

Andrea

0 Kudos

Andrea,

I have done all the assignments correctly as you mentioned in the previous reply.

But even though when I keep break-point in IDOC_OUTPUT_ORDRSP and also in the suggested user exits, it does not stop.

Somewhere the standard IDOC segments are being populated, even I found some code populating the standard segments in the above FM, but since the break point does not stop.

Suggest me where the IDOC segments are being populated so that I can write some coding for the custom segments since my custom segments are not yet populated.

Rgds,

JK

0 Kudos

Hi,

in order to debug the outbound process code, you need to change the timing of the output dispatch.

From the contract item overview screen choose:

Extras> Output> Header> Edit

Select a processed message and check through the pushbutton "Further Data" the attribute "Dispatch Time.

To perform the debug the "Dispatch Time" should not have the value = 4 (immediate dispatch)

If it is set to 4, repeat the output, set dispatch time = 1 and save the contract.

Then place the break-point in the function moudule IDOC_OUTPUT_ORDRSP.

Therefore go to SE38 and execute the program RSNAST00; set as parameters:

Output Application = V1

Object key <Your contract Number (with leading zeroes) e.g. 0040000203>

Output type KO00

Transmission medium 6

Hope this helps.

Regards,

Andrea

0 Kudos

Andrea,

Thanks for your input. Now the transaction stops at the break point at that FM when I keep the dispatch time option as '1' and execute the program RSNAST00.

I have created the include ZXVEDU15 within the function module EXIT_SAPLVEDC_003 of the standard enhancement SDEDI001.

But I could not find the fields which are added in the segments within the structures available in the customer exit i.e XVBAK, XVBAP, XVBKD,XVBPA,XVBEP,IKOMV,IKOMVD.

Below are the fields I need to update in the custom segments.

VBEGDAT, VENDDAT from VEDA (contract data tab) VA42->Dis.header data details->Contract data.

FPART, PERIO, BEDAR, ENDAR, HORIZ, ABRBE, ABREN,AFDAT from FPLA (BIlling Plan tab) VA42->Dis.header data details->Billing Plan

Could you suggest me where to look for those fields mentioned above and how to populate those segments next to its parent segment.

Now its been displayed as the last segment in the Idoc generated rather I need to display it as a child segment of E1EDK01.

Let me know whether the user has to assign the output type within the order as KO00 and save it and execute the program RSNAST00 to issue the IDOC output everytime when he wants the IDoc to get generated.

Expecting your timely help.

Rgds,

JK

0 Kudos

Hello JK ,

I kindly ask you to not send me e-mails directly, but always use the forum to post the questions that you need.

Regarding the missing data, you should take a look to the print program of the order confirmation and use, within your userexit, the function modules SD_VEDA_GET_PRINT_DATA and BILLING_SCHED_PRINTVIEW_READ.

If you do not know how to use them, perform a where-used list.

The user does not need to change data thru the message screen of the contract nor to use the program RSNAST00; it was just a trick to allow you to debug the program that creates the idoc. You have to create the output condition records from the transaction VV11, considering that customizing of the output message is properly configured.

I hope this help.

Regards,

Andrea

0 Kudos

Andrea,

I apologise for sending you mail personally.

Anyway, I did not use those function modules, instead I retrieved values of those fields using SELECT statements based on the document number.

Thanks for your valuable and timely inputs.

Let me know if you didnt get the rewarded points.

Rgds,

Lakshmanan.J.K

0 Kudos

Hi Andrea,

I need a help from you regarding increase in the maximum number of the segment definition of the Basic Idoc type.

I am using the Idoc type as ORDERS05 and extended as ZORDERS05 with two custom segments.

Within the generated IDoc, there is a standard segment E1EDP05 for populating condition values for a service contract.

Segment : E1EDP05

Min. No : 1

Max. No : 16

Parent Segment : E1EDP01

Hierar. Lev: 3

Now we have around 24 condition values for our service contract.

Since it exceeds the maximum number(16) of the segment E1EDP05, Idoc is generated with the error : EDI: Syntax error in IDoc (too many repetitions of a group)

Diagnosis

According to the syntax description of the basic type ORDERS05 (customer enhancement ZORDERS05), the segment group E1EDP05 can be repeated a maximum of 0000000016 times. However, this segment group occurs more frequently in the IDoc.

Suggest me how to increase the maximum number of the segment definition.

Timely help will be appreciated.

Rgds,

JK

Edited by: Lakshmanan JK on Dec 1, 2009 12:13 PM