cancel
Showing results for 
Search instead for 
Did you mean: 

Sending EDI 843 (Quotes)

paul_pendleton
Participant
0 Kudos

Not sure this is the correct forum to discuss this but here goes. I am not very familiar with configuring the SAP system for output. I am wondering if you can configure the system in a way that when you create a quote it sends the whole quote via EDI(843). When changing the quote it sends the header data and only the changed line items. In addition to sending the full quote when creating the quote we also need to be able to send the full quote when specific header fields are changed. Can this be setup with configuration?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Yes it can be, goto transaction NACE, select application V1 and click on "output types". You can see there is an output AN00, which can be triggered by a quotation.

You can copy this output type to a new and customize to your requirement.

Also you need to use message type QUOTES and Idoc type ORDERS05, process code SD12 in the outbound parameters of your receivers partner profile setup.

Create condition records as per your requirement for AN00 output type, with partner as your receiver partner for the partner profile you setup.

The outbound QUOTES / ORDERS05 idoc is to be mapped by your EDI subsystem to ANSI 843. The transaction can let the EDI subsystem know whether quote is created or changed, accordingly the mapping should filter header / details according to your requirement.

Also the quote trxn itself includes only changed line items and always triggers header. I am not sure if it triggers items when header is changed, you can check this out, it may well be the case

Hope this helps. let me know with specific details if you have any more query.

Regards,

Vishnu T

paul_pendleton
Participant
0 Kudos

Thanks for the reply. Good detailed response. I still have some questions though.

You make the following statement:

"The outbound QUOTES / ORDERS05 idoc is to be mapped by your EDI subsystem to ANSI 843. The transaction can let the EDI subsystem know whether quote is created or changed, accordingly the mapping should filter header / details according to your requirement."

Does this mean that code has to be placed in the outbound process to take out idoc entries? ie. We are in change mode and we only want to send changed items

What I'm looking for is if there are configuration settings that tell the system to either build the idoc with header and all line item detail in create mode OR,

create or build the idoc with header info and only changed line items while in change mode. OR

build the full quote when specific header fields are changed.

This created iDoc in turn gets sent to the outbound FM to be processed with only the desired segments created and sent. This means there would be no additional coding required. Other than maybe code in a requirement routine for the header field changes that should cause a full send.

It sounds like you are saying that the system builds the full idoc regardless of whether it is in create or change mode, and then in the output processing Function Module(IDOC_OUTPUT_QUOTES or something like that) it would modify the idoc with logic in the outbound FM. Is this what you are saying?

I am looking for a method that causes the system to only build the segments based on the transaction type being used (Create, Change).

If it does in fact have to be done in the post processing FM, how does the output process know that it was done in create or change mode?

Is there a way to know what lines were updated without going to the database to look at the fields for change dates etc? In other words is there some kind of status field on the iDoc that gets updated to reflect whether it was updated or not?

Former Member
0 Kudos

IDOC_OUTPUT_QUOTES carries a structure OBJECT which has field AENDE, if it carries 'X' then the message is from a change (and not from create) and blank when the message is first created (when the quote itself is created first). This is what SAP says about NAST-AENDE (OBJECT has NAST structure)

Definition

Indicator which identifies a message as a change message. A change message may be necessary if data which is important for the message is changed (for example, the number of items ordered is changed).

Dependencies

A change message can only be sent if a message has already been sent for the object (for example, an order).

Since this is a customer specific requirement you need to either create a wrapper function module Z_IDOC_OUTPUT_QUOTES for IDOC_OUTPUT_QUOTES with the same interface and use it to filter only those records that you determine are changed or you can use user-exits within the IDOC_OUTPUT_QUOTES to filter out the segments based on your own change analysis. If you are using user-exits create a new Z message type ZQUOTES and use it as a criterion for filter, so that IDOC_OUTPUT_QUOTES retains its original functionality when someone uses it with QUOTES message type

But I wonder how will you determine which fields are changed, as the output is triggered only after transaction is saved

Also don't forget to reward snippets that were helpful to you, the possibility of getting our name in the top list does encourage us to contribute more!!

paul_pendleton
Participant
0 Kudos

Another question. You made the statement in your earlier post:

"Also the quote trxn itself includes only changed line items and always triggers header. I am not sure if it triggers items when header is changed, you can check this out, it may well be the case"

Are you saying that when a quote is changed and the idoc is created it only contains the items that were changed? What tells it to only send only the changed items?

I will definitely reward you with points but I need to make sure I fully understand what you are saying first. Thanks again for your reply.

paul_pendleton
Participant
0 Kudos

After looking through this a little more and reading some other post it seems that the AENDE field tells the SAP system whether it is to send only changed items(AENDE=X 'change items only') OR send the whole document(AENDE = BLANK 'Complete document').

I have tested this and I changed a quote and I created a quote but this field did not get updated in NAST in either case. I also found that program RSNASTED in form EDI_PROCESSING copies this field into a structure and then FM EDI_AGREE_OUT_IDOC_READ does a select on table EDP12 and the where clause contains the AENDE field. The EDP12 table looks to be the outbound control table for partner profiles. It looks like you have to setup a partner profile so that they are able to do changes only. I am not sure though.

If this field is used in this manner and SAP only allows a change after it is output the first time then it would seem the solution is this:

Create 2 output types ie (type A AND B). One type (type A) when it is attached to the partner profile will allow changes. The other type (type B) will not. The one that does not allow changes can be setup as manual output(type B=Manual). This looks like it(type A) would allow in create mode to output the whole document since it has never been output yet, but, then when changes are done it flags it as changed and only sends changes. When the whole document needs to be sent they can manually send type B.

The only issue left is when particular header changes are made the whole document needs to be sent. But the system may not flag it as a change for header changes I'm not sure.

Can you give me your thoughts on this? Am I right or totally off on this?

paul_pendleton
Participant
0 Kudos

I'm not sure what the AENDE field does for me other than telling me that the quote going out is a change and not a create. Is there anyone in the forum that has sent out EDI quotes and only sent out changed lines? If so how did you do this? Vishnu I'm going to award you points for helpful answer. I appreciate your response. I still need help though, because my question involved how to send only changed lines. I still do not know how to accomplish this(if it can even be done) unless a bunch of code is written. Thanks. If you have anymore ideas please let me know.

Former Member
0 Kudos

Hi,

The similar question was asked before for Quote change idoc. This was me response to that mail and it seems it works fine. Please look at my reply below.

Or you can also refer to link.

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

There is not separate message type of quotation change.

What i would suggest you to do it to code user-exit EXIT_SAPLVEDE_003 ( Enhancement VEDE0001 ) . When the quotation idoc is created, this is the final user-exit. All idoc data is avaialble here. Here you can check that if document is being changed or created. If it is changed than delete the line items which are unchanged ( these is segment E1EDP01 and all the subsegment below that for that line item ). You write following loging in your code.

[1]. Read table CDHDR with

OBJECTCLAS = VERKBELEG

OBJECTID = XVBAK-VBELN[

[2]. If you find any records from CDHDR, that means that quotation has been changed. Now take the change document number from CDHDR (CHANGENR) and read table CDPOS with

OBJECTCLAS = VERKBELEG

OBJECTID = XVBAK-VBELN

CHANGENR = CHHDR-CHANGENR.

There might be multiple changes quotation. These causes multiple change document number in CDHDR. Also each changdocumnet has multiple line items in CDPOS.

So, you have to loop at the entries of CDHDR and for each Change document number in CDHDR, read CDPOS. Keep appending the line items of CDPOS into internal table.

SAP uses the standard function modules CHANGEDOCUMENT_READ_HEADERS ( to read header changes) and CHANGEDOCUMENT_READ_POSITIONS ( to read item level changes ) to read document changes.

See the code of the report RVSCD100 to find out how SAP reads change document. When you go to quotation and choose menu "Environment --> Changes", SAP uses this program to read change document. You can execute this report directly from SE38. When you execute this report in SE38, enter your quotation number in document field and then debug to see what SAP does.

[3]. So, once you determine which line items are being changed, now you loop through the idoc data table INT_EDIDD for segment "E1EDP01". if E1EDP01-POSEX ( line item number ) is not one of the line which is changed, then delete this segment and all subsegment of this segment.

[4]. Once you do that, you might have to change the content of segment E1EDS01 too. This is IDOC summary segment which contents the details like number of items, total net amount. But it works fine without changing E1EDS01, then you can left it as it is.

Let me know if you still have any question.

Regards,

RS

paul_pendleton
Participant
0 Kudos

Is there an easier way to know if a line has been changed other than CHANGEDOCUMENT_READ_POSITIONS? I just need to know that there was a change or not. I do not need to know any details about the change.

Answers (0)