2009 May 21 4:55 PM
Let's say we have the following simplified ORDERS05 IDOC
ORDERS05 Purchasing/Sales
Header
E1EDK01 IDoc: Document header general data
E1EDK14 IDoc: Document Header Organizational Data
Rows ( Items )
E1EDP01 IDoc: Document Item General Data
And would like to create it using certain data.
Would the approach of creating a class per each segment type with methods "Append", "Modify", "Delete" be feasible?
For example, if we want to construct ORDERS05 IDOC, we call:
ycl_e1edk01->append( ls_e1edk01 ).
ycl_e1edk14->append( ls_e1edk14 ).
ycl_e1edp01->append( ls_e1edp01 ).If we would like to modify the data in E1EDK01 segment, of the IDOC, we would call:
ycl_e1edk01->modify( ls_e1edk01 ).The reason for it would be to track all the changes to the data
in the ORDERS IDOC in different user-exits by "Where-Used".
2009 May 21 5:00 PM
Would the approach of creating a class per each segment type with methods "Append", "Modify", "Delete" be feasible?
Yes
The reason for it would be to track all the changes to the data
in the ORDERS IDOC in different user-exits by "Where-Used".
What do you mean by this?
Would the approach of creating a class per each segment type with methods "Append", "Modify", "Delete" be feasible?
Yes
The reason for it would be to track all the changes to the data
in the ORDERS IDOC in different user-exits by "Where-Used".
What do you mean by this?
2009 May 21 5:00 PM
Would the approach of creating a class per each segment type with methods "Append", "Modify", "Delete" be feasible?
Yes
The reason for it would be to track all the changes to the data
in the ORDERS IDOC in different user-exits by "Where-Used".
What do you mean by this?
2009 May 22 1:55 PM
Are you planning to use "Where-Used" for your IDoc segment classes / methods to track where in the user-exits they are used?
This may work if you are the only ABAP-er in your SAP shop. If you have more than one developer then how do you enforce that your class is being used in the user-exits?
2009 May 22 2:07 PM
Be sure that, if the solution for this whole thing will be nice and usable, I will surely enforce it
2009 May 22 2:17 PM
Creating individual classes would not be a good design. You should create a single class with different mehtods to achieve the functionality
Couple of months ago I was also thinking to use OO ABAP for the IDoc Processing (but I am not able to put this design into action).
Design would be:
PROCESS_SEGMENTS Public
Changing IA_EDIDD type EDIDD (Current work area)
Changing IT_EDIDD type EDIDD (Actual Idoc internal table)
Importing IF_TYPE type CHAR1 (Type of processing A - Append, M - Modify, D - Delete)
Individual private methods for processing individual Segments:
E.g. PROCESS_E1EDK01, PROCESS_E1EDK14 etc.
Call this private methods from the public method PROCESS_SEGMENTS. You can try to do it dyanmically to avoid future changes (following [Open-Closed Principle|/people/naimesh.patel/blog/2009/05/20/object-oriented-design-principles-oodp-open-closed-principleocp]) like this:
concatenate 'PROCESS_' ia_edidd-segnam into lf_method.
call method me->(lf_method).
Regards,
Naimesh Patel
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |